import { Client } from '../clients/client'; import { ListPurchasesOptions, StatementOptions, DownloadLinkOptions } from '../types/options'; import { Sale, MarketDomain } from '../types/api'; export declare class PrivateEndpoints { private _client; constructor(client: Client); /** * Lists all unrefunded sales of the authenticated user's items listed on Envato Market. Author sales data * ("Amount") is reported before subtraction of any income taxes (eg US Royalty Withholding Tax). * * @param page A page number to start the results from. */ getSales(page?: number): Promise; /** * Returns the details of an author's sale identified by the purchase code. Author sales data ("Amount") is reported * before subtraction of any income taxes (eg US Royalty Withholding Tax). Returns `undefined` if no matching sale * is found. * * @param code The unique code of the sale to return. */ getSale(code: string): Promise; /** * List purchases. * * @param code The unique code of the sale to return. */ getPurchases(options: ListPurchasesOptions): Promise; /** * Lists all purchases that the authenticated user has made of the app creator's listed items. Only works * with OAuth tokens. * * @param page A page number to start the results from. */ getPurchasesFromAppCreator(page?: number): Promise; /** * Returns the details of a user's purchase identified by the purchase code. Returns `undefined` if no matching * purchase is found. * * @param code The unique code of the purchase to return. * @deprecated The `purchase:history` permission is deprecated, please use `purchase:verify` instead. */ getPurchase(code: string): Promise; /** * Returns the first name, surname, earnings available to withdraw, total deposits, balance (deposits + earnings) * and country. */ getAccountDetails(): Promise; /** * Returns the currently logged in user's Envato Account username. */ getUsername(): Promise; /** * Returns the currently logged in user's email address. */ getEmail(): Promise; /** * Returns the monthly sales data, as displayed on the user's earnings page. Monthly sales data ("Earnings") is * reported before subtraction of any income taxes (eg US Royalty Withholding Tax). */ getMonthlySales(): Promise; /** * Lists transactions from the user's statement page. */ getStatement(options: StatementOptions): Promise; /** * Download purchased items by either the item_id or the purchase_code. Each invocation of this endpoint will count * against the items daily download limit. */ getDownloadLink(options: DownloadLinkOptions): Promise; } export interface ISaleResponse extends Sale { /** * The username of the buyer. Note that this can be `null` if the item was purchased via guest checkout. */ buyer: string | null; /** * The number of times this buyer has purchased the item. */ purchase_count: number; } export interface IPurchasesResponse { count: number; results: (Sale & { code: string; })[]; } export interface IPurchasesFromAppCreatorResponse { buyer: { id: number; username: string; }; author: { id: number; username: string; }; purchases: (Sale & { code: string; })[]; } export interface IPurchaseResponse extends Sale { code: string; } export interface IPrivateAccountDetailsResponse { image: string; firstname: string; surname: string; available_earnings: string; total_deposits: string; balance: string; country: string; } export interface IUsernameResponse { username: string; } export interface IEmailResponse { email: string; } export interface IMonthlySalesResponse extends Array<{ /** * The month as a timestamp (format: `"Mon Apr 01 00:00:00 +1100 2013"`). */ month: Date; /** * The number of sales for this month as an unformatted integer in a string. */ sales: string; /** * The total earnings from sales this month as a double in a string (e.g. `"652.45"`). */ earnings: string; }> { } export interface IStatementResponse { count: number; results: { unique_id: string; date: Date; order_id: number | null; type: string; detail: string; item_id: number | null; document: string | null; price: number | null; au_gst: number | null; eu_vat: number | null; us_rwt: number | null; us_bwt: number | null; amount: number; site: MarketDomain | null; other_party_country: string | null; other_party_region: string | null; other_party_city: string | null; other_party_zipcode: string | null; }[]; } export interface IDownloadLinkResponse { download_url: string; }