export type PlayFinancialReportType = 'earnings' | 'sales'; /** * 버킷 이름 해석: 명시 인자 > ~/.mimi-seed/play-financials.json. * * 버킷 이름은 Play Console 에만 있고 API 로 못 얻는다(개발자 계정마다 다르다). * 없으면 조용히 빈 결과를 주는 대신 여기서 끊는다 — "매출 0" 과 "설정 누락" 이 * 구분되지 않는 게 이 도구의 가장 위험한 오답이다. */ export declare function resolveBucket(explicit?: string, packageName?: string): string; export interface FinancialReportObject { name: string; size: number; updated: string; /** 파일명에서 뽑은 YYYYMM. 못 뽑으면 빈 문자열. */ yearMonth: string; } export declare function listFinancialReports(options: { packageName?: string; bucket?: string; reportType?: PlayFinancialReportType; }): Promise<{ bucket: string; objects: FinancialReportObject[]; }>; export interface EarningsSummary { bucket: string; files: string[]; rowCount: number; /** 정산 통화별 순액 합계 — 수수료·세금·환불이 음수로 들어와 이미 상쇄된 값이다. */ netByMerchantCurrency: Record; /** Transaction Type 별 건수·금액. 'Charge' 만이 실제 구매다. */ byTransactionType: Record; /** * 상품별 집계 (Charge 행만). **통화별로 행이 갈린다** — 여러 통화를 한 숫자로 더하면 * IDR 1,000,000 과 KRW 3,000 이 섞여 아무 의미 없는 값이 된다. */ byProduct: Array<{ productId: string; title: string; currency: string; count: number; amount: number; }>; /** 판독을 위해 남기는 원본 행. 기본은 생략된다. */ rows?: Array>; } export declare function getFinancialReport(options: { yearMonth: string; packageName?: string; bucket?: string; reportType?: PlayFinancialReportType; includeRows?: boolean; }): Promise; /** * 최소 ZIP 리더 (stored + deflate). * * Node 에 zip 해제가 없고, 이 하나 때문에 의존성을 늘리고 싶지 않다. Play 리포트는 * 항상 단일/소수 CSV 엔트리라 중앙 디렉터리만 훑으면 충분하다. */ export declare function unzip(buffer: Buffer): Buffer[]; /** 따옴표·따옴표 안 쉼표를 처리하는 최소 CSV 파서. 헤더 기준 객체 배열을 만든다. */ export declare function parseCsv(text: string): Array>;