@gpc-cli/cli 0.9.20 → 0.9.21
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/bin.js +1 -1
- package/dist/{chunk-UT222YBA.js → chunk-6DB65GRP.js} +6 -6
- package/dist/{generated-apks-N4S5PIQH.js → generated-apks-VX7HYZDU.js} +17 -2
- package/dist/generated-apks-VX7HYZDU.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/{pricing-6VLYEGDL.js → pricing-BYZSLN74.js} +11 -6
- package/dist/pricing-BYZSLN74.js.map +1 -0
- package/dist/purchase-options-CKRN4VIW.js +40 -0
- package/dist/purchase-options-CKRN4VIW.js.map +1 -0
- package/dist/reports-Q7GFQ5GG.js +80 -0
- package/dist/reports-Q7GFQ5GG.js.map +1 -0
- package/dist/{subscriptions-6B265ZN4.js → subscriptions-Z5ZPVUFM.js} +5 -3
- package/dist/subscriptions-Z5ZPVUFM.js.map +1 -0
- package/package.json +4 -4
- package/dist/generated-apks-N4S5PIQH.js.map +0 -1
- package/dist/pricing-6VLYEGDL.js.map +0 -1
- package/dist/purchase-options-GXWKY6GF.js +0 -149
- package/dist/purchase-options-GXWKY6GF.js.map +0 -1
- package/dist/reports-ZFVKYI4C.js +0 -185
- package/dist/reports-ZFVKYI4C.js.map +0 -1
- package/dist/subscriptions-6B265ZN4.js.map +0 -1
- /package/dist/{chunk-UT222YBA.js.map → chunk-6DB65GRP.js.map} +0 -0
package/dist/bin.js
CHANGED
|
@@ -106,7 +106,7 @@ async function createProgram(pluginManager) {
|
|
|
106
106
|
(await import("./vitals-FE2V5OHW.js")).registerVitalsCommands(program);
|
|
107
107
|
},
|
|
108
108
|
subscriptions: async () => {
|
|
109
|
-
(await import("./subscriptions-
|
|
109
|
+
(await import("./subscriptions-Z5ZPVUFM.js")).registerSubscriptionsCommands(program);
|
|
110
110
|
},
|
|
111
111
|
iap: async () => {
|
|
112
112
|
(await import("./iap-VK5TU3Q2.js")).registerIapCommands(program);
|
|
@@ -115,10 +115,10 @@ async function createProgram(pluginManager) {
|
|
|
115
115
|
(await import("./purchases-NB5P4FL4.js")).registerPurchasesCommands(program);
|
|
116
116
|
},
|
|
117
117
|
pricing: async () => {
|
|
118
|
-
(await import("./pricing-
|
|
118
|
+
(await import("./pricing-BYZSLN74.js")).registerPricingCommands(program);
|
|
119
119
|
},
|
|
120
120
|
reports: async () => {
|
|
121
|
-
(await import("./reports-
|
|
121
|
+
(await import("./reports-Q7GFQ5GG.js")).registerReportsCommands(program);
|
|
122
122
|
},
|
|
123
123
|
users: async () => {
|
|
124
124
|
(await import("./users-KUVAYRJC.js")).registerUsersCommands(program);
|
|
@@ -153,10 +153,10 @@ async function createProgram(pluginManager) {
|
|
|
153
153
|
(await import("./internal-sharing-OS3HVIY5.js")).registerInternalSharingCommands(program);
|
|
154
154
|
},
|
|
155
155
|
"generated-apks": async () => {
|
|
156
|
-
(await import("./generated-apks-
|
|
156
|
+
(await import("./generated-apks-VX7HYZDU.js")).registerGeneratedApksCommands(program);
|
|
157
157
|
},
|
|
158
158
|
"purchase-options": async () => {
|
|
159
|
-
(await import("./purchase-options-
|
|
159
|
+
(await import("./purchase-options-CKRN4VIW.js")).registerPurchaseOptionsCommands(program);
|
|
160
160
|
},
|
|
161
161
|
migrate: async () => {
|
|
162
162
|
(await import("./migrate-V6G5YUVH.js")).registerMigrateCommands(program);
|
|
@@ -302,4 +302,4 @@ export {
|
|
|
302
302
|
createProgram,
|
|
303
303
|
handleCliError
|
|
304
304
|
};
|
|
305
|
-
//# sourceMappingURL=chunk-
|
|
305
|
+
//# sourceMappingURL=chunk-6DB65GRP.js.map
|
|
@@ -38,7 +38,22 @@ function registerGeneratedApksCommands(program) {
|
|
|
38
38
|
}
|
|
39
39
|
try {
|
|
40
40
|
const result = await listGeneratedApks(client, packageName, versionCode);
|
|
41
|
-
|
|
41
|
+
if (format !== "json") {
|
|
42
|
+
const apks = result["generatedApks"];
|
|
43
|
+
if (apks && apks.length > 0) {
|
|
44
|
+
const rows = apks.map((apk) => ({
|
|
45
|
+
id: apk["generatedApkId"] || "-",
|
|
46
|
+
variantId: apk["variantId"] || "-",
|
|
47
|
+
moduleName: apk["moduleName"] || "-",
|
|
48
|
+
sha256: String(apk["certificateSha256Fingerprint"] || "-").slice(0, 16) + "..."
|
|
49
|
+
}));
|
|
50
|
+
console.log(formatOutput(rows, format));
|
|
51
|
+
} else {
|
|
52
|
+
console.log("No generated APKs found.");
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
console.log(formatOutput(result, format));
|
|
56
|
+
}
|
|
42
57
|
} catch (error) {
|
|
43
58
|
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
44
59
|
process.exit(4);
|
|
@@ -72,4 +87,4 @@ function registerGeneratedApksCommands(program) {
|
|
|
72
87
|
export {
|
|
73
88
|
registerGeneratedApksCommands
|
|
74
89
|
};
|
|
75
|
-
//# sourceMappingURL=generated-apks-
|
|
90
|
+
//# sourceMappingURL=generated-apks-VX7HYZDU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/generated-apks.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n listGeneratedApks,\n downloadGeneratedApk,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerGeneratedApksCommands(program: Command): void {\n const cmd = program\n .command(\"generated-apks\")\n .description(\"Manage device-specific APKs generated by Google Play\");\n\n cmd\n .command(\"list <version-code>\")\n .description(\"List generated APKs for a version code\")\n .action(async (versionCodeStr: string) => {\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 versionCode = parseInt(versionCodeStr, 10);\n if (isNaN(versionCode)) {\n console.error(\"Error: version-code must be a number\");\n process.exit(2);\n }\n\n try {\n const result = await listGeneratedApks(client, packageName, versionCode);\n if (format !== \"json\") {\n const apks = (result as Record<string, unknown>)[\"generatedApks\"] as Array<Record<string, unknown>> | undefined;\n if (apks && apks.length > 0) {\n const rows = apks.map((apk) => ({\n id: apk[\"generatedApkId\"] || \"-\",\n variantId: apk[\"variantId\"] || \"-\",\n moduleName: apk[\"moduleName\"] || \"-\",\n sha256: String(apk[\"certificateSha256Fingerprint\"] || \"-\").slice(0, 16) + \"...\",\n }));\n console.log(formatOutput(rows, format));\n } else {\n console.log(\"No generated APKs found.\");\n }\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n cmd\n .command(\"download <version-code> <apk-id>\")\n .description(\"Download a generated APK\")\n .requiredOption(\"--output <path>\", \"Output file path\")\n .action(async (versionCodeStr: string, apkId: string, opts: { output: string }) => {\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 versionCode = parseInt(versionCodeStr, 10);\n if (isNaN(versionCode)) {\n console.error(\"Error: version-code must be a number\");\n process.exit(2);\n }\n\n try {\n const result = await downloadGeneratedApk(\n client,\n packageName,\n versionCode,\n apkId,\n opts.output,\n );\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;AAEA,SAAS,kBAA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,GAAG,EAAE,MAAM,GAAG,EAAE,IAAI;AAAA,UAC5E,EAAE;AACF,kBAAQ,IAAI,aAAa,MAAM,MAAM,CAAC;AAAA,QACxC,OAAO;AACL,kBAAQ,IAAI,0BAA0B;AAAA,QACxC;AAAA,MACF,OAAO;AACL,gBAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,MAC1C;AAAA,IACF,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAEH,MACG,QAAQ,kCAAkC,EAC1C,YAAY,0BAA0B,EACtC,eAAe,mBAAmB,kBAAkB,EACpD,OAAO,OAAO,gBAAwB,OAAe,SAA6B;AACjF,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,cAAc,SAAS,gBAAgB,EAAE;AAC/C,QAAI,MAAM,WAAW,GAAG;AACtB,cAAQ,MAAM,sCAAsC;AACpD,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,QAAI;AACF,YAAM,SAAS,MAAM;AAAA,QACnB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK;AAAA,MACP;AACA,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -51,11 +51,16 @@ function registerPricingCommands(program) {
|
|
|
51
51
|
if (format !== "json") {
|
|
52
52
|
const prices = result["convertedRegionPrices"];
|
|
53
53
|
if (prices) {
|
|
54
|
-
const rows = Object.entries(prices).map(([region,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
const rows = Object.entries(prices).map(([region, data]) => {
|
|
55
|
+
const money = data["price"];
|
|
56
|
+
const units = money?.["units"] || "0";
|
|
57
|
+
const nanos = String(money?.["nanos"] || 0).padStart(9, "0").slice(0, 2);
|
|
58
|
+
return {
|
|
59
|
+
region,
|
|
60
|
+
price: money ? `${units}.${nanos}` : data["priceMicros"] ? String(Number(data["priceMicros"]) / 1e6) : "-",
|
|
61
|
+
currencyCode: money?.["currencyCode"] || data["currencyCode"] || "-"
|
|
62
|
+
};
|
|
63
|
+
});
|
|
59
64
|
console.log(formatOutput(rows, format));
|
|
60
65
|
} else {
|
|
61
66
|
console.log(formatOutput(result, format));
|
|
@@ -72,4 +77,4 @@ function registerPricingCommands(program) {
|
|
|
72
77
|
export {
|
|
73
78
|
registerPricingCommands
|
|
74
79
|
};
|
|
75
|
-
//# sourceMappingURL=pricing-
|
|
80
|
+
//# sourceMappingURL=pricing-BYZSLN74.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/pricing.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport { convertRegionPrices, formatOutput } from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerPricingCommands(program: Command): void {\n const pricing = program.command(\"pricing\").description(\"Pricing and regional price conversion\");\n\n pricing\n .command(\"convert\")\n .description(\"Convert a price to all regional prices\")\n .option(\"--from <currency>\", \"Source currency code (e.g. USD)\")\n .option(\"--amount <number>\", \"Price amount (e.g. 4.99)\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const { isInteractive, requireOption } = await import(\"../prompt.js\");\n const interactive = isInteractive(program);\n\n options.from = await requireOption(\n \"from\",\n options.from,\n {\n message: \"Source currency code (e.g. USD):\",\n default: \"USD\",\n },\n interactive,\n );\n\n options.amount = await requireOption(\n \"amount\",\n options.amount,\n {\n message: \"Price amount (e.g. 4.99):\",\n },\n interactive,\n );\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await convertRegionPrices(client, packageName, options.from, options.amount);\n if (format !== \"json\") {\n const prices = (result as Record<string, unknown>)[\"convertedRegionPrices\"] as Record<string, Record<string, unknown>> | undefined;\n if (prices) {\n const rows = Object.entries(prices).map(([region, data]) => {\n const money = data[\"price\"] as Record<string, unknown> | undefined;\n const units = money?.[\"units\"] || \"0\";\n const nanos = String(money?.[\"nanos\"] || 0).padStart(9, \"0\").slice(0, 2);\n return {\n region,\n price: money ? `${units}.${nanos}` : (data[\"priceMicros\"] ? String(Number(data[\"priceMicros\"]) / 1_000_000) : \"-\"),\n currencyCode: (money?.[\"currencyCode\"] || data[\"currencyCode\"] || \"-\") as string,\n };\n });\n console.log(formatOutput(rows, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,qBAAqB,oBAAoB;AAGlD,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,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,kBAAM,QAAQ,KAAK,OAAO;AAC1B,kBAAM,QAAQ,QAAQ,OAAO,KAAK;AAClC,kBAAM,QAAQ,OAAO,QAAQ,OAAO,KAAK,CAAC,EAAE,SAAS,GAAG,GAAG,EAAE,MAAM,GAAG,CAAC;AACvE,mBAAO;AAAA,cACL;AAAA,cACA,OAAO,QAAQ,GAAG,KAAK,IAAI,KAAK,KAAM,KAAK,aAAa,IAAI,OAAO,OAAO,KAAK,aAAa,CAAC,IAAI,GAAS,IAAI;AAAA,cAC9G,cAAe,QAAQ,cAAc,KAAK,KAAK,cAAc,KAAK;AAAA,YACpE;AAAA,UACF,CAAC;AACD,kBAAQ,IAAI,aAAa,MAAM,MAAM,CAAC;AAAA,QACxC,OAAO;AACL,kBAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,QAC1C;AAAA,MACF,OAAO;AACL,gBAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,MAC1C;AAAA,IACF,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/commands/purchase-options.ts
|
|
4
|
+
var REDIRECT_MESSAGE = `Purchase options are managed through one-time product offers.
|
|
5
|
+
|
|
6
|
+
Use the following commands instead:
|
|
7
|
+
gpc otp offers list <product-id> List purchase options for a product
|
|
8
|
+
gpc otp offers get <product-id> <id> Get a specific purchase option
|
|
9
|
+
gpc otp offers create <product-id> Create a purchase option
|
|
10
|
+
gpc otp offers activate <product-id> <id>
|
|
11
|
+
gpc otp offers deactivate <product-id> <id>
|
|
12
|
+
|
|
13
|
+
See: gpc otp offers --help`;
|
|
14
|
+
function registerPurchaseOptionsCommands(program) {
|
|
15
|
+
const po = program.command("purchase-options").description("Manage purchase options (use 'otp offers' commands)");
|
|
16
|
+
po.command("list").description("List purchase options").option("--sort <field>", "Sort by field").action(async () => {
|
|
17
|
+
console.log(REDIRECT_MESSAGE);
|
|
18
|
+
process.exit(2);
|
|
19
|
+
});
|
|
20
|
+
po.command("get <id>").description("Get a purchase option").action(async () => {
|
|
21
|
+
console.log(REDIRECT_MESSAGE);
|
|
22
|
+
process.exit(2);
|
|
23
|
+
});
|
|
24
|
+
po.command("create").description("Create a purchase option").option("--file <path>", "JSON file with purchase option data").action(async () => {
|
|
25
|
+
console.log(REDIRECT_MESSAGE);
|
|
26
|
+
process.exit(2);
|
|
27
|
+
});
|
|
28
|
+
po.command("activate <id>").description("Activate a purchase option").action(async () => {
|
|
29
|
+
console.log(REDIRECT_MESSAGE);
|
|
30
|
+
process.exit(2);
|
|
31
|
+
});
|
|
32
|
+
po.command("deactivate <id>").description("Deactivate a purchase option").action(async () => {
|
|
33
|
+
console.log(REDIRECT_MESSAGE);
|
|
34
|
+
process.exit(2);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
registerPurchaseOptionsCommands
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=purchase-options-CKRN4VIW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/purchase-options.ts"],"sourcesContent":["import type { Command } from \"commander\";\n\nconst REDIRECT_MESSAGE = `Purchase options are managed through one-time product offers.\n\nUse the following commands instead:\n gpc otp offers list <product-id> List purchase options for a product\n gpc otp offers get <product-id> <id> Get a specific purchase option\n gpc otp offers create <product-id> Create a purchase option\n gpc otp offers activate <product-id> <id>\n gpc otp offers deactivate <product-id> <id>\n\nSee: gpc otp offers --help`;\n\nexport function registerPurchaseOptionsCommands(program: Command): void {\n const po = program\n .command(\"purchase-options\")\n .description(\"Manage purchase options (use 'otp offers' commands)\");\n\n po.command(\"list\")\n .description(\"List purchase options\")\n .option(\"--sort <field>\", \"Sort by field\")\n .action(async () => {\n console.log(REDIRECT_MESSAGE);\n process.exit(2);\n });\n\n po.command(\"get <id>\")\n .description(\"Get a purchase option\")\n .action(async () => {\n console.log(REDIRECT_MESSAGE);\n process.exit(2);\n });\n\n po.command(\"create\")\n .description(\"Create a purchase option\")\n .option(\"--file <path>\", \"JSON file with purchase option data\")\n .action(async () => {\n console.log(REDIRECT_MESSAGE);\n process.exit(2);\n });\n\n po.command(\"activate <id>\")\n .description(\"Activate a purchase option\")\n .action(async () => {\n console.log(REDIRECT_MESSAGE);\n process.exit(2);\n });\n\n po.command(\"deactivate <id>\")\n .description(\"Deactivate a purchase option\")\n .action(async () => {\n console.log(REDIRECT_MESSAGE);\n process.exit(2);\n });\n}\n"],"mappings":";;;AAEA,IAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWlB,SAAS,gCAAgC,SAAwB;AACtE,QAAM,KAAK,QACR,QAAQ,kBAAkB,EAC1B,YAAY,qDAAqD;AAEpE,KAAG,QAAQ,MAAM,EACd,YAAY,uBAAuB,EACnC,OAAO,kBAAkB,eAAe,EACxC,OAAO,YAAY;AAClB,YAAQ,IAAI,gBAAgB;AAC5B,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AAEH,KAAG,QAAQ,UAAU,EAClB,YAAY,uBAAuB,EACnC,OAAO,YAAY;AAClB,YAAQ,IAAI,gBAAgB;AAC5B,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AAEH,KAAG,QAAQ,QAAQ,EAChB,YAAY,0BAA0B,EACtC,OAAO,iBAAiB,qCAAqC,EAC7D,OAAO,YAAY;AAClB,YAAQ,IAAI,gBAAgB;AAC5B,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AAEH,KAAG,QAAQ,eAAe,EACvB,YAAY,4BAA4B,EACxC,OAAO,YAAY;AAClB,YAAQ,IAAI,gBAAgB;AAC5B,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AAEH,KAAG,QAAQ,iBAAiB,EACzB,YAAY,8BAA8B,EAC1C,OAAO,YAAY;AAClB,YAAQ,IAAI,gBAAgB;AAC5B,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACL;","names":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/commands/reports.ts
|
|
4
|
+
import {
|
|
5
|
+
parseMonth,
|
|
6
|
+
isValidReportType,
|
|
7
|
+
isFinancialReportType,
|
|
8
|
+
isStatsReportType
|
|
9
|
+
} from "@gpc-cli/core";
|
|
10
|
+
var FINANCIAL_REPORT_MESSAGE = `Financial reports (earnings, sales, estimated_sales, play_balance) are not available through the Google Play Developer API.
|
|
11
|
+
|
|
12
|
+
These reports are delivered as CSV files in Google Cloud Storage buckets.
|
|
13
|
+
To access them:
|
|
14
|
+
1. Open Google Play Console \u2192 "Download reports" \u2192 "Financial"
|
|
15
|
+
2. For programmatic access, use the GCS bucket URI shown in Play Console
|
|
16
|
+
with the Google Cloud Storage API or gsutil.
|
|
17
|
+
|
|
18
|
+
See: https://support.google.com/googleplay/android-developer/answer/6135870`;
|
|
19
|
+
var STATS_REPORT_MESSAGE = `Stats reports (installs, crashes, ratings, reviews, store_performance, subscriptions) are not available through the Google Play Developer API as downloadable CSVs.
|
|
20
|
+
|
|
21
|
+
These reports are delivered as CSV files in Google Cloud Storage buckets.
|
|
22
|
+
To access them:
|
|
23
|
+
1. Open Google Play Console \u2192 "Download reports" \u2192 "Statistics"
|
|
24
|
+
2. For programmatic access, use the GCS bucket URI shown in Play Console
|
|
25
|
+
with the Google Cloud Storage API or gsutil.
|
|
26
|
+
|
|
27
|
+
For real-time crash and ANR metrics, use:
|
|
28
|
+
gpc vitals crashes
|
|
29
|
+
gpc vitals anr
|
|
30
|
+
gpc vitals overview
|
|
31
|
+
|
|
32
|
+
See: https://support.google.com/googleplay/android-developer/answer/6135870`;
|
|
33
|
+
function registerReportsCommands(program) {
|
|
34
|
+
const reports = program.command("reports").description("Financial and stats reports (via Google Cloud Storage)");
|
|
35
|
+
reports.command("list <report-type>").description("List available reports").option("--month <YYYY-MM>", "Report month (e.g., 2026-03)").option("--limit <n>", "Maximum results to return").option("--next-page <token>", "Pagination token for next page").action(async (reportType, options) => {
|
|
36
|
+
if (!isValidReportType(reportType)) {
|
|
37
|
+
console.error(
|
|
38
|
+
`Error: Invalid report type "${reportType}". Valid types: earnings, sales, estimated_sales, installs, crashes, ratings, reviews, store_performance, subscriptions, play_balance`
|
|
39
|
+
);
|
|
40
|
+
process.exit(2);
|
|
41
|
+
}
|
|
42
|
+
if (options.month) {
|
|
43
|
+
parseMonth(options.month);
|
|
44
|
+
}
|
|
45
|
+
if (isFinancialReportType(reportType)) {
|
|
46
|
+
console.log(FINANCIAL_REPORT_MESSAGE);
|
|
47
|
+
} else {
|
|
48
|
+
console.log(STATS_REPORT_MESSAGE);
|
|
49
|
+
}
|
|
50
|
+
process.exit(1);
|
|
51
|
+
});
|
|
52
|
+
const download = reports.command("download").description("Download a report");
|
|
53
|
+
download.command("financial").description("Download a financial report").option("--month <YYYY-MM>", "Report month (e.g., 2026-03)").option("--type <report-type>", "Report type", "earnings").option("--output-file <path>", "Save to file instead of stdout").action(async (options) => {
|
|
54
|
+
if (options.type && !isFinancialReportType(options.type)) {
|
|
55
|
+
console.error(
|
|
56
|
+
`Error: Invalid financial report type "${options.type}". Valid types: earnings, sales, estimated_sales, play_balance`
|
|
57
|
+
);
|
|
58
|
+
process.exit(2);
|
|
59
|
+
}
|
|
60
|
+
console.log(FINANCIAL_REPORT_MESSAGE);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
});
|
|
63
|
+
download.command("stats").description("Download a stats report").option("--month <YYYY-MM>", "Report month (e.g., 2026-03)").option(
|
|
64
|
+
"--type <report-type>",
|
|
65
|
+
"Report type (installs, crashes, ratings, reviews, store_performance, subscriptions)"
|
|
66
|
+
).option("--output-file <path>", "Save to file instead of stdout").action(async (options) => {
|
|
67
|
+
if (options.type && !isStatsReportType(options.type)) {
|
|
68
|
+
console.error(
|
|
69
|
+
`Error: Invalid stats report type "${options.type}". Valid types: installs, crashes, ratings, reviews, store_performance, subscriptions`
|
|
70
|
+
);
|
|
71
|
+
process.exit(2);
|
|
72
|
+
}
|
|
73
|
+
console.log(STATS_REPORT_MESSAGE);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
registerReportsCommands
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=reports-Q7GFQ5GG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/reports.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport {\n parseMonth,\n isValidReportType,\n isFinancialReportType,\n isStatsReportType,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\n\nconst FINANCIAL_REPORT_MESSAGE = `Financial reports (earnings, sales, estimated_sales, play_balance) are not available through the Google Play Developer API.\n\nThese reports are delivered as CSV files in Google Cloud Storage buckets.\nTo access them:\n 1. Open Google Play Console → \"Download reports\" → \"Financial\"\n 2. For programmatic access, use the GCS bucket URI shown in Play Console\n with the Google Cloud Storage API or gsutil.\n\nSee: https://support.google.com/googleplay/android-developer/answer/6135870`;\n\nconst STATS_REPORT_MESSAGE = `Stats reports (installs, crashes, ratings, reviews, store_performance, subscriptions) are not available through the Google Play Developer API as downloadable CSVs.\n\nThese reports are delivered as CSV files in Google Cloud Storage buckets.\nTo access them:\n 1. Open Google Play Console → \"Download reports\" → \"Statistics\"\n 2. For programmatic access, use the GCS bucket URI shown in Play Console\n with the Google Cloud Storage API or gsutil.\n\nFor real-time crash and ANR metrics, use:\n gpc vitals crashes\n gpc vitals anr\n gpc vitals overview\n\nSee: https://support.google.com/googleplay/android-developer/answer/6135870`;\n\nexport function registerReportsCommands(program: Command): void {\n const reports = program.command(\"reports\").description(\"Financial and stats reports (via Google Cloud Storage)\");\n\n reports\n .command(\"list <report-type>\")\n .description(\"List available reports\")\n .option(\"--month <YYYY-MM>\", \"Report month (e.g., 2026-03)\")\n .option(\"--limit <n>\", \"Maximum results to return\")\n .option(\"--next-page <token>\", \"Pagination token for next page\")\n .action(async (reportType: string, options) => {\n if (!isValidReportType(reportType)) {\n console.error(\n `Error: Invalid report type \"${reportType}\". Valid types: earnings, sales, estimated_sales, installs, crashes, ratings, reviews, store_performance, subscriptions, play_balance`,\n );\n process.exit(2);\n }\n\n // Validate month format if provided\n if (options.month) {\n parseMonth(options.month);\n }\n\n if (isFinancialReportType(reportType)) {\n console.log(FINANCIAL_REPORT_MESSAGE);\n } else {\n console.log(STATS_REPORT_MESSAGE);\n }\n process.exit(1);\n });\n\n const download = reports.command(\"download\").description(\"Download a report\");\n\n download\n .command(\"financial\")\n .description(\"Download a financial report\")\n .option(\"--month <YYYY-MM>\", \"Report month (e.g., 2026-03)\")\n .option(\"--type <report-type>\", \"Report type\", \"earnings\")\n .option(\"--output-file <path>\", \"Save to file instead of stdout\")\n .action(async (options) => {\n if (options.type && !isFinancialReportType(options.type)) {\n console.error(\n `Error: Invalid financial report type \"${options.type}\". Valid types: earnings, sales, estimated_sales, play_balance`,\n );\n process.exit(2);\n }\n\n console.log(FINANCIAL_REPORT_MESSAGE);\n process.exit(1);\n });\n\n download\n .command(\"stats\")\n .description(\"Download a stats report\")\n .option(\"--month <YYYY-MM>\", \"Report month (e.g., 2026-03)\")\n .option(\n \"--type <report-type>\",\n \"Report type (installs, crashes, ratings, reviews, store_performance, subscriptions)\",\n )\n .option(\"--output-file <path>\", \"Save to file instead of stdout\")\n .action(async (options) => {\n if (options.type && !isStatsReportType(options.type)) {\n console.error(\n `Error: Invalid stats report type \"${options.type}\". Valid types: installs, crashes, ratings, reviews, store_performance, subscriptions`,\n );\n process.exit(2);\n }\n\n console.log(STATS_REPORT_MESSAGE);\n process.exit(1);\n });\n}\n"],"mappings":";;;AACA;AAAA,EACE;AAAA,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AK,CAAC;AAAA,EAChB,CAAC;AAEH,WACG,QAAQ,OAAO,EACf,YAAY,yBAAyB,EACrC,OAAO,qBAAqB,8BAA8B,EAC1D;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,OAAO,wBAAwB,gCAAgC,EAC/D,OAAO,OAAO,YAAY;AACzB,QAAI,QAAQ,QAAQ,CAAC,kBAAkB,QAAQ,IAAI,GAAG;AACpD,cAAQ;AAAA,QACN,qCAAqC,QAAQ,IAAI;AAAA,MACnD;AACA,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,YAAQ,IAAI,oBAAoB;AAChC,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACL;","names":[]}
|
|
@@ -95,12 +95,14 @@ function registerSubscriptionsCommands(program) {
|
|
|
95
95
|
const s = result;
|
|
96
96
|
const basePlans2 = s["basePlans"];
|
|
97
97
|
const listings = s["listings"];
|
|
98
|
+
const listingLanguages = listings ? Array.isArray(listings) ? listings.map((l) => l["languageCode"] || l["language"] || "?").join(", ") : Object.keys(listings).join(", ") : "-";
|
|
99
|
+
const listingCount = listings ? Array.isArray(listings) ? listings.length : Object.keys(listings).length : 0;
|
|
98
100
|
const summary = {
|
|
99
101
|
productId: s["productId"],
|
|
100
102
|
basePlans: basePlans2?.length || 0,
|
|
101
103
|
basePlanIds: basePlans2?.map((bp) => bp["basePlanId"]).join(", ") || "-",
|
|
102
|
-
listings:
|
|
103
|
-
listingLanguages
|
|
104
|
+
listings: listingCount,
|
|
105
|
+
listingLanguages,
|
|
104
106
|
taxCategory: s["taxAndComplianceSettings"]?.["taxRateInfoByRegionCode"] ? "configured" : "-"
|
|
105
107
|
};
|
|
106
108
|
console.log(formatOutput(summary, format));
|
|
@@ -525,4 +527,4 @@ function registerSubscriptionsCommands(program) {
|
|
|
525
527
|
export {
|
|
526
528
|
registerSubscriptionsCommands
|
|
527
529
|
};
|
|
528
|
-
//# sourceMappingURL=subscriptions-
|
|
530
|
+
//# sourceMappingURL=subscriptions-Z5ZPVUFM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/subscriptions.ts"],"sourcesContent":["import type { GpcConfig } from \"@gpc-cli/config\";\nimport type { Command } from \"commander\";\nimport { Option } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport type { Subscription } from \"@gpc-cli/api\";\nimport {\n listSubscriptions,\n getSubscription,\n createSubscription,\n updateSubscription,\n deleteSubscription,\n activateBasePlan,\n deactivateBasePlan,\n deleteBasePlan,\n migratePrices,\n listOffers,\n getOffer,\n createOffer,\n updateOffer,\n deleteOffer,\n activateOffer,\n deactivateOffer,\n diffSubscription,\n formatOutput,\n sortResults,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { requireConfirm } from \"../prompt.js\";\nimport { readJsonFile } from \"../json.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerSubscriptionsCommands(program: Command): void {\n const subs = program.command(\"subscriptions\").description(\"Manage subscriptions and base plans\");\n\n subs\n .command(\"list\")\n .description(\"List subscriptions\")\n .addOption(new Option(\"--page-size <n>\", \"Results per page\").argParser(parseInt).hideHelp())\n .addOption(new Option(\"--page-token <token>\", \"Page token\").hideHelp())\n .option(\"--limit <n>\", \"Maximum total results\", parseInt)\n .option(\"--next-page <token>\", \"Resume from page token\")\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 try {\n const result = await listSubscriptions(client, packageName, {\n pageSize: options.pageSize,\n pageToken: options.pageToken,\n limit: options.limit,\n nextPage: options.nextPage,\n });\n if (options.sort) {\n result.subscriptions = sortResults(result.subscriptions, options.sort);\n }\n if (format !== \"json\") {\n const summary = (result.subscriptions || []).map((s: Subscription) => ({\n productId: s.productId,\n basePlans: s.basePlans?.length || 0,\n listings: s.listings ? Object.keys(s.listings).length : 0,\n firstBasePlanState: s.basePlans?.[0]?.state || \"-\",\n }));\n console.log(formatOutput(summary, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n subs\n .command(\"get <product-id>\")\n .description(\"Get a subscription\")\n .action(async (productId: string) => {\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 try {\n const result = await getSubscription(client, packageName, productId);\n if (format !== \"json\") {\n const s = result as Record<string, unknown>;\n const basePlans = s[\"basePlans\"] as Array<Record<string, unknown>> | undefined;\n const listings = s[\"listings\"] as Record<string, unknown> | Array<Record<string, unknown>> | undefined;\n const listingLanguages = listings\n ? Array.isArray(listings)\n ? listings.map((l) => l[\"languageCode\"] || l[\"language\"] || \"?\").join(\", \")\n : Object.keys(listings).join(\", \")\n : \"-\";\n const listingCount = listings\n ? Array.isArray(listings) ? listings.length : Object.keys(listings).length\n : 0;\n const summary = {\n productId: s[\"productId\"],\n basePlans: basePlans?.length || 0,\n basePlanIds: basePlans?.map((bp) => bp[\"basePlanId\"]).join(\", \") || \"-\",\n listings: listingCount,\n listingLanguages,\n taxCategory: (s[\"taxAndComplianceSettings\"] as Record<string, unknown>)?.[\"taxRateInfoByRegionCode\"] ? \"configured\" : \"-\",\n };\n console.log(formatOutput(summary, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n subs\n .command(\"create\")\n .description(\"Create a subscription from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with subscription data\")\n .option(\"--activate\", \"Activate all base plans after creation\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions create\",\n action: \"create\",\n target: `subscription from ${options.file}`,\n details: options.activate ? { activate: true } : undefined,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await createSubscription(client, packageName, data as any);\n\n if (options.activate && result.basePlans) {\n for (const bp of result.basePlans) {\n if (bp.state === \"DRAFT\") {\n await activateBasePlan(client, packageName, result.productId, bp.basePlanId);\n console.error(`Activated base plan: ${bp.basePlanId}`);\n }\n }\n // Re-fetch to get updated state\n const updated = await getSubscription(client, packageName, result.productId);\n console.log(formatOutput(updated, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n subs\n .command(\"update <product-id>\")\n .description(\"Update a subscription from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with subscription data\")\n .option(\"--update-mask <fields>\", \"Comma-separated field mask\")\n .action(async (productId: string, options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions update\",\n action: \"update\",\n target: productId,\n details: { file: options.file, updateMask: options.updateMask },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await updateSubscription(\n client,\n packageName,\n productId,\n data as any,\n options.updateMask,\n );\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n subs\n .command(\"delete <product-id>\")\n .description(\"Delete a subscription\")\n .action(async (productId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(`Delete subscription \"${productId}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"subscriptions delete\",\n action: \"delete\",\n target: productId,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n await deleteSubscription(client, packageName, productId);\n console.log(`Subscription ${productId} deleted.`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // --- Base Plans ---\n const basePlans = subs.command(\"base-plans\").description(\"Manage base plans\");\n\n basePlans\n .command(\"activate <product-id> <base-plan-id>\")\n .description(\"Activate a base plan\")\n .action(async (productId: string, basePlanId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions base-plans activate\",\n action: \"activate\",\n target: `${productId}/${basePlanId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await activateBasePlan(client, packageName, productId, basePlanId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n basePlans\n .command(\"deactivate <product-id> <base-plan-id>\")\n .description(\"Deactivate a base plan\")\n .action(async (productId: string, basePlanId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions base-plans deactivate\",\n action: \"deactivate\",\n target: `${productId}/${basePlanId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await deactivateBasePlan(client, packageName, productId, basePlanId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n basePlans\n .command(\"delete <product-id> <base-plan-id>\")\n .description(\"Delete a base plan\")\n .action(async (productId: string, basePlanId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(\n `Delete base plan \"${basePlanId}\" from subscription \"${productId}\"?`,\n program,\n );\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"subscriptions base-plans delete\",\n action: \"delete\",\n target: `${productId}/${basePlanId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n await deleteBasePlan(client, packageName, productId, basePlanId);\n console.log(`Base plan ${basePlanId} deleted.`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n basePlans\n .command(\"migrate-prices <product-id> <base-plan-id>\")\n .description(\"Migrate base plan prices\")\n .requiredOption(\"--file <path>\", \"JSON file with migration data\")\n .action(\n async (\n productId: string,\n basePlanId: string,\n options: { file: string; updateMask?: string },\n ) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions base-plans migrate-prices\",\n action: \"migrate prices for\",\n target: `${productId}/${basePlanId}`,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await migratePrices(client, packageName, productId, basePlanId, data as any);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n },\n );\n\n // --- Offers ---\n const offers = subs.command(\"offers\").description(\"Manage subscription offers\");\n\n offers\n .command(\"list <product-id> <base-plan-id>\")\n .description(\"List offers for a base plan\")\n .action(async (productId: string, basePlanId: string) => {\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 try {\n const result = await listOffers(client, packageName, productId, basePlanId);\n const offers_list = (result as Record<string, unknown>)[\"subscriptionOffers\"] as Array<Record<string, unknown>> | undefined;\n if (format !== \"json\") {\n if (!offers_list || offers_list.length === 0) {\n console.log(\"No offers found.\");\n return;\n }\n const summary = offers_list.map((o) => ({\n offerId: o[\"offerId\"],\n basePlanId: o[\"basePlanId\"],\n state: o[\"state\"] || \"-\",\n phases: (o[\"phases\"] as unknown[])?.length || 0,\n regionalConfigs: (o[\"regionalConfigs\"] as unknown[])?.length || 0,\n }));\n console.log(formatOutput(summary, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n offers\n .command(\"get <product-id> <base-plan-id> <offer-id>\")\n .description(\"Get an offer\")\n .action(async (productId: string, basePlanId: string, offerId: string) => {\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 try {\n const result = await getOffer(client, packageName, productId, basePlanId, offerId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n offers\n .command(\"create <product-id> <base-plan-id>\")\n .description(\"Create an offer from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with offer data\")\n .action(\n async (\n productId: string,\n basePlanId: string,\n options: { file: string; updateMask?: string },\n ) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions offers create\",\n action: \"create offer for\",\n target: `${productId}/${basePlanId}`,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await createOffer(client, packageName, productId, basePlanId, data as any);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n },\n );\n\n offers\n .command(\"update <product-id> <base-plan-id> <offer-id>\")\n .description(\"Update an offer from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with offer data\")\n .option(\"--update-mask <fields>\", \"Comma-separated field mask\")\n .action(\n async (\n productId: string,\n basePlanId: string,\n offerId: string,\n options: { file: string; updateMask?: string },\n ) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions offers update\",\n action: \"update offer\",\n target: `${productId}/${basePlanId}/${offerId}`,\n details: { file: options.file, updateMask: options.updateMask },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await updateOffer(\n client,\n packageName,\n productId,\n basePlanId,\n offerId,\n data as any,\n options.updateMask,\n );\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n },\n );\n\n offers\n .command(\"delete <product-id> <base-plan-id> <offer-id>\")\n .description(\"Delete an offer\")\n .action(async (productId: string, basePlanId: string, offerId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(`Delete offer \"${offerId}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"subscriptions offers delete\",\n action: \"delete offer\",\n target: `${productId}/${basePlanId}/${offerId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n await deleteOffer(client, packageName, productId, basePlanId, offerId);\n console.log(`Offer ${offerId} deleted.`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n offers\n .command(\"activate <product-id> <base-plan-id> <offer-id>\")\n .description(\"Activate an offer\")\n .action(async (productId: string, basePlanId: string, offerId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions offers activate\",\n action: \"activate offer\",\n target: `${productId}/${basePlanId}/${offerId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await activateOffer(client, packageName, productId, basePlanId, offerId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n offers\n .command(\"deactivate <product-id> <base-plan-id> <offer-id>\")\n .description(\"Deactivate an offer\")\n .action(async (productId: string, basePlanId: string, offerId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions offers deactivate\",\n action: \"deactivate offer\",\n target: `${productId}/${basePlanId}/${offerId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await deactivateOffer(client, packageName, productId, basePlanId, offerId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // --- Diff ---\n subs\n .command(\"diff <product-id>\")\n .description(\"Compare local JSON file against remote subscription\")\n .requiredOption(\"--file <path>\", \"Local JSON file to compare against remote\")\n .action(async (productId: string, options: { file: string }) => {\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 try {\n const localData = await readJsonFile(options.file) as Subscription;\n const diffs = await diffSubscription(client, packageName, productId, localData);\n if (diffs.length === 0) {\n console.log(\"No differences found.\");\n } else {\n console.log(formatOutput(diffs, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAEhC;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,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,8BAA8B,SAAwB;AACpE,QAAM,OAAO,QAAQ,QAAQ,eAAe,EAAE,YAAY,qCAAqC;AAE/F,OACG,QAAQ,MAAM,EACd,YAAY,oBAAoB,EAChC,UAAU,IAAI,OAAO,mBAAmB,kBAAkB,EAAE,UAAU,QAAQ,EAAE,SAAS,CAAC,EAC1F,UAAU,IAAI,OAAO,wBAAwB,YAAY,EAAE,SAAS,CAAC,EACrE,OAAO,eAAe,yBAAyB,QAAQ,EACvD,OAAO,uBAAuB,wBAAwB,EACtD,OAAO,kBAAkB,8CAA8C,EACvE,OAAO,OAAO,YAAY;AACzB,UAAM,S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,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAGH,OACG,QAAQ,mBAAmB,EAC3B,YAAY,qDAAqD,EACjE,eAAe,iBAAiB,2CAA2C,EAC3E,OAAO,OAAO,WAAmB,YAA8B;AAC9D,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,QAAI;AACF,YAAM,YAAY,MAAM,aAAa,QAAQ,IAAI;AACjD,YAAM,QAAQ,MAAM,iBAAiB,QAAQ,aAAa,WAAW,SAAS;AAC9E,UAAI,MAAM,WAAW,GAAG;AACtB,gBAAQ,IAAI,uBAAuB;AAAA,MACrC,OAAO;AACL,gBAAQ,IAAI,aAAa,OAAO,MAAM,CAAC;AAAA,MACzC;AAAA,IACF,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":["basePlans"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gpc-cli/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.21",
|
|
4
4
|
"description": "The complete Google Play CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"commander": "^14.0.3",
|
|
22
|
-
"@gpc-cli/api": "1.0.16",
|
|
23
|
-
"@gpc-cli/config": "0.9.8",
|
|
24
22
|
"@gpc-cli/auth": "^0.9.9",
|
|
23
|
+
"@gpc-cli/config": "0.9.8",
|
|
25
24
|
"@gpc-cli/plugin-sdk": "0.9.6",
|
|
26
|
-
"@gpc-cli/
|
|
25
|
+
"@gpc-cli/api": "1.0.16",
|
|
26
|
+
"@gpc-cli/core": "0.9.19"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"google-play",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/generated-apks.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n listGeneratedApks,\n downloadGeneratedApk,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerGeneratedApksCommands(program: Command): void {\n const cmd = program\n .command(\"generated-apks\")\n .description(\"Manage device-specific APKs generated by Google Play\");\n\n cmd\n .command(\"list <version-code>\")\n .description(\"List generated APKs for a version code\")\n .action(async (versionCodeStr: string) => {\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 versionCode = parseInt(versionCodeStr, 10);\n if (isNaN(versionCode)) {\n console.error(\"Error: version-code must be a number\");\n process.exit(2);\n }\n\n try {\n const result = await listGeneratedApks(client, packageName, versionCode);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n cmd\n .command(\"download <version-code> <apk-id>\")\n .description(\"Download a generated APK\")\n .requiredOption(\"--output <path>\", \"Output file path\")\n .action(async (versionCodeStr: string, apkId: string, opts: { output: string }) => {\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 versionCode = parseInt(versionCodeStr, 10);\n if (isNaN(versionCode)) {\n console.error(\"Error: version-code must be a number\");\n process.exit(2);\n }\n\n try {\n const result = await downloadGeneratedApk(\n client,\n packageName,\n versionCode,\n apkId,\n opts.output,\n );\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,8BAA8B,SAAwB;AACpE,QAAM,MAAM,QACT,QAAQ,gBAAgB,EACxB,YAAY,sDAAsD;AAErE,MACG,QAAQ,qBAAqB,EAC7B,YAAY,wCAAwC,EACpD,OAAO,OAAO,mBAA2B;AACxC,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,cAAc,SAAS,gBAAgB,EAAE;AAC/C,QAAI,MAAM,WAAW,GAAG;AACtB,cAAQ,MAAM,sCAAsC;AACpD,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,QAAI;AACF,YAAM,SAAS,MAAM,kBAAkB,QAAQ,aAAa,WAAW;AACvE,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAEH,MACG,QAAQ,kCAAkC,EAC1C,YAAY,0BAA0B,EACtC,eAAe,mBAAmB,kBAAkB,EACpD,OAAO,OAAO,gBAAwB,OAAe,SAA6B;AACjF,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,cAAc,SAAS,gBAAgB,EAAE;AAC/C,QAAI,MAAM,WAAW,GAAG;AACtB,cAAQ,MAAM,sCAAsC;AACpD,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,QAAI;AACF,YAAM,SAAS,MAAM;AAAA,QACnB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK;AAAA,MACP;AACA,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/pricing.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport { convertRegionPrices, formatOutput } from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerPricingCommands(program: Command): void {\n const pricing = program.command(\"pricing\").description(\"Pricing and regional price conversion\");\n\n pricing\n .command(\"convert\")\n .description(\"Convert a price to all regional prices\")\n .option(\"--from <currency>\", \"Source currency code (e.g. USD)\")\n .option(\"--amount <number>\", \"Price amount (e.g. 4.99)\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const { isInteractive, requireOption } = await import(\"../prompt.js\");\n const interactive = isInteractive(program);\n\n options.from = await requireOption(\n \"from\",\n options.from,\n {\n message: \"Source currency code (e.g. USD):\",\n default: \"USD\",\n },\n interactive,\n );\n\n options.amount = await requireOption(\n \"amount\",\n options.amount,\n {\n message: \"Price amount (e.g. 4.99):\",\n },\n interactive,\n );\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await convertRegionPrices(client, packageName, options.from, options.amount);\n if (format !== \"json\") {\n const prices = (result as Record<string, unknown>)[\"convertedRegionPrices\"] as Record<string, Record<string, unknown>> | undefined;\n if (prices) {\n const rows = Object.entries(prices).map(([region, price]) => ({\n region,\n priceMicros: price[\"priceMicros\"] || \"-\",\n currencyCode: price[\"currencyCode\"] || \"-\",\n }));\n console.log(formatOutput(rows, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }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AC1F,UAAI,WAAW,QAAQ;AACrB,cAAM,SAAU,OAAmC,uBAAuB;AAC1E,YAAI,QAAQ;AACV,gBAAM,OAAO,OAAO,QAAQ,MAAM,EAAE,IAAI,CAAC,CAAC,QAAQ,KAAK,OAAO;AAAA,YAC5D;AAAA,YACA,aAAa,MAAM,aAAa,KAAK;AAAA,YACrC,cAAc,MAAM,cAAc,KAAK;AAAA,UACzC,EAAE;AACF,kBAAQ,IAAI,aAAa,MAAM,MAAM,CAAC;AAAA,QACxC,OAAO;AACL,kBAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,QAC1C;AAAA,MACF,OAAO;AACL,gBAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,MAC1C;AAAA,IACF,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
readJsonFile
|
|
4
|
-
} from "./chunk-FWKYRLKY.js";
|
|
5
|
-
import {
|
|
6
|
-
isDryRun,
|
|
7
|
-
printDryRun
|
|
8
|
-
} from "./chunk-Y3QZDAKS.js";
|
|
9
|
-
import {
|
|
10
|
-
getOutputFormat
|
|
11
|
-
} from "./chunk-ELXAK7GI.js";
|
|
12
|
-
|
|
13
|
-
// src/commands/purchase-options.ts
|
|
14
|
-
import { loadConfig } from "@gpc-cli/config";
|
|
15
|
-
import { resolveAuth } from "@gpc-cli/auth";
|
|
16
|
-
import { createApiClient } from "@gpc-cli/api";
|
|
17
|
-
import {
|
|
18
|
-
listPurchaseOptions,
|
|
19
|
-
getPurchaseOption,
|
|
20
|
-
createPurchaseOption,
|
|
21
|
-
activatePurchaseOption,
|
|
22
|
-
deactivatePurchaseOption,
|
|
23
|
-
formatOutput,
|
|
24
|
-
sortResults
|
|
25
|
-
} from "@gpc-cli/core";
|
|
26
|
-
function resolvePackageName(packageArg, config) {
|
|
27
|
-
const name = packageArg || config.app;
|
|
28
|
-
if (!name) {
|
|
29
|
-
console.error("Error: No package name. Use --app <package> or gpc config set app <package>");
|
|
30
|
-
process.exit(2);
|
|
31
|
-
}
|
|
32
|
-
return name;
|
|
33
|
-
}
|
|
34
|
-
async function getClient(config) {
|
|
35
|
-
const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });
|
|
36
|
-
return createApiClient({ auth });
|
|
37
|
-
}
|
|
38
|
-
function registerPurchaseOptionsCommands(program) {
|
|
39
|
-
const po = program.command("purchase-options").description("Manage purchase options");
|
|
40
|
-
po.command("list").description("List purchase options").option("--sort <field>", "Sort by field (prefix with - for descending)").action(async (options) => {
|
|
41
|
-
const config = await loadConfig();
|
|
42
|
-
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
43
|
-
const client = await getClient(config);
|
|
44
|
-
const format = getOutputFormat(program, config);
|
|
45
|
-
try {
|
|
46
|
-
const result = await listPurchaseOptions(client, packageName);
|
|
47
|
-
if (options.sort) {
|
|
48
|
-
result.purchaseOptions = sortResults(result.purchaseOptions, options.sort);
|
|
49
|
-
}
|
|
50
|
-
console.log(formatOutput(result, format));
|
|
51
|
-
} catch (error) {
|
|
52
|
-
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
53
|
-
process.exit(4);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
po.command("get <id>").description("Get a purchase option").action(async (id) => {
|
|
57
|
-
const config = await loadConfig();
|
|
58
|
-
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
59
|
-
const client = await getClient(config);
|
|
60
|
-
const format = getOutputFormat(program, config);
|
|
61
|
-
try {
|
|
62
|
-
const result = await getPurchaseOption(client, packageName, id);
|
|
63
|
-
console.log(formatOutput(result, format));
|
|
64
|
-
} catch (error) {
|
|
65
|
-
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
66
|
-
process.exit(4);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
po.command("create").description("Create a purchase option from JSON file").requiredOption("--file <path>", "JSON file with purchase option data").action(async (options) => {
|
|
70
|
-
const config = await loadConfig();
|
|
71
|
-
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
72
|
-
const format = getOutputFormat(program, config);
|
|
73
|
-
if (isDryRun(program)) {
|
|
74
|
-
printDryRun(
|
|
75
|
-
{
|
|
76
|
-
command: "purchase-options create",
|
|
77
|
-
action: "create",
|
|
78
|
-
target: `purchase option from ${options.file}`
|
|
79
|
-
},
|
|
80
|
-
format,
|
|
81
|
-
formatOutput
|
|
82
|
-
);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const client = await getClient(config);
|
|
86
|
-
try {
|
|
87
|
-
const data = await readJsonFile(options.file);
|
|
88
|
-
const result = await createPurchaseOption(client, packageName, data);
|
|
89
|
-
console.log(formatOutput(result, format));
|
|
90
|
-
} catch (error) {
|
|
91
|
-
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
92
|
-
process.exit(4);
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
po.command("activate <id>").description("Activate a purchase option").action(async (id) => {
|
|
96
|
-
const config = await loadConfig();
|
|
97
|
-
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
98
|
-
const format = getOutputFormat(program, config);
|
|
99
|
-
if (isDryRun(program)) {
|
|
100
|
-
printDryRun(
|
|
101
|
-
{
|
|
102
|
-
command: "purchase-options activate",
|
|
103
|
-
action: "activate",
|
|
104
|
-
target: id
|
|
105
|
-
},
|
|
106
|
-
format,
|
|
107
|
-
formatOutput
|
|
108
|
-
);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
const client = await getClient(config);
|
|
112
|
-
try {
|
|
113
|
-
const result = await activatePurchaseOption(client, packageName, id);
|
|
114
|
-
console.log(formatOutput(result, format));
|
|
115
|
-
} catch (error) {
|
|
116
|
-
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
117
|
-
process.exit(4);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
po.command("deactivate <id>").description("Deactivate a purchase option").action(async (id) => {
|
|
121
|
-
const config = await loadConfig();
|
|
122
|
-
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
123
|
-
const format = getOutputFormat(program, config);
|
|
124
|
-
if (isDryRun(program)) {
|
|
125
|
-
printDryRun(
|
|
126
|
-
{
|
|
127
|
-
command: "purchase-options deactivate",
|
|
128
|
-
action: "deactivate",
|
|
129
|
-
target: id
|
|
130
|
-
},
|
|
131
|
-
format,
|
|
132
|
-
formatOutput
|
|
133
|
-
);
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const client = await getClient(config);
|
|
137
|
-
try {
|
|
138
|
-
const result = await deactivatePurchaseOption(client, packageName, id);
|
|
139
|
-
console.log(formatOutput(result, format));
|
|
140
|
-
} catch (error) {
|
|
141
|
-
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
142
|
-
process.exit(4);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
export {
|
|
147
|
-
registerPurchaseOptionsCommands
|
|
148
|
-
};
|
|
149
|
-
//# sourceMappingURL=purchase-options-GXWKY6GF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/purchase-options.ts"],"sourcesContent":["import 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 } from \"@gpc-cli/api\";\nimport {\n listPurchaseOptions,\n getPurchaseOption,\n createPurchaseOption,\n activatePurchaseOption,\n deactivatePurchaseOption,\n formatOutput,\n sortResults,\n} from \"@gpc-cli/core\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { getOutputFormat } from \"../format.js\";\nimport { readJsonFile } from \"../json.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerPurchaseOptionsCommands(program: Command): void {\n const po = program\n .command(\"purchase-options\")\n .description(\"Manage purchase options\");\n\n po.command(\"list\")\n .description(\"List purchase options\")\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 try {\n const result = await listPurchaseOptions(client, packageName);\n if (options.sort) {\n result.purchaseOptions = sortResults(result.purchaseOptions, options.sort);\n }\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n po.command(\"get <id>\")\n .description(\"Get a purchase option\")\n .action(async (id: string) => {\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 try {\n const result = await getPurchaseOption(client, packageName, id);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n po.command(\"create\")\n .description(\"Create a purchase option from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with purchase option data\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"purchase-options create\",\n action: \"create\",\n target: `purchase option from ${options.file}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await createPurchaseOption(client, packageName, data as any);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n po.command(\"activate <id>\")\n .description(\"Activate a purchase option\")\n .action(async (id: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"purchase-options activate\",\n action: \"activate\",\n target: id,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await activatePurchaseOption(client, packageName, id);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n po.command(\"deactivate <id>\")\n .description(\"Deactivate a purchase option\")\n .action(async (id: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"purchase-options deactivate\",\n action: \"deactivate\",\n target: id,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await deactivatePurchaseOption(client, packageName, id);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AAC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MACF;AACA;AAAA,IACF;AAEA,UAAM,SAAS,MAAM,UAAU,MAAM;AAErC,QAAI;AACF,YAAM,SAAS,MAAM,uBAAuB,QAAQ,aAAa,EAAE;AACnE,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAEH,KAAG,QAAQ,iBAAiB,EACzB,YAAY,8BAA8B,EAC1C,OAAO,OAAO,OAAe;AAC5B,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,QAAI,SAAS,OAAO,GAAG;AACrB;AAAA,QACE;AAAA,UACE,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA;AAAA,IACF;AAEA,UAAM,SAAS,MAAM,UAAU,MAAM;AAErC,QAAI;AACF,YAAM,SAAS,MAAM,yBAAyB,QAAQ,aAAa,EAAE;AACrE,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
|
package/dist/reports-ZFVKYI4C.js
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
getOutputFormat
|
|
4
|
-
} from "./chunk-ELXAK7GI.js";
|
|
5
|
-
import {
|
|
6
|
-
isInteractive,
|
|
7
|
-
requireOption
|
|
8
|
-
} from "./chunk-NV75I5VP.js";
|
|
9
|
-
|
|
10
|
-
// src/commands/reports.ts
|
|
11
|
-
import { loadConfig } from "@gpc-cli/config";
|
|
12
|
-
import { resolveAuth } from "@gpc-cli/auth";
|
|
13
|
-
import { createApiClient } from "@gpc-cli/api";
|
|
14
|
-
import {
|
|
15
|
-
listReports,
|
|
16
|
-
downloadReport,
|
|
17
|
-
parseMonth,
|
|
18
|
-
isValidReportType,
|
|
19
|
-
isFinancialReportType,
|
|
20
|
-
isStatsReportType,
|
|
21
|
-
formatOutput
|
|
22
|
-
} from "@gpc-cli/core";
|
|
23
|
-
import { writeFile } from "fs/promises";
|
|
24
|
-
function resolvePackageName(packageArg, config) {
|
|
25
|
-
const name = packageArg || config.app;
|
|
26
|
-
if (!name) {
|
|
27
|
-
console.error("Error: No package name. Use --app <package> or gpc config set app <package>");
|
|
28
|
-
process.exit(2);
|
|
29
|
-
}
|
|
30
|
-
return name;
|
|
31
|
-
}
|
|
32
|
-
async function getClient(config) {
|
|
33
|
-
const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });
|
|
34
|
-
return createApiClient({ auth });
|
|
35
|
-
}
|
|
36
|
-
function registerReportsCommands(program) {
|
|
37
|
-
const reports = program.command("reports").description("Download financial and stats reports");
|
|
38
|
-
reports.command("list <report-type>").description("List available report buckets").option("--month <YYYY-MM>", "Report month (e.g., 2026-03)").option("--limit <n>", "Maximum results to return").option("--next-page <token>", "Pagination token for next page").action(async (reportType, options) => {
|
|
39
|
-
const interactive = isInteractive(program);
|
|
40
|
-
const now = /* @__PURE__ */ new Date();
|
|
41
|
-
const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}`;
|
|
42
|
-
options.month = await requireOption(
|
|
43
|
-
"month",
|
|
44
|
-
options.month,
|
|
45
|
-
{
|
|
46
|
-
message: "Report month (YYYY-MM):",
|
|
47
|
-
default: defaultMonth
|
|
48
|
-
},
|
|
49
|
-
interactive
|
|
50
|
-
);
|
|
51
|
-
if (!isValidReportType(reportType)) {
|
|
52
|
-
console.error(
|
|
53
|
-
`Error: Invalid report type "${reportType}". Valid types: earnings, sales, estimated_sales, installs, crashes, ratings, reviews, store_performance, subscriptions, play_balance`
|
|
54
|
-
);
|
|
55
|
-
process.exit(2);
|
|
56
|
-
}
|
|
57
|
-
const config = await loadConfig();
|
|
58
|
-
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
59
|
-
const client = await getClient(config);
|
|
60
|
-
const format = getOutputFormat(program, config);
|
|
61
|
-
try {
|
|
62
|
-
const { year, month } = parseMonth(options.month);
|
|
63
|
-
const result = await listReports(
|
|
64
|
-
client,
|
|
65
|
-
packageName,
|
|
66
|
-
reportType,
|
|
67
|
-
year,
|
|
68
|
-
month
|
|
69
|
-
);
|
|
70
|
-
console.log(formatOutput(result, format));
|
|
71
|
-
} catch (error) {
|
|
72
|
-
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
73
|
-
process.exit(4);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
const download = reports.command("download").description("Download a report");
|
|
77
|
-
download.command("financial").description("Download a financial report").option("--month <YYYY-MM>", "Report month (e.g., 2026-03)").option("--type <report-type>", "Report type", "earnings").option("--output-file <path>", "Save to file instead of stdout").action(async (options) => {
|
|
78
|
-
const interactive = isInteractive(program);
|
|
79
|
-
const now = /* @__PURE__ */ new Date();
|
|
80
|
-
const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}`;
|
|
81
|
-
options.month = await requireOption(
|
|
82
|
-
"month",
|
|
83
|
-
options.month,
|
|
84
|
-
{
|
|
85
|
-
message: "Report month (YYYY-MM):",
|
|
86
|
-
default: defaultMonth
|
|
87
|
-
},
|
|
88
|
-
interactive
|
|
89
|
-
);
|
|
90
|
-
if (!isFinancialReportType(options.type)) {
|
|
91
|
-
console.error(
|
|
92
|
-
`Error: Invalid financial report type "${options.type}". Valid types: earnings, sales, estimated_sales, play_balance`
|
|
93
|
-
);
|
|
94
|
-
process.exit(2);
|
|
95
|
-
}
|
|
96
|
-
const config = await loadConfig();
|
|
97
|
-
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
98
|
-
const client = await getClient(config);
|
|
99
|
-
try {
|
|
100
|
-
const { year, month } = parseMonth(options.month);
|
|
101
|
-
const csv = await downloadReport(
|
|
102
|
-
client,
|
|
103
|
-
packageName,
|
|
104
|
-
options.type,
|
|
105
|
-
year,
|
|
106
|
-
month
|
|
107
|
-
);
|
|
108
|
-
if (options.outputFile) {
|
|
109
|
-
await writeFile(options.outputFile, csv, "utf-8");
|
|
110
|
-
console.log(`Report saved to ${options.outputFile}`);
|
|
111
|
-
} else {
|
|
112
|
-
console.log(csv);
|
|
113
|
-
}
|
|
114
|
-
} catch (error) {
|
|
115
|
-
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
116
|
-
process.exit(4);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
download.command("stats").description("Download a stats report").option("--month <YYYY-MM>", "Report month (e.g., 2026-03)").option(
|
|
120
|
-
"--type <report-type>",
|
|
121
|
-
"Report type (installs, crashes, ratings, reviews, store_performance, subscriptions)"
|
|
122
|
-
).option("--output-file <path>", "Save to file instead of stdout").action(async (options) => {
|
|
123
|
-
const interactive = isInteractive(program);
|
|
124
|
-
const now = /* @__PURE__ */ new Date();
|
|
125
|
-
const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}`;
|
|
126
|
-
const statsTypes = [
|
|
127
|
-
"installs",
|
|
128
|
-
"crashes",
|
|
129
|
-
"ratings",
|
|
130
|
-
"reviews",
|
|
131
|
-
"store_performance",
|
|
132
|
-
"subscriptions"
|
|
133
|
-
];
|
|
134
|
-
options.month = await requireOption(
|
|
135
|
-
"month",
|
|
136
|
-
options.month,
|
|
137
|
-
{
|
|
138
|
-
message: "Report month (YYYY-MM):",
|
|
139
|
-
default: defaultMonth
|
|
140
|
-
},
|
|
141
|
-
interactive
|
|
142
|
-
);
|
|
143
|
-
options.type = await requireOption(
|
|
144
|
-
"type",
|
|
145
|
-
options.type,
|
|
146
|
-
{
|
|
147
|
-
message: "Stats report type:",
|
|
148
|
-
choices: statsTypes
|
|
149
|
-
},
|
|
150
|
-
interactive
|
|
151
|
-
);
|
|
152
|
-
if (!isStatsReportType(options.type)) {
|
|
153
|
-
console.error(
|
|
154
|
-
`Error: Invalid stats report type "${options.type}". Valid types: installs, crashes, ratings, reviews, store_performance, subscriptions`
|
|
155
|
-
);
|
|
156
|
-
process.exit(2);
|
|
157
|
-
}
|
|
158
|
-
const config = await loadConfig();
|
|
159
|
-
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
160
|
-
const client = await getClient(config);
|
|
161
|
-
try {
|
|
162
|
-
const { year, month } = parseMonth(options.month);
|
|
163
|
-
const csv = await downloadReport(
|
|
164
|
-
client,
|
|
165
|
-
packageName,
|
|
166
|
-
options.type,
|
|
167
|
-
year,
|
|
168
|
-
month
|
|
169
|
-
);
|
|
170
|
-
if (options.outputFile) {
|
|
171
|
-
await writeFile(options.outputFile, csv, "utf-8");
|
|
172
|
-
console.log(`Report saved to ${options.outputFile}`);
|
|
173
|
-
} else {
|
|
174
|
-
console.log(csv);
|
|
175
|
-
}
|
|
176
|
-
} catch (error) {
|
|
177
|
-
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
178
|
-
process.exit(4);
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
export {
|
|
183
|
-
registerReportsCommands
|
|
184
|
-
};
|
|
185
|
-
//# sourceMappingURL=reports-ZFVKYI4C.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/reports.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n listReports,\n downloadReport,\n parseMonth,\n isValidReportType,\n isFinancialReportType,\n isStatsReportType,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport type { ReportType } from \"@gpc-cli/api\";\nimport { writeFile } from \"node:fs/promises\";\nimport { isInteractive, requireOption } from \"../prompt.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerReportsCommands(program: Command): void {\n const reports = program.command(\"reports\").description(\"Download financial and stats reports\");\n\n reports\n .command(\"list <report-type>\")\n .description(\"List available report buckets\")\n .option(\"--month <YYYY-MM>\", \"Report month (e.g., 2026-03)\")\n .option(\"--limit <n>\", \"Maximum results to return\")\n .option(\"--next-page <token>\", \"Pagination token for next page\")\n .action(async (reportType: string, options) => {\n const interactive = isInteractive(program);\n const now = new Date();\n const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}`;\n\n options.month = await requireOption(\n \"month\",\n options.month,\n {\n message: \"Report month (YYYY-MM):\",\n default: defaultMonth,\n },\n interactive,\n );\n\n if (!isValidReportType(reportType)) {\n console.error(\n `Error: Invalid report type \"${reportType}\". Valid types: earnings, sales, estimated_sales, installs, crashes, ratings, reviews, store_performance, subscriptions, play_balance`,\n );\n process.exit(2);\n }\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 try {\n const { year, month } = parseMonth(options.month);\n const result = await listReports(\n client,\n packageName,\n reportType as ReportType,\n year,\n month,\n );\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n const download = reports.command(\"download\").description(\"Download a report\");\n\n download\n .command(\"financial\")\n .description(\"Download a financial report\")\n .option(\"--month <YYYY-MM>\", \"Report month (e.g., 2026-03)\")\n .option(\"--type <report-type>\", \"Report type\", \"earnings\")\n .option(\"--output-file <path>\", \"Save to file instead of stdout\")\n .action(async (options) => {\n const interactive = isInteractive(program);\n const now = new Date();\n const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}`;\n\n options.month = await requireOption(\n \"month\",\n options.month,\n {\n message: \"Report month (YYYY-MM):\",\n default: defaultMonth,\n },\n interactive,\n );\n\n if (!isFinancialReportType(options.type)) {\n console.error(\n `Error: Invalid financial report type \"${options.type}\". Valid types: earnings, sales, estimated_sales, play_balance`,\n );\n process.exit(2);\n }\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n\n try {\n const { year, month } = parseMonth(options.month);\n const csv = await downloadReport(\n client,\n packageName,\n options.type as ReportType,\n year,\n month,\n );\n if (options.outputFile) {\n await writeFile(options.outputFile, csv, \"utf-8\");\n console.log(`Report saved to ${options.outputFile}`);\n } else {\n console.log(csv);\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n download\n .command(\"stats\")\n .description(\"Download a stats report\")\n .option(\"--month <YYYY-MM>\", \"Report month (e.g., 2026-03)\")\n .option(\n \"--type <report-type>\",\n \"Report type (installs, crashes, ratings, reviews, store_performance, subscriptions)\",\n )\n .option(\"--output-file <path>\", \"Save to file instead of stdout\")\n .action(async (options) => {\n const interactive = isInteractive(program);\n const now = new Date();\n const defaultMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}`;\n const statsTypes = [\n \"installs\",\n \"crashes\",\n \"ratings\",\n \"reviews\",\n \"store_performance\",\n \"subscriptions\",\n ];\n\n options.month = await requireOption(\n \"month\",\n options.month,\n {\n message: \"Report month (YYYY-MM):\",\n default: defaultMonth,\n },\n interactive,\n );\n\n options.type = await requireOption(\n \"type\",\n options.type,\n {\n message: \"Stats report type:\",\n choices: statsTypes,\n },\n interactive,\n );\n\n if (!isStatsReportType(options.type)) {\n console.error(\n `Error: Invalid stats report type \"${options.type}\". Valid types: installs, crashes, ratings, reviews, store_performance, subscriptions`,\n );\n process.exit(2);\n }\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n\n try {\n const { year, month } = parseMonth(options.month);\n const csv = await downloadReport(\n client,\n packageName,\n options.type as ReportType,\n year,\n month,\n );\n if (options.outputFile) {\n await writeFile(options.outputFile, csv, \"utf-8\");\n console.log(`Report saved to ${options.outputFile}`);\n } else {\n console.log(csv);\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,wBAAwB,SAAwB;AAC9D,QAAM,UAAU,QAAQ,QAAQ,SAAS,EAAE,YAAY,sCAAsC;AAE7F,UACG,QAAQ,oBAAoB,EAC5B,YAAY,+BAA+B,EAC3C,OAAO,qBAAqB,8BAA8B,EAC1D,OAAO,eAAe,2B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E;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/subscriptions.ts"],"sourcesContent":["import type { GpcConfig } from \"@gpc-cli/config\";\nimport type { Command } from \"commander\";\nimport { Option } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport type { Subscription } from \"@gpc-cli/api\";\nimport {\n listSubscriptions,\n getSubscription,\n createSubscription,\n updateSubscription,\n deleteSubscription,\n activateBasePlan,\n deactivateBasePlan,\n deleteBasePlan,\n migratePrices,\n listOffers,\n getOffer,\n createOffer,\n updateOffer,\n deleteOffer,\n activateOffer,\n deactivateOffer,\n diffSubscription,\n formatOutput,\n sortResults,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { requireConfirm } from \"../prompt.js\";\nimport { readJsonFile } from \"../json.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerSubscriptionsCommands(program: Command): void {\n const subs = program.command(\"subscriptions\").description(\"Manage subscriptions and base plans\");\n\n subs\n .command(\"list\")\n .description(\"List subscriptions\")\n .addOption(new Option(\"--page-size <n>\", \"Results per page\").argParser(parseInt).hideHelp())\n .addOption(new Option(\"--page-token <token>\", \"Page token\").hideHelp())\n .option(\"--limit <n>\", \"Maximum total results\", parseInt)\n .option(\"--next-page <token>\", \"Resume from page token\")\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 try {\n const result = await listSubscriptions(client, packageName, {\n pageSize: options.pageSize,\n pageToken: options.pageToken,\n limit: options.limit,\n nextPage: options.nextPage,\n });\n if (options.sort) {\n result.subscriptions = sortResults(result.subscriptions, options.sort);\n }\n if (format !== \"json\") {\n const summary = (result.subscriptions || []).map((s: Subscription) => ({\n productId: s.productId,\n basePlans: s.basePlans?.length || 0,\n listings: s.listings ? Object.keys(s.listings).length : 0,\n firstBasePlanState: s.basePlans?.[0]?.state || \"-\",\n }));\n console.log(formatOutput(summary, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n subs\n .command(\"get <product-id>\")\n .description(\"Get a subscription\")\n .action(async (productId: string) => {\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 try {\n const result = await getSubscription(client, packageName, productId);\n if (format !== \"json\") {\n const s = result as Record<string, unknown>;\n const basePlans = s[\"basePlans\"] as Array<Record<string, unknown>> | undefined;\n const listings = s[\"listings\"] as Record<string, unknown> | undefined;\n const summary = {\n productId: s[\"productId\"],\n basePlans: basePlans?.length || 0,\n basePlanIds: basePlans?.map((bp) => bp[\"basePlanId\"]).join(\", \") || \"-\",\n listings: listings ? Object.keys(listings).length : 0,\n listingLanguages: listings ? Object.keys(listings).join(\", \") : \"-\",\n taxCategory: (s[\"taxAndComplianceSettings\"] as Record<string, unknown>)?.[\"taxRateInfoByRegionCode\"] ? \"configured\" : \"-\",\n };\n console.log(formatOutput(summary, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n subs\n .command(\"create\")\n .description(\"Create a subscription from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with subscription data\")\n .option(\"--activate\", \"Activate all base plans after creation\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions create\",\n action: \"create\",\n target: `subscription from ${options.file}`,\n details: options.activate ? { activate: true } : undefined,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await createSubscription(client, packageName, data as any);\n\n if (options.activate && result.basePlans) {\n for (const bp of result.basePlans) {\n if (bp.state === \"DRAFT\") {\n await activateBasePlan(client, packageName, result.productId, bp.basePlanId);\n console.error(`Activated base plan: ${bp.basePlanId}`);\n }\n }\n // Re-fetch to get updated state\n const updated = await getSubscription(client, packageName, result.productId);\n console.log(formatOutput(updated, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n subs\n .command(\"update <product-id>\")\n .description(\"Update a subscription from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with subscription data\")\n .option(\"--update-mask <fields>\", \"Comma-separated field mask\")\n .action(async (productId: string, options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions update\",\n action: \"update\",\n target: productId,\n details: { file: options.file, updateMask: options.updateMask },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await updateSubscription(\n client,\n packageName,\n productId,\n data as any,\n options.updateMask,\n );\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n subs\n .command(\"delete <product-id>\")\n .description(\"Delete a subscription\")\n .action(async (productId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(`Delete subscription \"${productId}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"subscriptions delete\",\n action: \"delete\",\n target: productId,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n await deleteSubscription(client, packageName, productId);\n console.log(`Subscription ${productId} deleted.`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // --- Base Plans ---\n const basePlans = subs.command(\"base-plans\").description(\"Manage base plans\");\n\n basePlans\n .command(\"activate <product-id> <base-plan-id>\")\n .description(\"Activate a base plan\")\n .action(async (productId: string, basePlanId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions base-plans activate\",\n action: \"activate\",\n target: `${productId}/${basePlanId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await activateBasePlan(client, packageName, productId, basePlanId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n basePlans\n .command(\"deactivate <product-id> <base-plan-id>\")\n .description(\"Deactivate a base plan\")\n .action(async (productId: string, basePlanId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions base-plans deactivate\",\n action: \"deactivate\",\n target: `${productId}/${basePlanId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await deactivateBasePlan(client, packageName, productId, basePlanId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n basePlans\n .command(\"delete <product-id> <base-plan-id>\")\n .description(\"Delete a base plan\")\n .action(async (productId: string, basePlanId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(\n `Delete base plan \"${basePlanId}\" from subscription \"${productId}\"?`,\n program,\n );\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"subscriptions base-plans delete\",\n action: \"delete\",\n target: `${productId}/${basePlanId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n await deleteBasePlan(client, packageName, productId, basePlanId);\n console.log(`Base plan ${basePlanId} deleted.`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n basePlans\n .command(\"migrate-prices <product-id> <base-plan-id>\")\n .description(\"Migrate base plan prices\")\n .requiredOption(\"--file <path>\", \"JSON file with migration data\")\n .action(\n async (\n productId: string,\n basePlanId: string,\n options: { file: string; updateMask?: string },\n ) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions base-plans migrate-prices\",\n action: \"migrate prices for\",\n target: `${productId}/${basePlanId}`,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await migratePrices(client, packageName, productId, basePlanId, data as any);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n },\n );\n\n // --- Offers ---\n const offers = subs.command(\"offers\").description(\"Manage subscription offers\");\n\n offers\n .command(\"list <product-id> <base-plan-id>\")\n .description(\"List offers for a base plan\")\n .action(async (productId: string, basePlanId: string) => {\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 try {\n const result = await listOffers(client, packageName, productId, basePlanId);\n const offers_list = (result as Record<string, unknown>)[\"subscriptionOffers\"] as Array<Record<string, unknown>> | undefined;\n if (format !== \"json\") {\n if (!offers_list || offers_list.length === 0) {\n console.log(\"No offers found.\");\n return;\n }\n const summary = offers_list.map((o) => ({\n offerId: o[\"offerId\"],\n basePlanId: o[\"basePlanId\"],\n state: o[\"state\"] || \"-\",\n phases: (o[\"phases\"] as unknown[])?.length || 0,\n regionalConfigs: (o[\"regionalConfigs\"] as unknown[])?.length || 0,\n }));\n console.log(formatOutput(summary, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n offers\n .command(\"get <product-id> <base-plan-id> <offer-id>\")\n .description(\"Get an offer\")\n .action(async (productId: string, basePlanId: string, offerId: string) => {\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 try {\n const result = await getOffer(client, packageName, productId, basePlanId, offerId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n offers\n .command(\"create <product-id> <base-plan-id>\")\n .description(\"Create an offer from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with offer data\")\n .action(\n async (\n productId: string,\n basePlanId: string,\n options: { file: string; updateMask?: string },\n ) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions offers create\",\n action: \"create offer for\",\n target: `${productId}/${basePlanId}`,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await createOffer(client, packageName, productId, basePlanId, data as any);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n },\n );\n\n offers\n .command(\"update <product-id> <base-plan-id> <offer-id>\")\n .description(\"Update an offer from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with offer data\")\n .option(\"--update-mask <fields>\", \"Comma-separated field mask\")\n .action(\n async (\n productId: string,\n basePlanId: string,\n offerId: string,\n options: { file: string; updateMask?: string },\n ) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions offers update\",\n action: \"update offer\",\n target: `${productId}/${basePlanId}/${offerId}`,\n details: { file: options.file, updateMask: options.updateMask },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await updateOffer(\n client,\n packageName,\n productId,\n basePlanId,\n offerId,\n data as any,\n options.updateMask,\n );\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n },\n );\n\n offers\n .command(\"delete <product-id> <base-plan-id> <offer-id>\")\n .description(\"Delete an offer\")\n .action(async (productId: string, basePlanId: string, offerId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(`Delete offer \"${offerId}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"subscriptions offers delete\",\n action: \"delete offer\",\n target: `${productId}/${basePlanId}/${offerId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n await deleteOffer(client, packageName, productId, basePlanId, offerId);\n console.log(`Offer ${offerId} deleted.`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n offers\n .command(\"activate <product-id> <base-plan-id> <offer-id>\")\n .description(\"Activate an offer\")\n .action(async (productId: string, basePlanId: string, offerId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions offers activate\",\n action: \"activate offer\",\n target: `${productId}/${basePlanId}/${offerId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await activateOffer(client, packageName, productId, basePlanId, offerId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n offers\n .command(\"deactivate <product-id> <base-plan-id> <offer-id>\")\n .description(\"Deactivate an offer\")\n .action(async (productId: string, basePlanId: string, offerId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions offers deactivate\",\n action: \"deactivate offer\",\n target: `${productId}/${basePlanId}/${offerId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await deactivateOffer(client, packageName, productId, basePlanId, offerId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // --- Diff ---\n subs\n .command(\"diff <product-id>\")\n .description(\"Compare local JSON file against remote subscription\")\n .requiredOption(\"--file <path>\", \"Local JSON file to compare against remote\")\n .action(async (productId: string, options: { file: string }) => {\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 try {\n const localData = await readJsonFile(options.file) as Subscription;\n const diffs = await diffSubscription(client, packageName, productId, localData);\n if (diffs.length === 0) {\n console.log(\"No differences found.\");\n } else {\n console.log(formatOutput(diffs, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAEhC;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,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,8BAA8B,SAAwB;AACpE,QAAM,OAAO,QAAQ,QAAQ,eAAe,EAAE,YAAY,qCAAqC;AAE/F,OACG,QAAQ,MAAM,EACd,YAAY,oBAAoB,EAChC,UAAU,IAAI,OAAO,mBAAmB,kBAAkB,EAAE,UAAU,QAAQ,EAAE,SAAS,CAAC,EAC1F,UAAU,IAAI,OAAO,wBAAwB,YAAY,EAAE,SAAS,CAAC,EACrE,OAAO,eAAe,yBAAyB,QAAQ,EACvD,OAAO,uBAAuB,wBAAwB,EACtD,OAAO,kBAAkB,8CAA8C,EACvE,OAAO,OAAO,YAAY;AACzB,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAA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