@gpc-cli/cli 0.9.83 → 0.9.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  createProgram,
4
4
  handleCliError
5
- } from "./chunk-7UYPZIQZ.js";
5
+ } from "./chunk-IAPAEPDL.js";
6
6
  export {
7
7
  createProgram,
8
8
  handleCliError
@@ -79,7 +79,7 @@ function registerOneTimeProductsCommands(program) {
79
79
  const result = await getOneTimeProduct(client, packageName, productId);
80
80
  console.log(formatOutput(result, format));
81
81
  });
82
- otp.command("create").description("Create a one-time product from JSON file").requiredOption("--file <path>", "JSON file with product data").action(async (options) => {
82
+ otp.command("create").description("Create a one-time product from JSON file").requiredOption("--file <path>", "JSON file with product data").option("--regions-version <version>", "Regional pricing version (default 2022/02)").action(async (options) => {
83
83
  const config = await loadConfig();
84
84
  const packageName = resolvePackageName(program.opts()["app"], config);
85
85
  const format = getOutputFormat(program, config);
@@ -88,7 +88,8 @@ function registerOneTimeProductsCommands(program) {
88
88
  {
89
89
  command: "one-time-products create",
90
90
  action: "create",
91
- target: `one-time product from ${options.file}`
91
+ target: `one-time product from ${options.file}`,
92
+ details: options.regionsVersion ? { regionsVersion: options.regionsVersion } : void 0
92
93
  },
93
94
  format,
94
95
  formatOutput
@@ -97,10 +98,15 @@ function registerOneTimeProductsCommands(program) {
97
98
  }
98
99
  const client = await getClient(config);
99
100
  const data = await readJsonFile(options.file);
100
- const result = await createOneTimeProduct(client, packageName, data);
101
+ const result = await createOneTimeProduct(
102
+ client,
103
+ packageName,
104
+ data,
105
+ options.regionsVersion
106
+ );
101
107
  console.log(formatOutput(result, format));
102
108
  });
103
- otp.command("update <product-id>").description("Update a one-time product from JSON file").requiredOption("--file <path>", "JSON file with product data").option("--update-mask <fields>", "Comma-separated field mask").action(async (productId, options) => {
109
+ otp.command("update <product-id>").description("Update a one-time product from JSON file").requiredOption("--file <path>", "JSON file with product data").option("--update-mask <fields>", "Comma-separated field mask").option("--regions-version <version>", "Regional pricing version (default 2022/02)").action(async (productId, options) => {
104
110
  const config = await loadConfig();
105
111
  const packageName = resolvePackageName(program.opts()["app"], config);
106
112
  const format = getOutputFormat(program, config);
@@ -110,7 +116,10 @@ function registerOneTimeProductsCommands(program) {
110
116
  command: "one-time-products update",
111
117
  action: "update",
112
118
  target: productId,
113
- details: { file: options.file }
119
+ details: {
120
+ file: options.file,
121
+ ...options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}
122
+ }
114
123
  },
115
124
  format,
116
125
  formatOutput
@@ -124,7 +133,8 @@ function registerOneTimeProductsCommands(program) {
124
133
  packageName,
125
134
  productId,
126
135
  data,
127
- options.updateMask
136
+ options.updateMask,
137
+ options.regionsVersion
128
138
  );
129
139
  console.log(formatOutput(result, format));
130
140
  });
@@ -184,35 +194,42 @@ function registerOneTimeProductsCommands(program) {
184
194
  );
185
195
  console.log(formatOutput(result, format));
186
196
  });
187
- offers.command("create <product-id>").description("Create an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").option("--purchase-option <id>", 'Purchase option ID (default: "-" for all)', "-").action(async (productId, options) => {
188
- const config = await loadConfig();
189
- const packageName = resolvePackageName(program.opts()["app"], config);
190
- const format = getOutputFormat(program, config);
191
- if (isDryRun(program)) {
192
- printDryRun(
193
- {
194
- command: "one-time-products offers create",
195
- action: "create offer for",
196
- target: productId,
197
- details: { file: options.file, purchaseOption: options.purchaseOption }
198
- },
199
- format,
200
- formatOutput
197
+ offers.command("create <product-id>").description("Create an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").option("--purchase-option <id>", 'Purchase option ID (default: "-" for all)', "-").option("--regions-version <version>", "Regional pricing version (default 2022/02)").action(
198
+ async (productId, options) => {
199
+ const config = await loadConfig();
200
+ const packageName = resolvePackageName(program.opts()["app"], config);
201
+ const format = getOutputFormat(program, config);
202
+ if (isDryRun(program)) {
203
+ printDryRun(
204
+ {
205
+ command: "one-time-products offers create",
206
+ action: "create offer for",
207
+ target: productId,
208
+ details: {
209
+ file: options.file,
210
+ purchaseOption: options.purchaseOption,
211
+ ...options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}
212
+ }
213
+ },
214
+ format,
215
+ formatOutput
216
+ );
217
+ return;
218
+ }
219
+ const client = await getClient(config);
220
+ const data = await readJsonFile(options.file);
221
+ const result = await createOneTimeOffer(
222
+ client,
223
+ packageName,
224
+ productId,
225
+ data,
226
+ options.purchaseOption,
227
+ options.regionsVersion
201
228
  );
202
- return;
229
+ console.log(formatOutput(result, format));
203
230
  }
204
- const client = await getClient(config);
205
- const data = await readJsonFile(options.file);
206
- const result = await createOneTimeOffer(
207
- client,
208
- packageName,
209
- productId,
210
- data,
211
- options.purchaseOption
212
- );
213
- console.log(formatOutput(result, format));
214
- });
215
- offers.command("update <product-id> <offer-id>").description("Update an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").option("--update-mask <fields>", "Comma-separated field mask").option("--purchase-option <id>", 'Purchase option ID (default: "-" for all)', "-").action(
231
+ );
232
+ offers.command("update <product-id> <offer-id>").description("Update an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").option("--update-mask <fields>", "Comma-separated field mask").option("--purchase-option <id>", 'Purchase option ID (default: "-" for all)', "-").option("--regions-version <version>", "Regional pricing version (default 2022/02)").action(
216
233
  async (productId, offerId, options) => {
217
234
  const config = await loadConfig();
218
235
  const packageName = resolvePackageName(program.opts()["app"], config);
@@ -223,7 +240,11 @@ function registerOneTimeProductsCommands(program) {
223
240
  command: "one-time-products offers update",
224
241
  action: "update offer",
225
242
  target: `${productId}/${offerId}`,
226
- details: { file: options.file, purchaseOption: options.purchaseOption }
243
+ details: {
244
+ file: options.file,
245
+ purchaseOption: options.purchaseOption,
246
+ ...options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}
247
+ }
227
248
  },
228
249
  format,
229
250
  formatOutput
@@ -239,7 +260,8 @@ function registerOneTimeProductsCommands(program) {
239
260
  offerId,
240
261
  data,
241
262
  options.updateMask,
242
- options.purchaseOption
263
+ options.purchaseOption,
264
+ options.regionsVersion
243
265
  );
244
266
  console.log(formatOutput(result, format));
245
267
  }
@@ -469,4 +491,4 @@ function registerOneTimeProductsCommands(program) {
469
491
  export {
470
492
  registerOneTimeProductsCommands
471
493
  };
472
- //# sourceMappingURL=one-time-products-HHCHEDRJ.js.map
494
+ //# sourceMappingURL=one-time-products-3QH5IKOZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/one-time-products.ts"],"sourcesContent":["import { resolvePackageName, getClient } from \"../resolve.js\";\nimport type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\n\nimport type { OneTimeProduct, OneTimeOffer } from \"@gpc-cli/api\";\nimport {\n listOneTimeProducts,\n getOneTimeProduct,\n createOneTimeProduct,\n updateOneTimeProduct,\n deleteOneTimeProduct,\n listOneTimeOffers,\n getOneTimeOffer,\n createOneTimeOffer,\n updateOneTimeOffer,\n deleteOneTimeOffer,\n diffOneTimeProduct,\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nasync function readJsonArray<T = any>(filePath: string): Promise<T[]> {\n const data = await readJsonFile(filePath);\n if (!Array.isArray(data)) {\n const err = new Error(`Expected a JSON array in ${filePath}, got ${typeof data}`);\n Object.assign(err, { code: \"USAGE_ERROR\", exitCode: 2 });\n throw err;\n }\n return data as T[];\n}\n\nexport function registerOneTimeProductsCommands(program: Command): void {\n const otp = program\n .command(\"one-time-products\")\n .alias(\"otp\")\n .description(\"Manage one-time products and offers (modern OTP API)\");\n\n otp\n .command(\"list\")\n .description(\"List one-time products\")\n .option(\"--sort <field>\", \"Sort by field (prefix with - for descending)\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const result = await listOneTimeProducts(client, packageName);\n if (options.sort) {\n result.oneTimeProducts = sortResults(result.oneTimeProducts, options.sort);\n }\n const products = result.oneTimeProducts || [];\n if (format !== \"json\") {\n if (products.length === 0) {\n console.log(\"No one-time products found.\");\n return;\n }\n const summary = products.map((p: OneTimeProduct) => ({\n productId: p.productId,\n purchaseType: (p as unknown as Record<string, unknown>)[\"purchaseType\"] || \"-\",\n listings: p.listings ? Object.keys(p.listings).length : 0,\n firstTitle: p.listings ? Object.values(p.listings)[0]?.title || \"-\" : \"-\",\n }));\n console.log(formatOutput(summary, format));\n } else {\n console.log(formatOutput(result, format));\n }\n });\n\n otp\n .command(\"get <product-id>\")\n .description(\"Get a one-time product\")\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 const result = await getOneTimeProduct(client, packageName, productId);\n console.log(formatOutput(result, format));\n });\n\n otp\n .command(\"create\")\n .description(\"Create a one-time product from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with product data\")\n .option(\"--regions-version <version>\", \"Regional pricing version (default 2022/02)\")\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: \"one-time-products create\",\n action: \"create\",\n target: `one-time product from ${options.file}`,\n details: options.regionsVersion\n ? { regionsVersion: options.regionsVersion }\n : undefined,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const data = await readJsonFile(options.file);\n const result = await createOneTimeProduct(\n client,\n packageName,\n data as OneTimeProduct,\n options.regionsVersion,\n );\n console.log(formatOutput(result, format));\n });\n\n otp\n .command(\"update <product-id>\")\n .description(\"Update a one-time product from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with product data\")\n .option(\"--update-mask <fields>\", \"Comma-separated field mask\")\n .option(\"--regions-version <version>\", \"Regional pricing version (default 2022/02)\")\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: \"one-time-products update\",\n action: \"update\",\n target: productId,\n details: {\n file: options.file,\n ...(options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}),\n },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const data = await readJsonFile(options.file);\n const result = await updateOneTimeProduct(\n client,\n packageName,\n productId,\n data as Partial<OneTimeProduct>,\n options.updateMask,\n options.regionsVersion,\n );\n console.log(formatOutput(result, format));\n });\n\n otp\n .command(\"delete <product-id>\")\n .description(\"Delete a one-time product\")\n .action(async (productId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(`Delete one-time product \"${productId}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"one-time-products 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 await deleteOneTimeProduct(client, packageName, productId);\n console.log(`One-time product ${productId} deleted.`);\n });\n\n // --- Offers ---\n const offers = otp.command(\"offers\").description(\"Manage one-time product offers\");\n\n offers\n .command(\"list <product-id>\")\n .description(\"List offers for a one-time product\")\n .option(\"--purchase-option <id>\", 'Purchase option ID (default: \"-\" for all)', \"-\")\n .option(\"--sort <field>\", \"Sort by field (prefix with - for descending)\")\n .action(async (productId: string, options: { purchaseOption: string; sort?: 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 result = await listOneTimeOffers(\n client,\n packageName,\n productId,\n options.purchaseOption,\n );\n const items = result.oneTimeProductOffers ?? result.oneTimeOffers ?? [];\n if (options.sort) {\n console.log(formatOutput(sortResults(items, options.sort), format));\n } else {\n console.log(\n formatOutput(items.length > 0 ? result : { oneTimeProductOffers: items }, format),\n );\n }\n });\n\n offers\n .command(\"get <product-id> <offer-id>\")\n .description(\"Get an offer for a one-time product\")\n .option(\"--purchase-option <id>\", 'Purchase option ID (default: \"-\" for all)', \"-\")\n .action(async (productId: string, offerId: string, options: { purchaseOption: 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 result = await getOneTimeOffer(\n client,\n packageName,\n productId,\n offerId,\n options.purchaseOption,\n );\n console.log(formatOutput(result, format));\n });\n\n offers\n .command(\"create <product-id>\")\n .description(\"Create an offer from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with offer data\")\n .option(\"--purchase-option <id>\", 'Purchase option ID (default: \"-\" for all)', \"-\")\n .option(\"--regions-version <version>\", \"Regional pricing version (default 2022/02)\")\n .action(\n async (\n productId: string,\n options: { file: string; purchaseOption: string; regionsVersion?: 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: \"one-time-products offers create\",\n action: \"create offer for\",\n target: productId,\n details: {\n file: options.file,\n purchaseOption: options.purchaseOption,\n ...(options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}),\n },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const data = await readJsonFile(options.file);\n const result = await createOneTimeOffer(\n client,\n packageName,\n productId,\n data as OneTimeOffer,\n options.purchaseOption,\n options.regionsVersion,\n );\n console.log(formatOutput(result, format));\n },\n );\n\n offers\n .command(\"update <product-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 .option(\"--purchase-option <id>\", 'Purchase option ID (default: \"-\" for all)', \"-\")\n .option(\"--regions-version <version>\", \"Regional pricing version (default 2022/02)\")\n .action(\n async (\n productId: string,\n offerId: string,\n options: {\n file: string;\n updateMask?: string;\n purchaseOption: string;\n regionsVersion?: string;\n },\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: \"one-time-products offers update\",\n action: \"update offer\",\n target: `${productId}/${offerId}`,\n details: {\n file: options.file,\n purchaseOption: options.purchaseOption,\n ...(options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}),\n },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const data = await readJsonFile(options.file);\n const result = await updateOneTimeOffer(\n client,\n packageName,\n productId,\n offerId,\n data as Partial<OneTimeOffer>,\n options.updateMask,\n options.purchaseOption,\n options.regionsVersion,\n );\n console.log(formatOutput(result, format));\n },\n );\n\n offers\n .command(\"delete <product-id> <offer-id>\")\n .description(\"Delete an offer\")\n .option(\"--purchase-option <id>\", 'Purchase option ID (default: \"-\" for all)', \"-\")\n .action(async (productId: string, offerId: string, options: { purchaseOption: string }) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(`Delete offer \"${offerId}\" for product \"${productId}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"one-time-products offers delete\",\n action: \"delete offer\",\n target: `${productId}/${offerId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n await deleteOneTimeOffer(client, packageName, productId, offerId, options.purchaseOption);\n console.log(`Offer ${offerId} deleted.`);\n });\n\n offers\n .command(\"cancel <product-id> <offer-id>\")\n .description(\"Cancel an offer (permanent, cannot be re-activated)\")\n .option(\"--purchase-option <id>\", 'Purchase option ID (default: \"-\" for all)', \"-\")\n .action(async (productId: string, offerId: string, options: { purchaseOption: string }) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(\n `Cancel offer \"${offerId}\"? This is permanent and cannot be undone.`,\n program,\n );\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"otp offers cancel\",\n action: \"cancel offer\",\n target: `${productId}/${offerId}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n const result = await client.oneTimeProducts.cancelOffer(\n packageName,\n productId,\n options.purchaseOption,\n offerId,\n );\n console.log(formatOutput(result, format));\n });\n\n offers\n .command(\"batch-get <product-id>\")\n .description(\"Batch get multiple offers\")\n .requiredOption(\n \"--file <path>\",\n \"JSON file with array of {productId, purchaseOptionId, offerId}\",\n )\n .option(\"--purchase-option <id>\", 'Purchase option ID in URL path (default: \"-\")', \"-\")\n .action(async (productId: string, options: { file: string; purchaseOption: 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 requests = await readJsonArray(options.file);\n const result = await client.oneTimeProducts.batchGetOffers(\n packageName,\n productId,\n options.purchaseOption,\n requests.map((r: Record<string, unknown>) => ({\n packageName,\n productId: (r[\"productId\"] as string) || productId,\n purchaseOptionId: (r[\"purchaseOptionId\"] as string) || \"-\",\n offerId: r[\"offerId\"] as string,\n })),\n );\n console.log(formatOutput(result, format));\n });\n\n offers\n .command(\"batch-update <product-id>\")\n .description(\"Batch create or update multiple offers (max 100)\")\n .requiredOption(\"--file <path>\", \"JSON file with update requests\")\n .option(\"--purchase-option <id>\", 'Purchase option ID in URL path (default: \"-\")', \"-\")\n .action(async (productId: string, options: { file: string; purchaseOption: 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: \"otp offers batch-update\",\n action: \"batch update offers for\",\n target: productId,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n const requests = await readJsonArray(options.file);\n const result = await client.oneTimeProducts.batchUpdateOffers(\n packageName,\n productId,\n options.purchaseOption,\n requests,\n );\n console.log(formatOutput(result, format));\n });\n\n offers\n .command(\"batch-update-states <product-id>\")\n .description(\"Batch activate, deactivate, or cancel multiple offers (max 100)\")\n .requiredOption(\"--file <path>\", \"JSON file with state transition requests\")\n .option(\"--purchase-option <id>\", 'Purchase option ID in URL path (default: \"-\")', \"-\")\n .action(async (productId: string, options: { file: string; purchaseOption: 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: \"otp offers batch-update-states\",\n action: \"batch update offer states for\",\n target: productId,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n const requests = await readJsonArray(options.file);\n const result = await client.oneTimeProducts.batchUpdateOfferStates(\n packageName,\n productId,\n options.purchaseOption,\n requests,\n );\n console.log(formatOutput(result, format));\n });\n\n offers\n .command(\"batch-delete <product-id>\")\n .description(\"Batch delete multiple offers (max 100)\")\n .requiredOption(\n \"--file <path>\",\n \"JSON file with array of {productId, purchaseOptionId, offerId}\",\n )\n .option(\"--purchase-option <id>\", 'Purchase option ID in URL path (default: \"-\")', \"-\")\n .action(async (productId: string, options: { file: string; purchaseOption: string }) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(`Batch delete offers for product \"${productId}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"otp offers batch-delete\",\n action: \"batch delete offers for\",\n target: productId,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n const requests = await readJsonArray(options.file);\n await client.oneTimeProducts.batchDeleteOffers(\n packageName,\n productId,\n options.purchaseOption,\n requests,\n );\n console.log(`Batch delete completed.`);\n });\n\n // --- Purchase Options batch ---\n const po = otp.command(\"purchase-options\").description(\"Manage purchase option batch operations\");\n\n po.command(\"batch-delete <product-id>\")\n .description(\"Batch delete purchase options (max 100)\")\n .requiredOption(\"--file <path>\", \"JSON file with delete requests\")\n .action(async (productId: string, options: { file: string }) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(`Batch delete purchase options for product \"${productId}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"otp purchase-options batch-delete\",\n action: \"batch delete purchase options for\",\n target: productId,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n const requests = await readJsonArray(options.file);\n await client.oneTimeProducts.batchDeletePurchaseOptions(packageName, productId, requests);\n console.log(`Batch delete completed.`);\n });\n\n po.command(\"batch-update-states <product-id>\")\n .description(\"Batch activate or deactivate purchase options (max 100)\")\n .requiredOption(\"--file <path>\", \"JSON file with state transition requests\")\n .action(async (productId: string, options: { file: 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: \"otp purchase-options batch-update-states\",\n action: \"batch update purchase option states for\",\n target: productId,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n const requests = await readJsonArray(options.file);\n const result = await client.oneTimeProducts.batchUpdatePurchaseOptionStates(\n packageName,\n productId,\n requests,\n );\n console.log(formatOutput(result, format));\n });\n\n // --- Diff ---\n otp\n .command(\"diff <product-id>\")\n .description(\"Compare local JSON file against remote one-time product\")\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 const localData = (await readJsonFile(options.file)) as OneTimeProduct;\n const diffs = await diffOneTimeProduct(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 });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,SAAS,kBAAkB;AAG3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,eAAe,cAAuB,UAAgC;AACpE,QAAM,OAAO,MAAM,aAAa,QAAQ;AACxC,MAAI,CAAC,MAAM,QAAQ,IAAI,GAAG;AACxB,UAAM,MAAM,IAAI,MAAM,4BAA4B,QAAQ,SAAS,OAAO,IAAI,EAAE;AAChF,WAAO,OAAO,KAAK,EAAE,MAAM,eAAe,UAAU,EAAE,CAAC;AACvD,UAAM;AAAA,EACR;AACA,SAAO;AACT;AAEO,SAAS,gCAAgC,SAAwB;AACtE,QAAM,MAAM,QACT,QAAQ,mBAAmB,EAC3B,MAAM,KAAK,EACX,YAAY,sDAAsD;AAErE,MACG,QAAQ,MAAM,EACd,YAAY,wBAAwB,EACpC,OAAO,kBAAkB,8CAA8C,EACvE,OAAO,OAAO,YAAY;AACzB,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,SAAS,MAAM,UAAU,MAAM;AACrC,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,UAAM,SAAS,MAAM,oBAAoB,QAAQ,WAAW;AAC5D,QAAI,QAAQ,MAAM;AAChB,aAAO,kBAAkB,YAAY,OAAO,iBAAiB,QAAQ,IAAI;AAAA,IAC3E;AACA,U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;AACL;","names":["format"]}
@@ -114,7 +114,7 @@ function registerSubscriptionsCommands(program) {
114
114
  console.log(formatOutput(result, format));
115
115
  }
116
116
  });
117
- subs.command("create").description("Create a subscription from JSON file").requiredOption("--file <path>", "JSON file with subscription data").option("--activate", "Activate all base plans after creation").action(async (options) => {
117
+ subs.command("create").description("Create a subscription from JSON file").requiredOption("--file <path>", "JSON file with subscription data").option("--activate", "Activate all base plans after creation").option("--regions-version <version>", "Regional pricing version (default 2022/02)").action(async (options) => {
118
118
  const config = await loadConfig();
119
119
  const packageName = resolvePackageName(program.opts()["app"], config);
120
120
  const format = getOutputFormat(program, config);
@@ -124,7 +124,10 @@ function registerSubscriptionsCommands(program) {
124
124
  command: "subscriptions create",
125
125
  action: "create",
126
126
  target: `subscription from ${options.file}`,
127
- details: options.activate ? { activate: true } : void 0
127
+ details: {
128
+ ...options.activate ? { activate: true } : {},
129
+ ...options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}
130
+ }
128
131
  },
129
132
  format,
130
133
  formatOutput
@@ -133,7 +136,12 @@ function registerSubscriptionsCommands(program) {
133
136
  }
134
137
  const client = await getClient(config);
135
138
  const data = await readJsonFile(options.file);
136
- const result = await createSubscription(client, packageName, data);
139
+ const result = await createSubscription(
140
+ client,
141
+ packageName,
142
+ data,
143
+ options.regionsVersion
144
+ );
137
145
  if (options.activate && result.basePlans) {
138
146
  for (const bp of result.basePlans) {
139
147
  if (bp.state === "DRAFT") {
@@ -147,7 +155,7 @@ function registerSubscriptionsCommands(program) {
147
155
  console.log(formatOutput(result, format));
148
156
  }
149
157
  });
150
- subs.command("update <product-id>").description("Update a subscription from JSON file").requiredOption("--file <path>", "JSON file with subscription data").option("--update-mask <fields>", "Comma-separated field mask").action(async (productId, options) => {
158
+ subs.command("update <product-id>").description("Update a subscription from JSON file").requiredOption("--file <path>", "JSON file with subscription data").option("--update-mask <fields>", "Comma-separated field mask").option("--regions-version <version>", "Regional pricing version (default 2022/02)").action(async (productId, options) => {
151
159
  const config = await loadConfig();
152
160
  const packageName = resolvePackageName(program.opts()["app"], config);
153
161
  const format = getOutputFormat(program, config);
@@ -157,7 +165,11 @@ function registerSubscriptionsCommands(program) {
157
165
  command: "subscriptions update",
158
166
  action: "update",
159
167
  target: productId,
160
- details: { file: options.file, updateMask: options.updateMask }
168
+ details: {
169
+ file: options.file,
170
+ updateMask: options.updateMask,
171
+ ...options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}
172
+ }
161
173
  },
162
174
  format,
163
175
  formatOutput
@@ -171,7 +183,8 @@ function registerSubscriptionsCommands(program) {
171
183
  packageName,
172
184
  productId,
173
185
  data,
174
- options.updateMask
186
+ options.updateMask,
187
+ options.regionsVersion
175
188
  );
176
189
  console.log(formatOutput(result, format));
177
190
  });
@@ -324,7 +337,7 @@ function registerSubscriptionsCommands(program) {
324
337
  const result = await getOffer(client, packageName, productId, basePlanId, offerId);
325
338
  console.log(formatOutput(result, format));
326
339
  });
327
- offers.command("create <product-id> <base-plan-id>").description("Create an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").action(
340
+ offers.command("create <product-id> <base-plan-id>").description("Create an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").option("--regions-version <version>", "Regional pricing version (default 2022/02)").action(
328
341
  async (productId, basePlanId, options) => {
329
342
  const config = await loadConfig();
330
343
  const packageName = resolvePackageName(program.opts()["app"], config);
@@ -335,7 +348,10 @@ function registerSubscriptionsCommands(program) {
335
348
  command: "subscriptions offers create",
336
349
  action: "create offer for",
337
350
  target: `${productId}/${basePlanId}`,
338
- details: { file: options.file }
351
+ details: {
352
+ file: options.file,
353
+ ...options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}
354
+ }
339
355
  },
340
356
  format,
341
357
  formatOutput
@@ -349,12 +365,13 @@ function registerSubscriptionsCommands(program) {
349
365
  packageName,
350
366
  productId,
351
367
  basePlanId,
352
- data
368
+ data,
369
+ options.regionsVersion
353
370
  );
354
371
  console.log(formatOutput(result, format));
355
372
  }
356
373
  );
357
- offers.command("update <product-id> <base-plan-id> <offer-id>").description("Update an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").option("--update-mask <fields>", "Comma-separated field mask").action(
374
+ offers.command("update <product-id> <base-plan-id> <offer-id>").description("Update an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").option("--update-mask <fields>", "Comma-separated field mask").option("--regions-version <version>", "Regional pricing version (default 2022/02)").action(
358
375
  async (productId, basePlanId, offerId, options) => {
359
376
  const config = await loadConfig();
360
377
  const packageName = resolvePackageName(program.opts()["app"], config);
@@ -365,7 +382,11 @@ function registerSubscriptionsCommands(program) {
365
382
  command: "subscriptions offers update",
366
383
  action: "update offer",
367
384
  target: `${productId}/${basePlanId}/${offerId}`,
368
- details: { file: options.file, updateMask: options.updateMask }
385
+ details: {
386
+ file: options.file,
387
+ updateMask: options.updateMask,
388
+ regionsVersion: options.regionsVersion
389
+ }
369
390
  },
370
391
  format,
371
392
  formatOutput
@@ -381,7 +402,8 @@ function registerSubscriptionsCommands(program) {
381
402
  basePlanId,
382
403
  offerId,
383
404
  data,
384
- options.updateMask
405
+ options.updateMask,
406
+ options.regionsVersion
385
407
  );
386
408
  console.log(formatOutput(result, format));
387
409
  }
@@ -530,4 +552,4 @@ By product:`);
530
552
  export {
531
553
  registerSubscriptionsCommands
532
554
  };
533
- //# sourceMappingURL=subscriptions-KEF7KIST.js.map
555
+ //# sourceMappingURL=subscriptions-W67I25XY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/subscriptions.ts"],"sourcesContent":["import { resolvePackageName, getClient } from \"../resolve.js\";\nimport type { Command } from \"commander\";\nimport { Option } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\n\nimport type { Subscription, BasePlanMigratePricesRequest, SubscriptionOffer } 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 getSubscriptionAnalytics,\n formatOutput,\n sortResults,\n maybePaginate,\n annotateListResult,\n moreResultsFooter,\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\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 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 const subs = result.subscriptions || [];\n if (format !== \"json\") {\n if (subs.length === 0) {\n console.log(\"No subscriptions found.\");\n return;\n }\n const summary = subs.map((s: Subscription) => ({\n productId: s.productId,\n basePlans: s.basePlans?.length || 0,\n listings: s.listings ? s.listings.length : 0,\n firstBasePlanState: s.basePlans?.[0]?.state || \"-\",\n }));\n await maybePaginate(formatOutput(summary, format));\n const footer = moreResultsFooter(result.nextPageToken);\n if (footer) console.log(footer);\n } else {\n await maybePaginate(\n formatOutput(\n annotateListResult(\n { ...result, subscriptions: subs },\n \"subscriptions\",\n \"No subscriptions found\",\n ),\n format,\n ),\n );\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 const result = await getSubscription(client, packageName, productId);\n if (format !== \"json\") {\n const s = result as unknown as Record<string, unknown>;\n const basePlans = s[\"basePlans\"] as Array<Record<string, unknown>> | undefined;\n const listings = s[\"listings\"] as\n | Record<string, unknown>\n | Array<Record<string, unknown>>\n | 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)\n ? listings.length\n : 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>)?.[\n \"taxRateInfoByRegionCode\"\n ]\n ? \"configured\"\n : \"-\",\n };\n console.log(formatOutput(summary, format));\n } else {\n console.log(formatOutput(result, format));\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 .option(\"--regions-version <version>\", \"Regional pricing version (default 2022/02)\")\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: {\n ...(options.activate ? { activate: true } : {}),\n ...(options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}),\n },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const data = await readJsonFile(options.file);\n const result = await createSubscription(\n client,\n packageName,\n data as Subscription,\n options.regionsVersion,\n );\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 });\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 .option(\"--regions-version <version>\", \"Regional pricing version (default 2022/02)\")\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: {\n file: options.file,\n updateMask: options.updateMask,\n ...(options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}),\n },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const data = await readJsonFile(options.file);\n const result = await updateSubscription(\n client,\n packageName,\n productId,\n data as Subscription,\n options.updateMask,\n options.regionsVersion,\n );\n console.log(formatOutput(result, format));\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 await deleteSubscription(client, packageName, productId);\n console.log(`Subscription ${productId} deleted.`);\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 const result = await activateBasePlan(client, packageName, productId, basePlanId);\n console.log(formatOutput(result, format));\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 const result = await deactivateBasePlan(client, packageName, productId, basePlanId);\n console.log(formatOutput(result, format));\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 await deleteBasePlan(client, packageName, productId, basePlanId);\n console.log(`Base plan ${basePlanId} deleted.`);\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 const data = await readJsonFile(options.file);\n await migratePrices(\n client,\n packageName,\n productId,\n basePlanId,\n data as BasePlanMigratePricesRequest,\n );\n console.log(formatOutput({ success: true }, format));\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 const result = await listOffers(client, packageName, productId, basePlanId);\n const offers_list = (result as unknown as Record<string, unknown>)[\"subscriptionOffers\"] as\n | Array<Record<string, unknown>>\n | 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 });\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 const result = await getOffer(client, packageName, productId, basePlanId, offerId);\n console.log(formatOutput(result, format));\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 .option(\"--regions-version <version>\", \"Regional pricing version (default 2022/02)\")\n .action(\n async (\n productId: string,\n basePlanId: string,\n options: { file: string; updateMask?: string; regionsVersion?: 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: {\n file: options.file,\n ...(options.regionsVersion ? { regionsVersion: options.regionsVersion } : {}),\n },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n const data = await readJsonFile(options.file);\n const result = await createOffer(\n client,\n packageName,\n productId,\n basePlanId,\n data as SubscriptionOffer,\n options.regionsVersion,\n );\n console.log(formatOutput(result, format));\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 .option(\"--regions-version <version>\", \"Regional pricing version (default 2022/02)\")\n .action(\n async (\n productId: string,\n basePlanId: string,\n offerId: string,\n options: { file: string; updateMask?: string; regionsVersion?: 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: {\n file: options.file,\n updateMask: options.updateMask,\n regionsVersion: options.regionsVersion,\n },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\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 SubscriptionOffer,\n options.updateMask,\n options.regionsVersion,\n );\n console.log(formatOutput(result, format));\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 await deleteOffer(client, packageName, productId, basePlanId, offerId);\n console.log(`Offer ${offerId} deleted.`);\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 const result = await activateOffer(client, packageName, productId, basePlanId, offerId);\n console.log(formatOutput(result, format));\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 const result = await deactivateOffer(client, packageName, productId, basePlanId, offerId);\n console.log(formatOutput(result, format));\n });\n\n offers\n .command(\"batch-get <product-id> <base-plan-id>\")\n .description(\"Batch get multiple offers (max 100)\")\n .requiredOption(\"--ids <offer-ids>\", \"Comma-separated offer IDs\")\n .action(async (productId: string, basePlanId: string, options: { ids: 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 offerIds = options.ids.split(\",\").map((id) => id.trim());\n const result = await client.subscriptions.batchGetOffers(\n packageName,\n productId,\n basePlanId,\n offerIds,\n );\n console.log(formatOutput(result, format));\n });\n\n offers\n .command(\"batch-update-states <product-id> <base-plan-id>\")\n .description(\"Batch activate or deactivate multiple offers (max 100)\")\n .requiredOption(\"--file <path>\", \"JSON file with state transition requests\")\n .action(async (productId: string, basePlanId: string, options: { file: 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 batch-update-states\",\n action: \"batch update offer states\",\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 const requests = await readJsonFile(options.file);\n const result = await client.subscriptions.batchUpdateOfferStates(\n packageName,\n productId,\n basePlanId,\n requests as {\n requests: Array<{\n activateSubscriptionOfferRequest?: { offerId: string };\n deactivateSubscriptionOfferRequest?: { offerId: string };\n }>;\n },\n );\n console.log(formatOutput(result, format));\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 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 });\n\n subs\n .command(\"analytics\")\n .description(\"Subscription catalog analytics: active plans, offer counts, state breakdown\")\n .action(async () => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const result = await getSubscriptionAnalytics(client, packageName);\n\n if (format === \"json\") {\n console.log(formatOutput(result, format));\n return;\n }\n\n console.log(`\\nSubscription Analytics — ${packageName}`);\n console.log(`${\"─\".repeat(50)}`);\n console.log(`Total subscriptions: ${result.totalSubscriptions}`);\n console.log(`Active subscriptions: ${result.activeCount}`);\n console.log(`Active base plans: ${result.activeBasePlans}`);\n console.log(`Draft base plans: ${result.trialBasePlans}`);\n console.log(`Inactive base plans: ${result.pausedBasePlans}`);\n console.log(`Total offers: ${result.offerCount}`);\n\n if (result.byProductId.length > 0) {\n console.log(`\\nBy product:`);\n console.log(formatOutput(result.byProductId, format));\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAG3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMA,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,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AU,EAAE;AAExD,QAAI,OAAO,YAAY,SAAS,GAAG;AACjC,cAAQ,IAAI;AAAA,YAAe;AAC3B,cAAQ,IAAI,aAAa,OAAO,aAAa,MAAM,CAAC;AAAA,IACtD;AAAA,EACF,CAAC;AACL;","names":["subs","basePlans"]}
@@ -17,7 +17,7 @@ function registerUpdateCommand(program) {
17
17
  program.command("update").description("Update gpc to the latest version").option("--check", "Check for updates without installing (exits 0 always)").option("--force", "Update even if already on the latest version").action(async (opts, cmd) => {
18
18
  const parentOpts = cmd.parent?.opts() ?? {};
19
19
  const jsonMode = !!(parentOpts["json"] || parentOpts["output"] === "json");
20
- const currentVersion = "0.9.83";
20
+ const currentVersion = "0.9.85";
21
21
  if (currentVersion === "0.0.0") {
22
22
  if (jsonMode) {
23
23
  console.log(
@@ -172,4 +172,4 @@ Run: gpc update`);
172
172
  export {
173
173
  registerUpdateCommand
174
174
  };
175
- //# sourceMappingURL=update-ROEAKMQD.js.map
175
+ //# sourceMappingURL=update-JGLB2ELN.js.map
@@ -7,7 +7,7 @@ import "./chunk-3SJ6OXCZ.js";
7
7
  // src/commands/version.ts
8
8
  function registerVersionCommand(program) {
9
9
  program.command("version").description("Show version information").action(() => {
10
- const version = "0.9.83";
10
+ const version = "0.9.85";
11
11
  if (program.opts()["output"] === "json") {
12
12
  console.log(
13
13
  JSON.stringify({
@@ -25,4 +25,4 @@ function registerVersionCommand(program) {
25
25
  export {
26
26
  registerVersionCommand
27
27
  };
28
- //# sourceMappingURL=version-X3RJKLJW.js.map
28
+ //# sourceMappingURL=version-B4AE5NVE.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpc-cli/cli",
3
- "version": "0.9.83",
3
+ "version": "0.9.85",
4
4
  "description": "GPC — Google Play Console CLI. 217 API endpoints including Managed Google Play. Upload AABs, manage releases, monitor vitals, publish private enterprise apps. Fastlane alternative for Android.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,7 +20,7 @@
20
20
  "scripts": {
21
21
  "prebuild": "tsx ../../scripts/build-docs-bundle.ts",
22
22
  "build": "tsup",
23
- "postbuild": "mkdir -p dist/generated && cp src/generated/docs-bundle.json dist/generated/",
23
+ "postbuild": "node -e \"const fs=require('node:fs');fs.mkdirSync('dist/generated',{recursive:true});fs.copyFileSync('src/generated/docs-bundle.json','dist/generated/docs-bundle.json')\"",
24
24
  "dev": "tsup --watch",
25
25
  "test": "vitest run",
26
26
  "test:watch": "vitest",
@@ -29,11 +29,11 @@
29
29
  "clean": "rm -rf dist"
30
30
  },
31
31
  "dependencies": {
32
- "@gpc-cli/api": "workspace:*",
33
- "@gpc-cli/auth": "workspace:*",
34
- "@gpc-cli/config": "workspace:*",
35
- "@gpc-cli/core": "workspace:*",
36
- "@gpc-cli/plugin-sdk": "workspace:*",
32
+ "@gpc-cli/api": "1.0.44",
33
+ "@gpc-cli/auth": "0.9.16",
34
+ "@gpc-cli/config": "0.9.18",
35
+ "@gpc-cli/core": "0.9.71",
36
+ "@gpc-cli/plugin-sdk": "0.9.10",
37
37
  "commander": "^14.0.3"
38
38
  },
39
39
  "homepage": "https://yasserstudio.github.io/gpc/",