export interface AppleKeyConfig { keyId: string; issuerId?: string; p8Path: string; keyType?: 'TEAM' | 'INDIVIDUAL'; } export interface AppleConfig extends AppleKeyConfig { /** Optional key for Sales/Finance/Analytics reports, e.g. a Sales and Reports key */ reportsKey?: AppleKeyConfig; /** Optional Admin key for analytics requests and as a reporting/finance fallback. */ adminKey?: AppleKeyConfig; } export type AppleKeyPurpose = 'default' | 'reports' | 'finance' | 'admin'; /** * Picks the key for a request by API, never by retrying with a stronger key: * changing analytics report requests needs Admin, reading reports needs a * reports-capable role, everything else uses the main key. */ export declare function keyPurpose(method: string, url: string): AppleKeyPurpose; export declare class AppleApiError extends Error { readonly status: number; readonly method: string; readonly path: string; readonly responseBody: string; constructor(message: string, status: number, method: string, path: string, responseBody: string); } export declare class AppleClient { private config; private baseOrigin; private baseUrl; private tokens; constructor(config: AppleConfig); /** The key used for a purpose: reports fall back to the Admin key, then to the main key. */ keyFor(purpose?: AppleKeyPurpose): AppleKeyConfig; private getToken; request(path: string, options?: { method?: string; body?: any; params?: Record; /** Return the response body as a Buffer (gzip reports) instead of parsing JSON */ raw?: boolean; }): Promise; upload(url: string, filePath: string, contentType: string): Promise; uploadOperation(operation: { method?: string; url?: string; requestHeaders?: Array<{ name?: string; value?: string; }>; length?: number; offset?: number; }, filePath: string): Promise; } //# sourceMappingURL=client.d.ts.map