@gpc-cli/core 0.9.68 → 0.9.70

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/dist/index.d.ts CHANGED
@@ -30,6 +30,26 @@ declare class NetworkError extends GpcError {
30
30
 
31
31
  declare function detectOutputFormat(): OutputFormat;
32
32
  declare function formatOutput(data: unknown, format: OutputFormat, redact?: boolean): string;
33
+ /**
34
+ * Annotate a list command's --json envelope with a consistent shape: a
35
+ * `meta.count`, a `nextPageToken` (null when absent so the field is always
36
+ * present), and a `message` when the result set is empty. The descriptive items
37
+ * key (e.g. `users`, `reviews`) is preserved as-is.
38
+ */
39
+ declare function annotateListResult(result: object, itemsKey: string, emptyMessage: string): Record<string, unknown>;
40
+ /**
41
+ * Footer line shown after a human-readable list table when more results are
42
+ * available. Returns undefined when there is no continuation token.
43
+ */
44
+ declare function moreResultsFooter(nextPageToken?: string | null): string | undefined;
45
+ /**
46
+ * Format a Google Money amount (`units` + `nanos`) honoring the currency's ISO
47
+ * 4217 minor-unit count (JPY has 0 decimals, KWD/BHD/OMR have 3, most have 2)
48
+ * rather than assuming 2. The currency code is used only to pick the precision;
49
+ * it is not appended -- callers place the code where they need it. `nanos` are
50
+ * billionths of a unit; the leading digits are truncated to match prior output.
51
+ */
52
+ declare function formatMoney(units: string | number | undefined, nanos: number | undefined, currencyCode?: string): string;
33
53
  declare const SENSITIVE_KEYS: Set<string>;
34
54
  /** Recursively redact sensitive fields from data before output. */
35
55
  declare function redactSensitive(data: unknown): unknown;
@@ -485,7 +505,10 @@ interface ReviewsFilterOptions {
485
505
  interface ReviewExportOptions extends ReviewsFilterOptions {
486
506
  format?: "json" | "csv";
487
507
  }
488
- declare function listReviews(client: PlayApiClient, packageName: string, options?: ReviewsFilterOptions): Promise<Review[]>;
508
+ declare function listReviews(client: PlayApiClient, packageName: string, options?: ReviewsFilterOptions): Promise<{
509
+ reviews: Review[];
510
+ nextPageToken?: string;
511
+ }>;
489
512
  declare function getReview(client: PlayApiClient, packageName: string, reviewId: string, translationLanguage?: string): Promise<Review>;
490
513
  declare function replyToReview(client: PlayApiClient, packageName: string, reviewId: string, replyText: string): Promise<ReviewReplyResponse>;
491
514
  declare function exportReviews(client: PlayApiClient, packageName: string, options?: ReviewExportOptions): Promise<string>;
@@ -504,8 +527,8 @@ declare function listSubscriptions(client: PlayApiClient, packageName: string, o
504
527
  nextPageToken?: string;
505
528
  }>;
506
529
  declare function getSubscription(client: PlayApiClient, packageName: string, productId: string): Promise<Subscription>;
507
- declare function createSubscription(client: PlayApiClient, packageName: string, data: Subscription): Promise<Subscription>;
508
- declare function updateSubscription(client: PlayApiClient, packageName: string, productId: string, data: Subscription, updateMask?: string): Promise<Subscription>;
530
+ declare function createSubscription(client: PlayApiClient, packageName: string, data: Subscription, regionsVersion?: string): Promise<Subscription>;
531
+ declare function updateSubscription(client: PlayApiClient, packageName: string, productId: string, data: Subscription, updateMask?: string, regionsVersion?: string): Promise<Subscription>;
509
532
  declare function deleteSubscription(client: PlayApiClient, packageName: string, productId: string): Promise<void>;
510
533
  declare function activateBasePlan(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<Subscription>;
511
534
  declare function deactivateBasePlan(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<Subscription>;
@@ -513,8 +536,8 @@ declare function deleteBasePlan(client: PlayApiClient, packageName: string, prod
513
536
  declare function migratePrices(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: BasePlanMigratePricesRequest): Promise<void>;
514
537
  declare function listOffers(client: PlayApiClient, packageName: string, productId: string, basePlanId: string): Promise<OffersListResponse>;
515
538
  declare function getOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
516
- declare function createOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: SubscriptionOffer): Promise<SubscriptionOffer>;
517
- declare function updateOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string, data: SubscriptionOffer, updateMask?: string): Promise<SubscriptionOffer>;
539
+ declare function createOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, data: SubscriptionOffer, regionsVersion?: string): Promise<SubscriptionOffer>;
540
+ declare function updateOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string, data: SubscriptionOffer, updateMask?: string, regionsVersion?: string): Promise<SubscriptionOffer>;
518
541
  declare function deleteOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<void>;
519
542
  declare function activateOffer(client: PlayApiClient, packageName: string, productId: string, basePlanId: string, offerId: string): Promise<SubscriptionOffer>;
520
543
  interface SubscriptionDiff {
@@ -814,13 +837,13 @@ declare function createDeviceTier(client: PlayApiClient, packageName: string, co
814
837
 
815
838
  declare function listOneTimeProducts(client: PlayApiClient, packageName: string): Promise<OneTimeProductsListResponse>;
816
839
  declare function getOneTimeProduct(client: PlayApiClient, packageName: string, productId: string): Promise<OneTimeProduct>;
817
- declare function createOneTimeProduct(client: PlayApiClient, packageName: string, data: OneTimeProduct): Promise<OneTimeProduct>;
818
- declare function updateOneTimeProduct(client: PlayApiClient, packageName: string, productId: string, data: Partial<OneTimeProduct>, updateMask?: string): Promise<OneTimeProduct>;
840
+ declare function createOneTimeProduct(client: PlayApiClient, packageName: string, data: OneTimeProduct, regionsVersion?: string): Promise<OneTimeProduct>;
841
+ declare function updateOneTimeProduct(client: PlayApiClient, packageName: string, productId: string, data: Partial<OneTimeProduct>, updateMask?: string, regionsVersion?: string): Promise<OneTimeProduct>;
819
842
  declare function deleteOneTimeProduct(client: PlayApiClient, packageName: string, productId: string): Promise<void>;
820
843
  declare function listOneTimeOffers(client: PlayApiClient, packageName: string, productId: string, purchaseOptionId?: string): Promise<OneTimeOffersListResponse>;
821
844
  declare function getOneTimeOffer(client: PlayApiClient, packageName: string, productId: string, offerId: string, purchaseOptionId?: string): Promise<OneTimeOffer>;
822
- declare function createOneTimeOffer(client: PlayApiClient, packageName: string, productId: string, data: OneTimeOffer, purchaseOptionId?: string): Promise<OneTimeOffer>;
823
- declare function updateOneTimeOffer(client: PlayApiClient, packageName: string, productId: string, offerId: string, data: Partial<OneTimeOffer>, updateMask?: string, purchaseOptionId?: string): Promise<OneTimeOffer>;
845
+ declare function createOneTimeOffer(client: PlayApiClient, packageName: string, productId: string, data: OneTimeOffer, purchaseOptionId?: string, regionsVersion?: string): Promise<OneTimeOffer>;
846
+ declare function updateOneTimeOffer(client: PlayApiClient, packageName: string, productId: string, offerId: string, data: Partial<OneTimeOffer>, updateMask?: string, purchaseOptionId?: string, regionsVersion?: string): Promise<OneTimeOffer>;
824
847
  interface OneTimeProductDiff {
825
848
  field: string;
826
849
  local: string;
@@ -1651,4 +1674,4 @@ interface ChecklistInput {
1651
1674
  declare function buildChecklist(input: ChecklistInput): ChecklistResult;
1652
1675
  declare function renderChecklistMarkdown(result: ChecklistResult, accountEmail: string): string;
1653
1676
 
1654
- 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, type CommitResult, 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, assignRelease, 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, retryOnUploadNotComplete, 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 };
1677
+ 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, type CommitResult, 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, annotateListResult, applyReleaseNotes, assignRelease, 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, formatMoney, 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, moreResultsFooter, 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, retryOnUploadNotComplete, 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
@@ -71,6 +71,55 @@ function formatOutput(data, format, redact = true) {
71
71
  return formatJson(safe);
72
72
  }
73
73
  }
74
+ function annotateListResult(result, itemsKey, emptyMessage) {
75
+ const source = result;
76
+ const items = Array.isArray(source[itemsKey]) ? source[itemsKey] : [];
77
+ const annotated = {
78
+ ...source,
79
+ nextPageToken: source["nextPageToken"] ?? null,
80
+ meta: { count: items.length }
81
+ };
82
+ if (items.length === 0) annotated["message"] = emptyMessage;
83
+ return annotated;
84
+ }
85
+ function moreResultsFooter(nextPageToken) {
86
+ if (!nextPageToken) return void 0;
87
+ return dim(`More results available. Re-run this command with --next-page ${nextPageToken}`);
88
+ }
89
+ var CURRENCY_DECIMALS = {
90
+ // Zero-decimal currencies
91
+ JPY: 0,
92
+ KRW: 0,
93
+ VND: 0,
94
+ CLP: 0,
95
+ ISK: 0,
96
+ XAF: 0,
97
+ XOF: 0,
98
+ XPF: 0,
99
+ BIF: 0,
100
+ DJF: 0,
101
+ GNF: 0,
102
+ KMF: 0,
103
+ RWF: 0,
104
+ UGX: 0,
105
+ VUV: 0,
106
+ PYG: 0,
107
+ // Three-decimal currencies
108
+ BHD: 3,
109
+ IQD: 3,
110
+ JOD: 3,
111
+ KWD: 3,
112
+ LYD: 3,
113
+ OMR: 3,
114
+ TND: 3
115
+ };
116
+ function formatMoney(units, nanos, currencyCode) {
117
+ const decimals = currencyCode ? CURRENCY_DECIMALS[currencyCode.toUpperCase()] ?? 2 : 2;
118
+ const whole = String(units ?? "0");
119
+ if (decimals === 0) return whole;
120
+ const frac = String(Math.abs(nanos ?? 0)).padStart(9, "0").slice(0, decimals);
121
+ return `${whole}.${frac}`;
122
+ }
74
123
  var SENSITIVE_KEYS = /* @__PURE__ */ new Set([
75
124
  "private_key",
76
125
  "privateKey",
@@ -238,10 +287,11 @@ ${separator}
238
287
  ${body}`;
239
288
  }
240
289
  function escapeCsvField(val) {
241
- if (val.includes(",") || val.includes('"') || val.includes("\n") || val.includes("\r")) {
242
- return `"${val.replace(/"/g, '""')}"`;
290
+ let out = /^[=+\-@\t\r]/.test(val) ? `'${val}` : val;
291
+ if (out.includes(",") || out.includes('"') || out.includes("\n") || out.includes("\r")) {
292
+ out = `"${out.replace(/"/g, '""')}"`;
243
293
  }
244
- return val;
294
+ return out;
245
295
  }
246
296
  function formatCsv(data) {
247
297
  const rows = toRows(data);
@@ -262,7 +312,10 @@ function formatTsv(data) {
262
312
  if (!firstRow) return "";
263
313
  const keys = Object.keys(firstRow);
264
314
  if (keys.length === 0) return "";
265
- const escape = (val) => val.replace(/\t/g, "\\t").replace(/\r/g, "\\r").replace(/\n/g, "\\n");
315
+ const escape = (val) => {
316
+ const guarded = /^[=+\-@]/.test(val) ? `'${val}` : val;
317
+ return guarded.replace(/\t/g, "\\t").replace(/\r/g, "\\r").replace(/\n/g, "\\n");
318
+ };
266
319
  const header = keys.join(" ");
267
320
  const body = rows.map((row) => keys.map((key) => escape(cellValue(row[key]))).join(" ")).join("\n");
268
321
  return `${header}
@@ -1933,8 +1986,9 @@ function analyzeReviews(reviews) {
1933
1986
  // src/commands/reviews.ts
1934
1987
  async function listReviews(client, packageName, options) {
1935
1988
  let reviews;
1989
+ let nextPageToken;
1936
1990
  if (options?.all) {
1937
- const { items } = await paginateAll(
1991
+ const { items, nextPageToken: token } = await paginateAll(
1938
1992
  async (pageToken) => {
1939
1993
  const apiOptions = { token: pageToken };
1940
1994
  if (options?.translationLanguage)
@@ -1949,6 +2003,7 @@ async function listReviews(client, packageName, options) {
1949
2003
  { limit: options?.limit }
1950
2004
  );
1951
2005
  reviews = items;
2006
+ nextPageToken = token;
1952
2007
  } else {
1953
2008
  const apiOptions = {};
1954
2009
  if (options?.translationLanguage) apiOptions.translationLanguage = options.translationLanguage;
@@ -1956,6 +2011,7 @@ async function listReviews(client, packageName, options) {
1956
2011
  if (options?.nextPage) apiOptions.token = options.nextPage;
1957
2012
  const response = await client.reviews.list(packageName, apiOptions);
1958
2013
  reviews = response.reviews || [];
2014
+ nextPageToken = response.tokenPagination?.nextPageToken;
1959
2015
  }
1960
2016
  if (options?.stars !== void 0) {
1961
2017
  reviews = reviews.filter((r) => {
@@ -1976,7 +2032,7 @@ async function listReviews(client, packageName, options) {
1976
2032
  return userComment && Number(userComment.lastModified.seconds) >= sinceTime;
1977
2033
  });
1978
2034
  }
1979
- return reviews;
2035
+ return { reviews, nextPageToken };
1980
2036
  }
1981
2037
  async function getReview(client, packageName, reviewId, translationLanguage) {
1982
2038
  return client.reviews.get(packageName, reviewId, translationLanguage);
@@ -2065,7 +2121,7 @@ function csvEscape(value) {
2065
2121
  return safe;
2066
2122
  }
2067
2123
  async function analyzeReviews2(client, packageName, options) {
2068
- const reviews = await listReviews(client, packageName, options);
2124
+ const { reviews } = await listReviews(client, packageName, options);
2069
2125
  const items = reviews.map((r) => {
2070
2126
  const uc = r.comments?.[0]?.userComment;
2071
2127
  return {
@@ -2206,23 +2262,23 @@ async function getSubscription(client, packageName, productId) {
2206
2262
  validateSku(productId);
2207
2263
  return client.subscriptions.get(packageName, productId);
2208
2264
  }
2209
- async function createSubscription(client, packageName, data) {
2265
+ async function createSubscription(client, packageName, data, regionsVersion) {
2210
2266
  validatePackageName(packageName);
2211
2267
  validateSubscriptionData(data);
2212
2268
  const sanitized = sanitizeSubscription(data);
2213
- return client.subscriptions.create(packageName, sanitized, data.productId);
2269
+ return client.subscriptions.create(packageName, sanitized, data.productId, regionsVersion);
2214
2270
  }
2215
2271
  var SUBSCRIPTION_ID_FIELDS = /* @__PURE__ */ new Set(["productId", "packageName"]);
2216
2272
  function deriveSubscriptionUpdateMask(data) {
2217
2273
  return Object.keys(data).filter((k) => !SUBSCRIPTION_ID_FIELDS.has(k)).join(",");
2218
2274
  }
2219
- async function updateSubscription(client, packageName, productId, data, updateMask) {
2275
+ async function updateSubscription(client, packageName, productId, data, updateMask, regionsVersion) {
2220
2276
  validatePackageName(packageName);
2221
2277
  validateSku(productId);
2222
2278
  validateSubscriptionData(data);
2223
2279
  const sanitized = sanitizeSubscription(data);
2224
2280
  const mask = updateMask || deriveSubscriptionUpdateMask(data);
2225
- return client.subscriptions.update(packageName, productId, sanitized, mask);
2281
+ return client.subscriptions.update(packageName, productId, sanitized, mask, regionsVersion);
2226
2282
  }
2227
2283
  async function deleteSubscription(client, packageName, productId) {
2228
2284
  validatePackageName(packageName);
@@ -2259,7 +2315,7 @@ async function getOffer(client, packageName, productId, basePlanId, offerId) {
2259
2315
  validateSku(productId);
2260
2316
  return client.subscriptions.getOffer(packageName, productId, basePlanId, offerId);
2261
2317
  }
2262
- async function createOffer(client, packageName, productId, basePlanId, data) {
2318
+ async function createOffer(client, packageName, productId, basePlanId, data, regionsVersion) {
2263
2319
  validatePackageName(packageName);
2264
2320
  validateSku(productId);
2265
2321
  const sanitized = sanitizeOffer(data);
@@ -2268,14 +2324,15 @@ async function createOffer(client, packageName, productId, basePlanId, data) {
2268
2324
  productId,
2269
2325
  basePlanId,
2270
2326
  sanitized,
2271
- data.offerId
2327
+ data.offerId,
2328
+ regionsVersion
2272
2329
  );
2273
2330
  }
2274
2331
  var OFFER_ID_FIELDS = /* @__PURE__ */ new Set(["productId", "basePlanId", "offerId"]);
2275
2332
  function deriveOfferUpdateMask(data) {
2276
2333
  return Object.keys(data).filter((k) => !OFFER_ID_FIELDS.has(k)).join(",");
2277
2334
  }
2278
- async function updateOffer(client, packageName, productId, basePlanId, offerId, data, updateMask) {
2335
+ async function updateOffer(client, packageName, productId, basePlanId, offerId, data, updateMask, regionsVersion) {
2279
2336
  validatePackageName(packageName);
2280
2337
  validateSku(productId);
2281
2338
  const sanitized = sanitizeOffer(data);
@@ -2286,7 +2343,8 @@ async function updateOffer(client, packageName, productId, basePlanId, offerId,
2286
2343
  basePlanId,
2287
2344
  offerId,
2288
2345
  sanitized,
2289
- mask
2346
+ mask,
2347
+ regionsVersion
2290
2348
  );
2291
2349
  }
2292
2350
  async function deleteOffer(client, packageName, productId, basePlanId, offerId) {
@@ -2832,7 +2890,7 @@ async function getAppStatus(client, reporting, packageName, options = {}) {
2832
2890
  sections.has("vitals") ? queryVitalWithTrend(reporting, packageName, "anrRateMetricSet", days) : Promise.resolve(SKIPPED_VITAL),
2833
2891
  sections.has("vitals") ? queryVitalWithTrend(reporting, packageName, "slowStartRateMetricSet", days) : Promise.resolve(SKIPPED_VITAL),
2834
2892
  sections.has("vitals") ? queryVitalWithTrend(reporting, packageName, "slowRenderingRateMetricSet", days) : Promise.resolve(SKIPPED_VITAL),
2835
- sections.has("reviews") ? listReviews(client, packageName, { maxResults: 500 }) : Promise.resolve([])
2893
+ sections.has("reviews") ? listReviews(client, packageName, { maxResults: 500 }) : Promise.resolve({ reviews: [] })
2836
2894
  ]);
2837
2895
  const sectionErrors = [];
2838
2896
  const rawReleases = releasesResult.status === "fulfilled" ? releasesResult.value : [];
@@ -2856,7 +2914,7 @@ async function getAppStatus(client, reporting, packageName, options = {}) {
2856
2914
  const slowRender = slowRenderResult.status === "fulfilled" ? slowRenderResult.value : SKIPPED_VITAL;
2857
2915
  if (slowRenderResult.status === "rejected")
2858
2916
  sectionErrors.push(`vitals/slowRender: ${String(slowRenderResult.reason)}`);
2859
- const rawReviews = reviewsResult.status === "fulfilled" ? reviewsResult.value : [];
2917
+ const rawReviews = reviewsResult.status === "fulfilled" ? reviewsResult.value.reviews : [];
2860
2918
  if (reviewsResult.status === "rejected")
2861
2919
  sectionErrors.push(`reviews: ${String(reviewsResult.reason)}`);
2862
2920
  const reviews = computeReviewSentiment(rawReviews, reviewDays);
@@ -3606,7 +3664,7 @@ async function listVoidedPurchases(client, packageName, options) {
3606
3664
  if (options?.limit || options?.nextPage) {
3607
3665
  const result = await paginateAll4(
3608
3666
  async (pageToken) => {
3609
- const resp = await client.purchases.listVoided(packageName, {
3667
+ const resp2 = await client.purchases.listVoided(packageName, {
3610
3668
  startTime: options?.startTime,
3611
3669
  endTime: options?.endTime,
3612
3670
  type: options?.type,
@@ -3615,15 +3673,19 @@ async function listVoidedPurchases(client, packageName, options) {
3615
3673
  token: pageToken
3616
3674
  });
3617
3675
  return {
3618
- items: resp.voidedPurchases || [],
3619
- nextPageToken: resp.tokenPagination?.nextPageToken
3676
+ items: resp2.voidedPurchases || [],
3677
+ nextPageToken: resp2.tokenPagination?.nextPageToken
3620
3678
  };
3621
3679
  },
3622
3680
  { limit: options.limit, startPageToken: options.nextPage }
3623
3681
  );
3624
3682
  return { voidedPurchases: result.items, nextPageToken: result.nextPageToken };
3625
3683
  }
3626
- return client.purchases.listVoided(packageName, options);
3684
+ const resp = await client.purchases.listVoided(packageName, options);
3685
+ return {
3686
+ voidedPurchases: resp.voidedPurchases || [],
3687
+ nextPageToken: resp.tokenPagination?.nextPageToken
3688
+ };
3627
3689
  }
3628
3690
  async function refundOrder(client, packageName, orderId, options) {
3629
3691
  validatePackageName(packageName);
@@ -4173,9 +4235,9 @@ async function getOneTimeProduct(client, packageName, productId) {
4173
4235
  );
4174
4236
  }
4175
4237
  }
4176
- async function createOneTimeProduct(client, packageName, data) {
4238
+ async function createOneTimeProduct(client, packageName, data, regionsVersion) {
4177
4239
  try {
4178
- return await client.oneTimeProducts.create(packageName, data);
4240
+ return await client.oneTimeProducts.create(packageName, data, regionsVersion);
4179
4241
  } catch (error) {
4180
4242
  throw new GpcError(
4181
4243
  `Failed to create one-time product: ${error instanceof Error ? error.message : String(error)}`,
@@ -4193,10 +4255,10 @@ var OTP_OFFER_ID_FIELDS = /* @__PURE__ */ new Set(["packageName", "productId", "
4193
4255
  function deriveOtpOfferUpdateMask(data) {
4194
4256
  return Object.keys(data).filter((k) => !OTP_OFFER_ID_FIELDS.has(k)).join(",");
4195
4257
  }
4196
- async function updateOneTimeProduct(client, packageName, productId, data, updateMask) {
4258
+ async function updateOneTimeProduct(client, packageName, productId, data, updateMask, regionsVersion) {
4197
4259
  try {
4198
4260
  const mask = updateMask || deriveOtpUpdateMask(data);
4199
- return await client.oneTimeProducts.update(packageName, productId, data, mask);
4261
+ return await client.oneTimeProducts.update(packageName, productId, data, mask, regionsVersion);
4200
4262
  } catch (error) {
4201
4263
  throw new GpcError(
4202
4264
  `Failed to update one-time product "${productId}": ${error instanceof Error ? error.message : String(error)}`,
@@ -4242,9 +4304,15 @@ async function getOneTimeOffer(client, packageName, productId, offerId, purchase
4242
4304
  );
4243
4305
  }
4244
4306
  }
4245
- async function createOneTimeOffer(client, packageName, productId, data, purchaseOptionId = "-") {
4307
+ async function createOneTimeOffer(client, packageName, productId, data, purchaseOptionId = "-", regionsVersion) {
4246
4308
  try {
4247
- return await client.oneTimeProducts.createOffer(packageName, productId, purchaseOptionId, data);
4309
+ return await client.oneTimeProducts.createOffer(
4310
+ packageName,
4311
+ productId,
4312
+ purchaseOptionId,
4313
+ data,
4314
+ regionsVersion
4315
+ );
4248
4316
  } catch (error) {
4249
4317
  throw new GpcError(
4250
4318
  `Failed to create offer for product "${productId}": ${error instanceof Error ? error.message : String(error)}`,
@@ -4254,7 +4322,7 @@ async function createOneTimeOffer(client, packageName, productId, data, purchase
4254
4322
  );
4255
4323
  }
4256
4324
  }
4257
- async function updateOneTimeOffer(client, packageName, productId, offerId, data, updateMask, purchaseOptionId = "-") {
4325
+ async function updateOneTimeOffer(client, packageName, productId, offerId, data, updateMask, purchaseOptionId = "-", regionsVersion) {
4258
4326
  try {
4259
4327
  const mask = updateMask || deriveOtpOfferUpdateMask(data);
4260
4328
  return await client.oneTimeProducts.updateOffer(
@@ -4263,7 +4331,8 @@ async function updateOneTimeOffer(client, packageName, productId, offerId, data,
4263
4331
  purchaseOptionId,
4264
4332
  offerId,
4265
4333
  data,
4266
- mask
4334
+ mask,
4335
+ regionsVersion
4267
4336
  );
4268
4337
  } catch (error) {
4269
4338
  throw new GpcError(
@@ -8864,6 +8933,7 @@ export {
8864
8933
  analyzeBundle,
8865
8934
  analyzeRemoteListings,
8866
8935
  analyzeReviews2 as analyzeReviews,
8936
+ annotateListResult,
8867
8937
  applyReleaseNotes,
8868
8938
  assignRelease,
8869
8939
  batchGetOrders,
@@ -8939,6 +9009,7 @@ export {
8939
9009
  formatCustomPayload,
8940
9010
  formatDiscordPayload,
8941
9011
  formatJunit,
9012
+ formatMoney,
8942
9013
  formatNotification,
8943
9014
  formatOutput,
8944
9015
  formatPathLabel,
@@ -9025,6 +9096,7 @@ export {
9025
9096
  loadStatusCache,
9026
9097
  maybePaginate,
9027
9098
  migratePrices,
9099
+ moreResultsFooter,
9028
9100
  normalizeFingerprint,
9029
9101
  parseAppfile,
9030
9102
  parseCommit,