import { Methods } from "./methods.js"; import { Product, Recurrence } from "./types/gumroad.js"; //#region src/products.d.ts /** Bindings for {@link Product} */ interface ProductProps { /** * Deletes the product * * @returns On success, `true` */ delete(requestOptions?: { signal?: AbortSignal; }): Promise; /** * Enables the product * * @returns On success, a {@link Product} */ enable(requestOptions?: { signal?: AbortSignal; }): Promise; /** * Disables the product * * @returns On success, a {@link Product} */ disable(requestOptions?: { signal?: AbortSignal; }): Promise; } /** A class having API methods related to Products */ declare class ProductsMethods extends Methods { protected _bindProduct(product: Product): Product & ProductProps; /** * Retrieve all of the existing products for the authenticated user. * * @returns On success, an Array of {@link Product} * * @see https://app.gumroad.com/api#get-/products */ list({ signal }?: { signal?: AbortSignal; }): Promise<(Product & ProductProps)[]>; /** * Retrieve the details of a product. * * @param product_id Id of the product * * @returns On success, a {@link Product} * * @see https://app.gumroad.com/api#get-/products/:id */ get(product_id: string, { signal }?: { signal?: AbortSignal; }): Promise; /** * Create a new product (as a draft). * * @param name The name of the product * @param price The price of the product in the smallest currency unit (e.g. cents) * @param options (Optional) Options * * @returns On success, a {@link Product} * * @see https://app.gumroad.com/api#post-/products * * **Only available with the `edit_products` or `account` scope.** */ create(name: string, price: number, options?: { /** * Native type of the product. * Cannot be changed later * * @default 'digital' */ native_type?: 'digital' | 'course' | 'ebook' | 'membership' | 'bundle' | 'coffee' | 'call' | 'commission'; /** The product description in HTML */ description?: string; /** The custom URL slug for the product */ custom_permalink?: string; /** ISO currency code; defaults to your account currency */ price_currency_type?: string; /** For `membership` only */ subscription_duration?: Recurrence; /** Set to `true` if want to enable pay-what-you-want */ customizable_price?: boolean; /** Suggested price in cents */ suggested_price_cents?: number; /** The number of maximum purchase allowed for the product */ max_purchase_count?: number; taxonomy_id?: string; /** Array of tag strings */ tags?: string[]; /** The custom summary shown to buyers */ custom_summary?: string; /** Array of files to attach */ files?: { id?: string; url: string; }[]; }, { signal }?: { signal?: AbortSignal; }): Promise; /** * Update an existing product. * * Send only the fields you want to change. * Sending `files`, `tags`, or `rich_content` replaces the entire collection. * * @param product_id The id of the product * @param options (Optional) Send only the fields you want to change. * * @returns On success, a {@link Product} * * @see https://app.gumroad.com/api#put-/products/:id * * **Only available with the `edit_products` or `account` scope.** */ update(product_id: string, options?: { /** The name of the product */ name?: string; /** The price of the product in the smallest currency unit (e.g. cents) */ price?: number; /** The product description in HTML */ description?: string; /** The custom URL slug for the product */ custom_permalink?: string; /** ISO currency code; defaults to your account currency */ price_currency_type?: string; /** Set to `true` if want to enable pay-what-you-want */ customizable_price?: boolean; /** Suggested price in cents */ suggested_price_cents?: number; /** The number of maximum purchase allowed for the product */ max_purchase_count?: number; /** Whether quantity should be enabled */ quantity_enabled?: boolean; /** Whether adult product */ is_adult?: boolean; /** Whether to display product reviews */ display_product_reviews?: boolean; /** Whether to show sales count */ should_show_sales_count?: boolean; taxonomy_id?: string; /** Array of tag strings; full replacement */ tags?: string[]; /** The custom receipt text */ custom_receipt?: string; /** The custom summary shown to buyers */ custom_summary?: string; /** Array of cover GUIDs in display order */ cover_ids?: string[]; /** Switches between product-level and per-variant rich content */ has_same_rich_content_for_all_variants?: boolean; /** Array of files; full replacement */ files?: { id?: string; url: string; }[]; }, { signal }?: { signal?: AbortSignal; }): Promise; /** * Permanently delete a product. * * @param product_id The id of the product to delete * * @returns On success, `true` * * @see https://app.gumroad.com/api#delete-/products/:id */ delete(product_id: string, { signal }?: { signal?: AbortSignal; }): Promise; /** * Enable an existing product. * * @param product_id The id of the product to enable * * @returns On success, a {@link Product} * * @see https://app.gumroad.com/api#put-/products/:id/enable */ enable(product_id: string, { signal }?: { signal?: AbortSignal; }): Promise; /** * Disable an existing product. * * @param product_id The id of the product to disable * * @returns On success, a {@link Product} * * @see https://app.gumroad.com/api#put-/products/:id/disable */ disable(product_id: string, { signal }?: { signal?: AbortSignal; }): Promise; } //#endregion export { ProductProps, ProductsMethods }; //# sourceMappingURL=products.d.ts.map