export type SalesFrequency = 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY'; /** 리포트 한 줄 = TSV 헤더명 → 값. 컬럼 구성은 reportType 마다 다르다. */ export type ReportRow = Record; export declare function parseTsv(text: string): ReportRow[]; export interface SalesLine { sku: string; title: string; /** Apple 의 Product Type Identifier. IA* / IAY 계열이 인앱결제·구독이다. */ productType: string; country: string; /** 환불은 **음수 units** 로 들어온다 — 합계에서 자연히 상쇄된다. */ units: number; customerPrice: number; customerCurrency: string; /** 개발자 수취액 **1개당** 금액. 총액은 units 를 곱해야 한다. */ proceedsPerUnit: number; proceedsCurrency: string; proceedsTotal: number; } export interface SalesSummary { /** 데이터가 존재한 날짜들. 요청 범위 중 리포트가 없던 날은 빠진다. */ datesWithData: string[]; datesWithoutData: string[]; lines: SalesLine[]; /** 통화별 개발자 수취액 합계. 통화가 섞이므로 절대 하나로 더하지 않는다. */ proceedsByCurrency: Record; /** 유료 결제 건수 합계 (customerPrice > 0 인 줄의 units). */ paidUnits: number; /** 무료 다운로드/설치 units — 매출과 무관하지만 같은 리포트에 섞여 온다. */ freeUnits: number; } /** 날짜 문자열(YYYY-MM-DD)을 하루씩 증가시키며 나열. endDate 포함. */ export declare function eachDate(startDate: string, endDate: string, maxDays: number): string[]; export declare function getSalesReport(options: { vendorNumber?: string; startDate: string; endDate?: string; frequency?: SalesFrequency; reportType?: string; reportSubType?: string; version?: string; }): Promise; /** * 리포트 접근 가능 여부만 싸게 확인한다 (appstore_verify_credentials 용). * * 왜 별도 프로브가 필요한가: 리포트 엔드포인트는 **다른 ASC API 와 요구 롤이 다르다.** * App Manager 키는 GET /apps 가 멀쩡히 되므로 기존 검증은 전부 통과하는데, 매출 도구만 * 403 으로 죽는다. 그 사실이 첫 매출 조회 때까지 드러나지 않으면 "도구가 고장났다" 로 * 오진하게 된다 — Play 쪽 playstore_verify_service_account 가 'View financial data' 를 * 함께 확인하는 것과 같은 이유다. */ export declare function probeReportsAccess(): Promise<{ status: 'ok' | 'no_vendor_number' | 'forbidden' | 'error'; detail: string; }>; export declare function getFinanceReport(options: { vendorNumber?: string; /** YYYY-MM. **Apple 회계월**이라 달력월과 어긋날 수 있다 — 도구 설명 참고. */ reportDate: string; regionCode?: string; reportType?: 'FINANCIAL' | 'FINANCE_DETAIL'; }): Promise<{ notFound: boolean; rows: ReportRow[]; raw: string; }>;