@gpc-cli/cli 0.9.50 → 0.9.52
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/README.md +56 -122
- package/dist/anomalies-V3AFS4LD.js +0 -0
- package/dist/{apps-FKD3ZG5X.js → apps-4GP3FD7O.js} +6 -3
- package/dist/apps-4GP3FD7O.js.map +1 -0
- package/dist/audit-VTWXTXC6.js +0 -0
- package/dist/auth-BA4FE2PO.js +0 -0
- package/dist/bin.js +2 -2
- package/dist/bundle-F7MUVC5J.js +0 -0
- package/dist/cache-XKPLZYEB.js +0 -0
- package/dist/changelog-QLDFG5TV.js +0 -0
- package/dist/chunk-3SJ6OXCZ.js +0 -0
- package/dist/chunk-A7VRCCNS.js +17 -0
- package/dist/chunk-A7VRCCNS.js.map +1 -0
- package/dist/chunk-BCBXQC7J.js +0 -0
- package/dist/chunk-ELXAK7GI.js +0 -0
- package/dist/chunk-FAN4ZITI.js +0 -0
- package/dist/{chunk-VUTRVVWR.js → chunk-FXOWADQD.js} +14 -14
- package/dist/chunk-NQH4G7BI.js +0 -0
- package/dist/chunk-SLNJEAMK.js +0 -0
- package/dist/chunk-Y3QZDAKS.js +0 -0
- package/dist/chunk-YFUBD2XB.js +0 -0
- package/dist/completion-BCHRJSAT.js +0 -0
- package/dist/{config-2AOJNBLQ.js → config-BLMJ35J2.js} +2 -2
- package/dist/data-safety-AFMD6MYI.js +0 -0
- package/dist/device-tiers-AQAMUQXI.js +0 -0
- package/dist/diff-6EO4ID6W.js +0 -0
- package/dist/{docs-KXAHL3HY.js → docs-GMFN6V4K.js} +20 -3
- package/dist/docs-GMFN6V4K.js.map +1 -0
- package/dist/{doctor-KXJEQ3DV.js → doctor-7LQWPY5P.js} +2 -2
- package/dist/enterprise-7PWXMSUN.js +0 -0
- package/dist/external-transactions-LCZALS3V.js +0 -0
- package/dist/{feedback-CP3YMXXI.js → feedback-7ADYSGRD.js} +2 -2
- package/dist/games-ZSNGEI7A.js +0 -0
- package/dist/generated-apks-RX2IUWSF.js +0 -0
- package/dist/grants-EBPECI26.js +0 -0
- package/dist/iap-OUI5YYN4.js +0 -0
- package/dist/index.js +1 -1
- package/dist/init-WSTQTJOD.js +0 -0
- package/dist/install-skills-JKPYZHYS.js +0 -0
- package/dist/internal-sharing-ONNIWIAT.js +0 -0
- package/dist/{listings-7SGQ4SRX.js → listings-LNX6MQYN.js} +15 -11
- package/dist/listings-LNX6MQYN.js.map +1 -0
- package/dist/migrate-ZQCJGQQS.js +0 -0
- package/dist/one-time-products-MGZTU7OM.js +0 -0
- package/dist/preflight-W3JAJ4GO.js +0 -0
- package/dist/pricing-JJZFICFL.js +0 -0
- package/dist/prompt-GXC2JSLA.js +0 -0
- package/dist/{publish-JPTI4EBT.js → publish-P5KIGSLI.js} +20 -3
- package/dist/publish-P5KIGSLI.js.map +1 -0
- package/dist/purchase-options-KFWW4JW2.js +0 -0
- package/dist/purchases-UBFLNYZC.js +0 -0
- package/dist/quickstart-Z5Y3FYJU.js +0 -0
- package/dist/quota-MZRWYJGR.js +0 -0
- package/dist/recovery-YE3Z7NIN.js +0 -0
- package/dist/{releases-OUJ65774.js → releases-LUAHKIMY.js} +26 -6
- package/dist/releases-LUAHKIMY.js.map +1 -0
- package/dist/reports-CIB2T3XT.js +0 -0
- package/dist/reviews-YCBBM656.js +0 -0
- package/dist/rtdn-LID2B7XZ.js +0 -0
- package/dist/status-3HXBBXG6.js +0 -0
- package/dist/subscriptions-LURZFPGJ.js +0 -0
- package/dist/{testers-LSMBXCA2.js → testers-6CQL4KQV.js} +10 -7
- package/dist/testers-6CQL4KQV.js.map +1 -0
- package/dist/{tracks-DO7C5OSE.js → tracks-I4QZNZ3M.js} +8 -5
- package/dist/tracks-I4QZNZ3M.js.map +1 -0
- package/dist/train-MDD2EBHS.js +0 -0
- package/dist/{update-IMIKX4LX.js → update-FZ3MNLOH.js} +2 -2
- package/dist/users-UKG7VIQH.js +0 -0
- package/dist/validate-QIYSA3N7.js +0 -0
- package/dist/verify-UUQNQMPG.js +0 -0
- package/dist/{version-G2SFHULX.js → version-VHQBXU2I.js} +2 -2
- package/dist/vitals-PJEQUUAK.js +0 -0
- package/package.json +17 -17
- package/LICENSE +0 -21
- package/dist/apps-FKD3ZG5X.js.map +0 -1
- package/dist/docs-KXAHL3HY.js.map +0 -1
- package/dist/listings-7SGQ4SRX.js.map +0 -1
- package/dist/publish-JPTI4EBT.js.map +0 -1
- package/dist/releases-OUJ65774.js.map +0 -1
- package/dist/testers-LSMBXCA2.js.map +0 -1
- package/dist/tracks-DO7C5OSE.js.map +0 -1
- /package/dist/{chunk-VUTRVVWR.js.map → chunk-FXOWADQD.js.map} +0 -0
- /package/dist/{config-2AOJNBLQ.js.map → config-BLMJ35J2.js.map} +0 -0
- /package/dist/{doctor-KXJEQ3DV.js.map → doctor-7LQWPY5P.js.map} +0 -0
- /package/dist/{feedback-CP3YMXXI.js.map → feedback-7ADYSGRD.js.map} +0 -0
- /package/dist/{update-IMIKX4LX.js.map → update-FZ3MNLOH.js.map} +0 -0
- /package/dist/{version-G2SFHULX.js.map → version-VHQBXU2I.js.map} +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
buildCommitOptions
|
|
4
|
+
} from "./chunk-A7VRCCNS.js";
|
|
2
5
|
import {
|
|
3
6
|
getClient,
|
|
4
7
|
resolvePackageName
|
|
@@ -71,7 +74,7 @@ function registerListingsCommands(program) {
|
|
|
71
74
|
const result = await getListings(client, packageName, options.lang);
|
|
72
75
|
console.log(formatOutput(result, format));
|
|
73
76
|
});
|
|
74
|
-
listings.command("update").description("Update a store listing").option("--lang <language>", "Language code (BCP 47)").option("--title <text>", "App title").option("--short <text>", "Short description").option("--full <text>", "Full description").option("--full-file <path>", "Read full description from file").option("--video <url>", "Video URL").action(async (options) => {
|
|
77
|
+
listings.command("update").description("Update a store listing").option("--lang <language>", "Language code (BCP 47)").option("--title <text>", "App title").option("--short <text>", "Short description").option("--full <text>", "Full description").option("--full-file <path>", "Read full description from file").option("--video <url>", "Video URL").option("--changes-not-sent-for-review", "Commit changes without sending for review").option("--error-if-in-review", "Fail if changes are already in review").action(async (options) => {
|
|
75
78
|
const config = await loadConfig();
|
|
76
79
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
77
80
|
const interactive = isInteractive(program);
|
|
@@ -116,10 +119,10 @@ function registerListingsCommands(program) {
|
|
|
116
119
|
return;
|
|
117
120
|
}
|
|
118
121
|
const client = await getClient(config);
|
|
119
|
-
const result = await updateListing(client, packageName, options.lang, data);
|
|
122
|
+
const result = await updateListing(client, packageName, options.lang, data, buildCommitOptions(options));
|
|
120
123
|
console.log(formatOutput(result, format));
|
|
121
124
|
});
|
|
122
|
-
listings.command("delete").description("Delete a store listing for a language").option("--lang <language>", "Language code (BCP 47)").action(async (options) => {
|
|
125
|
+
listings.command("delete").description("Delete a store listing for a language").option("--lang <language>", "Language code (BCP 47)").option("--changes-not-sent-for-review", "Commit changes without sending for review").option("--error-if-in-review", "Fail if changes are already in review").action(async (options) => {
|
|
123
126
|
const config = await loadConfig();
|
|
124
127
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
125
128
|
const interactive = isInteractive(program);
|
|
@@ -146,7 +149,7 @@ function registerListingsCommands(program) {
|
|
|
146
149
|
return;
|
|
147
150
|
}
|
|
148
151
|
const client = await getClient(config);
|
|
149
|
-
await deleteListing(client, packageName, options.lang);
|
|
152
|
+
await deleteListing(client, packageName, options.lang, buildCommitOptions(options));
|
|
150
153
|
console.log(`Listing for "${options.lang}" deleted.`);
|
|
151
154
|
});
|
|
152
155
|
listings.command("pull").description("Download listings to Fastlane-format directory").option("--dir <path>", "Target directory (default: metadata)", "metadata").action(async (options) => {
|
|
@@ -166,7 +169,7 @@ function registerListingsCommands(program) {
|
|
|
166
169
|
)
|
|
167
170
|
);
|
|
168
171
|
});
|
|
169
|
-
listings.command("push").description("Upload listings from Fastlane-format directory").option("--dir <path>", "Source directory (default: metadata)", "metadata").option("--force", "Push even if fields exceed character limits").action(async (options) => {
|
|
172
|
+
listings.command("push").description("Upload listings from Fastlane-format directory").option("--dir <path>", "Source directory (default: metadata)", "metadata").option("--force", "Push even if fields exceed character limits").option("--changes-not-sent-for-review", "Commit changes without sending for review").option("--error-if-in-review", "Fail if changes are already in review").action(async (options) => {
|
|
170
173
|
const config = await loadConfig();
|
|
171
174
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
172
175
|
const client = await getClient(config);
|
|
@@ -177,7 +180,8 @@ function registerListingsCommands(program) {
|
|
|
177
180
|
const dryRun = isDryRun(program);
|
|
178
181
|
const result = await pushListings(client, packageName, options.dir, {
|
|
179
182
|
dryRun,
|
|
180
|
-
force: options.force
|
|
183
|
+
force: options.force,
|
|
184
|
+
commitOptions: buildCommitOptions(options)
|
|
181
185
|
});
|
|
182
186
|
spinner.stop(dryRun ? "Dry-run complete (no changes made)" : "Listings pushed");
|
|
183
187
|
console.log(formatOutput(result, format));
|
|
@@ -315,7 +319,7 @@ Missing locales: ${missingLocales.join(", ")}`);
|
|
|
315
319
|
const result = await listImages(client, packageName, options.lang, imageType);
|
|
316
320
|
console.log(formatOutput(result, format));
|
|
317
321
|
});
|
|
318
|
-
images.command("upload <file>").description("Upload an image").option("--lang <language>", "Language code (BCP 47)").option("--type <type>", "Image type").action(async (file, options) => {
|
|
322
|
+
images.command("upload <file>").description("Upload an image").option("--lang <language>", "Language code (BCP 47)").option("--type <type>", "Image type").option("--changes-not-sent-for-review", "Commit changes without sending for review").option("--error-if-in-review", "Fail if changes are already in review").action(async (file, options) => {
|
|
319
323
|
const config = await loadConfig();
|
|
320
324
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
321
325
|
const interactive = isInteractive(program);
|
|
@@ -343,7 +347,7 @@ Missing locales: ${missingLocales.join(", ")}`);
|
|
|
343
347
|
const spinner = createSpinner("Uploading image...");
|
|
344
348
|
if (!program.opts()["quiet"] && process.stderr.isTTY) spinner.start();
|
|
345
349
|
try {
|
|
346
|
-
const result = await uploadImage(client, packageName, options.lang, imageType, file);
|
|
350
|
+
const result = await uploadImage(client, packageName, options.lang, imageType, file, buildCommitOptions(options));
|
|
347
351
|
spinner.stop("Image uploaded");
|
|
348
352
|
console.log(formatOutput(result, format));
|
|
349
353
|
} catch (error) {
|
|
@@ -351,7 +355,7 @@ Missing locales: ${missingLocales.join(", ")}`);
|
|
|
351
355
|
throw error;
|
|
352
356
|
}
|
|
353
357
|
});
|
|
354
|
-
images.command("delete").description("Delete an image").option("--lang <language>", "Language code (BCP 47)").option("--type <type>", "Image type").option("--id <imageId>", "Image ID to delete").action(async (options) => {
|
|
358
|
+
images.command("delete").description("Delete an image").option("--lang <language>", "Language code (BCP 47)").option("--type <type>", "Image type").option("--id <imageId>", "Image ID to delete").option("--changes-not-sent-for-review", "Commit changes without sending for review").option("--error-if-in-review", "Fail if changes are already in review").action(async (options) => {
|
|
355
359
|
const config = await loadConfig();
|
|
356
360
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
357
361
|
const interactive = isInteractive(program);
|
|
@@ -383,7 +387,7 @@ Missing locales: ${missingLocales.join(", ")}`);
|
|
|
383
387
|
await requireConfirm(`Delete image "${options.id}"?`, program);
|
|
384
388
|
const client = await getClient(config);
|
|
385
389
|
const imageType = validateImageType(options.type);
|
|
386
|
-
await deleteImage(client, packageName, options.lang, imageType, options.id);
|
|
390
|
+
await deleteImage(client, packageName, options.lang, imageType, options.id, buildCommitOptions(options));
|
|
387
391
|
console.log(`Image "${options.id}" deleted.`);
|
|
388
392
|
});
|
|
389
393
|
images.command("export").description("Export all images to a local directory").option("--dir <path>", "Output directory", "images").option("--lang <language>", "Language code (BCP 47) \u2014 export only this language").option("--type <type>", "Image type \u2014 export only this type").action(async (options) => {
|
|
@@ -424,4 +428,4 @@ Missing locales: ${missingLocales.join(", ")}`);
|
|
|
424
428
|
export {
|
|
425
429
|
registerListingsCommands
|
|
426
430
|
};
|
|
427
|
-
//# sourceMappingURL=listings-
|
|
431
|
+
//# sourceMappingURL=listings-LNX6MQYN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/listings.ts"],"sourcesContent":["import { resolvePackageName, getClient } from \"../resolve.js\";\nimport type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\n\nimport type { ImageType } from \"@gpc-cli/api\";\nimport {\n getListings,\n updateListing,\n deleteListing,\n pullListings,\n pushListings,\n diffListingsEnhanced,\n lintLocalListings,\n analyzeRemoteListings,\n listImages,\n uploadImage,\n deleteImage,\n exportImages,\n getCountryAvailability,\n formatOutput,\n createSpinner,\n GpcError,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { isInteractive, requireOption, requireConfirm } from \"../prompt.js\";\nimport { green, red } from \"../colors.js\";\nimport { buildCommitOptions } from \"../commit-options.js\";\n\n\n\nconst VALID_IMAGE_TYPES: ImageType[] = [\n \"phoneScreenshots\",\n \"sevenInchScreenshots\",\n \"tenInchScreenshots\",\n \"tvScreenshots\",\n \"wearScreenshots\",\n \"icon\",\n \"featureGraphic\",\n \"tvBanner\",\n];\n\nfunction validateImageType(type: string): ImageType {\n if (!VALID_IMAGE_TYPES.includes(type as ImageType)) {\n throw new GpcError(\n `Invalid image type \"${type}\". Valid types: ${VALID_IMAGE_TYPES.join(\", \")}`,\n \"LISTINGS_USAGE_ERROR\",\n 2,\n `Use one of: ${VALID_IMAGE_TYPES.join(\", \")}`,\n );\n }\n return type as ImageType;\n}\n\nexport function registerListingsCommands(program: Command): void {\n const listings = program.command(\"listings\").description(\"Manage store listings and metadata\");\n\n // Get\n listings\n .command(\"get\")\n .description(\"Get store listing(s)\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const result = await getListings(client, packageName, options.lang);\n console.log(formatOutput(result, format));\n });\n\n // Update\n listings\n .command(\"update\")\n .description(\"Update a store listing\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .option(\"--title <text>\", \"App title\")\n .option(\"--short <text>\", \"Short description\")\n .option(\"--full <text>\", \"Full description\")\n .option(\"--full-file <path>\", \"Read full description from file\")\n .option(\"--video <url>\", \"Video URL\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.lang = await requireOption(\n \"lang\",\n options.lang,\n {\n message: \"Language code (BCP 47):\",\n default: \"en-US\",\n },\n interactive,\n );\n const format = getOutputFormat(program, config);\n\n const data: Record<string, string> = {};\n if (options[\"title\"]) data[\"title\"] = options[\"title\"];\n if (options[\"short\"]) data[\"shortDescription\"] = options[\"short\"];\n if (options[\"full\"]) data[\"fullDescription\"] = options[\"full\"];\n if (options[\"fullFile\"]) {\n const { readFile } = await import(\"node:fs/promises\");\n data[\"fullDescription\"] = (await readFile(options[\"fullFile\"], \"utf-8\")).trimEnd();\n }\n if (options[\"video\"]) data[\"video\"] = options[\"video\"];\n\n if (Object.keys(data).length === 0) {\n throw new GpcError(\n \"Provide at least one field to update (--title, --short, --full, --full-file, --video).\",\n \"LISTINGS_USAGE_ERROR\",\n 2,\n \"Pass at least one of: --title, --short, --full, --full-file, --video\",\n );\n }\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"listings update\",\n action: \"update listing for\",\n target: options.lang,\n details: data,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n const result = await updateListing(client, packageName, options.lang, data, buildCommitOptions(options));\n console.log(formatOutput(result, format));\n });\n\n // Delete\n listings\n .command(\"delete\")\n .description(\"Delete a store listing for a language\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.lang = await requireOption(\n \"lang\",\n options.lang,\n {\n message: \"Language code (BCP 47):\",\n },\n interactive,\n );\n\n await requireConfirm(`Delete listing for \"${options.lang}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"listings delete\",\n action: \"delete listing for\",\n target: options.lang,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n await deleteListing(client, packageName, options.lang, buildCommitOptions(options));\n console.log(`Listing for \"${options.lang}\" deleted.`);\n });\n\n // Pull\n listings\n .command(\"pull\")\n .description(\"Download listings to Fastlane-format directory\")\n .option(\"--dir <path>\", \"Target directory (default: metadata)\", \"metadata\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const result = await pullListings(client, packageName, options.dir);\n console.log(\n formatOutput(\n {\n directory: options.dir,\n languages: result.listings.map((l) => l.language),\n count: result.listings.length,\n },\n format,\n ),\n );\n });\n\n // Push\n listings\n .command(\"push\")\n .description(\"Upload listings from Fastlane-format directory\")\n .option(\"--dir <path>\", \"Source directory (default: metadata)\", \"metadata\")\n .option(\"--force\", \"Push even if fields exceed character limits\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const spinner = createSpinner(\"Pushing listings...\");\n if (!program.opts()[\"quiet\"] && process.stderr.isTTY) spinner.start();\n\n try {\n const dryRun = isDryRun(program);\n const result = await pushListings(client, packageName, options.dir, {\n dryRun,\n force: options.force,\n commitOptions: buildCommitOptions(options),\n });\n spinner.stop(dryRun ? \"Dry-run complete (no changes made)\" : \"Listings pushed\");\n console.log(formatOutput(result, format));\n } catch (error) {\n spinner.fail(\"Push failed\");\n throw error;\n }\n });\n\n // Diff (enhanced: --lang filter, word-level inline diff)\n listings\n .command(\"diff\")\n .description(\"Compare local Fastlane-format metadata against remote listings\")\n .option(\"--dir <path>\", \"Local metadata directory\", \"metadata\")\n .option(\"--lang <language>\", \"Filter diff to a specific language\")\n .option(\"--word-diff\", \"Show word-level inline diff for fullDescription\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const diffs = await diffListingsEnhanced(client, packageName, options.dir, {\n lang: options.lang,\n wordLevel: options.wordDiff,\n });\n\n if (diffs.length === 0) {\n if (format === \"json\") {\n console.log(formatOutput([], format));\n } else {\n console.log(\"No differences found.\");\n }\n return;\n }\n\n if (format === \"json\") {\n console.log(formatOutput(diffs, format));\n } else {\n for (const diff of diffs) {\n const charInfo = (diff as unknown as Record<string, unknown>)[\"chars\"]\n ? ` (${(diff as unknown as Record<string, unknown>)[\"chars\"]} chars)`\n : \"\";\n console.log(`[${diff.language}] ${diff.field}:${charInfo}`);\n if ((diff as unknown as Record<string, unknown>)[\"diffSummary\"]) {\n console.log(` ${(diff as unknown as Record<string, unknown>)[\"diffSummary\"]}`);\n } else {\n console.log(green(` + local: ${diff.local || \"(empty)\"}`));\n console.log(red(` - remote: ${diff.remote || \"(empty)\"}`));\n }\n }\n }\n });\n\n // Lint (local, no API)\n listings\n .command(\"lint\")\n .description(\"Lint local listing metadata for Play Store character limits (no API)\")\n .option(\"--dir <path>\", \"Metadata directory\", \"metadata\")\n .action(async (options) => {\n const format = getOutputFormat(program, await loadConfig());\n const results = await lintLocalListings(options.dir);\n if (format === \"json\") {\n console.log(formatOutput(results, format));\n return;\n }\n let hasErrors = false;\n for (const r of results) {\n console.log(`\\n[${r.language}] ${r.valid ? green(\"✓ valid\") : red(\"✗ over limit\")}`);\n const rows = r.fields.map((f) => ({\n field: f.field,\n chars: f.chars,\n limit: f.limit,\n pct: `${f.pct}%`,\n status: f.status === \"ok\" ? green(\"✓\") : f.status === \"warn\" ? \"⚠\" : red(\"✗\"),\n }));\n console.log(formatOutput(rows, \"table\"));\n if (!r.valid) hasErrors = true;\n }\n if (hasErrors) {\n process.exitCode = 1;\n }\n });\n\n // Analyze (live, fetches remote)\n listings\n .command(\"analyze\")\n .description(\"Analyze live Play Store listings for character limit compliance\")\n .option(\"--expected <locales>\", \"Comma-separated list of expected locale codes\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const spinner = createSpinner(\"Fetching remote listings...\");\n if (!program.opts()[\"quiet\"] && process.stderr.isTTY) spinner.start();\n\n try {\n const expectedLocales = options.expected\n ? (options.expected as string).split(\",\").map((s: string) => s.trim())\n : undefined;\n const { results, missingLocales } = await analyzeRemoteListings(client, packageName, {\n expectedLocales,\n });\n spinner.stop(\"Done\");\n\n if (format === \"json\") {\n console.log(formatOutput({ results, missingLocales }, format));\n return;\n }\n\n let hasErrors = false;\n for (const r of results) {\n console.log(`\\n[${r.language}] ${r.valid ? green(\"✓ valid\") : red(\"✗ over limit\")}`);\n const rows = r.fields.map((f) => ({\n field: f.field,\n chars: f.chars,\n limit: f.limit,\n pct: `${f.pct}%`,\n status: f.status === \"ok\" ? green(\"✓\") : f.status === \"warn\" ? \"⚠\" : red(\"✗\"),\n }));\n console.log(formatOutput(rows, \"table\"));\n if (!r.valid) hasErrors = true;\n }\n\n if (missingLocales && missingLocales.length > 0) {\n console.log(`\\nMissing locales: ${missingLocales.join(\", \")}`);\n }\n\n if (hasErrors) {\n process.exitCode = 1;\n }\n } catch (error) {\n spinner.fail(\"Analysis failed\");\n throw error;\n }\n });\n\n // Images subcommand\n const images = listings.command(\"images\").description(\"Manage listing images\");\n\n // Images list\n images\n .command(\"list\")\n .description(\"List images for a language and type\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .option(\"--type <type>\", \"Image type\")\n .option(\"--limit <n>\", \"Maximum results to return\")\n .option(\"--next-page <token>\", \"Pagination token for next page\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.lang = await requireOption(\n \"lang\",\n options.lang,\n {\n message: \"Language code (BCP 47):\",\n default: \"en-US\",\n },\n interactive,\n );\n\n options.type = await requireOption(\n \"type\",\n options.type,\n {\n message: \"Image type:\",\n choices: VALID_IMAGE_TYPES as unknown as string[],\n },\n interactive,\n );\n\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n const imageType = validateImageType(options.type);\n\n const result = await listImages(client, packageName, options.lang, imageType);\n console.log(formatOutput(result, format));\n });\n\n // Images upload\n images\n .command(\"upload <file>\")\n .description(\"Upload an image\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .option(\"--type <type>\", \"Image type\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review\")\n .action(async (file: string, options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.lang = await requireOption(\n \"lang\",\n options.lang,\n {\n message: \"Language code (BCP 47):\",\n default: \"en-US\",\n },\n interactive,\n );\n\n options.type = await requireOption(\n \"type\",\n options.type,\n {\n message: \"Image type:\",\n choices: VALID_IMAGE_TYPES as unknown as string[],\n },\n interactive,\n );\n\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n const imageType = validateImageType(options.type);\n\n const spinner = createSpinner(\"Uploading image...\");\n if (!program.opts()[\"quiet\"] && process.stderr.isTTY) spinner.start();\n\n try {\n const result = await uploadImage(client, packageName, options.lang, imageType, file, buildCommitOptions(options));\n spinner.stop(\"Image uploaded\");\n console.log(formatOutput(result, format));\n } catch (error) {\n spinner.fail(\"Image upload failed\");\n throw error;\n }\n });\n\n // Images delete\n images\n .command(\"delete\")\n .description(\"Delete an image\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .option(\"--type <type>\", \"Image type\")\n .option(\"--id <imageId>\", \"Image ID to delete\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.lang = await requireOption(\n \"lang\",\n options.lang,\n {\n message: \"Language code (BCP 47):\",\n },\n interactive,\n );\n\n options.type = await requireOption(\n \"type\",\n options.type,\n {\n message: \"Image type:\",\n choices: VALID_IMAGE_TYPES as unknown as string[],\n },\n interactive,\n );\n\n options.id = await requireOption(\n \"id\",\n options.id,\n {\n message: \"Image ID to delete:\",\n },\n interactive,\n );\n\n await requireConfirm(`Delete image \"${options.id}\"?`, program);\n\n const client = await getClient(config);\n const imageType = validateImageType(options.type);\n\n await deleteImage(client, packageName, options.lang, imageType, options.id, buildCommitOptions(options));\n console.log(`Image \"${options.id}\" deleted.`);\n });\n\n // Images export\n images\n .command(\"export\")\n .description(\"Export all images to a local directory\")\n .option(\"--dir <path>\", \"Output directory\", \"images\")\n .option(\"--lang <language>\", \"Language code (BCP 47) — export only this language\")\n .option(\"--type <type>\", \"Image type — export only this type\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const exportOpts: { lang?: string; type?: ImageType } = {};\n if (options.lang) exportOpts.lang = options.lang;\n if (options.type) {\n exportOpts.type = validateImageType(options.type);\n }\n\n const spinner = createSpinner(\"Exporting images...\");\n if (!program.opts()[\"quiet\"] && process.stderr.isTTY) spinner.start();\n\n try {\n const result = await exportImages(client, packageName, options.dir, exportOpts);\n spinner.stop(\"Images exported\");\n console.log(formatOutput(result, format));\n } catch (error) {\n spinner.fail(\"Image export failed\");\n throw error;\n }\n });\n\n // Availability\n listings\n .command(\"availability\")\n .description(\"Get country availability for a track\")\n .option(\"--track <track>\", \"Track name\", \"production\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const result = await getCountryAvailability(client, packageName, options.track);\n const countries = (result as unknown as Record<string, unknown>)[\"countryTargeting\"] as\n | unknown[]\n | undefined;\n if (\n format !== \"json\" &&\n (!countries || (Array.isArray(countries) && countries.length === 0)) &&\n Object.keys(result as object).length === 0\n ) {\n console.log(\"No availability data.\");\n return;\n }\n console.log(formatOutput(result, format));\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,kBAAkB;AAG3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP,IAAM,oBAAiC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,kBAAkB,MAAyB;AAClD,MAAI,CAAC,kBAAkB,SAAS,IAAiB,GAAG;AAClD,UAAM,IAAI;AAAA,MACR,uBAAuB,IAAI,mBAAmB,kBAAkB,KAAK,IAAI,CAAC;AAAA,MAC1E;AAAA,MACA;AAAA,MACA,eAAe,kBAAkB,KAAK,IAAI,CAAC;AAAA,IAC7C;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,yBAAyB,SAAwB;AAC/D,QAAM,WAAW,QAAQ,QAAQ,UA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AEA,UAAM,UAAU,cAAc,qBAAqB;AACnD,QAAI,CAAC,QAAQ,KAAK,EAAE,OAAO,KAAK,QAAQ,OAAO,MAAO,SAAQ,MAAM;AAEpE,QAAI;AACF,YAAM,SAAS,MAAM,aAAa,QAAQ,aAAa,QAAQ,KAAK,UAAU;AAC9E,cAAQ,KAAK,iBAAiB;AAC9B,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,KAAK,qBAAqB;AAClC,YAAM;AAAA,IACR;AAAA,EACF,CAAC;AAGH,WACG,QAAQ,cAAc,EACtB,YAAY,sCAAsC,EAClD,OAAO,mBAAmB,cAAc,YAAY,EACpD,OAAO,OAAO,YAAY;AACzB,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,SAAS,MAAM,UAAU,MAAM;AACrC,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,UAAM,SAAS,MAAM,uBAAuB,QAAQ,aAAa,QAAQ,KAAK;AAC9E,UAAM,YAAa,OAA8C,kBAAkB;AAGnF,QACE,WAAW,WACV,CAAC,aAAc,MAAM,QAAQ,SAAS,KAAK,UAAU,WAAW,MACjE,OAAO,KAAK,MAAgB,EAAE,WAAW,GACzC;AACA,cAAQ,IAAI,uBAAuB;AACnC;AAAA,IACF;AACA,YAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,EAC1C,CAAC;AACL;","names":[]}
|
package/dist/migrate-ZQCJGQQS.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/pricing-JJZFICFL.js
CHANGED
|
File without changes
|
package/dist/prompt-GXC2JSLA.js
CHANGED
|
File without changes
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
buildCommitOptions
|
|
4
|
+
} from "./chunk-A7VRCCNS.js";
|
|
2
5
|
import {
|
|
3
6
|
resolvePackageName
|
|
4
7
|
} from "./chunk-NQH4G7BI.js";
|
|
@@ -80,7 +83,7 @@ function formatDryRunOutput(result, format) {
|
|
|
80
83
|
return lines.join("\n");
|
|
81
84
|
}
|
|
82
85
|
function registerPublishCommand(program) {
|
|
83
|
-
program.command("publish <file>").description("Validate, upload, and release in one step").option("--track <track>", "Target track", "internal").option("--rollout <percent>", "Staged rollout percentage (1-100)").option("--notes <text>", "Release notes (en-US)").option("--notes-dir <dir>", "Read release notes from directory (<dir>/<lang>.txt)").option("--notes-from-git", "Generate release notes from git commit history").option("--since <ref>", "Git ref to start from (tag, SHA) \u2014 used with --notes-from-git").option("--name <name>", "Release name").option("--mapping <file>", "ProGuard/R8 mapping file for deobfuscation").option("--retry-log <path>", "Write retry log entries to file (JSONL)").action(async (file, options) => {
|
|
86
|
+
program.command("publish <file>").description("Validate, upload, and release in one step").option("--track <track>", "Target track", "internal").option("--rollout <percent>", "Staged rollout percentage (1-100)").option("--notes <text>", "Release notes (en-US)").option("--notes-dir <dir>", "Read release notes from directory (<dir>/<lang>.txt)").option("--notes-from-git", "Generate release notes from git commit history").option("--since <ref>", "Git ref to start from (tag, SHA) \u2014 used with --notes-from-git").option("--name <name>", "Release name").option("--mapping <file>", "ProGuard/R8 mapping file for deobfuscation").option("--retry-log <path>", "Write retry log entries to file (JSONL)").option("--mapping-type <type>", "Deobfuscation file type: proguard or nativeCode", "proguard").option("--device-tier-config <id>", "Device tier config ID (or LATEST)").option("--changes-not-sent-for-review", "Commit changes without sending for review (required for rejected apps)").option("--error-if-in-review", "Fail if changes are already in review instead of cancelling them").action(async (file, options) => {
|
|
84
87
|
try {
|
|
85
88
|
await stat(file);
|
|
86
89
|
} catch {
|
|
@@ -133,6 +136,14 @@ function registerPublishCommand(program) {
|
|
|
133
136
|
);
|
|
134
137
|
}
|
|
135
138
|
}
|
|
139
|
+
if (options.mappingType && options.mappingType !== "proguard" && options.mappingType !== "nativeCode") {
|
|
140
|
+
throw new GpcError(
|
|
141
|
+
`--mapping-type must be "proguard" or "nativeCode" (got: "${options.mappingType}")`,
|
|
142
|
+
"PUBLISH_USAGE_ERROR",
|
|
143
|
+
2,
|
|
144
|
+
"Use --mapping-type proguard (default) for ProGuard/R8 maps, or --mapping-type nativeCode for native debug symbols."
|
|
145
|
+
);
|
|
146
|
+
}
|
|
136
147
|
if (options.notesFromGit) {
|
|
137
148
|
const gitNotes = await generateNotesFromGit({ since: options.since });
|
|
138
149
|
options.notes = gitNotes.text;
|
|
@@ -162,6 +173,9 @@ function registerPublishCommand(program) {
|
|
|
162
173
|
notesDir: options.notesDir,
|
|
163
174
|
releaseName: options.name,
|
|
164
175
|
mappingFile: options.mapping,
|
|
176
|
+
mappingFileType: options.mappingType,
|
|
177
|
+
deviceTierConfigId: options.deviceTierConfig,
|
|
178
|
+
commitOptions: buildCommitOptions(options),
|
|
165
179
|
dryRun: true
|
|
166
180
|
});
|
|
167
181
|
console.log(formatDryRunOutput(result, format));
|
|
@@ -179,7 +193,10 @@ function registerPublishCommand(program) {
|
|
|
179
193
|
notes: options.notes,
|
|
180
194
|
notesDir: options.notesDir,
|
|
181
195
|
releaseName: options.name,
|
|
182
|
-
mappingFile: options.mapping
|
|
196
|
+
mappingFile: options.mapping,
|
|
197
|
+
mappingFileType: options.mappingType,
|
|
198
|
+
deviceTierConfigId: options.deviceTierConfig,
|
|
199
|
+
commitOptions: buildCommitOptions(options)
|
|
183
200
|
});
|
|
184
201
|
if (!result.upload) {
|
|
185
202
|
console.log(formatValidationOutput(result, format));
|
|
@@ -204,4 +221,4 @@ function registerPublishCommand(program) {
|
|
|
204
221
|
export {
|
|
205
222
|
registerPublishCommand
|
|
206
223
|
};
|
|
207
|
-
//# sourceMappingURL=publish-
|
|
224
|
+
//# sourceMappingURL=publish-P5KIGSLI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/publish.ts"],"sourcesContent":["import { resolvePackageName } from \"../resolve.js\";\nimport { appendFile, stat } from \"node:fs/promises\";\nimport type { OutputFormat } from \"@gpc-cli/config\";\nimport type { Command } from \"commander\";\nimport { loadConfig, getCacheDir } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport type { RetryLogEntry } from \"@gpc-cli/api\";\nimport {\n publish,\n generateNotesFromGit,\n writeAuditLog,\n createAuditEntry,\n formatOutput,\n GpcError,\n} from \"@gpc-cli/core\";\nimport type { PublishResult, DryRunPublishResult } from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun } from \"../dry-run.js\";\nimport { isInteractive, promptSelect, promptInput } from \"../prompt.js\";\nimport { buildCommitOptions } from \"../commit-options.js\";\n\nconst PASS = \"\\u2713\";\nconst FAIL = \"\\u2717\";\nconst WARN = \"\\u26A0\";\n\n\n// ---------------------------------------------------------------------------\n// Output formatters\n// ---------------------------------------------------------------------------\n\nfunction formatChecks(checks: { name: string; passed: boolean; message: string }[]): string[] {\n return checks.map((c) => ` ${c.passed ? PASS : FAIL} ${c.message}`);\n}\n\nfunction formatValidationOutput(result: PublishResult, format: OutputFormat): string {\n if (format !== \"table\") {\n return formatOutput({ success: false, validation: result.validation }, format);\n }\n const lines = [\"Validation failed:\\n\", ...formatChecks(result.validation.checks)];\n for (const w of result.validation.warnings) {\n lines.push(` ${WARN} ${w}`);\n }\n return lines.join(\"\\n\");\n}\n\nfunction formatPublishOutput(result: PublishResult, format: OutputFormat): string {\n if (format !== \"table\") return formatOutput(result, format);\n\n const upload = result.upload;\n if (!upload) return formatOutput(result, format);\n const rollout =\n upload.status === \"inProgress\" && \"userFraction\" in upload\n ? ` (${Math.round(Number((upload as Record<string, unknown>)[\"userFraction\"]) * 100)}% rollout)`\n : \"\";\n\n const lines = [\"Published successfully\\n\", ...formatChecks(result.validation.checks)];\n for (const w of result.validation.warnings) {\n lines.push(` ${WARN} ${w}`);\n }\n lines.push(\"\");\n lines.push(` versionCode ${upload.versionCode}`);\n lines.push(` track ${upload.track}`);\n lines.push(` status ${upload.status}${rollout}`);\n return lines.join(\"\\n\");\n}\n\nfunction formatDryRunOutput(result: DryRunPublishResult, format: OutputFormat): string {\n if (format !== \"table\") return formatOutput(result, format);\n\n const lines = [\"Dry run — no changes made\\n\", ...formatChecks(result.validation.checks)];\n for (const w of result.validation.warnings) {\n lines.push(` ${WARN} ${w}`);\n }\n\n const u = result.upload;\n lines.push(\"\");\n lines.push(` Track ${u.track}`);\n\n if (u.currentReleases.length === 0) {\n lines.push(` Current (no releases on this track)`);\n } else {\n for (const r of u.currentReleases) {\n const fraction =\n r.userFraction !== undefined ? ` (${Math.round(r.userFraction * 100)}%)` : \"\";\n lines.push(` Current ${r.versionCodes.join(\", \")} · ${r.status}${fraction}`);\n }\n }\n const plannedFraction =\n u.plannedRelease.userFraction !== undefined\n ? ` (${Math.round(u.plannedRelease.userFraction * 100)}%)`\n : \"\";\n lines.push(` Would be (new bundle) · ${u.plannedRelease.status}${plannedFraction}`);\n return lines.join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// Command\n// ---------------------------------------------------------------------------\n\nexport function registerPublishCommand(program: Command): void {\n program\n .command(\"publish <file>\")\n .description(\"Validate, upload, and release in one step\")\n .option(\"--track <track>\", \"Target track\", \"internal\")\n .option(\"--rollout <percent>\", \"Staged rollout percentage (1-100)\")\n .option(\"--notes <text>\", \"Release notes (en-US)\")\n .option(\"--notes-dir <dir>\", \"Read release notes from directory (<dir>/<lang>.txt)\")\n .option(\"--notes-from-git\", \"Generate release notes from git commit history\")\n .option(\"--since <ref>\", \"Git ref to start from (tag, SHA) — used with --notes-from-git\")\n .option(\"--name <name>\", \"Release name\")\n .option(\"--mapping <file>\", \"ProGuard/R8 mapping file for deobfuscation\")\n .option(\"--retry-log <path>\", \"Write retry log entries to file (JSONL)\")\n .option(\"--mapping-type <type>\", \"Deobfuscation file type: proguard or nativeCode\", \"proguard\")\n .option(\"--device-tier-config <id>\", \"Device tier config ID (or LATEST)\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review (required for rejected apps)\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review instead of cancelling them\")\n .action(async (file: string, options) => {\n try {\n await stat(file);\n } catch {\n throw new GpcError(\n `File not found: ${file}`,\n \"PUBLISH_USAGE_ERROR\",\n 2,\n \"Check the file path and try again.\",\n );\n }\n\n const noteSources = [options.notes, options.notesDir, options.notesFromGit].filter(Boolean);\n if (noteSources.length > 1) {\n throw new GpcError(\n \"Cannot combine --notes, --notes-dir, and --notes-from-git. Use only one.\",\n \"PUBLISH_USAGE_ERROR\",\n 2,\n \"Pick one release notes source.\",\n );\n }\n\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n // Interactive mode: prompt for missing options\n if (isInteractive(program)) {\n if (!options.track || options.track === \"internal\") {\n const tracks = [\"internal\", \"alpha\", \"beta\", \"production\"];\n options.track = await promptSelect(\"Select track:\", tracks, \"internal\");\n }\n\n if (!options.rollout && options.track === \"production\") {\n const rolloutStr = await promptInput(\n \"Staged rollout percentage (1-100, blank for full)\",\n \"100\",\n );\n if (rolloutStr && rolloutStr !== \"100\") {\n options.rollout = rolloutStr;\n }\n }\n\n if (!options.notes && !options.notesDir && !options.notesFromGit) {\n const notes = await promptInput(\"Release notes (en-US, blank to skip)\");\n if (notes) options.notes = notes;\n }\n }\n\n // Rollout range guard\n if (options.rollout !== undefined) {\n const rollout = Number(options.rollout);\n if (!Number.isFinite(rollout) || rollout < 1 || rollout > 100) {\n throw new GpcError(\n `--rollout must be a number between 1 and 100 (got: ${options.rollout})`,\n \"PUBLISH_USAGE_ERROR\",\n 2,\n \"Use a percentage between 1 and 100.\",\n );\n }\n }\n\n if (options.mappingType && options.mappingType !== \"proguard\" && options.mappingType !== \"nativeCode\") {\n throw new GpcError(\n `--mapping-type must be \"proguard\" or \"nativeCode\" (got: \"${options.mappingType}\")`,\n \"PUBLISH_USAGE_ERROR\",\n 2,\n 'Use --mapping-type proguard (default) for ProGuard/R8 maps, or --mapping-type nativeCode for native debug symbols.',\n );\n }\n\n // Resolve git-based release notes before calling publish\n if (options.notesFromGit) {\n const gitNotes = await generateNotesFromGit({ since: options.since });\n options.notes = gitNotes.text;\n if (gitNotes.truncated) {\n console.error(\n `${WARN} Release notes truncated to 500 characters (${gitNotes.commitCount} commits from ${gitNotes.since}).`,\n );\n }\n }\n\n let onRetry: ((entry: RetryLogEntry) => void) | undefined;\n if (options.retryLog) {\n onRetry = (entry: RetryLogEntry) => {\n appendFile(options.retryLog, JSON.stringify(entry) + \"\\n\").catch(() => {});\n };\n }\n\n const auth = await resolveAuth({\n serviceAccountPath: config.auth?.serviceAccount,\n cachePath: getCacheDir(),\n });\n const client = createApiClient({ auth, onRetry });\n\n if (isDryRun(program)) {\n const result = await publish(client, packageName, file, {\n track: options.track,\n rolloutPercent: options.rollout ? Number(options.rollout) : undefined,\n notes: options.notes,\n notesDir: options.notesDir,\n releaseName: options.name,\n mappingFile: options.mapping,\n mappingFileType: options.mappingType,\n deviceTierConfigId: options.deviceTierConfig,\n commitOptions: buildCommitOptions(options),\n dryRun: true,\n });\n console.log(formatDryRunOutput(result as DryRunPublishResult, format));\n return;\n }\n\n const auditEntry = createAuditEntry(\n \"publish\",\n { file, track: options.track, rollout: options.rollout },\n packageName,\n );\n\n try {\n const result = await publish(client, packageName, file, {\n track: options.track,\n rolloutPercent: options.rollout ? Number(options.rollout) : undefined,\n notes: options.notes,\n notesDir: options.notesDir,\n releaseName: options.name,\n mappingFile: options.mapping,\n mappingFileType: options.mappingType,\n deviceTierConfigId: options.deviceTierConfig,\n commitOptions: buildCommitOptions(options),\n });\n\n if (!result.upload) {\n console.log(formatValidationOutput(result as PublishResult, format));\n auditEntry.success = false;\n auditEntry.error = \"Validation failed\";\n process.exitCode = 1;\n return;\n }\n\n console.log(formatPublishOutput(result as PublishResult, format));\n auditEntry.success = true;\n } catch (error) {\n auditEntry.success = false;\n auditEntry.error = error instanceof Error ? error.message : String(error);\n throw error;\n } finally {\n auditEntry.durationMs = Date.now() - new Date(auditEntry.timestamp).getTime();\n writeAuditLog(auditEntry).catch(() => {});\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,SAAS,YAAY,YAAY;AAGjC,SAAS,YAAY,mBAAmB;AACxC,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,IAAM,OAAO;AACb,IAAM,OAAO;AACb,IAAM,OAAO;AAOb,SAAS,aAAa,QAAwE;AAC5F,SAAO,OAAO,IAAI,CAAC,MAAM,KAAK,EAAE,SAAS,OAAO,IAAI,IAAI,EAAE,OAAO,EAAE;AACrE;AAEA,SAAS,uBAAuB,QAAuB,QAA8B;AACnF,MAAI,WAAW,SAAS;AACtB,WAAO,aAAa,EAAE,SAAS,OAAO,YAAY,OAAO,WAAW,GAAG,MAAM;AAAA,EAC/E;AACA,QAAM,QAAQ,CAAC,wBAAwB,GAAG,aAAa,OAAO,WAAW,MAAM,CAAC;AAChF,aAAW,KAAK,OAAO,WAAW,UAAU;AAC1C,UAAM,KAAK,KAAK,IAAI,IAAI,CAAC,EAAE;AAAA,EAC7B;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,oBAAoB,QAAuB,QAA8B;AAChF,MAAI,WAAW,QAAS,QAAO,aAAa,QAAQ,MAAM;AAE1D,QAAM,SAAS,OAAO;AACtB,MAAI,CAAC,OAAQ,QAAO,aAAa,QAAQ,MAAM;AAC/C,QAAM,UACJ,OAAO,WAAW,gBAAgB,kBAAkB,SAChD,KAAK,KAAK,MAAM,OAAQ,OAAmC,cAAc,CAAC,IAAI,GAAG,CAAC,eAClF;AAEN,QAAM,QAAQ,CAAC,4BAA4B,GAAG,aAAa,OAAO,WAAW,MAAM,CAAC;AACpF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,OAAO,KAAK;AACxE,YAAM;AAAA,IACR,UAAE;AACA,iBAAW,aAAa,KAAK,IAAI,IAAI,IAAI,KAAK,WAAW,SAAS,EAAE,QAAQ;AAC5E,oBAAc,UAAU,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAAA,IAC1C;AAAA,EACF,CAAC;AACL;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/quota-MZRWYJGR.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
buildCommitOptions
|
|
4
|
+
} from "./chunk-A7VRCCNS.js";
|
|
2
5
|
import {
|
|
3
6
|
isDryRun,
|
|
4
7
|
printDryRun
|
|
@@ -67,7 +70,7 @@ function registerReleasesCommands(program) {
|
|
|
67
70
|
"--timeout <ms>",
|
|
68
71
|
"Upload timeout in milliseconds (auto-scales with file size by default)",
|
|
69
72
|
parseInt
|
|
70
|
-
).option("--status <status>", "Release status: completed, inProgress, draft, halted", "completed").action(async (file, options) => {
|
|
73
|
+
).option("--status <status>", "Release status: completed, inProgress, draft, halted", "completed").option("--mapping-type <type>", "Deobfuscation file type: proguard or nativeCode", "proguard").option("--device-tier-config <id>", "Device tier config ID (or LATEST)").option("--changes-not-sent-for-review", "Commit changes without sending for review (required for rejected apps)").option("--error-if-in-review", "Fail if changes are already in review instead of cancelling them").action(async (file, options) => {
|
|
71
74
|
try {
|
|
72
75
|
await stat(file);
|
|
73
76
|
} catch {
|
|
@@ -134,6 +137,14 @@ function registerReleasesCommands(program) {
|
|
|
134
137
|
);
|
|
135
138
|
}
|
|
136
139
|
}
|
|
140
|
+
if (options.mappingType && options.mappingType !== "proguard" && options.mappingType !== "nativeCode") {
|
|
141
|
+
throw new GpcError(
|
|
142
|
+
`--mapping-type must be "proguard" or "nativeCode" (got: "${options.mappingType}")`,
|
|
143
|
+
"RELEASES_USAGE_ERROR",
|
|
144
|
+
2,
|
|
145
|
+
"Use --mapping-type proguard (default) for ProGuard/R8 maps, or --mapping-type nativeCode for native debug symbols."
|
|
146
|
+
);
|
|
147
|
+
}
|
|
137
148
|
const { size: fileSize } = await stat(file);
|
|
138
149
|
const jsonMode = format === "json";
|
|
139
150
|
const client = await getClient(config, options.retryLog, options.timeout);
|
|
@@ -162,6 +173,8 @@ function registerReleasesCommands(program) {
|
|
|
162
173
|
track: options.track,
|
|
163
174
|
status: options.status,
|
|
164
175
|
userFraction: options.rollout ? Number(options.rollout) / 100 : void 0,
|
|
176
|
+
mappingFileType: options.mappingType,
|
|
177
|
+
deviceTierConfigId: options.deviceTierConfig,
|
|
165
178
|
dryRun: true
|
|
166
179
|
});
|
|
167
180
|
console.log(formatOutput(result, format));
|
|
@@ -197,7 +210,10 @@ function registerReleasesCommands(program) {
|
|
|
197
210
|
releaseNotes,
|
|
198
211
|
releaseName: options.name,
|
|
199
212
|
mappingFile: options.mapping,
|
|
200
|
-
|
|
213
|
+
mappingFileType: options.mappingType,
|
|
214
|
+
deviceTierConfigId: options.deviceTierConfig,
|
|
215
|
+
onUploadProgress,
|
|
216
|
+
commitOptions: buildCommitOptions(options)
|
|
201
217
|
});
|
|
202
218
|
if (showProgress) {
|
|
203
219
|
process.stderr.write(`\r \u2713 Uploaded ${basename(file)} ${sizeMB} MB\x1B[K
|
|
@@ -253,7 +269,7 @@ function registerReleasesCommands(program) {
|
|
|
253
269
|
await maybePaginate(formatOutput(sorted, format));
|
|
254
270
|
}
|
|
255
271
|
});
|
|
256
|
-
releases.command("promote").description("Promote a release from one track to another").option("--from <track>", "Source track").option("--to <track>", "Target track").option("--rollout <percent>", "Staged rollout percentage").option("--notes <text>", "Release notes").option("--copy-notes-from <track>", "Copy release notes from another track").option("--status <status>", "Release status: completed, inProgress, draft, halted").action(async (options) => {
|
|
272
|
+
releases.command("promote").description("Promote a release from one track to another").option("--from <track>", "Source track").option("--to <track>", "Target track").option("--rollout <percent>", "Staged rollout percentage").option("--notes <text>", "Release notes").option("--copy-notes-from <track>", "Copy release notes from another track").option("--status <status>", "Release status: completed, inProgress, draft, halted").option("--changes-not-sent-for-review", "Commit changes without sending for review (required for rejected apps)").option("--error-if-in-review", "Fail if changes are already in review instead of cancelling them").action(async (options) => {
|
|
257
273
|
if (options.notes && options.copyNotesFrom) {
|
|
258
274
|
throw new GpcError(
|
|
259
275
|
"Cannot combine --notes and --copy-notes-from. Use only one.",
|
|
@@ -327,7 +343,8 @@ function registerReleasesCommands(program) {
|
|
|
327
343
|
const result = await promoteRelease(client, packageName, options.from, options.to, {
|
|
328
344
|
status: options.status,
|
|
329
345
|
userFraction: options.rollout ? Number(options.rollout) / 100 : void 0,
|
|
330
|
-
releaseNotes
|
|
346
|
+
releaseNotes,
|
|
347
|
+
commitOptions: buildCommitOptions(options)
|
|
331
348
|
});
|
|
332
349
|
console.log(formatOutput(result, format));
|
|
333
350
|
});
|
|
@@ -338,6 +355,8 @@ function registerReleasesCommands(program) {
|
|
|
338
355
|
cmd.option("--to <percent>", "New rollout percentage");
|
|
339
356
|
cmd.option("--vitals-gate", "Halt rollout if crash rate exceeds configured threshold");
|
|
340
357
|
}
|
|
358
|
+
cmd.option("--changes-not-sent-for-review", "Commit changes without sending for review (required for rejected apps)");
|
|
359
|
+
cmd.option("--error-if-in-review", "Fail if changes are already in review instead of cancelling them");
|
|
341
360
|
cmd.action(async (options) => {
|
|
342
361
|
const config = await loadConfig();
|
|
343
362
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
@@ -404,7 +423,8 @@ function registerReleasesCommands(program) {
|
|
|
404
423
|
packageName,
|
|
405
424
|
options.track,
|
|
406
425
|
action,
|
|
407
|
-
options.to ? Number(options.to) / 100 : void 0
|
|
426
|
+
options.to ? Number(options.to) / 100 : void 0,
|
|
427
|
+
buildCommitOptions(options)
|
|
408
428
|
);
|
|
409
429
|
if (action === "increase" && options.vitalsGate) {
|
|
410
430
|
const threshold = config.vitals?.thresholds?.crashRate;
|
|
@@ -548,4 +568,4 @@ function registerReleasesCommands(program) {
|
|
|
548
568
|
export {
|
|
549
569
|
registerReleasesCommands
|
|
550
570
|
};
|
|
551
|
-
//# sourceMappingURL=releases-
|
|
571
|
+
//# sourceMappingURL=releases-LUAHKIMY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/releases.ts"],"sourcesContent":["import { appendFile, stat } from \"node:fs/promises\";\nimport { basename, extname } from \"node:path\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient, createReportingClient } from \"@gpc-cli/api\";\nimport type { RetryLogEntry, ExternallyHostedApk, UploadProgressEvent } from \"@gpc-cli/api\";\nimport {\n uploadRelease,\n getReleasesStatus,\n promoteRelease,\n updateRollout,\n readReleaseNotesFromDir,\n generateNotesFromGit,\n writeAuditLog,\n createAuditEntry,\n uploadExternallyHosted,\n diffReleases,\n fetchReleaseNotes,\n getVitalsCrashes,\n checkThreshold,\n GpcError,\n} from \"@gpc-cli/core\";\nimport { formatOutput, sortResults, createSpinner, maybePaginate } from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport {\n isInteractive,\n promptSelect,\n promptInput,\n requireOption,\n requireConfirm,\n} from \"../prompt.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n throw new GpcError(\n \"No package name. Use --app <package> or gpc config set app <package>\",\n \"RELEASES_USAGE_ERROR\",\n 2,\n \"Set a default app: gpc config set app <package>\",\n );\n }\n return name;\n}\n\nimport { buildCommitOptions } from \"../commit-options.js\";\n\nfunction createRetryLogger(retryLogPath?: string): ((entry: RetryLogEntry) => void) | undefined {\n if (!retryLogPath) return undefined;\n return (entry: RetryLogEntry) => {\n const line = JSON.stringify(entry) + \"\\n\";\n appendFile(retryLogPath, line).catch(() => {});\n };\n}\n\nasync function getClient(config: GpcConfig, retryLogPath?: string, uploadTimeout?: number) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth, onRetry: createRetryLogger(retryLogPath), uploadTimeout });\n}\n\nexport function registerReleasesCommands(program: Command): void {\n const releases = program.command(\"releases\").description(\"Manage releases and rollouts\");\n\n // Upload\n releases\n .command(\"upload <file>\")\n .description(\"Upload AAB/APK and assign to a track\")\n .option(\"--track <track>\", \"Target track\", \"internal\")\n .option(\"--rollout <percent>\", \"Staged rollout percentage (1-100)\")\n .option(\"--notes <text>\", \"Release notes (en-US)\")\n .option(\"--name <name>\", \"Release name\")\n .option(\"--mapping <file>\", \"ProGuard/R8 mapping file for deobfuscation\")\n .option(\"--notes-dir <dir>\", \"Read release notes from directory (<dir>/<lang>.txt)\")\n .option(\"--notes-from-git\", \"Generate release notes from git commit history\")\n .option(\"--copy-notes-from <track>\", \"Copy release notes from another track\")\n .option(\"--since <ref>\", \"Git ref to start from (tag, SHA) — used with --notes-from-git\")\n .option(\"--retry-log <path>\", \"Write retry log entries to file (JSONL)\")\n .option(\n \"--timeout <ms>\",\n \"Upload timeout in milliseconds (auto-scales with file size by default)\",\n parseInt,\n )\n .option(\"--status <status>\", \"Release status: completed, inProgress, draft, halted\", \"completed\")\n .option(\"--mapping-type <type>\", \"Deobfuscation file type: proguard or nativeCode\", \"proguard\")\n .option(\"--device-tier-config <id>\", \"Device tier config ID (or LATEST)\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review (required for rejected apps)\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review instead of cancelling them\")\n .action(async (file: string, options) => {\n try {\n await stat(file);\n } catch {\n throw new GpcError(\n `File not found: ${file}`,\n \"RELEASES_USAGE_ERROR\",\n 2,\n \"Check the file path and try again.\",\n );\n }\n\n const ext = extname(file).toLowerCase();\n if (ext !== \".aab\" && ext !== \".apk\") {\n throw new GpcError(\n `Expected .aab or .apk file, got \"${ext || \"(no extension)\"}\"`,\n \"RELEASES_USAGE_ERROR\",\n 2,\n \"Provide a .aab or .apk file.\",\n );\n }\n\n const noteSources = [\n options.notes,\n options.notesDir,\n options.notesFromGit,\n options.copyNotesFrom,\n ].filter(Boolean);\n if (noteSources.length > 1) {\n throw new GpcError(\n \"Cannot combine --notes, --notes-dir, --notes-from-git, and --copy-notes-from. Use only one.\",\n \"RELEASES_USAGE_ERROR\",\n 2,\n \"Pick one release notes source.\",\n );\n }\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n // Interactive mode: prompt for missing options\n if (isInteractive(program)) {\n if (!options.track || options.track === \"internal\") {\n const tracks = [\"internal\", \"alpha\", \"beta\", \"production\"];\n options.track = await promptSelect(\"Select track:\", tracks, \"internal\");\n }\n\n if (!options.rollout && options.track === \"production\") {\n const rolloutStr = await promptInput(\n \"Staged rollout percentage (1-100, blank for full)\",\n \"100\",\n );\n if (rolloutStr && rolloutStr !== \"100\") {\n options.rollout = rolloutStr;\n }\n }\n\n if (!options.notes && !options.notesDir) {\n const notes = await promptInput(\"Release notes (en-US, blank to skip)\");\n if (notes) options.notes = notes;\n }\n }\n\n if (options.rollout !== undefined) {\n const rollout = Number(options.rollout);\n if (!Number.isFinite(rollout) || rollout < 1 || rollout > 100) {\n throw new GpcError(\n `--rollout must be a number between 1 and 100 (got: ${options.rollout})`,\n \"RELEASES_USAGE_ERROR\",\n 2,\n \"Use a percentage between 1 and 100.\",\n );\n }\n }\n\n if (options.mappingType && options.mappingType !== \"proguard\" && options.mappingType !== \"nativeCode\") {\n throw new GpcError(\n `--mapping-type must be \"proguard\" or \"nativeCode\" (got: \"${options.mappingType}\")`,\n \"RELEASES_USAGE_ERROR\",\n 2,\n 'Use --mapping-type proguard (default) for ProGuard/R8 maps, or --mapping-type nativeCode for native debug symbols.',\n );\n }\n\n const { size: fileSize } = await stat(file);\n const jsonMode = format === \"json\";\n const client = await getClient(config, options.retryLog, options.timeout);\n\n const showProgress = !jsonMode && process.stderr.isTTY && !program.opts()[\"quiet\"];\n const sizeMB = (fileSize / (1024 * 1024)).toFixed(1);\n\n function formatBytes(bytes: number): string {\n if (bytes >= 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;\n if (bytes >= 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n if (bytes >= 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${bytes} B`;\n }\n\n const BAR_WIDTH = 20;\n const onUploadProgress = showProgress\n ? (event: UploadProgressEvent) => {\n const filled = Math.round((event.percent / 100) * BAR_WIDTH);\n const bar = \"█\".repeat(filled) + \"░\".repeat(BAR_WIDTH - filled);\n const uploaded = formatBytes(event.bytesUploaded);\n const total = formatBytes(event.totalBytes);\n const speed =\n event.bytesPerSecond > 0 ? `${formatBytes(event.bytesPerSecond)}/s` : \"...\";\n const eta = event.etaSeconds > 0 ? `ETA ${event.etaSeconds}s` : \"\";\n process.stderr.write(\n `\\r ${bar} ${event.percent}% ${uploaded}/${total} ${speed} ${eta}\\x1b[K`,\n );\n }\n : undefined;\n\n if (isDryRun(program)) {\n const result = await uploadRelease(client, packageName, file, {\n track: options.track,\n status: options.status,\n userFraction: options.rollout ? Number(options.rollout) / 100 : undefined,\n mappingFileType: options.mappingType,\n deviceTierConfigId: options.deviceTierConfig,\n dryRun: true,\n });\n console.log(formatOutput(result, format));\n return;\n }\n\n const auditEntry = createAuditEntry(\n \"releases upload\",\n {\n file,\n track: options.track,\n rollout: options.rollout,\n },\n packageName,\n );\n\n const spinner = createSpinner(`Uploading ${basename(file)} (${sizeMB} MB)...`);\n if (!showProgress) spinner.start();\n\n try {\n let releaseNotes: { language: string; text: string }[] | undefined;\n if (options.copyNotesFrom) {\n releaseNotes = await fetchReleaseNotes(client, packageName, options.copyNotesFrom);\n } else if (options.notesFromGit) {\n const gitNotes = await generateNotesFromGit({ since: options.since });\n releaseNotes = [{ language: gitNotes.language, text: gitNotes.text }];\n } else if (options.notesDir) {\n releaseNotes = await readReleaseNotesFromDir(options.notesDir);\n } else if (options.notes) {\n releaseNotes = [{ language: \"en-US\", text: options.notes }];\n }\n\n const result = await uploadRelease(client, packageName, file, {\n track: options.track,\n status: options.status,\n userFraction: options.rollout ? Number(options.rollout) / 100 : undefined,\n releaseNotes,\n releaseName: options.name,\n mappingFile: options.mapping,\n mappingFileType: options.mappingType,\n deviceTierConfigId: options.deviceTierConfig,\n onUploadProgress,\n commitOptions: buildCommitOptions(options),\n });\n if (showProgress) {\n process.stderr.write(`\\r ✓ Uploaded ${basename(file)} ${sizeMB} MB\\x1b[K\\n`);\n }\n spinner.stop(\"Upload complete\");\n console.log(formatOutput(result, format));\n auditEntry.success = true;\n } catch (error) {\n if (showProgress) {\n process.stderr.write(\"\\n\");\n }\n spinner.fail(\"Upload failed\");\n auditEntry.success = false;\n auditEntry.error = error instanceof Error ? error.message : String(error);\n throw error;\n } finally {\n auditEntry.durationMs = Date.now() - new Date(auditEntry.timestamp).getTime();\n writeAuditLog(auditEntry).catch(() => {});\n }\n });\n\n // Status\n releases\n .command(\"status\")\n .description(\"Show current release status across tracks\")\n .option(\"--track <track>\", \"Filter by track\")\n .option(\"--sort <field>\", \"Sort by field (prefix with - for descending)\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const TRACK_ORDER = [\"production\", \"beta\", \"alpha\", \"internal\"];\n const rawStatuses = await getReleasesStatus(client, packageName, options.track);\n const statuses = options.track\n ? Array.isArray(rawStatuses)\n ? rawStatuses.filter((s: any) => s.track === options.track)\n : rawStatuses\n : rawStatuses;\n const sorted = Array.isArray(statuses)\n ? options.sort\n ? sortResults(statuses, options.sort)\n : [...statuses].sort((a, b) => {\n const ai = TRACK_ORDER.indexOf(\n String((a as unknown as Record<string, unknown>)[\"track\"] ?? \"\"),\n );\n const bi = TRACK_ORDER.indexOf(\n String((b as unknown as Record<string, unknown>)[\"track\"] ?? \"\"),\n );\n return (ai === -1 ? 99 : ai) - (bi === -1 ? 99 : bi);\n })\n : statuses;\n if (format !== \"json\" && Array.isArray(sorted)) {\n const rows = sorted.map((s: unknown) => {\n const sr = s as Record<string, unknown>;\n return {\n track: sr[\"track\"] || \"-\",\n status: sr[\"status\"] || \"-\",\n name: sr[\"name\"] || \"-\",\n versionCodes: Array.isArray(sr[\"versionCodes\"])\n ? (sr[\"versionCodes\"] as unknown[]).join(\", \")\n : \"-\",\n userFraction:\n sr[\"userFraction\"] !== undefined\n ? `${Math.round(Number(sr[\"userFraction\"]) * 100)}%`\n : \"—\",\n };\n });\n await maybePaginate(formatOutput(rows, format));\n } else {\n await maybePaginate(formatOutput(sorted, format));\n }\n });\n\n // Promote\n releases\n .command(\"promote\")\n .description(\"Promote a release from one track to another\")\n .option(\"--from <track>\", \"Source track\")\n .option(\"--to <track>\", \"Target track\")\n .option(\"--rollout <percent>\", \"Staged rollout percentage\")\n .option(\"--notes <text>\", \"Release notes\")\n .option(\"--copy-notes-from <track>\", \"Copy release notes from another track\")\n .option(\"--status <status>\", \"Release status: completed, inProgress, draft, halted\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review (required for rejected apps)\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review instead of cancelling them\")\n .action(async (options) => {\n if (options.notes && options.copyNotesFrom) {\n throw new GpcError(\n \"Cannot combine --notes and --copy-notes-from. Use only one.\",\n \"RELEASES_USAGE_ERROR\",\n 2,\n \"Pick one release notes source.\",\n );\n }\n\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n const interactive = isInteractive(program);\n const tracks = [\"internal\", \"alpha\", \"beta\", \"production\"];\n\n options.from = await requireOption(\n \"from\",\n options.from,\n {\n message: \"Source track:\",\n choices: tracks,\n },\n interactive,\n );\n\n options.to = await requireOption(\n \"to\",\n options.to,\n {\n message: \"Target track:\",\n choices: tracks.filter((t: string) => t !== options.from),\n },\n interactive,\n );\n\n if (options.from === options.to) {\n throw new GpcError(\n `--from and --to must be different tracks (both are \"${options.from}\")`,\n \"RELEASES_USAGE_ERROR\",\n 2,\n \"Specify different source and target tracks.\",\n );\n }\n\n if (options.rollout !== undefined) {\n const rollout = Number(options.rollout);\n if (!Number.isFinite(rollout) || rollout < 1 || rollout > 100) {\n throw new GpcError(\n `--rollout must be a number between 1 and 100 (got: ${options.rollout})`,\n \"RELEASES_USAGE_ERROR\",\n 2,\n \"Use a percentage between 1 and 100.\",\n );\n }\n }\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"releases promote\",\n action: \"promote\",\n target: `${options.from} → ${options.to}`,\n details: { rollout: options.rollout, ...(options.status && { status: options.status }) },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n let releaseNotes: { language: string; text: string }[] | undefined;\n if (options.copyNotesFrom) {\n releaseNotes = await fetchReleaseNotes(client, packageName, options.copyNotesFrom);\n } else if (options.notes) {\n releaseNotes = [{ language: \"en-US\", text: options.notes }];\n }\n\n const result = await promoteRelease(client, packageName, options.from, options.to, {\n status: options.status,\n userFraction: options.rollout ? Number(options.rollout) / 100 : undefined,\n releaseNotes,\n commitOptions: buildCommitOptions(options),\n });\n console.log(formatOutput(result, format));\n });\n\n // Rollout subcommands\n const rollout = releases.command(\"rollout\").description(\"Manage staged rollouts\");\n\n for (const action of [\"increase\", \"halt\", \"resume\", \"complete\"] as const) {\n const cmd = rollout\n .command(action)\n .description(`${action.charAt(0).toUpperCase() + action.slice(1)} a staged rollout`)\n .option(\"--track <track>\", \"Track name\");\n\n if (action === \"increase\") {\n cmd.option(\"--to <percent>\", \"New rollout percentage\");\n cmd.option(\"--vitals-gate\", \"Halt rollout if crash rate exceeds configured threshold\");\n }\n\n cmd.option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review (required for rejected apps)\");\n cmd.option(\"--error-if-in-review\", \"Fail if changes are already in review instead of cancelling them\");\n\n cmd.action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n const interactive = isInteractive(program);\n const tracks = [\"internal\", \"alpha\", \"beta\", \"production\"];\n\n options.track = await requireOption(\n \"track\",\n options.track,\n {\n message: \"Track:\",\n choices: tracks,\n },\n interactive,\n );\n\n if (action === \"increase\") {\n options.to = await requireOption(\n \"to\",\n options.to,\n {\n message: \"New rollout percentage (1-100):\",\n },\n interactive,\n );\n }\n\n if (action === \"increase\" && options.to !== undefined) {\n const to = Number(options.to);\n if (!Number.isFinite(to) || to < 1 || to > 100) {\n throw new GpcError(\n `--to must be a number between 1 and 100 (got: ${options.to})`,\n \"RELEASES_USAGE_ERROR\",\n 2,\n \"Use a percentage between 1 and 100.\",\n );\n }\n }\n\n // Require confirmation for destructive rollout halt\n if (action === \"halt\") {\n await requireConfirm(\n `Halt rollout on track \"${options.track}\" for ${packageName}?`,\n program,\n );\n }\n\n if (isDryRun(program)) {\n if (action === \"increase\" && options.vitalsGate) {\n console.error(\n \"Warning: --vitals-gate is ignored in --dry-run mode. Gate will run on live execution.\",\n );\n }\n printDryRun(\n {\n command: `releases rollout ${action}`,\n action: action,\n target: options.track,\n details: { percentage: options.to !== undefined ? `${options.to}%` : undefined },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const result = await updateRollout(\n client,\n packageName,\n options.track,\n action,\n options.to ? Number(options.to) / 100 : undefined,\n buildCommitOptions(options),\n );\n\n // Vitals gate: check crash rate after rollout increase\n if (action === \"increase\" && options.vitalsGate) {\n const threshold = (config as any).vitals?.thresholds?.crashRate;\n if (!threshold) {\n console.error(\n \"Warning: --vitals-gate requires vitals.thresholds.crashRate in config. Skipping gate.\",\n );\n } else {\n try {\n const { auth: authConfig } = config;\n const vitalsAuth = await resolveAuth({\n serviceAccountPath: authConfig?.serviceAccount,\n });\n const reportingClient = createReportingClient({ auth: vitalsAuth });\n const vitalsResult = await getVitalsCrashes(reportingClient, packageName, {\n days: 1,\n });\n const latest = (vitalsResult as any).data?.[0]?.crashRate;\n const check = checkThreshold(latest, threshold);\n if (check.breached) {\n await updateRollout(client, packageName, options.track, \"halt\");\n console.error(\n `Vitals gate: crash rate ${String(latest)}% > threshold ${String(threshold)}%. Rollout halted.`,\n );\n process.exitCode = 6;\n }\n } catch (vitalsErr) {\n console.error(\n `Warning: Vitals gate check failed: ${vitalsErr instanceof Error ? vitalsErr.message : String(vitalsErr)}`,\n );\n }\n }\n }\n\n console.log(formatOutput(result, format));\n });\n }\n\n // Release notes\n releases\n .command(\"notes\")\n .description(\"Get or set release notes\")\n .argument(\"<action>\", \"Action: get|set\")\n .option(\"--track <track>\", \"Track name\")\n .option(\"--lang <language>\", \"Language code\", \"en-US\")\n .option(\"--notes <text>\", \"Release notes text\")\n .option(\"--file <path>\", \"Read notes from file\")\n .action(async (action: string, options) => {\n if (action === \"set\") {\n throw new GpcError(\n \"gpc releases notes set is not implemented as a standalone command.\",\n \"RELEASES_USAGE_ERROR\",\n 1,\n \"Use --notes, --notes-dir, or --notes-from-git with: gpc releases upload or gpc publish\",\n );\n }\n\n if (action === \"get\") {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n const track = options.track ?? \"internal\";\n\n // Try getReleasesStatus first (has all releases), then fallback to fetchReleaseNotes\n const statuses = await getReleasesStatus(client, packageName, track);\n let notes = Array.isArray(statuses)\n ? statuses.flatMap((s: any) => s.releaseNotes ?? [])\n : ((statuses as any).releaseNotes ?? []);\n\n // Fallback: fetchReleaseNotes reads the raw track data which may have notes\n // even when getReleasesStatus doesn't (e.g. completed releases)\n if (notes.length === 0) {\n try {\n notes = await fetchReleaseNotes(client, packageName, track);\n } catch {\n // No release found on track — fall through to empty message\n }\n }\n\n if (notes.length === 0) {\n console.log(`No release notes found on track \"${track}\".`);\n return;\n }\n console.log(formatOutput(notes, format));\n return;\n }\n\n throw new GpcError(\n \"Unknown action. Usage: gpc releases notes <get|set> --track <track>\",\n \"RELEASES_USAGE_ERROR\",\n 2,\n \"Use: gpc releases notes get --track <track>\",\n );\n });\n\n // Upload externally hosted APK\n releases\n .command(\"upload-external\")\n .description(\"Upload an externally hosted APK configuration\")\n .requiredOption(\"--url <url>\", \"External URL where the APK is hosted\")\n .requiredOption(\"--file <config>\", \"Path to JSON config file with APK metadata\")\n .action(async (options: { url: string; file: string }) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n const { readFile } = await import(\"node:fs/promises\");\n const raw = await readFile(options.file, \"utf-8\");\n const apkConfig = JSON.parse(raw) as Record<string, unknown>;\n\n // Override with CLI-provided URL\n apkConfig[\"externallyHostedUrl\"] = options.url;\n\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n const client = createApiClient({ auth });\n const result = await uploadExternallyHosted(\n client,\n packageName,\n apkConfig as unknown as ExternallyHostedApk,\n );\n console.log(formatOutput(result, format));\n });\n\n // Diff\n releases\n .command(\"diff\")\n .description(\"Compare releases between two tracks\")\n .option(\"--from <track>\", \"Source track\", \"internal\")\n .option(\"--to <track>\", \"Target track\", \"production\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const result = await diffReleases(client, packageName, options.from, options.to);\n if (result.diffs.length === 0) {\n console.log(`No differences between ${result.fromTrack} and ${result.toTrack}.`);\n } else {\n if (format === \"json\") {\n console.log(formatOutput(result, format));\n } else {\n console.log(`Differences: ${result.fromTrack} vs ${result.toTrack}\\n`);\n console.log(formatOutput(result.diffs, format));\n }\n }\n });\n\n // Count\n releases\n .command(\"count\")\n .description(\"Count releases per track\")\n .option(\"--track <track>\", \"Filter to a specific track\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const statuses = await getReleasesStatus(client, packageName, options.track);\n\n // Group by track\n const trackCounts = new Map<string, { total: number; statuses: Record<string, number> }>();\n for (const r of statuses) {\n const entry = trackCounts.get(r.track) ?? { total: 0, statuses: {} };\n entry.total++;\n entry.statuses[r.status] = (entry.statuses[r.status] ?? 0) + 1;\n trackCounts.set(r.track, entry);\n }\n\n if (format === \"json\") {\n const data = Object.fromEntries(\n [...trackCounts.entries()].map(([track, info]) => [track, info]),\n );\n console.log(formatOutput(data, format));\n } else {\n const rows = [...trackCounts.entries()].map(([track, info]) => ({\n track,\n releases: info.total,\n ...info.statuses,\n }));\n if (rows.length === 0) {\n console.log(\"No releases found.\");\n } else {\n console.log(formatOutput(rows, format));\n }\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,YAAY;AACjC,SAAS,UAAU,eAAe;AAGlC,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB,6BAA6B;AAEvD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc,aAAa,eAAe,qBAAqB;AAWxE,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAIA,SAAS,kBAAkB,cAAqE;AAC9F,MAAI,CAAC,aAAc,QAAO;AAC1B,SAAO,CAAC,UAAyB;AAC/B,UAAM,OAAO,KAAK,UAAU,KAAK,IAAI;AACrC,eAAW,cAAc,I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Ac,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,SAAS,MAAM,UAAU,MAAM;AACrC,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,UAAM,WAAW,MAAM,kBAAkB,QAAQ,aAAa,QAAQ,KAAK;AAG3E,UAAM,cAAc,oBAAI,IAAiE;AACzF,eAAW,KAAK,UAAU;AACxB,YAAM,QAAQ,YAAY,IAAI,EAAE,KAAK,KAAK,EAAE,OAAO,GAAG,UAAU,CAAC,EAAE;AACnE,YAAM;AACN,YAAM,SAAS,EAAE,MAAM,KAAK,MAAM,SAAS,EAAE,MAAM,KAAK,KAAK;AAC7D,kBAAY,IAAI,EAAE,OAAO,KAAK;AAAA,IAChC;AAEA,QAAI,WAAW,QAAQ;AACrB,YAAM,OAAO,OAAO;AAAA,QAClB,CAAC,GAAG,YAAY,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,IAAI,CAAC;AAAA,MACjE;AACA,cAAQ,IAAI,aAAa,MAAM,MAAM,CAAC;AAAA,IACxC,OAAO;AACL,YAAM,OAAO,CAAC,GAAG,YAAY,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO;AAAA,QAC9D;AAAA,QACA,UAAU,KAAK;AAAA,QACf,GAAG,KAAK;AAAA,MACV,EAAE;AACF,UAAI,KAAK,WAAW,GAAG;AACrB,gBAAQ,IAAI,oBAAoB;AAAA,MAClC,OAAO;AACL,gBAAQ,IAAI,aAAa,MAAM,MAAM,CAAC;AAAA,MACxC;AAAA,IACF;AAAA,EACF,CAAC;AACL;","names":["rollout"]}
|
package/dist/reports-CIB2T3XT.js
CHANGED
|
File without changes
|
package/dist/reviews-YCBBM656.js
CHANGED
|
File without changes
|
package/dist/rtdn-LID2B7XZ.js
CHANGED
|
File without changes
|
package/dist/status-3HXBBXG6.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
buildCommitOptions
|
|
4
|
+
} from "./chunk-A7VRCCNS.js";
|
|
2
5
|
import {
|
|
3
6
|
getClient,
|
|
4
7
|
resolvePackageName
|
|
@@ -61,7 +64,7 @@ function registerTestersCommands(program) {
|
|
|
61
64
|
console.log(formatOutput(result, format));
|
|
62
65
|
}
|
|
63
66
|
});
|
|
64
|
-
testers.command("add <emails...>").description("Add testers (Google Group emails) to a track").option("--track <track>", "Track name (e.g., internal, alpha, beta)").action(async (emails, options) => {
|
|
67
|
+
testers.command("add <emails...>").description("Add testers (Google Group emails) to a track").option("--track <track>", "Track name (e.g., internal, alpha, beta)").option("--changes-not-sent-for-review", "Commit changes without sending for review").option("--error-if-in-review", "Fail if changes are already in review").action(async (emails, options) => {
|
|
65
68
|
const config = await loadConfig();
|
|
66
69
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
67
70
|
const format = getOutputFormat(program, config);
|
|
@@ -89,10 +92,10 @@ function registerTestersCommands(program) {
|
|
|
89
92
|
return;
|
|
90
93
|
}
|
|
91
94
|
const client = await getClient(config);
|
|
92
|
-
const result = await addTesters(client, packageName, options.track, emails);
|
|
95
|
+
const result = await addTesters(client, packageName, options.track, emails, buildCommitOptions(options));
|
|
93
96
|
console.log(formatOutput(result, format));
|
|
94
97
|
});
|
|
95
|
-
testers.command("remove <emails...>").description("Remove testers (Google Group emails) from a track").option("--track <track>", "Track name (e.g., internal, alpha, beta)").action(async (emails, options) => {
|
|
98
|
+
testers.command("remove <emails...>").description("Remove testers (Google Group emails) from a track").option("--track <track>", "Track name (e.g., internal, alpha, beta)").option("--changes-not-sent-for-review", "Commit changes without sending for review").option("--error-if-in-review", "Fail if changes are already in review").action(async (emails, options) => {
|
|
96
99
|
const config = await loadConfig();
|
|
97
100
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
98
101
|
const format = getOutputFormat(program, config);
|
|
@@ -121,10 +124,10 @@ function registerTestersCommands(program) {
|
|
|
121
124
|
return;
|
|
122
125
|
}
|
|
123
126
|
const client = await getClient(config);
|
|
124
|
-
const result = await removeTesters(client, packageName, options.track, emails);
|
|
127
|
+
const result = await removeTesters(client, packageName, options.track, emails, buildCommitOptions(options));
|
|
125
128
|
console.log(formatOutput(result, format));
|
|
126
129
|
});
|
|
127
|
-
testers.command("import").description("Import testers from a CSV file").option("--track <track>", "Track name (e.g., internal, alpha, beta)").option("--file <path>", "CSV file with email addresses").action(async (options) => {
|
|
130
|
+
testers.command("import").description("Import testers from a CSV file").option("--track <track>", "Track name (e.g., internal, alpha, beta)").option("--file <path>", "CSV file with email addresses").option("--changes-not-sent-for-review", "Commit changes without sending for review").option("--error-if-in-review", "Fail if changes are already in review").action(async (options) => {
|
|
128
131
|
const config = await loadConfig();
|
|
129
132
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
130
133
|
const format = getOutputFormat(program, config);
|
|
@@ -160,11 +163,11 @@ function registerTestersCommands(program) {
|
|
|
160
163
|
return;
|
|
161
164
|
}
|
|
162
165
|
const client = await getClient(config);
|
|
163
|
-
const result = await importTestersFromCsv(client, packageName, options.track, options.file);
|
|
166
|
+
const result = await importTestersFromCsv(client, packageName, options.track, options.file, buildCommitOptions(options));
|
|
164
167
|
console.log(formatOutput({ added: result.added, testers: result.testers }, format));
|
|
165
168
|
});
|
|
166
169
|
}
|
|
167
170
|
export {
|
|
168
171
|
registerTestersCommands
|
|
169
172
|
};
|
|
170
|
-
//# sourceMappingURL=testers-
|
|
173
|
+
//# sourceMappingURL=testers-6CQL4KQV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/testers.ts"],"sourcesContent":["import { resolvePackageName, getClient } from \"../resolve.js\";\nimport type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport {\n listTesters,\n addTesters,\n removeTesters,\n importTestersFromCsv,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { isInteractive, requireOption, requireConfirm } from \"../prompt.js\";\nimport { buildCommitOptions } from \"../commit-options.js\";\n\n\n\nexport function registerTestersCommands(program: Command): void {\n const testers = program.command(\"testers\").description(\"Manage testers and tester groups\");\n\n testers\n .command(\"list\")\n .description(\"List testers for a track\")\n .option(\"--track <track>\", \"Track name (e.g., internal, alpha, beta)\")\n .option(\"--sort <field>\", \"Sort by field (prefix with - for descending, e.g., email or -email)\")\n .option(\"--limit <n>\", \"Maximum results to return\")\n .option(\"--next-page <token>\", \"Pagination token for next page\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.track = await requireOption(\n \"track\",\n options.track,\n {\n message: \"Track:\",\n choices: [\"internal\", \"alpha\", \"beta\"],\n },\n interactive,\n );\n\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const result = await listTesters(client, packageName, options.track);\n if (options.sort && result.googleGroups) {\n const descending = options.sort.startsWith(\"-\");\n result.googleGroups = [...result.googleGroups].sort((a: string, b: string) =>\n descending ? b.localeCompare(a) : a.localeCompare(b),\n );\n }\n if (format !== \"json\") {\n const groups = (result.googleGroups || []) as string[];\n const rows = groups.map((g: string) => ({ googleGroup: g }));\n if (rows.length > 0) {\n console.log(formatOutput(rows, format));\n } else {\n console.log(\"No testers found.\");\n }\n } else {\n console.log(formatOutput(result, format));\n }\n });\n\n testers\n .command(\"add <emails...>\")\n .description(\"Add testers (Google Group emails) to a track\")\n .option(\"--track <track>\", \"Track name (e.g., internal, alpha, beta)\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review\")\n .action(async (emails: string[], options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n const interactive = isInteractive(program);\n\n options.track = await requireOption(\n \"track\",\n options.track,\n {\n message: \"Track:\",\n choices: [\"internal\", \"alpha\", \"beta\"],\n },\n interactive,\n );\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"testers add\",\n action: \"add testers to\",\n target: options.track,\n details: { emails },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const result = await addTesters(client, packageName, options.track, emails, buildCommitOptions(options));\n console.log(formatOutput(result, format));\n });\n\n testers\n .command(\"remove <emails...>\")\n .description(\"Remove testers (Google Group emails) from a track\")\n .option(\"--track <track>\", \"Track name (e.g., internal, alpha, beta)\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review\")\n .action(async (emails: string[], options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n const interactive = isInteractive(program);\n\n options.track = await requireOption(\n \"track\",\n options.track,\n {\n message: \"Track:\",\n choices: [\"internal\", \"alpha\", \"beta\"],\n },\n interactive,\n );\n\n await requireConfirm(`Remove ${emails.length} tester(s) from ${options.track}?`, program);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"testers remove\",\n action: \"remove testers from\",\n target: options.track,\n details: { emails },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const result = await removeTesters(client, packageName, options.track, emails, buildCommitOptions(options));\n console.log(formatOutput(result, format));\n });\n\n testers\n .command(\"import\")\n .description(\"Import testers from a CSV file\")\n .option(\"--track <track>\", \"Track name (e.g., internal, alpha, beta)\")\n .option(\"--file <path>\", \"CSV file with email addresses\")\n .option(\"--changes-not-sent-for-review\", \"Commit changes without sending for review\")\n .option(\"--error-if-in-review\", \"Fail if changes are already in review\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n const interactive = isInteractive(program);\n\n options.track = await requireOption(\n \"track\",\n options.track,\n {\n message: \"Track:\",\n choices: [\"internal\", \"alpha\", \"beta\"],\n },\n interactive,\n );\n\n options.file = await requireOption(\n \"file\",\n options.file,\n {\n message: \"CSV file path:\",\n },\n interactive,\n );\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"testers import\",\n action: \"import testers to\",\n target: options.track,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const result = await importTestersFromCsv(client, packageName, options.track, options.file, buildCommitOptions(options));\n console.log(formatOutput({ added: result.added, testers: result.testers }, format));\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,SAAS,wBAAwB,SAAwB;AAC9D,QAAM,UAAU,QAAQ,QAAQ,SAAS,EAAE,YAAY,kCAAkC;AAEzF,UACG,QAAQ,MAAM,EACd,YAAY,0BAA0B,EACtC,OAAO,mBAAmB,0CAA0C,EACpE,OAAO,kBAAkB,qEAAqE,EAC9F,OAAO,eAAe,2BAA2B,EACjD,OAAO,uBAAuB,gCAAgC,EAC9D,OAAO,OAAO,YAAY;AACzB,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,cAAc,cAAc,OAAO;AAEzC,YAAQ,QAAQ,MAAM;AAAA,MACpB;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,QACE,SAAS;AAAA,QACT,SAAS,CAAC,YAAY,SAAS,MAAM;AAAA,MACvC;AAAA,MACA;AAAA,IACF;AAEA,UAAM,SAAS,MAAM,UAAU,MAAM;AACrC,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,UAAM,SAAS,MAAM,YAAY,QAAQ,aAAa,QAAQ,KAAK;AACnE,QAAI,QAAQ,QAAQ,OAAO,cAAc;AACvC,YAAM,aAAa,QAAQ,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