schema { query: GqlQuery mutation: GqlMutation } """ This is a placeholder description """ type AccountingPortion { authorRoyalties: Float! id: ID! payableAt: ISO8601DateTime purchasedPackage: ReaderPurchasedPackage! state: String! } """ The record joining users to their books. """ type AuthorAuthor { user: IdentityUser } type AuthorAuthorRootMutation { bookClose(bookId: ID!): BookCloseMutationPayload! bookCouponEdit(bookId: ID!, couponCode: String!, couponId: String!, endDate: String, maxUses: Int, note: String, packages: JSON!, prerequisiteCount: Int, prerequisiteIds: [ID!] = [], prerequisiteMessage: String, prerequisiteMode: String, startDate: String!, suspended: Boolean!): BookCouponEditMutationPayload! bookRetire(bookId: ID!): BookRetireMutationPayload! bookUnpublish(bookId: ID!): BookUnpublishMutationPayload! newBookCoupon(alsoCreateCouponForTranslations: Boolean = false, bookId: ID!, couponCode: String!, endDate: String, maxUses: Int, note: String, packages: JSON!, prerequisiteCount: Int, prerequisiteIds: [ID!] = [], prerequisiteMessage: String, prerequisiteMode: String = "none", startDate: String!, suspended: Boolean!): NewBookCouponMutationPayload! """ Generate a full or subset preview of the book. """ previewSingleBook( bookId: ID! """ This will be the content used for generating a single chapter preview. """ content: String ): PreviewSingleBookPayload! """ Upload a PDF or EPUB file for an upload-mode book. """ uploadBookFile(bookId: ID!, editionType: String!, file: SharedFileName!): UploadBookFileMutationPayload! } type AuthorAuthorRootQuery { book(slug: String!): AuthorBook couponForProduct(couponCode: String!, productSlug: String!, productType: String!, publisherSlug: String = "leanpub"): AuthorCoupon course(publisher: String!, slug: String!): AuthorCourse! } """ The primary product on Leanpub """ type AuthorBook implements AuthorProductInterface { aboutText: String authorString: String! coupons: [AuthorCoupon!]! """ Returns an object representing the cover image to be used as emphasis of featured products on the homepage. """ coverFeatured: SharedImageAttachment! customersList: [String!]! enableHtmlVersion: Boolean! epubPreviewUrl: String epubPublishedUrl: String id: ID! individualPurchases(email: String, limit: Int = 20, offset: Int = 0): [AccountingPortion!]! individualPurchasesCount(email: String): Int! landingPagePath: String! lastJobError: String lastPublishedAt: ISO8601DateTime lastWeekRoyalties: Float metaText: String minimumPaidPrice: Float! mostRecentJob: SharedJob numCopiesSoldBundled: Int! numCopiesSoldUnbundled: Int! packages(includeTeamDiscounts: Boolean = false, packageStatesToInclude: [SharedPackageStateEnum!] = [published]): [AuthorBookPackage!]! pageCount: Int pageCountPublished: Int pdfPreviewUrl: String pdfPublishedUrl: String possibleReaderCount: Int! possibleReaders: [StorePossibleReader!]! primaryAuthor: AuthorAuthor! revenueBundled: Float! revenueUnbundled: Float! royaltiesBundled: Float! royaltiesToRevenueRatio: Float! royaltiesUnbundled: Float! slug: SharedSlug! state: String! subtitle: String suggestedPrice: Float! syncMode: SharedSyncModeEnum! title: String! titlePageUrl: String totalCopiesSold: Int! totalRevenue: Float totalRoyalties: Float wordCount: Int wordCountPublished: Int } """ An extension of the package type specifically for books. """ type AuthorBookPackage implements PackageInterface { """ The record id """ id: ID! minimumPaidPrice: Float! """ The slug of the item in this package """ slug: SharedSlug! } """ This is a placeholder description """ type AuthorCoupon { couponCode: String! createdAt: ISO8601DateTime! endDate: ISO8601DateTime id: ID! maxUses: Int note: String numUses: Int packageDiscounts: [AuthorPackageDiscount!]! startDate: ISO8601DateTime suspended: Boolean } """ A course for learning from an author in a more interactive way. """ type AuthorCourse implements AuthorProductInterface { """ Returns an object representing the cover image to be used as emphasis of featured products on the homepage. """ coverFeatured: SharedImageAttachment! id: ID! landingPagePath: String! slug: SharedSlug! state: String! } """ The base record that is sellable for books and courses """ type AuthorPackage implements PackageInterface { """ The record id """ id: ID! minimumPaidPrice: Float! """ The slug of the item in this package """ slug: SharedSlug! } """ This is a placeholder description """ type AuthorPackageDiscount { bookCredits: Int courseCredits: Int discountedPrice: Float package: AuthorPackage } interface AuthorProductInterface { """ Returns an object representing the cover image to be used as emphasis of featured products on the homepage. """ coverFeatured: SharedImageAttachment! id: ID! landingPagePath: String! slug: SharedSlug! state: String! } """ Autogenerated return type of BookCloseMutation. """ type BookCloseMutationPayload { book: AuthorBook! errors: [SharedError!] status: SharedStatusEnum! } """ Autogenerated return type of BookCouponEditMutation. """ type BookCouponEditMutationPayload { book: AuthorBook! errors: [SharedError!] status: SharedStatusEnum! } """ Autogenerated return type of BookRetireMutation. """ type BookRetireMutationPayload { book: AuthorBook errors: [SharedError!] status: SharedStatusEnum! } """ Autogenerated return type of BookUnpublishMutation. """ type BookUnpublishMutationPayload { book: AuthorBook! errors: [SharedError!] status: SharedStatusEnum! } """ Autogenerated return type of CoursePreviewMutation. """ type CoursePreviewMutationPayload { course: AuthorCourse! errors: [SharedError!] status: SharedStatusEnum! } """ Autogenerated return type of CreatePossibleReader. """ type CreatePossibleReaderPayload { errors: [SharedError!] possibleReader: StorePossibleReader status: SharedStatusEnum! } """ Autogenerated return type of CreateWritingOrder. """ type CreateWritingOrderPayload { errors: [SharedError!] status: SharedStatusEnum! writingOrder: WritingOrderInterface } type GenerationGenerationRootMutation { """ Generate a preview of the course material book. """ coursePreview(courseId: ID!, notifyOnComplete: Boolean = false, skipPdfAndEpub: Boolean = false): CoursePreviewMutationPayload! """ Generate a full or subset preview of the book. """ previewBook( bookId: ID! """ If this is true a subset will be generated. Only works for GitHub, BitBucket, and Dropbox, otherwise a regular preview will be generated. """ subset: Boolean = false ): PreviewBookPayload! """ Generate a full or subset publish of the book. """ publishBook( """ A private note for the author's own reference about what changed in this release. """ authorNote: String bookId: ID! """ If true, emails will be sent to readers about the new version. """ emailReaders: Boolean = true """ If true, the HTML version of the book will be generated. """ enableHtmlVersion: Boolean! """ The percentage of the book that is complete (0-100). """ percentComplete: Int """ If false, this publish does not render a new EPUB; readers keep the current one. """ publishEpub: Boolean = true """ If false, this publish does not render a new PDF; readers keep the current one. """ publishPdf: Boolean = true """ Release notes for the new version. """ releaseNotes: String """ If true, also republish all published translations of this book. """ republishTranslations: Boolean = false """ If this is true a subset will be generated. Only works for GitHub, BitBucket, and Dropbox, otherwise a regular publish will be generated. """ subset: Boolean = false ): PublishBookMutationPayload! """ Generate a full or subset publish of the course. """ publishCourse(authorNote: String, courseId: ID!, notifyLearners: Boolean = true, percentComplete: Int, releaseNotes: String): PublishCourseMutationPayload! } type GqlMutation { author: AuthorAuthorRootMutation! generation: GenerationGenerationRootMutation! store: StoreStoreRootMutation! } type GqlQuery { author: AuthorAuthorRootQuery! identity: IdentityIdentityRootQuery! org: OrgOrgRootQuery! shared: SharedSharedRootQuery! store: StoreStoreRootQuery! } """ An ISO 8601-encoded datetime """ scalar ISO8601DateTime @specifiedBy(url: "https://tools.ietf.org/html/rfc3339") """ A more protected version of user that should only be accessed by the current user. """ type IdentityCurrentUser { books(excludeTranslateaiBooks: Boolean = false, state: SharedBookStateEnum = PUBLISHED): [AuthorBook!]! email: SharedEmail! id: ID! """ The user's full name """ name: String! readerEmails(type: String = "all"): [String!]! username: String! } type IdentityIdentityRootQuery { currentUser: IdentityCurrentUser } """ A single Leanpub user. """ type IdentityUser { email: SharedEmail id: ID! """ The user's full name """ name: String! username: String! } """ Represents untyped JSON """ scalar JSON """ Autogenerated return type of NewBookCouponMutation. """ type NewBookCouponMutationPayload { book: AuthorBook! errors: [SharedError!] status: SharedStatusEnum! } type OrgOrgRootQuery { publisher(slug: String!): OrgPublisher } """ The record joining publishers to their products and users """ type OrgPublisher { id: ID! name: String! slug: SharedSlug! } interface PackageInterface { """ The record id """ id: ID! minimumPaidPrice: Float! """ The slug of the item in this package """ slug: SharedSlug! } """ Autogenerated return type of PreviewBook. """ type PreviewBookPayload { errors: [SharedError!] status: SharedStatusEnum! } """ Autogenerated return type of PreviewSingleBook. """ type PreviewSingleBookPayload { book: AuthorBook! errors: [SharedError!] status: SharedStatusEnum! } interface ProductInterface { id: ID! slug: String! } """ Autogenerated return type of PublishBookMutation. """ type PublishBookMutationPayload { errors: [SharedError!] status: SharedStatusEnum! } """ Autogenerated return type of PublishCourseMutation. """ type PublishCourseMutationPayload { course: AuthorCourse! errors: [SharedError!] status: SharedStatusEnum! } """ This is a placeholder description """ type ReaderPurchasedPackage { free: Boolean! id: ID! shareEmailWithAuthor: Boolean! user: IdentityUser } """ An enumerator for the states of Book """ enum SharedBookStateEnum { """ Closed """ CLOSED """ Published """ PUBLISHED """ Retired """ RETIRED """ Stealthed """ STEALTHED """ Suspended """ SUSPENDED """ Unpublished """ UNPUBLISHED } """ This is a placeholder description """ type SharedCategory { fullName: String! id: ID! name: String! slug: SharedSlug! } """ The Email scalar type represents a fully formed email string """ scalar SharedEmail type SharedError { messages: [String!]! path: String } """ A File Path scalar type that represents a file path string. """ scalar SharedFileName """ The base object for a paperclip image attachment """ type SharedImageAttachment { """ The URL for the image and the size given """ url: String! } """ The description of a background job """ type SharedJob { """ The time the job was created """ createdAt: ISO8601DateTime! """ The time the job finished """ finishedAt: ISO8601DateTime """ The unique identifier of the job """ id: ID! """ A short identifier for the job class and action, e.g. "GenerateBookJob#preview" """ jobType: String """ A human-readable name for this job run """ name: String """ The options the job was enqueued with (e.g. requested_by, slug, action) """ options: JSON """ The time the job is scheduled to run """ scheduledAt: ISO8601DateTime """ The current status of the job """ status: SharedJobStatus! } """ The status of a background job """ type SharedJobStatus { """ The number of steps completed in the job """ progress: Int """ The current status of the job """ status: String! """ The current step being executed in the job """ step: String """ The total number of steps in the job """ total: Int } """ This is a placeholder description """ type SharedLanguage { code2: String! code3: String! id: ID! name: String! originalName: String! } enum SharedPackageStateEnum { published unpublished } type SharedSharedRootQuery { category(slug: String!): SharedCategory language(code: String!): SharedLanguage } """ The Slug scalar type represents an identifier for a record on Leanpub, represented by a series of characters, numbers, underscores, or dashes. """ scalar SharedSlug """ An Enum with the various status codes returned by mutations """ enum SharedStatusEnum { ACCEPTED ALREADY_REPORTED BAD_GATEWAY BAD_REQUEST BANDWIDTH_LIMIT_EXCEEDED BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS CLIENT_CLOSED_REQUEST CONFLICT CONTINUE CREATED ENHANCE_YOUR_CALM EXPECTATION_FAILED FAILED_DEPENDENCY FORBIDDEN FOUND GATEWAY_TIMEOUT GONE HTTP_REQUEST_SENT_TO_HTTPS_PORT IM_A_TEAPOT INSUFFICIENT_STORAGE INTERNAL_SERVER_ERROR LENGTH_REQUIRED LOCKED LOOP_DETECTED METHOD_NOT_ALLOWED MISDIRECTED_REQUEST MOVED_PERMANENTLY MULTIPLE_CHOICES MULTI_STATUS NETWORK_AUTHENTICATION_REQUIRED NETWORK_CONNECT_TIMEOUT_ERROR NON_AUTHORITATIVE_INFORMATION NOT_ACCEPTABLE NOT_EXTENDED NOT_FOUND NOT_IMPLEMENTED NOT_MODIFIED NO_CONTENT NO_RESPONSE OK ORIGIN_IS_UNREACHABLE PARTIAL_CONTENT PAYLOAD_TOO_LARGE PAYMENT_REQUIRED PERMANENT_REIDRECT PRECONDITION_FAILED PROCESSING PROXY_AUTHENTICATION_REQUIRED REQUEST_HEADER_FIELDS_TOO_LARGE REQUEST_RANGE_NOT_SATISFIABLE REQUEST_TIMEOUT REQUEST_URI_TOO_LONG SEE_OTHER SERVICE_UNAVAILABLE SSL_HANDSHAKE_FAILED SWITCHING_PROTOCOLS TEMPORARY_REDIRECT TOKEN_EXPIRED_INVALID TOO_EARLY TOO_MANY_REQUESTS UNAUTHORIZED UNAVAILABLE_FOR_LEGAL_REASONS UNPROCESSABLE_ENTITY UNSUPPORTED_MEDIA_TYPE UPDGRADE_REQUIRED USE_PROXY VARIANT_ALSO_NEGOTIATES WEB_SERVER_IS_DOWN } """ An enum encoding the possible write modes. """ enum SharedSyncModeEnum { """ Sync mode: Bitbucket """ bitbucket """ Sync mode: Dropbox """ dropbox """ Sync mode: Dropbox cold storage """ dropbox_cold_storage """ Sync mode: Github """ github """ Sync mode: Google docs """ google_docs """ Sync mode: Lexical """ lexical """ Sync mode: Minimal """ minimal """ Sync mode: Monaco """ monaco """ Sync mode: Upload """ upload """ Sync mode: Visual """ visual """ Sync mode: Word upload """ word_upload } type StoreBookProduct implements ProductInterface { id: ID! slug: String! } """ A WritingOrder ready to be turned into a Book. """ type StoreBookWritingOrder implements WritingOrderInterface { canComplete: Boolean! complete: Boolean! """ The record id """ id: ID! product: StoreWritingPurchase redirectUrl: String! } """ A WritingOrder ready to be turned into a Bundle. """ type StoreBundleWritingOrder implements WritingOrderInterface { canComplete: Boolean! complete: Boolean! """ The record id """ id: ID! product: StoreWritingPurchase redirectUrl: String! } """ A WritingOrder ready to be turned into a Course. """ type StoreCourseWritingOrder implements WritingOrderInterface { canComplete: Boolean! complete: Boolean! """ The record id """ id: ID! product: StoreWritingPurchase redirectUrl: String! } """ Represents an expression of interest from a prospective reader (email optionally shared with author) """ type StorePossibleReader { email: SharedEmail id: ID! name: String shareEmailWithAuthor: Boolean! } type StoreStoreRootMutation { """ Create a PossibleReader entry for a book (pre-publish interest). """ createPossibleReader(email: String!, maxprice: Float, name: String!, productId: ID!, shareEmailWithAuthor: Boolean = false): CreatePossibleReaderPayload! createWritingOrder(createGithubRepo: Boolean = false, dropboxEmail: String, email: String, githubPath: String, githubUsername: String, languageId: ID, name: String, password: String, previewBranch: String, publishBranch: String, publisherId: ID, slug: String!, startFromScratch: Boolean = false, syncMode: String, title: String!, type: String!, useDropboxOutput: Boolean = false, username: String, writingOrderId: ID): CreateWritingOrderPayload! } type StoreStoreRootQuery { book(slug: SharedSlug!): StoreBookProduct } """ A WritingOrder ready to be turned into a track. """ type StoreTrackWritingOrder implements WritingOrderInterface { canComplete: Boolean! complete: Boolean! """ The record id """ id: ID! product: StoreWritingPurchase redirectUrl: String! } """ This is a placeholder description """ type StoreWritingPurchase { slug: SharedSlug } """ Autogenerated return type of UploadBookFileMutation. """ type UploadBookFileMutationPayload { book: AuthorBook! errors: [SharedError!] status: SharedStatusEnum! } interface WritingOrderInterface { canComplete: Boolean! complete: Boolean! """ The record id """ id: ID! product: StoreWritingPurchase redirectUrl: String! }