@gpc-cli/core 0.9.61 → 0.9.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GPC Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { OutputFormat, ResolvedConfig, WebhookConfig } from '@gpc-cli/config';
2
2
  import { AuthClient } from '@gpc-cli/auth';
3
3
  import { GpcPlugin, PluginManifest, CommandEvent, CommandResult, PluginError, RequestEvent, ResponseEvent, PluginCommand } from '@gpc-cli/plugin-sdk';
4
- import { PlayApiClient, EditCommitOptions, Track, ExternallyHostedApk, ExternallyHostedApkResponse, DeobfuscationFileType, UploadProgressEvent, ResumableUploadOptions, Listing, ImageType, CountryAvailability, Image, AppDetails, Review, ReviewReplyResponse, Subscription, SubscriptionOffer, OffersListResponse, BasePlanMigratePricesRequest, InAppProduct, Order, SubscriptionDeferResponse, SubscriptionsV2DeferResponse, ProductPurchase, ProductPurchaseV2, SubscriptionPurchaseV2, VoidedPurchase, UsersApiClient, User, DeveloperLevelPermission, Grant, MetricRow, ReportingDimension, ReportingAggregation, VitalsMetricSet, ReportingApiClient, AnomalyDetectionResponse, MetricSetResponse, ErrorIssuesResponse, ConvertRegionPricesResponse, ReportType, StatsDimension, ReportBucket, Testers, AppRecoveryTargeting, AppRecoveryAction, CreateAppRecoveryActionRequest, DataSafety, ExternalTransaction, ExternalTransactionRefund, DeviceTierConfig, OneTimeOffer, OneTimeProduct, OneTimeOffersListResponse, OneTimeProductsListResponse, GamesApiClient, Achievement, GameEvent, Leaderboard, EnterpriseApiClient, CustomApp, GeneratedApk, Bundle } from '@gpc-cli/api';
4
+ import { PlayApiClient, EditCommitOptions, Track, ExternallyHostedApk, ExternallyHostedApkResponse, DeobfuscationFileType, UploadProgressEvent, ResumableUploadOptions, Listing, ImageType, CountryAvailability, Image, AppDetails, Review, ReviewReplyResponse, Subscription, SubscriptionOffer, OffersListResponse, BasePlanMigratePricesRequest, InAppProduct, Order, SubscriptionDeferResponse, SubscriptionsV2DeferResponse, ProductPurchase, ProductPurchaseV2, SubscriptionPurchaseV2, VoidedPurchase, UsersApiClient, User, DeveloperLevelPermission, Grant, MetricRow, ReportingDimension, ReportingAggregation, VitalsMetricSet, ReportingApiClient, AnomalyDetectionResponse, MetricSetResponse, ErrorIssuesResponse, ConvertRegionPricesResponse, ReportType, StatsDimension, ReportBucket, Testers, AppRecoveryTargeting, AppRecoveryAction, CreateAppRecoveryActionRequest, DataSafetyResponse, DataSafetyRequest, ExternalTransaction, ExternalTransactionRefund, DeviceTierConfig, OneTimeOffer, OneTimeProduct, OneTimeOffersListResponse, OneTimeProductsListResponse, GamesApiClient, Achievement, GameEvent, Leaderboard, EnterpriseApiClient, CustomApp, GeneratedApksPerSigningKey, Bundle } from '@gpc-cli/api';
5
5
 
6
6
  declare class GpcError extends Error {
7
7
  readonly code: string;
@@ -105,7 +105,6 @@ declare function discoverPlugins(options?: DiscoverPluginsOptions): Promise<GpcP
105
105
 
106
106
  interface AppInfo {
107
107
  packageName: string;
108
- title?: string;
109
108
  defaultLanguage?: string;
110
109
  contactEmail?: string;
111
110
  }
@@ -488,7 +487,7 @@ declare function deleteSubscription(client: PlayApiClient, packageName: string,
488
487
  declare function activateBasePlan(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<Subscription>;
489
488
  declare function deactivateBasePlan(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<Subscription>;
490
489
  declare function deleteBasePlan(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<void>;
491
- declare function migratePrices(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: BasePlanMigratePricesRequest): Promise<Subscription>;
490
+ declare function migratePrices(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: BasePlanMigratePricesRequest): Promise<void>;
492
491
  declare function listOffers(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<OffersListResponse>;
493
492
  declare function getOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
494
493
  declare function createOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: SubscriptionOffer): Promise<SubscriptionOffer>;
@@ -557,7 +556,8 @@ declare function consumeProductPurchase(client: PlayApiClient, packageName: stri
557
556
  declare function getSubscriptionPurchase(client: PlayApiClient, packageName: string, token: string): Promise<SubscriptionPurchaseV2>;
558
557
  declare function cancelSubscriptionPurchase(client: PlayApiClient, packageName: string, subscriptionId: string, token: string): Promise<void>;
559
558
  declare function deferSubscriptionPurchase(client: PlayApiClient, packageName: string, subscriptionId: string, token: string, desiredExpiry: string): Promise<SubscriptionDeferResponse>;
560
- declare function revokeSubscriptionPurchase(client: PlayApiClient, packageName: string, token: string): Promise<void>;
559
+ type RevocationRefundType = "full" | "prorated" | "item";
560
+ declare function revokeSubscriptionPurchase(client: PlayApiClient, packageName: string, token: string, refundType?: RevocationRefundType, productId?: string): Promise<void>;
561
561
 
562
562
  interface ListVoidedOptions {
563
563
  startTime?: string;
@@ -573,14 +573,13 @@ declare function listVoidedPurchases(client: PlayApiClient, packageName: string,
573
573
  nextPageToken?: string;
574
574
  }>;
575
575
  declare function refundOrder(client: PlayApiClient, packageName: string, orderId: string, options?: {
576
- fullRefund?: boolean;
577
- proratedRefund?: boolean;
576
+ revoke?: boolean;
578
577
  }): Promise<void>;
579
578
  declare function getOrderDetails(client: PlayApiClient, packageName: string, orderId: string): Promise<Order>;
580
579
  declare function batchGetOrders(client: PlayApiClient, packageName: string, orderIds: string[]): Promise<Order[]>;
581
580
  declare function getProductPurchaseV2(client: PlayApiClient, packageName: string, token: string): Promise<ProductPurchaseV2>;
582
581
  declare function cancelSubscriptionV2(client: PlayApiClient, packageName: string, token: string, cancellationType?: string): Promise<void>;
583
- declare function deferSubscriptionV2(client: PlayApiClient, packageName: string, token: string, desiredExpiryTime: string): Promise<SubscriptionsV2DeferResponse>;
582
+ declare function deferSubscriptionV2(client: PlayApiClient, packageName: string, token: string, deferDuration: string, etag?: string): Promise<SubscriptionsV2DeferResponse>;
584
583
 
585
584
  declare const PERMISSION_PROPAGATION_WARNING = "Note: Permission changes may take up to 48 hours to propagate.";
586
585
  interface ListUsersOptions {
@@ -779,10 +778,10 @@ declare function deployRecoveryAction(client: PlayApiClient, packageName: string
779
778
  declare function createRecoveryAction(client: PlayApiClient, packageName: string, request: CreateAppRecoveryActionRequest): Promise<AppRecoveryAction>;
780
779
  declare function addRecoveryTargeting(client: PlayApiClient, packageName: string, actionId: string, targeting: AppRecoveryTargeting): Promise<AppRecoveryAction>;
781
780
 
782
- declare function updateDataSafety(client: PlayApiClient, packageName: string, data: DataSafety): Promise<DataSafety>;
783
- declare function importDataSafety(client: PlayApiClient, packageName: string, filePath: string): Promise<DataSafety>;
781
+ declare function updateDataSafety(client: PlayApiClient, packageName: string, data: DataSafetyRequest): Promise<DataSafetyResponse>;
782
+ declare function importDataSafety(client: PlayApiClient, packageName: string, filePath: string): Promise<DataSafetyResponse>;
784
783
 
785
- declare function createExternalTransaction(client: PlayApiClient, packageName: string, data: ExternalTransaction): Promise<ExternalTransaction>;
784
+ declare function createExternalTransaction(client: PlayApiClient, packageName: string, data: ExternalTransaction, externalTransactionId: string): Promise<ExternalTransaction>;
786
785
  declare function getExternalTransaction(client: PlayApiClient, packageName: string, transactionId: string): Promise<ExternalTransaction>;
787
786
  declare function refundExternalTransaction(client: PlayApiClient, packageName: string, transactionId: string, refundData: ExternalTransactionRefund): Promise<ExternalTransaction>;
788
787
 
@@ -1138,7 +1137,7 @@ interface InternalSharingUploadResult {
1138
1137
  }
1139
1138
  declare function uploadInternalSharing(client: PlayApiClient, packageName: string, filePath: string, fileType?: "bundle" | "apk"): Promise<InternalSharingUploadResult>;
1140
1139
 
1141
- declare function listGeneratedApks(client: PlayApiClient, packageName: string, versionCode: number): Promise<GeneratedApk[]>;
1140
+ declare function listGeneratedApks(client: PlayApiClient, packageName: string, versionCode: number): Promise<GeneratedApksPerSigningKey[]>;
1142
1141
  declare function downloadGeneratedApk(client: PlayApiClient, packageName: string, versionCode: number, apkId: string, outputPath: string): Promise<{
1143
1142
  path: string;
1144
1143
  sizeBytes: number;
@@ -1624,4 +1623,4 @@ interface ChecklistInput {
1624
1623
  declare function buildChecklist(input: ChecklistInput): ChecklistResult;
1625
1624
  declare function renderChecklistMarkdown(result: ChecklistResult, accountEmail: string): string;
1626
1625
 
1627
- export { ApiError, type ApiSigningFingerprint, type AppInfo, type AppStatus, type ApplyReleaseNotesResult, type AuditEntry, type BatchSyncResult, type BundleAnalysis, type BundleComparison, type BundleEntry, type BundleSizeCheckResult, type BundleSizeConfig, type BundlesWaitOptions, type ChangelogEntry, type ChecklistInput, type ChecklistItem, type ChecklistResult, type CommandContext, type CommitCluster, ConfigError, type CreateEnterpriseAppParams, DEFAULT_LIMITS, DEFAULT_MODELS, DEFAULT_PREFLIGHT_CONFIG, DEFAULT_WATCH_THRESHOLDS, type DecodedNotification, type DiffToken, type DiscoverPluginsOptions, type DryRunPublishResult, type DryRunResult, type DryRunUploadResult, type ErrorReason, type ExportImagesOptions, type ExportImagesSummary, type FastlaneDetection, type FastlaneLane, type FetchChangelogOptions, type FieldLintResult, type FileValidationResult, type FindingSeverity, GOOGLE_PLAY_LANGUAGES, type GenerateOptions, type GeneratedChangelog, type GetAppStatusOptions, type GitNotesOptions, type GitReleaseNotes, type GitRunner, GpcError, type ImageSyncDetail, type ImageSyncOptions, type ImageSyncResult, type ImageValidationResult, type InitOptions, type InitResult, type InternalSharingUploadResult, type KeystoreFingerprint, type ListIapOptions, type ListSubscriptionsOptions, type ListUsersOptions, type ListVoidedOptions, type ListingDiff, type ListingFieldLimits, type ListingLintResult, type ListingsResult, type LoadedPlugin, type LocaleBundle, type LocaleEntry, type MigrationResult, NetworkError, type OneTimeProductDiff, type OutputMode, PERMISSION_PROPAGATION_WARNING, PLACEHOLDER_TEXT, PLAY_STORE_LIMIT, PROVIDER_WHITELIST, type ParsedCommit, type ParsedManifest, type ParsedMonth, type PlayStoreFormat, type PlayStoreRenderOptions, PluginManager, type PreflightConfig, type PreflightFinding, type PreflightOptions, type PreflightResult, type PreflightScanner, type Provider, type PublishOptions, type PublishResult, type PushResult, type QuotaUsage, RENDERERS, type RawCommit, type ReleaseDiff, type ReleaseNotesValidation, type ReleaseStatusResult, type Renderer, type ResolveAiConfigOptions, type ResolveLocalesOptions, type ReviewAnalysis, type ReviewExportOptions, type ReviewsFilterOptions, type RtdnStatus, SECTION_ORDER, SENSITIVE_ARG_KEYS, SENSITIVE_KEYS, SEVERITY_ORDER, type ScaffoldOptions, type ScaffoldResult, type SigningConsistencyResult, type SigningKeyComparison, type Spinner, type StatusDiff, type StatusRelease, type StatusReviews, type StatusVitalMetric, type SubscriptionAnalytics, type SubscriptionDiff, type SyncResult, type ThresholdResult, type TrainConfig, type TrainState, type TranslateBundleOptions, type TranslatedBundle, type TranslationFailure, type TranslationPath, type TranslationResult, type Translator, type TranslatorConfig, type UploadResult, VALID_WATCH_METRICS, type ValidateCheck, type ValidateOptions, type ValidateResult, type VersionVitalsComparison, type VersionVitalsRow, type VitalsOverview, type VitalsQueryOptions, type VitalsTrendComparison, type WatchAction, type WatchCallbacks, type WatchConfig, type WatchEvent, type WatchMetric, type WatchOptions, type WatchRollout, type WatchSummary, type WatchVitalReading, type WatchVitalsOptions, type WebhookPayload, abortTrain, acknowledgeProductPurchase, activateBasePlan, activateOffer, addRecoveryTargeting, addTesters, advanceTrain, analyzeBundle, analyzeRemoteListings, analyzeReviews, applyReleaseNotes, batchGetOrders, batchSyncInAppProducts, buildChecklist, buildLocaleBundle, bundleToReleaseNotes, cancelRecoveryAction, cancelSubscriptionPurchase, cancelSubscriptionV2, checkBundleSize, checkSigningConsistency, checkThreshold, classifyError, clearAuditLog, commitWithRescue, compareBundles, compareFingerprints, compareVersionVitals, compareVitalsTrend, computeStatusDiff, consumeProductPurchase, convertRegionPrices, createAuditEntry, createDeviceTier, createEnterpriseApp, createExternalTransaction, createGrant, createInAppProduct, createOffer, createOneTimeOffer, createOneTimeProduct, createRecoveryAction, createSpinner, createSubscription, createTrack, createTranslator, deactivateBasePlan, deactivateOffer, decodeNotification, defaultGitRunner, deferSubscriptionPurchase, deferSubscriptionV2, deleteBasePlan, deleteGrant, deleteImage, deleteInAppProduct, deleteListing, deleteOffer, deleteOneTimeOffer, deleteOneTimeProduct, deleteSubscription, deployRecoveryAction, detectFastlane, detectOutputFormat, diffListings, diffListingsCommand, diffListingsEnhanced, diffOneTimeProduct, diffReleases, diffSubscription, discoverPlugins, dispatchWebhook, downloadGeneratedApk, downloadReport, exportImages, exportReviews, fetchAggregateCost, fetchChangelog, fetchReleaseNotes, findBundle, formatChangelogEntry, formatCustomPayload, formatDiscordPayload, formatJunit, formatNotification, formatOutput, formatPathLabel, formatSlackPayload, formatStatusDiff, formatStatusSummary, formatStatusTable, formatWordDiff, generateChangelog, generateMigrationPlan, generateNotesFromGit, getAllScannerNames, getApiSigningFingerprint, getAppInfo, getAppStatus, getCountryAvailability, getDeviceTier, getExternalTransaction, getInAppProduct, getKeystoreFingerprint, getListings, getOffer, getOneTimeOffer, getOneTimeProduct, getOrderDetails, getProductPurchase, getProductPurchaseV2, getQuotaUsage, getReleasesStatus, getReview, getRtdnStatus, getSubscription, getSubscriptionAnalytics, getSubscriptionPurchase, getTrainStatus, getUser, getVitalsAnomalies, getVitalsAnr, getVitalsBattery, getVitalsCrashes, getVitalsErrorCount, getVitalsLmk, getVitalsMemory, getVitalsOverview, getVitalsRendering, getVitalsStartup, handleBreach, importDataSafety, importTestersFromCsv, initAudit, initProject, inviteUser, isFinancialReportType, isStatsReportType, isValidBcp47, isValidReportType, isValidStatsDimension, isVersionedNotesDir, lintListing, lintListings, lintLocalListings, listAchievements, listAuditEvents, listBundles, listDeviceTiers, listEvents, listGeneratedApks, listGrants, listImages, listInAppProducts, listLeaderboards, listOffers, listOneTimeOffers, listOneTimeProducts, listRecoveryActions, listReports, listReviews, listSubscriptions, listTesters, listTracks, listUsers, listVoidedPurchases, loadPreflightConfig, loadStatusCache, maybePaginate, migratePrices, normalizeFingerprint, parseAppfile, parseCommit, parseFastfile, parseGrantArg, parseKeytoolOutput, parseMonth, parseRemoteUrl, pauseTrain, promoteRelease, publish, publishEnterpriseApp, pullListings, pushListings, readListingsFromDir, readReleaseNotesForVersion, readReleaseNotesFromDir, redactAuditArgs, redactSensitive, refundExternalTransaction, refundOrder, relativeTime, removeTesters, removeUser, renderChecklistMarkdown, renderJson, renderMarkdown, renderPlayStore, renderPlayStoreJson, renderPlayStoreMd, renderPlayStorePrompt, renderPrompt, replyToReview, resolveAiConfig, resolveLocales, revokeSubscriptionPurchase, runPreflight, runWatch, runWatchLoop, safePath, safePathWithin, saveStatusCache, scaffoldPlugin, searchAuditEvents, searchVitalsErrors, sendNotification, sendWebhook, sha256File, sortResults, startTrain, statusHasBreach, syncImages, syncInAppProducts, topFiles, trackBreachState, translateBundle, updateAppDetails, updateDataSafety, updateGrant, updateInAppProduct, updateListing, updateOffer, updateOneTimeOffer, updateOneTimeProduct, updateRollout, updateSubscription, updateTrackConfig, updateUser, uploadExternallyHosted, uploadImage, uploadInternalSharing, uploadRelease, validateAndCommit, validateBundleForApply, validateImage, validateLanguageCode, validatePackageName, validatePreSubmission, validateReleaseNotes, validateSku, validateTrackName, validateUploadFile, validateVersionCode, waitForBundle, waitForBundleProcessing, watchVitalsWithAutoHalt, wordDiff, writeAuditLog, writeListingsToDir, writeMigrationOutput };
1626
+ export { ApiError, type ApiSigningFingerprint, type AppInfo, type AppStatus, type ApplyReleaseNotesResult, type AuditEntry, type BatchSyncResult, type BundleAnalysis, type BundleComparison, type BundleEntry, type BundleSizeCheckResult, type BundleSizeConfig, type BundlesWaitOptions, type ChangelogEntry, type ChecklistInput, type ChecklistItem, type ChecklistResult, type CommandContext, type CommitCluster, ConfigError, type CreateEnterpriseAppParams, DEFAULT_LIMITS, DEFAULT_MODELS, DEFAULT_PREFLIGHT_CONFIG, DEFAULT_WATCH_THRESHOLDS, type DecodedNotification, type DiffToken, type DiscoverPluginsOptions, type DryRunPublishResult, type DryRunResult, type DryRunUploadResult, type ErrorReason, type ExportImagesOptions, type ExportImagesSummary, type FastlaneDetection, type FastlaneLane, type FetchChangelogOptions, type FieldLintResult, type FileValidationResult, type FindingSeverity, GOOGLE_PLAY_LANGUAGES, type GenerateOptions, type GeneratedChangelog, type GetAppStatusOptions, type GitNotesOptions, type GitReleaseNotes, type GitRunner, GpcError, type ImageSyncDetail, type ImageSyncOptions, type ImageSyncResult, type ImageValidationResult, type InitOptions, type InitResult, type InternalSharingUploadResult, type KeystoreFingerprint, type ListIapOptions, type ListSubscriptionsOptions, type ListUsersOptions, type ListVoidedOptions, type ListingDiff, type ListingFieldLimits, type ListingLintResult, type ListingsResult, type LoadedPlugin, type LocaleBundle, type LocaleEntry, type MigrationResult, NetworkError, type OneTimeProductDiff, type OutputMode, PERMISSION_PROPAGATION_WARNING, PLACEHOLDER_TEXT, PLAY_STORE_LIMIT, PROVIDER_WHITELIST, type ParsedCommit, type ParsedManifest, type ParsedMonth, type PlayStoreFormat, type PlayStoreRenderOptions, PluginManager, type PreflightConfig, type PreflightFinding, type PreflightOptions, type PreflightResult, type PreflightScanner, type Provider, type PublishOptions, type PublishResult, type PushResult, type QuotaUsage, RENDERERS, type RawCommit, type ReleaseDiff, type ReleaseNotesValidation, type ReleaseStatusResult, type Renderer, type ResolveAiConfigOptions, type ResolveLocalesOptions, type ReviewAnalysis, type ReviewExportOptions, type ReviewsFilterOptions, type RevocationRefundType, type RtdnStatus, SECTION_ORDER, SENSITIVE_ARG_KEYS, SENSITIVE_KEYS, SEVERITY_ORDER, type ScaffoldOptions, type ScaffoldResult, type SigningConsistencyResult, type SigningKeyComparison, type Spinner, type StatusDiff, type StatusRelease, type StatusReviews, type StatusVitalMetric, type SubscriptionAnalytics, type SubscriptionDiff, type SyncResult, type ThresholdResult, type TrainConfig, type TrainState, type TranslateBundleOptions, type TranslatedBundle, type TranslationFailure, type TranslationPath, type TranslationResult, type Translator, type TranslatorConfig, type UploadResult, VALID_WATCH_METRICS, type ValidateCheck, type ValidateOptions, type ValidateResult, type VersionVitalsComparison, type VersionVitalsRow, type VitalsOverview, type VitalsQueryOptions, type VitalsTrendComparison, type WatchAction, type WatchCallbacks, type WatchConfig, type WatchEvent, type WatchMetric, type WatchOptions, type WatchRollout, type WatchSummary, type WatchVitalReading, type WatchVitalsOptions, type WebhookPayload, abortTrain, acknowledgeProductPurchase, activateBasePlan, activateOffer, addRecoveryTargeting, addTesters, advanceTrain, analyzeBundle, analyzeRemoteListings, analyzeReviews, applyReleaseNotes, batchGetOrders, batchSyncInAppProducts, buildChecklist, buildLocaleBundle, bundleToReleaseNotes, cancelRecoveryAction, cancelSubscriptionPurchase, cancelSubscriptionV2, checkBundleSize, checkSigningConsistency, checkThreshold, classifyError, clearAuditLog, commitWithRescue, compareBundles, compareFingerprints, compareVersionVitals, compareVitalsTrend, computeStatusDiff, consumeProductPurchase, convertRegionPrices, createAuditEntry, createDeviceTier, createEnterpriseApp, createExternalTransaction, createGrant, createInAppProduct, createOffer, createOneTimeOffer, createOneTimeProduct, createRecoveryAction, createSpinner, createSubscription, createTrack, createTranslator, deactivateBasePlan, deactivateOffer, decodeNotification, defaultGitRunner, deferSubscriptionPurchase, deferSubscriptionV2, deleteBasePlan, deleteGrant, deleteImage, deleteInAppProduct, deleteListing, deleteOffer, deleteOneTimeOffer, deleteOneTimeProduct, deleteSubscription, deployRecoveryAction, detectFastlane, detectOutputFormat, diffListings, diffListingsCommand, diffListingsEnhanced, diffOneTimeProduct, diffReleases, diffSubscription, discoverPlugins, dispatchWebhook, downloadGeneratedApk, downloadReport, exportImages, exportReviews, fetchAggregateCost, fetchChangelog, fetchReleaseNotes, findBundle, formatChangelogEntry, formatCustomPayload, formatDiscordPayload, formatJunit, formatNotification, formatOutput, formatPathLabel, formatSlackPayload, formatStatusDiff, formatStatusSummary, formatStatusTable, formatWordDiff, generateChangelog, generateMigrationPlan, generateNotesFromGit, getAllScannerNames, getApiSigningFingerprint, getAppInfo, getAppStatus, getCountryAvailability, getDeviceTier, getExternalTransaction, getInAppProduct, getKeystoreFingerprint, getListings, getOffer, getOneTimeOffer, getOneTimeProduct, getOrderDetails, getProductPurchase, getProductPurchaseV2, getQuotaUsage, getReleasesStatus, getReview, getRtdnStatus, getSubscription, getSubscriptionAnalytics, getSubscriptionPurchase, getTrainStatus, getUser, getVitalsAnomalies, getVitalsAnr, getVitalsBattery, getVitalsCrashes, getVitalsErrorCount, getVitalsLmk, getVitalsMemory, getVitalsOverview, getVitalsRendering, getVitalsStartup, handleBreach, importDataSafety, importTestersFromCsv, initAudit, initProject, inviteUser, isFinancialReportType, isStatsReportType, isValidBcp47, isValidReportType, isValidStatsDimension, isVersionedNotesDir, lintListing, lintListings, lintLocalListings, listAchievements, listAuditEvents, listBundles, listDeviceTiers, listEvents, listGeneratedApks, listGrants, listImages, listInAppProducts, listLeaderboards, listOffers, listOneTimeOffers, listOneTimeProducts, listRecoveryActions, listReports, listReviews, listSubscriptions, listTesters, listTracks, listUsers, listVoidedPurchases, loadPreflightConfig, loadStatusCache, maybePaginate, migratePrices, normalizeFingerprint, parseAppfile, parseCommit, parseFastfile, parseGrantArg, parseKeytoolOutput, parseMonth, parseRemoteUrl, pauseTrain, promoteRelease, publish, publishEnterpriseApp, pullListings, pushListings, readListingsFromDir, readReleaseNotesForVersion, readReleaseNotesFromDir, redactAuditArgs, redactSensitive, refundExternalTransaction, refundOrder, relativeTime, removeTesters, removeUser, renderChecklistMarkdown, renderJson, renderMarkdown, renderPlayStore, renderPlayStoreJson, renderPlayStoreMd, renderPlayStorePrompt, renderPrompt, replyToReview, resolveAiConfig, resolveLocales, revokeSubscriptionPurchase, runPreflight, runWatch, runWatchLoop, safePath, safePathWithin, saveStatusCache, scaffoldPlugin, searchAuditEvents, searchVitalsErrors, sendNotification, sendWebhook, sha256File, sortResults, startTrain, statusHasBreach, syncImages, syncInAppProducts, topFiles, trackBreachState, translateBundle, updateAppDetails, updateDataSafety, updateGrant, updateInAppProduct, updateListing, updateOffer, updateOneTimeOffer, updateOneTimeProduct, updateRollout, updateSubscription, updateTrackConfig, updateUser, uploadExternallyHosted, uploadImage, uploadInternalSharing, uploadRelease, validateAndCommit, validateBundleForApply, validateImage, validateLanguageCode, validatePackageName, validatePreSubmission, validateReleaseNotes, validateSku, validateTrackName, validateUploadFile, validateVersionCode, waitForBundle, waitForBundleProcessing, watchVitalsWithAutoHalt, wordDiff, writeAuditLog, writeListingsToDir, writeMigrationOutput };
package/dist/index.js CHANGED
@@ -575,7 +575,6 @@ async function getAppInfo(client, packageName) {
575
575
  await client.edits.delete(packageName, edit.id);
576
576
  return {
577
577
  packageName,
578
- title: details.title,
579
578
  defaultLanguage: details.defaultLanguage,
580
579
  contactEmail: details.contactEmail
581
580
  };
@@ -2056,9 +2055,8 @@ function sanitizeSubscription(data) {
2056
2055
  delete cleaned["archived"];
2057
2056
  if (cleaned.basePlans) {
2058
2057
  cleaned.basePlans = cleaned.basePlans.map((bp) => {
2059
- const { state: _state, archived: _archived, ...cleanBp } = bp;
2058
+ const { state: _state, ...cleanBp } = bp;
2060
2059
  void _state;
2061
- void _archived;
2062
2060
  if (cleanBp.regionalConfigs) {
2063
2061
  cleanBp.regionalConfigs = cleanBp.regionalConfigs.map((rc) => ({
2064
2062
  ...rc,
@@ -2109,7 +2107,8 @@ function autoFixProrationMode(data) {
2109
2107
  function validateSubscriptionData(data) {
2110
2108
  autoFixProrationMode(data);
2111
2109
  if (data.listings) {
2112
- for (const [lang, listing] of Object.entries(data.listings)) {
2110
+ for (const listing of data.listings) {
2111
+ const lang = listing.languageCode || "?";
2113
2112
  if (listing.benefits && listing.benefits.length > 4) {
2114
2113
  throw new GpcError(
2115
2114
  `Listing "${lang}" has ${listing.benefits.length} benefits (max 4)`,
@@ -2213,7 +2212,7 @@ async function deleteBasePlan(client, packageName, productId, basePlanId) {
2213
2212
  async function migratePrices(client, packageName, productId, basePlanId, data) {
2214
2213
  validatePackageName(packageName);
2215
2214
  validateSku(productId);
2216
- return client.subscriptions.migratePrices(packageName, productId, basePlanId, data);
2215
+ await client.subscriptions.migratePrices(packageName, productId, basePlanId, data);
2217
2216
  }
2218
2217
  async function listOffers(client, packageName, productId, basePlanId) {
2219
2218
  validatePackageName(packageName);
@@ -3525,9 +3524,25 @@ async function deferSubscriptionPurchase(client, packageName, subscriptionId, to
3525
3524
  }
3526
3525
  });
3527
3526
  }
3528
- async function revokeSubscriptionPurchase(client, packageName, token) {
3527
+ async function revokeSubscriptionPurchase(client, packageName, token, refundType = "prorated", productId) {
3529
3528
  validatePackageName(packageName);
3530
- return client.purchases.revokeSubscriptionV2(packageName, token);
3529
+ let body;
3530
+ if (refundType === "item") {
3531
+ if (!productId) {
3532
+ throw new GpcError(
3533
+ "productId is required for item-based refund",
3534
+ "REVOKE_MISSING_PRODUCT_ID",
3535
+ 2,
3536
+ "Pass --product-id when using --refund-type item"
3537
+ );
3538
+ }
3539
+ body = { revocationContext: { itemBasedRefund: { productId } } };
3540
+ } else if (refundType === "full") {
3541
+ body = { revocationContext: { fullRefund: {} } };
3542
+ } else {
3543
+ body = { revocationContext: { proratedRefund: {} } };
3544
+ }
3545
+ return client.purchases.revokeSubscriptionV2(packageName, token, body);
3531
3546
  }
3532
3547
  async function listVoidedPurchases(client, packageName, options) {
3533
3548
  validatePackageName(packageName);
@@ -3585,15 +3600,17 @@ async function getProductPurchaseV2(client, packageName, token) {
3585
3600
  validatePackageName(packageName);
3586
3601
  return client.purchases.getProductV2(packageName, token);
3587
3602
  }
3588
- async function cancelSubscriptionV2(client, packageName, token, cancellationType) {
3603
+ async function cancelSubscriptionV2(client, packageName, token, cancellationType = "USER_REQUESTED_STOP_RENEWALS") {
3589
3604
  validatePackageName(packageName);
3590
- const body = cancellationType ? { cancellationType } : void 0;
3591
- return client.purchases.cancelSubscriptionV2(packageName, token, body);
3605
+ return client.purchases.cancelSubscriptionV2(packageName, token, {
3606
+ cancellationContext: { cancellationType }
3607
+ });
3592
3608
  }
3593
- async function deferSubscriptionV2(client, packageName, token, desiredExpiryTime) {
3609
+ async function deferSubscriptionV2(client, packageName, token, deferDuration, etag) {
3594
3610
  validatePackageName(packageName);
3611
+ const resolvedEtag = etag ?? (await client.purchases.getSubscriptionV2(packageName, token)).etag ?? "";
3595
3612
  return client.purchases.deferSubscriptionV2(packageName, token, {
3596
- deferralInfo: { desiredExpiryTime }
3613
+ deferralContext: { etag: resolvedEtag, deferDuration }
3597
3614
  });
3598
3615
  }
3599
3616
 
@@ -3975,29 +3992,46 @@ async function addRecoveryTargeting(client, packageName, actionId, targeting) {
3975
3992
  }
3976
3993
 
3977
3994
  // src/commands/data-safety.ts
3978
- import { readFile as readFile6 } from "fs/promises";
3995
+ import { readFile as readFile6, stat as stat4 } from "fs/promises";
3996
+ var MAX_CSV_BYTES = 1 * 1024 * 1024;
3979
3997
  async function updateDataSafety(client, packageName, data) {
3980
3998
  return client.dataSafety.update(packageName, data);
3981
3999
  }
3982
4000
  async function importDataSafety(client, packageName, filePath) {
3983
- const content = await readFile6(filePath, "utf-8");
3984
- let data;
4001
+ let fileStat;
3985
4002
  try {
3986
- data = JSON.parse(content);
4003
+ fileStat = await stat4(filePath);
3987
4004
  } catch {
3988
4005
  throw new GpcError(
3989
- `Failed to parse data safety JSON from "${filePath}"`,
3990
- "INVALID_JSON",
4006
+ `Cannot read data safety CSV: "${filePath}"`,
4007
+ "FILE_NOT_FOUND",
4008
+ 1,
4009
+ "Check the file path and ensure the file exists."
4010
+ );
4011
+ }
4012
+ if (fileStat.size === 0) {
4013
+ throw new GpcError(
4014
+ `Data safety CSV is empty: "${filePath}"`,
4015
+ "INVALID_INPUT",
4016
+ 1,
4017
+ "Export your data safety form from Play Console and provide the CSV."
4018
+ );
4019
+ }
4020
+ if (fileStat.size > MAX_CSV_BYTES) {
4021
+ throw new GpcError(
4022
+ `Data safety CSV exceeds 1 MB (${fileStat.size} bytes): "${filePath}"`,
4023
+ "FILE_TOO_LARGE",
3991
4024
  1,
3992
- "Ensure the file contains valid JSON matching the data safety schema."
4025
+ "The CSV should be a few KB. Check that you are passing the correct file."
3993
4026
  );
3994
4027
  }
3995
- return updateDataSafety(client, packageName, data);
4028
+ const csvContent = await readFile6(filePath, "utf-8");
4029
+ return updateDataSafety(client, packageName, { safetyLabels: csvContent });
3996
4030
  }
3997
4031
 
3998
4032
  // src/commands/external-transactions.ts
3999
- async function createExternalTransaction(client, packageName, data) {
4000
- return client.externalTransactions.create(packageName, data);
4033
+ async function createExternalTransaction(client, packageName, data, externalTransactionId) {
4034
+ return client.externalTransactions.create(packageName, data, externalTransactionId);
4001
4035
  }
4002
4036
  async function getExternalTransaction(client, packageName, transactionId) {
4003
4037
  return client.externalTransactions.get(packageName, transactionId);
@@ -4667,11 +4701,11 @@ function safePathWithin(userPath, baseDir) {
4667
4701
  }
4668
4702
 
4669
4703
  // src/commands/init.ts
4670
- import { mkdir as mkdir6, writeFile as writeFile6, stat as stat4 } from "fs/promises";
4704
+ import { mkdir as mkdir6, writeFile as writeFile6, stat as stat5 } from "fs/promises";
4671
4705
  import { join as join7 } from "path";
4672
4706
  async function exists2(path) {
4673
4707
  try {
4674
- await stat4(path);
4708
+ await stat5(path);
4675
4709
  return true;
4676
4710
  } catch {
4677
4711
  return false;
@@ -5756,7 +5790,7 @@ ${fileList}` + (hasPageSizeCompat ? "\nandroid:pageSizeCompat is set, so the app
5756
5790
  }
5757
5791
 
5758
5792
  // src/preflight/scanners/metadata-scanner.ts
5759
- import { readdir as readdir4, stat as stat5, readFile as readFile10 } from "fs/promises";
5793
+ import { readdir as readdir4, stat as stat6, readFile as readFile10 } from "fs/promises";
5760
5794
  import { join as join8 } from "path";
5761
5795
  var SAFE_LANG = /^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/;
5762
5796
  var FILE_MAP2 = {
@@ -5809,7 +5843,7 @@ var metadataScanner = {
5809
5843
  }
5810
5844
  for (const lang of locales) {
5811
5845
  const langDir = join8(dir, lang);
5812
- const langStat = await stat5(langDir).catch(() => null);
5846
+ const langStat = await stat6(langDir).catch(() => null);
5813
5847
  if (!langStat?.isDirectory()) continue;
5814
5848
  const fields = {};
5815
5849
  for (const [fileName, field] of Object.entries(FILE_MAP2)) {
@@ -5916,7 +5950,7 @@ var metadataScanner = {
5916
5950
  import { readFile as readFile11 } from "fs/promises";
5917
5951
 
5918
5952
  // src/preflight/scan-files.ts
5919
- import { readdir as readdir5, stat as stat6 } from "fs/promises";
5953
+ import { readdir as readdir5, stat as stat7 } from "fs/promises";
5920
5954
  import { join as join9, extname as extname2 } from "path";
5921
5955
  var DEFAULT_SKIP_DIRS = /* @__PURE__ */ new Set([
5922
5956
  ".git",
@@ -5941,7 +5975,7 @@ async function collectSourceFiles(dir, extensions, skipDirs = DEFAULT_SKIP_DIRS,
5941
5975
  for (const entry of entries) {
5942
5976
  if (skipDirs.has(entry)) continue;
5943
5977
  const fullPath = join9(dir, entry);
5944
- const s = await stat6(fullPath).catch(() => null);
5978
+ const s = await stat7(fullPath).catch(() => null);
5945
5979
  if (!s) continue;
5946
5980
  if (s.isDirectory()) {
5947
5981
  const sub = await collectSourceFiles(fullPath, extensions, skipDirs, maxDepth - 1);
@@ -6863,7 +6897,7 @@ async function downloadGeneratedApk(client, packageName, versionCode, apkId, out
6863
6897
  }
6864
6898
 
6865
6899
  // src/commands/bundle-analysis.ts
6866
- import { readFile as readFile14, stat as stat7 } from "fs/promises";
6900
+ import { readFile as readFile14, stat as stat8 } from "fs/promises";
6867
6901
  var EOCD_SIGNATURE = 101010256;
6868
6902
  var CD_SIGNATURE = 33639248;
6869
6903
  var MODULE_SUBDIRS = /* @__PURE__ */ new Set(["dex", "manifest", "res", "assets", "lib", "resources.pb", "root"]);
@@ -6939,7 +6973,7 @@ function detectFileType2(filePath) {
6939
6973
  return "apk";
6940
6974
  }
6941
6975
  async function analyzeBundle(filePath) {
6942
- const fileInfo = await stat7(filePath).catch(() => null);
6976
+ const fileInfo = await stat8(filePath).catch(() => null);
6943
6977
  if (!fileInfo || !fileInfo.isFile()) {
6944
6978
  throw new Error(`File not found: ${filePath}`);
6945
6979
  }
@@ -8359,10 +8393,10 @@ function compareFingerprints(a, b) {
8359
8393
 
8360
8394
  // src/utils/hash.ts
8361
8395
  import { createHash } from "crypto";
8362
- import { stat as stat8 } from "fs/promises";
8396
+ import { stat as stat9 } from "fs/promises";
8363
8397
  async function sha256File(filePath) {
8364
8398
  const hash = createHash("sha256");
8365
- const { size } = await stat8(filePath);
8399
+ const { size } = await stat9(filePath);
8366
8400
  if (size === 0) return hash.digest("hex");
8367
8401
  const { createReadStream } = await import("fs");
8368
8402
  const stream = createReadStream(filePath);