import type { OAuth2Client, JWT } from 'google-auth-library'; export type PlayImageType = 'featureGraphic' | 'icon' | 'phoneScreenshots' | 'promoGraphic' | 'sevenInchScreenshots' | 'tenInchScreenshots' | 'tvBanner' | 'tvScreenshots' | 'wearScreenshots'; /** * Google Play Developer API (Android Publisher API v3) 래퍼 * * 주의: 최초 앱 생성은 API로 불가 (Play Console에서만). * 여기서는 기존 앱의 메타데이터, 빌드, 출시를 관리. */ export declare const publisher: () => import("googleapis/build/src/apis/androidpublisher/v3.js").androidpublisher_v3.Androidpublisher; export type PlayVitalsMetricSet = 'anrRate' | 'crashRate' | 'errorCount'; export interface PlayStatisticsQuery { metricSet?: PlayVitalsMetricSet; startDate: string; endDate: string; aggregationPeriod?: 'DAILY' | 'HOURLY'; dimensions?: string[]; metrics?: string[]; filter?: string; pageSize?: number; pageToken?: string; userCohort?: 'OS_PUBLIC' | 'APP_TESTERS' | 'OS_BETA'; timeZone?: string; } export interface EditCommitInfo { /** true 면 커밋은 됐지만 심사 전송은 Play Console 에서 사람이 눌러야 한다. */ changesNotSentForReview: boolean; } export declare function withEdit(auth: OAuth2Client | JWT, packageName: string, fn: (editId: string) => Promise, commit?: boolean, onCommit?: (info: EditCommitInfo) => void): Promise; export declare function getStatistics(auth: OAuth2Client | JWT, packageName: string, query: PlayStatisticsQuery): Promise; export declare function getAppDetails(auth: OAuth2Client | JWT, packageName: string): Promise; export declare function updateAppDetails(auth: OAuth2Client | JWT, packageName: string, data: { contactEmail?: string; contactPhone?: string; contactWebsite?: string; defaultLanguage?: string; }): Promise; export declare function getListing(auth: OAuth2Client | JWT, packageName: string, language?: string): Promise; export declare function updateListing(auth: OAuth2Client | JWT, packageName: string, language: string, data: { title?: string; shortDescription?: string; fullDescription?: string; }): Promise; export declare function listTracks(auth: OAuth2Client | JWT, packageName: string): Promise<{ track: string | null | undefined; releases: { name: string | null | undefined; status: string | null | undefined; versionCodes: string[] | null | undefined; releaseNotes: import("googleapis/build/src/apis/androidpublisher/v3.js").androidpublisher_v3.Schema$LocalizedText[] | undefined; }[]; }[]>; export declare function updateReleaseNotes(auth: OAuth2Client | JWT, packageName: string, track: string, versionCode: string, language: string, text: string): Promise; /** * 최신 release (versionCode 최대값)의 releaseNotes[language]를 교체/추가. * versionCode를 모를 때 편의용. */ export declare function updateLatestReleaseNotes(auth: OAuth2Client | JWT, packageName: string, track: string, language: string, text: string): Promise<{ updatedVersionCodes: string[] | null | undefined; updatedReleaseName: string | null | undefined; releases?: import("googleapis/build/src/apis/androidpublisher/v3.js").androidpublisher_v3.Schema$TrackRelease[]; track?: string | null; }>; export declare function listImages(auth: OAuth2Client | JWT, packageName: string, language: string, imageType: PlayImageType): Promise; export declare function uploadImage(auth: OAuth2Client | JWT, packageName: string, language: string, imageType: PlayImageType, filePath: string): Promise; export declare function deleteAllImages(auth: OAuth2Client | JWT, packageName: string, language: string, imageType: PlayImageType): Promise<{ ok: boolean; imageType: PlayImageType; }>; /** * 한 edit 세션 내에서 기존 이미지 전체 삭제 + 새 이미지 순서대로 업로드 + commit. * phoneScreenshots처럼 여러 장 교체 시 효율적 (단일 edit). */ export declare function replaceImages(auth: OAuth2Client | JWT, packageName: string, language: string, imageType: PlayImageType, filePaths: string[]): Promise<{ imageType: PlayImageType; count: number; uploaded: { id?: string | null; url?: string | null; sha256?: string | null; }[]; }>; export declare function submitRelease(auth: OAuth2Client | JWT, packageName: string, track: string, versionCode: string, status?: 'completed' | 'draft' | 'inProgress' | 'halted'): Promise<{ track: string; versionCode: string; previousStatus: string | null | undefined; newStatus: "completed" | "draft" | "inProgress" | "halted"; committed: boolean; result: import("googleapis/build/src/apis/androidpublisher/v3.js").androidpublisher_v3.Schema$Track; }>; export interface PromoteReleaseOptions { status?: 'completed' | 'draft' | 'inProgress' | 'halted'; userFraction?: number; releaseName?: string; releaseNotes?: Array<{ language: string; text: string; }>; copyReleaseNotes?: boolean; } export declare function promoteRelease(auth: OAuth2Client | JWT, packageName: string, fromTrack: string, toTrack: string, versionCode: string, options?: PromoteReleaseOptions): Promise<{ changesNotSentForReview: boolean; nextAction: string | undefined; warnings: string[] | undefined; packageName: string; fromTrack: string; toTrack: string; versionCode: string; newStatus: "completed" | "draft" | "inProgress" | "halted"; userFraction: number | undefined; releaseName: string | null | undefined; releaseNotesLanguages: (string | null | undefined)[]; committed: boolean; result: import("googleapis/build/src/apis/androidpublisher/v3.js").androidpublisher_v3.Schema$Track; }>; export declare function listReviews(auth: OAuth2Client | JWT, packageName: string): Promise<{ reviewId: string | null | undefined; authorName: string | null | undefined; comments: { text: string | null | undefined; starRating: number | null | undefined; lastModified: string | null | undefined; deviceMetadata: string | null | undefined; }[] | undefined; }[]>; export declare function replyToReview(auth: OAuth2Client | JWT, packageName: string, reviewId: string, replyText: string): Promise; export declare function listInAppProducts(auth: OAuth2Client | JWT, packageName: string): Promise<{ productId: any; listings: any; purchaseOptions: any; }[]>; export declare function listSubscriptions(auth: OAuth2Client | JWT, packageName: string): Promise<{ productId: string | null | undefined; basePlans: import("googleapis/build/src/apis/androidpublisher/v3.js").androidpublisher_v3.Schema$BasePlan[] | undefined; listings: import("googleapis/build/src/apis/androidpublisher/v3.js").androidpublisher_v3.Schema$SubscriptionListing[] | undefined; }[]>; export interface ProductListingInput { languageCode: string; title?: string; description?: string; /** 구독 전용. 최대 4개. */ benefits?: string[]; } interface StoredListing { languageCode?: string | null; title?: string | null; description?: string | null; benefits?: string[] | null; } export declare function updateOneTimeProductListings(auth: OAuth2Client | JWT, packageName: string, productId: string, listings: ProductListingInput[]): Promise<{ productId: string; created: string[]; updated: string[]; listings: StoredListing[]; }>; export declare function updateSubscriptionListings(auth: OAuth2Client | JWT, packageName: string, productId: string, listings: ProductListingInput[]): Promise<{ productId: string; created: string[]; updated: string[]; listings: StoredListing[]; }>; export declare function updatePurchaseOptionState(auth: OAuth2Client | JWT, packageName: string, productId: string, purchaseOptionId: string, action: 'activate' | 'deactivate'): Promise<{ productId: string; purchaseOptionId: string; action: "activate" | "deactivate"; states: { purchaseOptionId: string | undefined; state: string | undefined; }[]; }>; export interface RecoveryTargeting { /** 전체 사용자 대상. versionCodes / 범위와 함께 쓸 수 없다. */ allUsers?: boolean; /** 특정 버전 코드들 */ versionCodes?: string[]; /** 버전 코드 범위 (start~end) */ versionRange?: { start: string; end: string; }; /** 지역 코드 (예: KR, US) */ regions?: string[]; /** Android SDK 레벨 */ sdkLevels?: string[]; } export declare function buildTargeting(t: RecoveryTargeting): Record; export declare function listRecoveryActions(auth: OAuth2Client | JWT, packageName: string, versionCode?: string): Promise<{ id: string | null | undefined; status: string | null | undefined; createTime: string | null | undefined; deployTime: string | null | undefined; cancelTime: string | null | undefined; targeting: import("googleapis/build/src/apis/androidpublisher/v3.js").androidpublisher_v3.Schema$Targeting | undefined; }[]>; /** DRAFT 상태로만 만든다 — 실제 배포는 deployRecoveryAction 이 별도로 한다. */ export declare function createRecoveryAction(auth: OAuth2Client | JWT, packageName: string, targeting: RecoveryTargeting): Promise<{ id: string | null | undefined; status: string | null | undefined; targeting: import("googleapis/build/src/apis/androidpublisher/v3.js").androidpublisher_v3.Schema$Targeting | undefined; }>; export declare function deployRecoveryAction(auth: OAuth2Client | JWT, packageName: string, appRecoveryId: string): Promise<{ appRecoveryId: string; deployed: boolean; }>; export declare function cancelRecoveryAction(auth: OAuth2Client | JWT, packageName: string, appRecoveryId: string): Promise<{ appRecoveryId: string; cancelled: boolean; }>; export declare function uploadDataSafety(auth: OAuth2Client | JWT, packageName: string, safetyLabelsCsv: string): Promise<{ packageName: string; bytes: number; lines: number; }>; export type ServiceAccountVerifyResult = { ok: true; clientEmail: string; projectId: string; } | { ok: false; stage: 'parse' | 'auth' | 'api'; httpStatus?: number; message: string; }; export declare function verifyServiceAccountJson(serviceAccountJson: string, packageName: string): Promise; export {};