@gpc-cli/core 0.9.68 → 0.9.69
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 +25 -2
- package/dist/index.js +76 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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<
|
|
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>;
|
|
@@ -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
|
-
|
|
242
|
-
|
|
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
|
|
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) =>
|
|
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 {
|
|
@@ -2832,7 +2888,7 @@ async function getAppStatus(client, reporting, packageName, options = {}) {
|
|
|
2832
2888
|
sections.has("vitals") ? queryVitalWithTrend(reporting, packageName, "anrRateMetricSet", days) : Promise.resolve(SKIPPED_VITAL),
|
|
2833
2889
|
sections.has("vitals") ? queryVitalWithTrend(reporting, packageName, "slowStartRateMetricSet", days) : Promise.resolve(SKIPPED_VITAL),
|
|
2834
2890
|
sections.has("vitals") ? queryVitalWithTrend(reporting, packageName, "slowRenderingRateMetricSet", days) : Promise.resolve(SKIPPED_VITAL),
|
|
2835
|
-
sections.has("reviews") ? listReviews(client, packageName, { maxResults: 500 }) : Promise.resolve([])
|
|
2891
|
+
sections.has("reviews") ? listReviews(client, packageName, { maxResults: 500 }) : Promise.resolve({ reviews: [] })
|
|
2836
2892
|
]);
|
|
2837
2893
|
const sectionErrors = [];
|
|
2838
2894
|
const rawReleases = releasesResult.status === "fulfilled" ? releasesResult.value : [];
|
|
@@ -2856,7 +2912,7 @@ async function getAppStatus(client, reporting, packageName, options = {}) {
|
|
|
2856
2912
|
const slowRender = slowRenderResult.status === "fulfilled" ? slowRenderResult.value : SKIPPED_VITAL;
|
|
2857
2913
|
if (slowRenderResult.status === "rejected")
|
|
2858
2914
|
sectionErrors.push(`vitals/slowRender: ${String(slowRenderResult.reason)}`);
|
|
2859
|
-
const rawReviews = reviewsResult.status === "fulfilled" ? reviewsResult.value : [];
|
|
2915
|
+
const rawReviews = reviewsResult.status === "fulfilled" ? reviewsResult.value.reviews : [];
|
|
2860
2916
|
if (reviewsResult.status === "rejected")
|
|
2861
2917
|
sectionErrors.push(`reviews: ${String(reviewsResult.reason)}`);
|
|
2862
2918
|
const reviews = computeReviewSentiment(rawReviews, reviewDays);
|
|
@@ -3606,7 +3662,7 @@ async function listVoidedPurchases(client, packageName, options) {
|
|
|
3606
3662
|
if (options?.limit || options?.nextPage) {
|
|
3607
3663
|
const result = await paginateAll4(
|
|
3608
3664
|
async (pageToken) => {
|
|
3609
|
-
const
|
|
3665
|
+
const resp2 = await client.purchases.listVoided(packageName, {
|
|
3610
3666
|
startTime: options?.startTime,
|
|
3611
3667
|
endTime: options?.endTime,
|
|
3612
3668
|
type: options?.type,
|
|
@@ -3615,15 +3671,19 @@ async function listVoidedPurchases(client, packageName, options) {
|
|
|
3615
3671
|
token: pageToken
|
|
3616
3672
|
});
|
|
3617
3673
|
return {
|
|
3618
|
-
items:
|
|
3619
|
-
nextPageToken:
|
|
3674
|
+
items: resp2.voidedPurchases || [],
|
|
3675
|
+
nextPageToken: resp2.tokenPagination?.nextPageToken
|
|
3620
3676
|
};
|
|
3621
3677
|
},
|
|
3622
3678
|
{ limit: options.limit, startPageToken: options.nextPage }
|
|
3623
3679
|
);
|
|
3624
3680
|
return { voidedPurchases: result.items, nextPageToken: result.nextPageToken };
|
|
3625
3681
|
}
|
|
3626
|
-
|
|
3682
|
+
const resp = await client.purchases.listVoided(packageName, options);
|
|
3683
|
+
return {
|
|
3684
|
+
voidedPurchases: resp.voidedPurchases || [],
|
|
3685
|
+
nextPageToken: resp.tokenPagination?.nextPageToken
|
|
3686
|
+
};
|
|
3627
3687
|
}
|
|
3628
3688
|
async function refundOrder(client, packageName, orderId, options) {
|
|
3629
3689
|
validatePackageName(packageName);
|
|
@@ -8864,6 +8924,7 @@ export {
|
|
|
8864
8924
|
analyzeBundle,
|
|
8865
8925
|
analyzeRemoteListings,
|
|
8866
8926
|
analyzeReviews2 as analyzeReviews,
|
|
8927
|
+
annotateListResult,
|
|
8867
8928
|
applyReleaseNotes,
|
|
8868
8929
|
assignRelease,
|
|
8869
8930
|
batchGetOrders,
|
|
@@ -8939,6 +9000,7 @@ export {
|
|
|
8939
9000
|
formatCustomPayload,
|
|
8940
9001
|
formatDiscordPayload,
|
|
8941
9002
|
formatJunit,
|
|
9003
|
+
formatMoney,
|
|
8942
9004
|
formatNotification,
|
|
8943
9005
|
formatOutput,
|
|
8944
9006
|
formatPathLabel,
|
|
@@ -9025,6 +9087,7 @@ export {
|
|
|
9025
9087
|
loadStatusCache,
|
|
9026
9088
|
maybePaginate,
|
|
9027
9089
|
migratePrices,
|
|
9090
|
+
moreResultsFooter,
|
|
9028
9091
|
normalizeFingerprint,
|
|
9029
9092
|
parseAppfile,
|
|
9030
9093
|
parseCommit,
|