@gpc-cli/cli 0.1.3 → 0.1.4

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.
Files changed (73) hide show
  1. package/README.md +21 -21
  2. package/dist/{apps-BBYNHB2H.js → apps-TZG5GEDW.js} +9 -7
  3. package/dist/apps-TZG5GEDW.js.map +1 -0
  4. package/dist/{auth-T7IDSMVX.js → auth-CIITFC3C.js} +4 -2
  5. package/dist/auth-CIITFC3C.js.map +1 -0
  6. package/dist/bin.js +1 -1
  7. package/dist/bin.js.map +1 -1
  8. package/dist/{chunk-IVVT73IP.js → chunk-22DW4R5W.js} +31 -26
  9. package/dist/chunk-22DW4R5W.js.map +1 -0
  10. package/dist/{chunk-4QV4WD3F.js → chunk-Q7KVGI46.js} +9 -7
  11. package/dist/chunk-Q7KVGI46.js.map +1 -0
  12. package/dist/{chunk-QMKZYXDJ.js → chunk-Y3QZDAKS.js} +2 -2
  13. package/dist/chunk-Y3QZDAKS.js.map +1 -0
  14. package/dist/{completion-U44CGHRH.js → completion-IHVLP7OK.js} +1 -1
  15. package/dist/completion-IHVLP7OK.js.map +1 -0
  16. package/dist/{config-K7UJKIXT.js → config-7QKUVNZZ.js} +8 -4
  17. package/dist/config-7QKUVNZZ.js.map +1 -0
  18. package/dist/{doctor-VDDUPTIM.js → doctor-KVP7PGZU.js} +5 -3
  19. package/dist/doctor-KVP7PGZU.js.map +1 -0
  20. package/dist/{iap-QIV4CXKZ.js → iap-Z365AMDD.js} +37 -25
  21. package/dist/iap-Z365AMDD.js.map +1 -0
  22. package/dist/index.js +1 -1
  23. package/dist/{listings-PF5FDXKQ.js → listings-U3T6NFVH.js} +128 -68
  24. package/dist/listings-U3T6NFVH.js.map +1 -0
  25. package/dist/{pricing-S4SB5FXJ.js → pricing-LXIRB4R7.js} +21 -15
  26. package/dist/pricing-LXIRB4R7.js.map +1 -0
  27. package/dist/{prompt-VP5LURRP.js → prompt-ASDQX6LZ.js} +2 -2
  28. package/dist/{publish-3BAIN4NQ.js → publish-HKOJVZ23.js} +27 -16
  29. package/dist/publish-HKOJVZ23.js.map +1 -0
  30. package/dist/{purchases-E6A2T5WQ.js → purchases-ZQ7FXEZQ.js} +84 -49
  31. package/dist/purchases-ZQ7FXEZQ.js.map +1 -0
  32. package/dist/{releases-464IMEEF.js → releases-IZJJYTNZ.js} +103 -51
  33. package/dist/releases-IZJJYTNZ.js.map +1 -0
  34. package/dist/{reports-3YAD4U4F.js → reports-43OVCCU3.js} +83 -29
  35. package/dist/reports-43OVCCU3.js.map +1 -0
  36. package/dist/{reviews-2CLM53E3.js → reviews-T3SRAZLW.js} +25 -16
  37. package/dist/reviews-T3SRAZLW.js.map +1 -0
  38. package/dist/{status-M7U3YNMU.js → status-TBPVS7YR.js} +5 -3
  39. package/dist/status-TBPVS7YR.js.map +1 -0
  40. package/dist/{subscriptions-PUHH4FBB.js → subscriptions-UJUX3ELS.js} +201 -130
  41. package/dist/subscriptions-UJUX3ELS.js.map +1 -0
  42. package/dist/{testers-WWZMLB7J.js → testers-YNOGFHUR.js} +81 -44
  43. package/dist/testers-YNOGFHUR.js.map +1 -0
  44. package/dist/{tracks-427E34S3.js → tracks-HMJ3F55N.js} +5 -3
  45. package/dist/tracks-HMJ3F55N.js.map +1 -0
  46. package/dist/{users-E5Y5HI6K.js → users-GRQTY6HY.js} +48 -28
  47. package/dist/users-GRQTY6HY.js.map +1 -0
  48. package/dist/{vitals-YMZMUPNA.js → vitals-VP2GKG3G.js} +23 -9
  49. package/dist/vitals-VP2GKG3G.js.map +1 -0
  50. package/package.json +5 -5
  51. package/dist/apps-BBYNHB2H.js.map +0 -1
  52. package/dist/auth-T7IDSMVX.js.map +0 -1
  53. package/dist/chunk-4QV4WD3F.js.map +0 -1
  54. package/dist/chunk-IVVT73IP.js.map +0 -1
  55. package/dist/chunk-QMKZYXDJ.js.map +0 -1
  56. package/dist/completion-U44CGHRH.js.map +0 -1
  57. package/dist/config-K7UJKIXT.js.map +0 -1
  58. package/dist/doctor-VDDUPTIM.js.map +0 -1
  59. package/dist/iap-QIV4CXKZ.js.map +0 -1
  60. package/dist/listings-PF5FDXKQ.js.map +0 -1
  61. package/dist/pricing-S4SB5FXJ.js.map +0 -1
  62. package/dist/publish-3BAIN4NQ.js.map +0 -1
  63. package/dist/purchases-E6A2T5WQ.js.map +0 -1
  64. package/dist/releases-464IMEEF.js.map +0 -1
  65. package/dist/reports-3YAD4U4F.js.map +0 -1
  66. package/dist/reviews-2CLM53E3.js.map +0 -1
  67. package/dist/status-M7U3YNMU.js.map +0 -1
  68. package/dist/subscriptions-PUHH4FBB.js.map +0 -1
  69. package/dist/testers-WWZMLB7J.js.map +0 -1
  70. package/dist/tracks-427E34S3.js.map +0 -1
  71. package/dist/users-E5Y5HI6K.js.map +0 -1
  72. package/dist/vitals-YMZMUPNA.js.map +0 -1
  73. /package/dist/{prompt-VP5LURRP.js.map → prompt-ASDQX6LZ.js.map} +0 -0
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  isDryRun,
4
4
  printDryRun
5
- } from "./chunk-QMKZYXDJ.js";
5
+ } from "./chunk-Y3QZDAKS.js";
6
6
  import {
7
7
  requireConfirm
8
- } from "./chunk-4QV4WD3F.js";
8
+ } from "./chunk-Q7KVGI46.js";
9
9
 
10
10
  // src/commands/subscriptions.ts
11
11
  import { readFile } from "fs/promises";
@@ -48,7 +48,7 @@ function registerSubscriptionsCommands(program) {
48
48
  const subs = program.command("subscriptions").description("Manage subscriptions and base plans");
49
49
  subs.command("list").description("List subscriptions").option("--page-size <n>", "Results per page", parseInt).option("--page-token <token>", "Page token").option("--limit <n>", "Maximum total results", parseInt).option("--next-page <token>", "Resume from page token").action(async (options) => {
50
50
  const config = await loadConfig();
51
- const packageName = resolvePackageName(program.opts().app, config);
51
+ const packageName = resolvePackageName(program.opts()["app"], config);
52
52
  const client = await getClient(config);
53
53
  const format = detectOutputFormat();
54
54
  try {
@@ -66,7 +66,7 @@ function registerSubscriptionsCommands(program) {
66
66
  });
67
67
  subs.command("get <product-id>").description("Get a subscription").action(async (productId) => {
68
68
  const config = await loadConfig();
69
- const packageName = resolvePackageName(program.opts().app, config);
69
+ const packageName = resolvePackageName(program.opts()["app"], config);
70
70
  const client = await getClient(config);
71
71
  const format = detectOutputFormat();
72
72
  try {
@@ -79,14 +79,18 @@ function registerSubscriptionsCommands(program) {
79
79
  });
80
80
  subs.command("create").description("Create a subscription from JSON file").requiredOption("--file <path>", "JSON file with subscription data").action(async (options) => {
81
81
  const config = await loadConfig();
82
- const packageName = resolvePackageName(program.opts().app, config);
82
+ const packageName = resolvePackageName(program.opts()["app"], config);
83
83
  const format = detectOutputFormat();
84
84
  if (isDryRun(program)) {
85
- printDryRun({
86
- command: "subscriptions create",
87
- action: "create",
88
- target: `subscription from ${options.file}`
89
- }, format, formatOutput);
85
+ printDryRun(
86
+ {
87
+ command: "subscriptions create",
88
+ action: "create",
89
+ target: `subscription from ${options.file}`
90
+ },
91
+ format,
92
+ formatOutput
93
+ );
90
94
  return;
91
95
  }
92
96
  const client = await getClient(config);
@@ -101,21 +105,31 @@ function registerSubscriptionsCommands(program) {
101
105
  });
102
106
  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) => {
103
107
  const config = await loadConfig();
104
- const packageName = resolvePackageName(program.opts().app, config);
108
+ const packageName = resolvePackageName(program.opts()["app"], config);
105
109
  const format = detectOutputFormat();
106
110
  if (isDryRun(program)) {
107
- printDryRun({
108
- command: "subscriptions update",
109
- action: "update",
110
- target: productId,
111
- details: { file: options.file, updateMask: options.updateMask }
112
- }, format, formatOutput);
111
+ printDryRun(
112
+ {
113
+ command: "subscriptions update",
114
+ action: "update",
115
+ target: productId,
116
+ details: { file: options.file, updateMask: options.updateMask }
117
+ },
118
+ format,
119
+ formatOutput
120
+ );
113
121
  return;
114
122
  }
115
123
  const client = await getClient(config);
116
124
  try {
117
125
  const data = JSON.parse(await readFile(options.file, "utf-8"));
118
- const result = await updateSubscription(client, packageName, productId, data, options.updateMask);
126
+ const result = await updateSubscription(
127
+ client,
128
+ packageName,
129
+ productId,
130
+ data,
131
+ options.updateMask
132
+ );
119
133
  console.log(formatOutput(result, format));
120
134
  } catch (error) {
121
135
  console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
@@ -124,15 +138,19 @@ function registerSubscriptionsCommands(program) {
124
138
  });
125
139
  subs.command("delete <product-id>").description("Delete a subscription").action(async (productId) => {
126
140
  const config = await loadConfig();
127
- const packageName = resolvePackageName(program.opts().app, config);
141
+ const packageName = resolvePackageName(program.opts()["app"], config);
128
142
  await requireConfirm(`Delete subscription "${productId}"?`, program);
129
143
  if (isDryRun(program)) {
130
144
  const format = detectOutputFormat();
131
- printDryRun({
132
- command: "subscriptions delete",
133
- action: "delete",
134
- target: productId
135
- }, format, formatOutput);
145
+ printDryRun(
146
+ {
147
+ command: "subscriptions delete",
148
+ action: "delete",
149
+ target: productId
150
+ },
151
+ format,
152
+ formatOutput
153
+ );
136
154
  return;
137
155
  }
138
156
  const client = await getClient(config);
@@ -147,14 +165,18 @@ function registerSubscriptionsCommands(program) {
147
165
  const basePlans = subs.command("base-plans").description("Manage base plans");
148
166
  basePlans.command("activate <product-id> <base-plan-id>").description("Activate a base plan").action(async (productId, basePlanId) => {
149
167
  const config = await loadConfig();
150
- const packageName = resolvePackageName(program.opts().app, config);
168
+ const packageName = resolvePackageName(program.opts()["app"], config);
151
169
  const format = detectOutputFormat();
152
170
  if (isDryRun(program)) {
153
- printDryRun({
154
- command: "subscriptions base-plans activate",
155
- action: "activate",
156
- target: `${productId}/${basePlanId}`
157
- }, format, formatOutput);
171
+ printDryRun(
172
+ {
173
+ command: "subscriptions base-plans activate",
174
+ action: "activate",
175
+ target: `${productId}/${basePlanId}`
176
+ },
177
+ format,
178
+ formatOutput
179
+ );
158
180
  return;
159
181
  }
160
182
  const client = await getClient(config);
@@ -168,14 +190,18 @@ function registerSubscriptionsCommands(program) {
168
190
  });
169
191
  basePlans.command("deactivate <product-id> <base-plan-id>").description("Deactivate a base plan").action(async (productId, basePlanId) => {
170
192
  const config = await loadConfig();
171
- const packageName = resolvePackageName(program.opts().app, config);
193
+ const packageName = resolvePackageName(program.opts()["app"], config);
172
194
  const format = detectOutputFormat();
173
195
  if (isDryRun(program)) {
174
- printDryRun({
175
- command: "subscriptions base-plans deactivate",
176
- action: "deactivate",
177
- target: `${productId}/${basePlanId}`
178
- }, format, formatOutput);
196
+ printDryRun(
197
+ {
198
+ command: "subscriptions base-plans deactivate",
199
+ action: "deactivate",
200
+ target: `${productId}/${basePlanId}`
201
+ },
202
+ format,
203
+ formatOutput
204
+ );
179
205
  return;
180
206
  }
181
207
  const client = await getClient(config);
@@ -189,15 +215,22 @@ function registerSubscriptionsCommands(program) {
189
215
  });
190
216
  basePlans.command("delete <product-id> <base-plan-id>").description("Delete a base plan").action(async (productId, basePlanId) => {
191
217
  const config = await loadConfig();
192
- const packageName = resolvePackageName(program.opts().app, config);
193
- await requireConfirm(`Delete base plan "${basePlanId}" from subscription "${productId}"?`, program);
218
+ const packageName = resolvePackageName(program.opts()["app"], config);
219
+ await requireConfirm(
220
+ `Delete base plan "${basePlanId}" from subscription "${productId}"?`,
221
+ program
222
+ );
194
223
  if (isDryRun(program)) {
195
224
  const format = detectOutputFormat();
196
- printDryRun({
197
- command: "subscriptions base-plans delete",
198
- action: "delete",
199
- target: `${productId}/${basePlanId}`
200
- }, format, formatOutput);
225
+ printDryRun(
226
+ {
227
+ command: "subscriptions base-plans delete",
228
+ action: "delete",
229
+ target: `${productId}/${basePlanId}`
230
+ },
231
+ format,
232
+ formatOutput
233
+ );
201
234
  return;
202
235
  }
203
236
  const client = await getClient(config);
@@ -209,33 +242,39 @@ function registerSubscriptionsCommands(program) {
209
242
  process.exit(4);
210
243
  }
211
244
  });
212
- basePlans.command("migrate-prices <product-id> <base-plan-id>").description("Migrate base plan prices").requiredOption("--file <path>", "JSON file with migration data").action(async (productId, basePlanId, options) => {
213
- const config = await loadConfig();
214
- const packageName = resolvePackageName(program.opts().app, config);
215
- const format = detectOutputFormat();
216
- if (isDryRun(program)) {
217
- printDryRun({
218
- command: "subscriptions base-plans migrate-prices",
219
- action: "migrate prices for",
220
- target: `${productId}/${basePlanId}`,
221
- details: { file: options.file }
222
- }, format, formatOutput);
223
- return;
224
- }
225
- const client = await getClient(config);
226
- try {
227
- const data = JSON.parse(await readFile(options.file, "utf-8"));
228
- const result = await migratePrices(client, packageName, productId, basePlanId, data);
229
- console.log(formatOutput(result, format));
230
- } catch (error) {
231
- console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
232
- process.exit(4);
245
+ basePlans.command("migrate-prices <product-id> <base-plan-id>").description("Migrate base plan prices").requiredOption("--file <path>", "JSON file with migration data").action(
246
+ async (productId, basePlanId, options) => {
247
+ const config = await loadConfig();
248
+ const packageName = resolvePackageName(program.opts()["app"], config);
249
+ const format = detectOutputFormat();
250
+ if (isDryRun(program)) {
251
+ printDryRun(
252
+ {
253
+ command: "subscriptions base-plans migrate-prices",
254
+ action: "migrate prices for",
255
+ target: `${productId}/${basePlanId}`,
256
+ details: { file: options.file }
257
+ },
258
+ format,
259
+ formatOutput
260
+ );
261
+ return;
262
+ }
263
+ const client = await getClient(config);
264
+ try {
265
+ const data = JSON.parse(await readFile(options.file, "utf-8"));
266
+ const result = await migratePrices(client, packageName, productId, basePlanId, data);
267
+ console.log(formatOutput(result, format));
268
+ } catch (error) {
269
+ console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
270
+ process.exit(4);
271
+ }
233
272
  }
234
- });
273
+ );
235
274
  const offers = subs.command("offers").description("Manage subscription offers");
236
275
  offers.command("list <product-id> <base-plan-id>").description("List offers for a base plan").action(async (productId, basePlanId) => {
237
276
  const config = await loadConfig();
238
- const packageName = resolvePackageName(program.opts().app, config);
277
+ const packageName = resolvePackageName(program.opts()["app"], config);
239
278
  const client = await getClient(config);
240
279
  const format = detectOutputFormat();
241
280
  try {
@@ -248,7 +287,7 @@ function registerSubscriptionsCommands(program) {
248
287
  });
249
288
  offers.command("get <product-id> <base-plan-id> <offer-id>").description("Get an offer").action(async (productId, basePlanId, offerId) => {
250
289
  const config = await loadConfig();
251
- const packageName = resolvePackageName(program.opts().app, config);
290
+ const packageName = resolvePackageName(program.opts()["app"], config);
252
291
  const client = await getClient(config);
253
292
  const format = detectOutputFormat();
254
293
  try {
@@ -259,63 +298,87 @@ function registerSubscriptionsCommands(program) {
259
298
  process.exit(4);
260
299
  }
261
300
  });
262
- offers.command("create <product-id> <base-plan-id>").description("Create an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").action(async (productId, basePlanId, options) => {
263
- const config = await loadConfig();
264
- const packageName = resolvePackageName(program.opts().app, config);
265
- const format = detectOutputFormat();
266
- if (isDryRun(program)) {
267
- printDryRun({
268
- command: "subscriptions offers create",
269
- action: "create offer for",
270
- target: `${productId}/${basePlanId}`,
271
- details: { file: options.file }
272
- }, format, formatOutput);
273
- return;
274
- }
275
- const client = await getClient(config);
276
- try {
277
- const data = JSON.parse(await readFile(options.file, "utf-8"));
278
- const result = await createOffer(client, packageName, productId, basePlanId, data);
279
- console.log(formatOutput(result, format));
280
- } catch (error) {
281
- console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
282
- process.exit(4);
283
- }
284
- });
285
- 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(async (productId, basePlanId, offerId, options) => {
286
- const config = await loadConfig();
287
- const packageName = resolvePackageName(program.opts().app, config);
288
- const format = detectOutputFormat();
289
- if (isDryRun(program)) {
290
- printDryRun({
291
- command: "subscriptions offers update",
292
- action: "update offer",
293
- target: `${productId}/${basePlanId}/${offerId}`,
294
- details: { file: options.file, updateMask: options.updateMask }
295
- }, format, formatOutput);
296
- return;
301
+ offers.command("create <product-id> <base-plan-id>").description("Create an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").action(
302
+ async (productId, basePlanId, options) => {
303
+ const config = await loadConfig();
304
+ const packageName = resolvePackageName(program.opts()["app"], config);
305
+ const format = detectOutputFormat();
306
+ if (isDryRun(program)) {
307
+ printDryRun(
308
+ {
309
+ command: "subscriptions offers create",
310
+ action: "create offer for",
311
+ target: `${productId}/${basePlanId}`,
312
+ details: { file: options.file }
313
+ },
314
+ format,
315
+ formatOutput
316
+ );
317
+ return;
318
+ }
319
+ const client = await getClient(config);
320
+ try {
321
+ const data = JSON.parse(await readFile(options.file, "utf-8"));
322
+ const result = await createOffer(client, packageName, productId, basePlanId, data);
323
+ console.log(formatOutput(result, format));
324
+ } catch (error) {
325
+ console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
326
+ process.exit(4);
327
+ }
297
328
  }
298
- const client = await getClient(config);
299
- try {
300
- const data = JSON.parse(await readFile(options.file, "utf-8"));
301
- const result = await updateOffer(client, packageName, productId, basePlanId, offerId, data, options.updateMask);
302
- console.log(formatOutput(result, format));
303
- } catch (error) {
304
- console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
305
- process.exit(4);
329
+ );
330
+ 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(
331
+ async (productId, basePlanId, offerId, options) => {
332
+ const config = await loadConfig();
333
+ const packageName = resolvePackageName(program.opts()["app"], config);
334
+ const format = detectOutputFormat();
335
+ if (isDryRun(program)) {
336
+ printDryRun(
337
+ {
338
+ command: "subscriptions offers update",
339
+ action: "update offer",
340
+ target: `${productId}/${basePlanId}/${offerId}`,
341
+ details: { file: options.file, updateMask: options.updateMask }
342
+ },
343
+ format,
344
+ formatOutput
345
+ );
346
+ return;
347
+ }
348
+ const client = await getClient(config);
349
+ try {
350
+ const data = JSON.parse(await readFile(options.file, "utf-8"));
351
+ const result = await updateOffer(
352
+ client,
353
+ packageName,
354
+ productId,
355
+ basePlanId,
356
+ offerId,
357
+ data,
358
+ options.updateMask
359
+ );
360
+ console.log(formatOutput(result, format));
361
+ } catch (error) {
362
+ console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
363
+ process.exit(4);
364
+ }
306
365
  }
307
- });
366
+ );
308
367
  offers.command("delete <product-id> <base-plan-id> <offer-id>").description("Delete an offer").action(async (productId, basePlanId, offerId) => {
309
368
  const config = await loadConfig();
310
- const packageName = resolvePackageName(program.opts().app, config);
369
+ const packageName = resolvePackageName(program.opts()["app"], config);
311
370
  await requireConfirm(`Delete offer "${offerId}"?`, program);
312
371
  if (isDryRun(program)) {
313
372
  const format = detectOutputFormat();
314
- printDryRun({
315
- command: "subscriptions offers delete",
316
- action: "delete offer",
317
- target: `${productId}/${basePlanId}/${offerId}`
318
- }, format, formatOutput);
373
+ printDryRun(
374
+ {
375
+ command: "subscriptions offers delete",
376
+ action: "delete offer",
377
+ target: `${productId}/${basePlanId}/${offerId}`
378
+ },
379
+ format,
380
+ formatOutput
381
+ );
319
382
  return;
320
383
  }
321
384
  const client = await getClient(config);
@@ -329,14 +392,18 @@ function registerSubscriptionsCommands(program) {
329
392
  });
330
393
  offers.command("activate <product-id> <base-plan-id> <offer-id>").description("Activate an offer").action(async (productId, basePlanId, offerId) => {
331
394
  const config = await loadConfig();
332
- const packageName = resolvePackageName(program.opts().app, config);
395
+ const packageName = resolvePackageName(program.opts()["app"], config);
333
396
  const format = detectOutputFormat();
334
397
  if (isDryRun(program)) {
335
- printDryRun({
336
- command: "subscriptions offers activate",
337
- action: "activate offer",
338
- target: `${productId}/${basePlanId}/${offerId}`
339
- }, format, formatOutput);
398
+ printDryRun(
399
+ {
400
+ command: "subscriptions offers activate",
401
+ action: "activate offer",
402
+ target: `${productId}/${basePlanId}/${offerId}`
403
+ },
404
+ format,
405
+ formatOutput
406
+ );
340
407
  return;
341
408
  }
342
409
  const client = await getClient(config);
@@ -350,14 +417,18 @@ function registerSubscriptionsCommands(program) {
350
417
  });
351
418
  offers.command("deactivate <product-id> <base-plan-id> <offer-id>").description("Deactivate an offer").action(async (productId, basePlanId, offerId) => {
352
419
  const config = await loadConfig();
353
- const packageName = resolvePackageName(program.opts().app, config);
420
+ const packageName = resolvePackageName(program.opts()["app"], config);
354
421
  const format = detectOutputFormat();
355
422
  if (isDryRun(program)) {
356
- printDryRun({
357
- command: "subscriptions offers deactivate",
358
- action: "deactivate offer",
359
- target: `${productId}/${basePlanId}/${offerId}`
360
- }, format, formatOutput);
423
+ printDryRun(
424
+ {
425
+ command: "subscriptions offers deactivate",
426
+ action: "deactivate offer",
427
+ target: `${productId}/${basePlanId}/${offerId}`
428
+ },
429
+ format,
430
+ formatOutput
431
+ );
361
432
  return;
362
433
  }
363
434
  const client = await getClient(config);
@@ -373,4 +444,4 @@ function registerSubscriptionsCommands(program) {
373
444
  export {
374
445
  registerSubscriptionsCommands
375
446
  };
376
- //# sourceMappingURL=subscriptions-PUHH4FBB.js.map
447
+ //# sourceMappingURL=subscriptions-UJUX3ELS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/subscriptions.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } 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 detectOutputFormat,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { requireConfirm } 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 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 .option(\"--page-size <n>\", \"Results per page\", parseInt)\n .option(\"--page-token <token>\", \"Page token\")\n .option(\"--limit <n>\", \"Maximum total results\", parseInt)\n .option(\"--next-page <token>\", \"Resume from page token\")\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 = detectOutputFormat();\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 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(\"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 = detectOutputFormat();\n\n try {\n const result = await getSubscription(client, packageName, productId);\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(\"create\")\n .description(\"Create a subscription from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with subscription data\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = detectOutputFormat();\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"subscriptions create\",\n action: \"create\",\n target: `subscription 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 = JSON.parse(await readFile(options.file, \"utf-8\"));\n const result = await createSubscription(client, packageName, data);\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(\"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 = detectOutputFormat();\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 = JSON.parse(await readFile(options.file, \"utf-8\"));\n const result = await updateSubscription(\n client,\n packageName,\n productId,\n data,\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 = detectOutputFormat();\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 = detectOutputFormat();\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 = detectOutputFormat();\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 = detectOutputFormat();\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 = detectOutputFormat();\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 = JSON.parse(await readFile(options.file, \"utf-8\"));\n const result = await migratePrices(client, packageName, productId, basePlanId, data);\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 = detectOutputFormat();\n\n try {\n const result = await listOffers(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 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 = detectOutputFormat();\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 = detectOutputFormat();\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 = JSON.parse(await readFile(options.file, \"utf-8\"));\n const result = await createOffer(client, packageName, productId, basePlanId, data);\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 = detectOutputFormat();\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 = JSON.parse(await readFile(options.file, \"utf-8\"));\n const result = await updateOffer(\n client,\n packageName,\n productId,\n basePlanId,\n offerId,\n data,\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 = detectOutputFormat();\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 = detectOutputFormat();\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 = detectOutputFormat();\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(`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