@gpc-cli/cli 0.9.18 → 0.9.20

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 (43) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/chunk-FWKYRLKY.js +19 -0
  3. package/dist/chunk-FWKYRLKY.js.map +1 -0
  4. package/dist/{chunk-R3KI4HZ5.js → chunk-UT222YBA.js} +13 -13
  5. package/dist/{data-safety-TNG3QMJX.js → data-safety-DBA26FHB.js} +16 -30
  6. package/dist/data-safety-DBA26FHB.js.map +1 -0
  7. package/dist/{device-tiers-WFBZWCTY.js → device-tiers-V2R6AEXL.js} +6 -1
  8. package/dist/device-tiers-V2R6AEXL.js.map +1 -0
  9. package/dist/{iap-HDSHNFVG.js → iap-VK5TU3Q2.js} +6 -4
  10. package/dist/iap-VK5TU3Q2.js.map +1 -0
  11. package/dist/index.js +1 -1
  12. package/dist/{listings-S4CJ7EDX.js → listings-VSBHQY5H.js} +9 -3
  13. package/dist/listings-VSBHQY5H.js.map +1 -0
  14. package/dist/{one-time-products-UYXGLH5A.js → one-time-products-2PK4QKWE.js} +47 -11
  15. package/dist/one-time-products-2PK4QKWE.js.map +1 -0
  16. package/dist/{pricing-OB3MSWID.js → pricing-6VLYEGDL.js} +16 -2
  17. package/dist/pricing-6VLYEGDL.js.map +1 -0
  18. package/dist/{purchase-options-PIOSWZOW.js → purchase-options-GXWKY6GF.js} +5 -3
  19. package/dist/purchase-options-GXWKY6GF.js.map +1 -0
  20. package/dist/{recovery-Q2I2HV6Q.js → recovery-S5UNJDBO.js} +14 -1
  21. package/dist/recovery-S5UNJDBO.js.map +1 -0
  22. package/dist/{releases-KXKLLIRR.js → releases-JIBSHE4F.js} +30 -6
  23. package/dist/releases-JIBSHE4F.js.map +1 -0
  24. package/dist/{subscriptions-SF4LBZDJ.js → subscriptions-6B265ZN4.js} +72 -10
  25. package/dist/subscriptions-6B265ZN4.js.map +1 -0
  26. package/dist/{testers-QSAXJM7W.js → testers-FXRW6KN3.js} +5 -1
  27. package/dist/testers-FXRW6KN3.js.map +1 -0
  28. package/dist/{vitals-EOHSUQJM.js → vitals-FE2V5OHW.js} +22 -9
  29. package/dist/vitals-FE2V5OHW.js.map +1 -0
  30. package/package.json +5 -5
  31. package/dist/data-safety-TNG3QMJX.js.map +0 -1
  32. package/dist/device-tiers-WFBZWCTY.js.map +0 -1
  33. package/dist/iap-HDSHNFVG.js.map +0 -1
  34. package/dist/listings-S4CJ7EDX.js.map +0 -1
  35. package/dist/one-time-products-UYXGLH5A.js.map +0 -1
  36. package/dist/pricing-OB3MSWID.js.map +0 -1
  37. package/dist/purchase-options-PIOSWZOW.js.map +0 -1
  38. package/dist/recovery-Q2I2HV6Q.js.map +0 -1
  39. package/dist/releases-KXKLLIRR.js.map +0 -1
  40. package/dist/subscriptions-SF4LBZDJ.js.map +0 -1
  41. package/dist/testers-QSAXJM7W.js.map +0 -1
  42. package/dist/vitals-EOHSUQJM.js.map +0 -1
  43. /package/dist/{chunk-R3KI4HZ5.js.map → chunk-UT222YBA.js.map} +0 -0
package/dist/bin.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  createProgram,
4
4
  handleCliError,
5
5
  loadPlugins
6
- } from "./chunk-R3KI4HZ5.js";
6
+ } from "./chunk-UT222YBA.js";
7
7
 
8
8
  // src/networking.ts
9
9
  async function setupNetworking() {
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/json.ts
4
+ async function readJsonFile(filePath) {
5
+ const { readFile } = await import("fs/promises");
6
+ try {
7
+ return JSON.parse(await readFile(filePath, "utf-8"));
8
+ } catch (err) {
9
+ console.error(
10
+ `Error: Could not read JSON from ${filePath}: ${err instanceof Error ? err.message : String(err)}`
11
+ );
12
+ process.exit(2);
13
+ }
14
+ }
15
+
16
+ export {
17
+ readJsonFile
18
+ };
19
+ //# sourceMappingURL=chunk-FWKYRLKY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/json.ts"],"sourcesContent":["export async function readJsonFile(filePath: string): Promise<unknown> {\n const { readFile } = await import(\"node:fs/promises\");\n try {\n return JSON.parse(await readFile(filePath, \"utf-8\"));\n } catch (err) {\n console.error(\n `Error: Could not read JSON from ${filePath}: ${err instanceof Error ? err.message : String(err)}`,\n );\n process.exit(2);\n }\n}\n"],"mappings":";;;AAAA,eAAsB,aAAa,UAAoC;AACrE,QAAM,EAAE,SAAS,IAAI,MAAM,OAAO,aAAkB;AACpD,MAAI;AACF,WAAO,KAAK,MAAM,MAAM,SAAS,UAAU,OAAO,CAAC;AAAA,EACrD,SAAS,KAAK;AACZ,YAAQ;AAAA,MACN,mCAAmC,QAAQ,KAAK,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,IAClG;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":[]}
@@ -88,7 +88,7 @@ async function createProgram(pluginManager) {
88
88
  (await import("./apps-CVBURB5V.js")).registerAppsCommands(program);
89
89
  },
90
90
  releases: async () => {
91
- (await import("./releases-KXKLLIRR.js")).registerReleasesCommands(program);
91
+ (await import("./releases-JIBSHE4F.js")).registerReleasesCommands(program);
92
92
  },
93
93
  tracks: async () => {
94
94
  (await import("./tracks-TP6TDO56.js")).registerTracksCommands(program);
@@ -97,25 +97,25 @@ async function createProgram(pluginManager) {
97
97
  (await import("./status-S3FAEXNH.js")).registerStatusCommand(program);
98
98
  },
99
99
  listings: async () => {
100
- (await import("./listings-S4CJ7EDX.js")).registerListingsCommands(program);
100
+ (await import("./listings-VSBHQY5H.js")).registerListingsCommands(program);
101
101
  },
102
102
  reviews: async () => {
103
103
  (await import("./reviews-PMUJVNVC.js")).registerReviewsCommands(program);
104
104
  },
105
105
  vitals: async () => {
106
- (await import("./vitals-EOHSUQJM.js")).registerVitalsCommands(program);
106
+ (await import("./vitals-FE2V5OHW.js")).registerVitalsCommands(program);
107
107
  },
108
108
  subscriptions: async () => {
109
- (await import("./subscriptions-SF4LBZDJ.js")).registerSubscriptionsCommands(program);
109
+ (await import("./subscriptions-6B265ZN4.js")).registerSubscriptionsCommands(program);
110
110
  },
111
111
  iap: async () => {
112
- (await import("./iap-HDSHNFVG.js")).registerIapCommands(program);
112
+ (await import("./iap-VK5TU3Q2.js")).registerIapCommands(program);
113
113
  },
114
114
  purchases: async () => {
115
115
  (await import("./purchases-NB5P4FL4.js")).registerPurchasesCommands(program);
116
116
  },
117
117
  pricing: async () => {
118
- (await import("./pricing-OB3MSWID.js")).registerPricingCommands(program);
118
+ (await import("./pricing-6VLYEGDL.js")).registerPricingCommands(program);
119
119
  },
120
120
  reports: async () => {
121
121
  (await import("./reports-ZFVKYI4C.js")).registerReportsCommands(program);
@@ -124,7 +124,7 @@ async function createProgram(pluginManager) {
124
124
  (await import("./users-KUVAYRJC.js")).registerUsersCommands(program);
125
125
  },
126
126
  testers: async () => {
127
- (await import("./testers-QSAXJM7W.js")).registerTestersCommands(program);
127
+ (await import("./testers-FXRW6KN3.js")).registerTestersCommands(program);
128
128
  },
129
129
  validate: async () => {
130
130
  (await import("./validate-UYXICKBO.js")).registerValidateCommand(program);
@@ -133,10 +133,10 @@ async function createProgram(pluginManager) {
133
133
  (await import("./publish-PZRWX3TH.js")).registerPublishCommand(program);
134
134
  },
135
135
  recovery: async () => {
136
- (await import("./recovery-Q2I2HV6Q.js")).registerRecoveryCommands(program);
136
+ (await import("./recovery-S5UNJDBO.js")).registerRecoveryCommands(program);
137
137
  },
138
138
  "data-safety": async () => {
139
- (await import("./data-safety-TNG3QMJX.js")).registerDataSafetyCommands(program);
139
+ (await import("./data-safety-DBA26FHB.js")).registerDataSafetyCommands(program);
140
140
  },
141
141
  "external-transactions": async () => {
142
142
  (await import("./external-transactions-HCL7ROMN.js")).registerExternalTransactionsCommands(
@@ -144,10 +144,10 @@ async function createProgram(pluginManager) {
144
144
  );
145
145
  },
146
146
  "device-tiers": async () => {
147
- (await import("./device-tiers-WFBZWCTY.js")).registerDeviceTiersCommands(program);
147
+ (await import("./device-tiers-V2R6AEXL.js")).registerDeviceTiersCommands(program);
148
148
  },
149
149
  "one-time-products": async () => {
150
- (await import("./one-time-products-UYXGLH5A.js")).registerOneTimeProductsCommands(program);
150
+ (await import("./one-time-products-2PK4QKWE.js")).registerOneTimeProductsCommands(program);
151
151
  },
152
152
  "internal-sharing": async () => {
153
153
  (await import("./internal-sharing-OS3HVIY5.js")).registerInternalSharingCommands(program);
@@ -156,7 +156,7 @@ async function createProgram(pluginManager) {
156
156
  (await import("./generated-apks-N4S5PIQH.js")).registerGeneratedApksCommands(program);
157
157
  },
158
158
  "purchase-options": async () => {
159
- (await import("./purchase-options-PIOSWZOW.js")).registerPurchaseOptionsCommands(program);
159
+ (await import("./purchase-options-GXWKY6GF.js")).registerPurchaseOptionsCommands(program);
160
160
  },
161
161
  migrate: async () => {
162
162
  (await import("./migrate-V6G5YUVH.js")).registerMigrateCommands(program);
@@ -302,4 +302,4 @@ export {
302
302
  createProgram,
303
303
  handleCliError
304
304
  };
305
- //# sourceMappingURL=chunk-R3KI4HZ5.js.map
305
+ //# sourceMappingURL=chunk-UT222YBA.js.map
@@ -12,8 +12,6 @@ import { loadConfig } from "@gpc-cli/config";
12
12
  import { resolveAuth } from "@gpc-cli/auth";
13
13
  import { createApiClient } from "@gpc-cli/api";
14
14
  import {
15
- getDataSafety,
16
- exportDataSafety,
17
15
  importDataSafety,
18
16
  formatOutput
19
17
  } from "@gpc-cli/core";
@@ -32,17 +30,14 @@ async function getClient(config) {
32
30
  function registerDataSafetyCommands(program) {
33
31
  const dataSafety = program.command("data-safety").description("Manage data safety declarations");
34
32
  dataSafety.command("get").description("Get the current data safety declaration").action(async () => {
35
- const config = await loadConfig();
36
- const packageName = resolvePackageName(program.opts()["app"], config);
37
- const client = await getClient(config);
38
- const format = getOutputFormat(program, config);
39
- try {
40
- const result = await getDataSafety(client, packageName);
41
- console.log(formatOutput(result, format));
42
- } catch (error) {
43
- console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
44
- process.exit(4);
45
- }
33
+ console.error("Error: The Google Play Developer API does not provide a GET endpoint for data safety declarations.");
34
+ console.error("");
35
+ console.error("Data safety labels can only be updated (not read) via the API.");
36
+ console.error("To view your current data safety declaration, use the Google Play Console:");
37
+ console.error(" https://play.google.com/console \u2192 App content \u2192 Data safety");
38
+ console.error("");
39
+ console.error("To update data safety via the API, use: gpc data-safety update --file <csv-file>");
40
+ process.exit(1);
46
41
  });
47
42
  dataSafety.command("update").description("Update data safety declaration from a JSON file").requiredOption("--file <path>", "Path to data safety JSON file").action(async (options) => {
48
43
  const config = await loadConfig();
@@ -69,25 +64,16 @@ function registerDataSafetyCommands(program) {
69
64
  process.exit(4);
70
65
  }
71
66
  });
72
- dataSafety.command("export").description("Export data safety declaration to a JSON file").option("--output <path>", "Output file path", "data-safety.json").action(async (options) => {
73
- const config = await loadConfig();
74
- const packageName = resolvePackageName(program.opts()["app"], config);
75
- const client = await getClient(config);
76
- const format = getOutputFormat(program, config);
77
- try {
78
- const result = await exportDataSafety(client, packageName, options.output);
79
- if (format === "json") {
80
- console.log(formatOutput({ file: options.output, dataSafety: result }, format));
81
- } else {
82
- console.log(`Data safety declaration exported to ${options.output}`);
83
- }
84
- } catch (error) {
85
- console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
86
- process.exit(4);
87
- }
67
+ dataSafety.command("export").description("Export data safety declaration to a JSON file").option("--output <path>", "Output file path", "data-safety.json").action(async () => {
68
+ console.error("Error: The Google Play Developer API does not provide a GET endpoint for data safety declarations.");
69
+ console.error("Data safety labels cannot be exported via the API.");
70
+ console.error("");
71
+ console.error("To export your data safety declaration, use the Google Play Console:");
72
+ console.error(" App content \u2192 Data safety \u2192 Export to CSV");
73
+ process.exit(1);
88
74
  });
89
75
  }
90
76
  export {
91
77
  registerDataSafetyCommands
92
78
  };
93
- //# sourceMappingURL=data-safety-TNG3QMJX.js.map
79
+ //# sourceMappingURL=data-safety-DBA26FHB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/data-safety.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n getDataSafety,\n updateDataSafety,\n exportDataSafety,\n importDataSafety,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { getOutputFormat } from \"../format.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerDataSafetyCommands(program: Command): void {\n const dataSafety = program\n .command(\"data-safety\")\n .description(\"Manage data safety declarations\");\n\n // Get — not supported by Google Play API (no GET endpoint for data safety)\n dataSafety\n .command(\"get\")\n .description(\"Get the current data safety declaration\")\n .action(async () => {\n console.error(\"Error: The Google Play Developer API does not provide a GET endpoint for data safety declarations.\");\n console.error(\"\");\n console.error(\"Data safety labels can only be updated (not read) via the API.\");\n console.error(\"To view your current data safety declaration, use the Google Play Console:\");\n console.error(\" https://play.google.com/console → App content → Data safety\");\n console.error(\"\");\n console.error(\"To update data safety via the API, use: gpc data-safety update --file <csv-file>\");\n process.exit(1);\n });\n\n // Update\n dataSafety\n .command(\"update\")\n .description(\"Update data safety declaration from a JSON file\")\n .requiredOption(\"--file <path>\", \"Path to data safety JSON file\")\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: \"data-safety update\",\n action: \"update data safety from\",\n target: options.file,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await importDataSafety(client, packageName, options.file);\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 // Export — not supported (no GET endpoint)\n dataSafety\n .command(\"export\")\n .description(\"Export data safety declaration to a JSON file\")\n .option(\"--output <path>\", \"Output file path\", \"data-safety.json\")\n .action(async () => {\n console.error(\"Error: The Google Play Developer API does not provide a GET endpoint for data safety declarations.\");\n console.error(\"Data safety labels cannot be exported via the API.\");\n console.error(\"\");\n console.error(\"To export your data safety declaration, use the Google Play Console:\");\n console.error(\" App content → Data safety → Export to CSV\");\n process.exit(1);\n });\n}\n"],"mappings":";;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EAIE;AAAA,EACA;AAAA,OACK;AAIP,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,2BAA2B,SAAwB;AACjE,QAAM,aAAa,QAChB,QAAQ,aAAa,EACrB,YAAY,iCAAiC;AAGhD,aACG,QAAQ,KAAK,EACb,YAAY,yCAAyC,EACrD,OAAO,YAAY;AAClB,YAAQ,MAAM,oGAAoG;AAClH,YAAQ,MAAM,EAAE;AAChB,YAAQ,MAAM,gEAAgE;AAC9E,YAAQ,MAAM,4EAA4E;AAC1F,YAAQ,MAAM,yEAA+D;AAC7E,YAAQ,MAAM,EAAE;AAChB,YAAQ,MAAM,kFAAkF;AAChG,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AAGH,aACG,QAAQ,QAAQ,EAChB,YAAY,iDAAiD,EAC7D,eAAe,iBAAiB,+BAA+B,EAC/D,OAAO,OAAO,YAAY;AACzB,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,QAAI,SAAS,OAAO,GAAG;AACrB;AAAA,QACE;AAAA,UACE,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ,QAAQ;AAAA,QAClB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA;AAAA,IACF;AAEA,UAAM,SAAS,MAAM,UAAU,MAAM;AAErC,QAAI;AACF,YAAM,SAAS,MAAM,iBAAiB,QAAQ,aAAa,QAAQ,IAAI;AACvE,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAGH,aACG,QAAQ,QAAQ,EAChB,YAAY,+CAA+C,EAC3D,OAAO,mBAAmB,oBAAoB,kBAAkB,EAChE,OAAO,YAAY;AAClB,YAAQ,MAAM,oGAAoG;AAClH,YAAQ,MAAM,oDAAoD;AAClE,YAAQ,MAAM,EAAE;AAChB,YAAQ,MAAM,sEAAsE;AACpF,YAAQ,MAAM,uDAA6C;AAC3D,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACL;","names":[]}
@@ -35,6 +35,11 @@ function registerDeviceTiersCommands(program) {
35
35
  const format = getOutputFormat(program, config);
36
36
  try {
37
37
  const result = await listDeviceTiers(client, packageName);
38
+ const configs = result["deviceTierConfigs"];
39
+ if (format !== "json" && (!configs || configs.length === 0)) {
40
+ console.log("No device tier configs found.");
41
+ return;
42
+ }
38
43
  console.log(formatOutput(result, format));
39
44
  } catch (error) {
40
45
  console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
@@ -73,4 +78,4 @@ function registerDeviceTiersCommands(program) {
73
78
  export {
74
79
  registerDeviceTiersCommands
75
80
  };
76
- //# sourceMappingURL=device-tiers-WFBZWCTY.js.map
81
+ //# sourceMappingURL=device-tiers-V2R6AEXL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/device-tiers.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n listDeviceTiers,\n getDeviceTier,\n createDeviceTier,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { readFile } from \"node:fs/promises\";\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 registerDeviceTiersCommands(program: Command): void {\n const dt = program.command(\"device-tiers\").description(\"Manage device tier configurations\");\n\n dt.command(\"list\")\n .description(\"List device tier configurations\")\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 try {\n const result = await listDeviceTiers(client, packageName);\n const configs = (result as Record<string, unknown>)[\"deviceTierConfigs\"] as unknown[] | undefined;\n if (format !== \"json\" && (!configs || configs.length === 0)) {\n console.log(\"No device tier configs found.\");\n return;\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 dt.command(\"get <config-id>\")\n .description(\"Get a device tier configuration\")\n .action(async (configId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await getDeviceTier(client, packageName, configId);\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 dt.command(\"create\")\n .description(\"Create a device tier configuration from a JSON file\")\n .requiredOption(\"--file <path>\", \"Path to JSON config file\")\n .action(async (opts: { file: string }) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const raw = await readFile(opts.file, \"utf-8\");\n const tierConfig = JSON.parse(raw);\n const result = await createDeviceTier(client, packageName, tierConfig);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,gBAAgB;AAEzB,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,4BAA4B,SAAwB;AAClE,QAAM,KAAK,QAAQ,QAAQ,cAAc,EAAE,YAAY,mCAAmC;AAE1F,KAAG,QAAQ,MA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AM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,SAAS,MAAM,UAAU,MAAM;AACrC,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,QAAI;AACF,YAAM,MAAM,MAAM,SAAS,KAAK,MAAM,OAAO;AAC7C,YAAM,aAAa,KAAK,MAAM,GAAG;AACjC,YAAM,SAAS,MAAM,iBAAiB,QAAQ,aAAa,UAAU;AACrE,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ readJsonFile
4
+ } from "./chunk-FWKYRLKY.js";
2
5
  import {
3
6
  isDryRun,
4
7
  printDryRun
@@ -11,7 +14,6 @@ import {
11
14
  } from "./chunk-NV75I5VP.js";
12
15
 
13
16
  // src/commands/iap.ts
14
- import { readFile } from "fs/promises";
15
17
  import { loadConfig } from "@gpc-cli/config";
16
18
  import { resolveAuth } from "@gpc-cli/auth";
17
19
  import { createApiClient } from "@gpc-cli/api";
@@ -90,7 +92,7 @@ function registerIapCommands(program) {
90
92
  }
91
93
  const client = await getClient(config);
92
94
  try {
93
- const data = JSON.parse(await readFile(options.file, "utf-8"));
95
+ const data = await readJsonFile(options.file);
94
96
  const result = await createInAppProduct(client, packageName, data);
95
97
  console.log(formatOutput(result, format));
96
98
  } catch (error) {
@@ -117,7 +119,7 @@ function registerIapCommands(program) {
117
119
  }
118
120
  const client = await getClient(config);
119
121
  try {
120
- const data = JSON.parse(await readFile(options.file, "utf-8"));
122
+ const data = await readJsonFile(options.file);
121
123
  const result = await updateInAppProduct(client, packageName, sku, data);
122
124
  console.log(formatOutput(result, format));
123
125
  } catch (error) {
@@ -178,4 +180,4 @@ function registerIapCommands(program) {
178
180
  export {
179
181
  registerIapCommands
180
182
  };
181
- //# sourceMappingURL=iap-HDSHNFVG.js.map
183
+ //# sourceMappingURL=iap-VK5TU3Q2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/iap.ts"],"sourcesContent":["import type { GpcConfig } from \"@gpc-cli/config\";\nimport type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n listOneTimeProducts,\n getOneTimeProduct,\n createInAppProduct,\n updateInAppProduct,\n deleteInAppProduct,\n syncInAppProducts,\n formatOutput,\n sortResults,\n createSpinner,\n} from \"@gpc-cli/core\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { getOutputFormat } from \"../format.js\";\nimport { requireConfirm } from \"../prompt.js\";\nimport { readJsonFile } from \"../json.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerIapCommands(program: Command): void {\n const iap = program.command(\"iap\").description(\"Manage in-app products (uses one-time products API)\");\n\n iap\n .command(\"list\")\n .description(\"List in-app products\")\n .option(\"--max <n>\", \"Maximum results per page\", parseInt)\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 console.error(\"Note: Using oneTimeProducts API (inappproducts endpoint is deprecated, shutdown Aug 2027)\");\n\n try {\n const result = await listOneTimeProducts(client, packageName);\n let products = result.oneTimeProducts || [];\n if (options.sort) {\n products = sortResults(products, options.sort);\n }\n console.log(formatOutput(products, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n iap\n .command(\"get <sku>\")\n .description(\"Get an in-app product\")\n .action(async (sku: 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 console.error(\"Note: Using oneTimeProducts API (inappproducts endpoint is deprecated, shutdown Aug 2027)\");\n\n try {\n const result = await getOneTimeProduct(client, packageName, sku);\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 iap\n .command(\"create\")\n .description(\"Create an in-app product from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with product data\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"iap create\",\n action: \"create\",\n target: `in-app product from ${options.file}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await createInAppProduct(client, packageName, data as any);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n iap\n .command(\"update <sku>\")\n .description(\"Update an in-app product from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with product data\")\n .action(async (sku: 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: \"iap update\",\n action: \"update\",\n target: sku,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await updateInAppProduct(client, packageName, sku, data as any);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n iap\n .command(\"delete <sku>\")\n .description(\"Delete an in-app product\")\n .action(async (sku: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n\n await requireConfirm(`Delete in-app product \"${sku}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"iap delete\",\n action: \"delete\",\n target: sku,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n await deleteInAppProduct(client, packageName, sku);\n console.log(`In-app product ${sku} deleted.`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n iap\n .command(\"sync\")\n .description(\"Sync in-app products from a directory of JSON files\")\n .requiredOption(\"--dir <path>\", \"Directory containing product JSON files\")\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 const dryRun = isDryRun(program);\n\n const spinner = createSpinner(\"Syncing in-app products...\");\n if (!program.opts()[\"quiet\"] && process.stderr.isTTY) spinner.start();\n\n try {\n const result = await syncInAppProducts(client, packageName, options.dir, {\n dryRun,\n });\n spinner.stop(\"Sync complete\");\n if (dryRun) {\n console.log(`[dry-run] Would create: ${result.created}, update: ${result.updated}`);\n }\n console.log(formatOutput(result, format));\n } catch (error) {\n spinner.fail(\"Sync failed\");\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAC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@@
2
2
  import {
3
3
  createProgram,
4
4
  handleCliError
5
- } from "./chunk-R3KI4HZ5.js";
5
+ } from "./chunk-UT222YBA.js";
6
6
  export {
7
7
  createProgram,
8
8
  handleCliError
@@ -192,10 +192,11 @@ function registerListingsCommands(program) {
192
192
  const spinner = createSpinner("Pushing listings...");
193
193
  if (!program.opts()["quiet"] && process.stderr.isTTY) spinner.start();
194
194
  try {
195
+ const dryRun = isDryRun(program);
195
196
  const result = await pushListings(client, packageName, options.dir, {
196
- dryRun: isDryRun(program)
197
+ dryRun
197
198
  });
198
- spinner.stop("Listings pushed");
199
+ spinner.stop(dryRun ? "Dry-run complete (no changes made)" : "Listings pushed");
199
200
  console.log(formatOutput(result, format));
200
201
  } catch (error) {
201
202
  spinner.fail("Push failed");
@@ -372,6 +373,11 @@ function registerListingsCommands(program) {
372
373
  const format = getOutputFormat(program, config);
373
374
  try {
374
375
  const result = await getCountryAvailability(client, packageName, options.track);
376
+ const countries = result["countryTargeting"];
377
+ if (format !== "json" && (!countries || Array.isArray(countries) && countries.length === 0) && Object.keys(result).length === 0) {
378
+ console.log("No availability data.");
379
+ return;
380
+ }
375
381
  console.log(formatOutput(result, format));
376
382
  } catch (error) {
377
383
  console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
@@ -382,4 +388,4 @@ function registerListingsCommands(program) {
382
388
  export {
383
389
  registerListingsCommands
384
390
  };
385
- //# sourceMappingURL=listings-S4CJ7EDX.js.map
391
+ //# sourceMappingURL=listings-VSBHQY5H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/listings.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport type { ImageType } from \"@gpc-cli/api\";\nimport {\n getListings,\n updateListing,\n deleteListing,\n pullListings,\n pushListings,\n diffListingsCommand,\n listImages,\n uploadImage,\n deleteImage,\n exportImages,\n getCountryAvailability,\n formatOutput,\n createSpinner,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { isInteractive, requireOption, 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\nconst VALID_IMAGE_TYPES: ImageType[] = [\n \"phoneScreenshots\",\n \"sevenInchScreenshots\",\n \"tenInchScreenshots\",\n \"tvScreenshots\",\n \"wearScreenshots\",\n \"icon\",\n \"featureGraphic\",\n \"tvBanner\",\n];\n\nfunction validateImageType(type: string): ImageType {\n if (!VALID_IMAGE_TYPES.includes(type as ImageType)) {\n console.error(`Error: Invalid image type \"${type}\".`);\n console.error(`Valid types: ${VALID_IMAGE_TYPES.join(\", \")}`);\n process.exit(2);\n }\n return type as ImageType;\n}\n\nexport function registerListingsCommands(program: Command): void {\n const listings = program.command(\"listings\").description(\"Manage store listings and metadata\");\n\n // Get\n listings\n .command(\"get\")\n .description(\"Get store listing(s)\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await getListings(client, packageName, options.lang);\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 // Update\n listings\n .command(\"update\")\n .description(\"Update a store listing\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .option(\"--title <text>\", \"App title\")\n .option(\"--short <text>\", \"Short description\")\n .option(\"--full <text>\", \"Full description\")\n .option(\"--full-file <path>\", \"Read full description from file\")\n .option(\"--video <url>\", \"Video URL\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.lang = await requireOption(\n \"lang\",\n options.lang,\n {\n message: \"Language code (BCP 47):\",\n default: \"en-US\",\n },\n interactive,\n );\n const format = getOutputFormat(program, config);\n\n try {\n const data: Record<string, string> = {};\n if (options[\"title\"]) data[\"title\"] = options[\"title\"];\n if (options[\"short\"]) data[\"shortDescription\"] = options[\"short\"];\n if (options[\"full\"]) data[\"fullDescription\"] = options[\"full\"];\n if (options[\"fullFile\"]) {\n const { readFile } = await import(\"node:fs/promises\");\n data[\"fullDescription\"] = (await readFile(options[\"fullFile\"], \"utf-8\")).trimEnd();\n }\n if (options[\"video\"]) data[\"video\"] = options[\"video\"];\n\n if (Object.keys(data).length === 0) {\n console.error(\n \"Error: Provide at least one field to update (--title, --short, --full, --full-file, --video).\",\n );\n process.exit(2);\n }\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"listings update\",\n action: \"update listing for\",\n target: options.lang,\n details: data,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n const result = await updateListing(client, packageName, options.lang, data);\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 // Delete\n listings\n .command(\"delete\")\n .description(\"Delete a store listing for a language\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.lang = await requireOption(\n \"lang\",\n options.lang,\n {\n message: \"Language code (BCP 47):\",\n },\n interactive,\n );\n\n await requireConfirm(`Delete listing for \"${options.lang}\"?`, program);\n\n if (isDryRun(program)) {\n const format = getOutputFormat(program, config);\n printDryRun(\n {\n command: \"listings delete\",\n action: \"delete listing for\",\n target: options.lang,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n await deleteListing(client, packageName, options.lang);\n console.log(`Listing for \"${options.lang}\" deleted.`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // Pull\n listings\n .command(\"pull\")\n .description(\"Download listings to Fastlane-format directory\")\n .option(\"--dir <path>\", \"Target directory (default: metadata)\", \"metadata\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await pullListings(client, packageName, options.dir);\n console.log(\n formatOutput(\n {\n directory: options.dir,\n languages: result.listings.map((l) => l.language),\n count: result.listings.length,\n },\n format,\n ),\n );\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // Push\n listings\n .command(\"push\")\n .description(\"Upload listings from Fastlane-format directory\")\n .option(\"--dir <path>\", \"Source directory (default: metadata)\", \"metadata\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const spinner = createSpinner(\"Pushing listings...\");\n if (!program.opts()[\"quiet\"] && process.stderr.isTTY) spinner.start();\n\n try {\n const dryRun = isDryRun(program);\n const result = await pushListings(client, packageName, options.dir, {\n dryRun,\n });\n spinner.stop(dryRun ? \"Dry-run complete (no changes made)\" : \"Listings pushed\");\n console.log(formatOutput(result, format));\n } catch (error) {\n spinner.fail(\"Push failed\");\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // Diff\n listings\n .command(\"diff\")\n .description(\"Compare local Fastlane-format metadata against remote listings\")\n .option(\"--dir <path>\", \"Local metadata directory\", \"metadata\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const diffs = await diffListingsCommand(client, packageName, options.dir);\n\n if (diffs.length === 0) {\n if (format === \"json\") {\n console.log(formatOutput([], format));\n } else {\n console.log(\"No differences found.\");\n }\n return;\n }\n\n if (format === \"json\") {\n console.log(formatOutput(diffs, format));\n } else {\n for (const diff of diffs) {\n console.log(`[${diff.language}] ${diff.field}:`);\n console.log(` local: ${diff.local || \"(empty)\"}`);\n console.log(` remote: ${diff.remote || \"(empty)\"}`);\n }\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // Images subcommand\n const images = listings.command(\"images\").description(\"Manage listing images\");\n\n // Images list\n images\n .command(\"list\")\n .description(\"List images for a language and type\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .option(\"--type <type>\", \"Image type\")\n .option(\"--limit <n>\", \"Maximum results to return\")\n .option(\"--next-page <token>\", \"Pagination token for next page\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.lang = await requireOption(\n \"lang\",\n options.lang,\n {\n message: \"Language code (BCP 47):\",\n default: \"en-US\",\n },\n interactive,\n );\n\n options.type = await requireOption(\n \"type\",\n options.type,\n {\n message: \"Image type:\",\n choices: VALID_IMAGE_TYPES as unknown as string[],\n },\n interactive,\n );\n\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n const imageType = validateImageType(options.type);\n\n try {\n const result = await listImages(client, packageName, options.lang, imageType);\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 // Images upload\n images\n .command(\"upload <file>\")\n .description(\"Upload an image\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .option(\"--type <type>\", \"Image type\")\n .action(async (file: string, options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.lang = await requireOption(\n \"lang\",\n options.lang,\n {\n message: \"Language code (BCP 47):\",\n default: \"en-US\",\n },\n interactive,\n );\n\n options.type = await requireOption(\n \"type\",\n options.type,\n {\n message: \"Image type:\",\n choices: VALID_IMAGE_TYPES as unknown as string[],\n },\n interactive,\n );\n\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n const imageType = validateImageType(options.type);\n\n const spinner = createSpinner(\"Uploading image...\");\n if (!program.opts()[\"quiet\"] && process.stderr.isTTY) spinner.start();\n\n try {\n const result = await uploadImage(client, packageName, options.lang, imageType, file);\n spinner.stop(\"Image uploaded\");\n console.log(formatOutput(result, format));\n } catch (error) {\n spinner.fail(\"Image upload failed\");\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // Images delete\n images\n .command(\"delete\")\n .description(\"Delete an image\")\n .option(\"--lang <language>\", \"Language code (BCP 47)\")\n .option(\"--type <type>\", \"Image type\")\n .option(\"--id <imageId>\", \"Image ID to delete\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const interactive = isInteractive(program);\n\n options.lang = await requireOption(\n \"lang\",\n options.lang,\n {\n message: \"Language code (BCP 47):\",\n },\n interactive,\n );\n\n options.type = await requireOption(\n \"type\",\n options.type,\n {\n message: \"Image type:\",\n choices: VALID_IMAGE_TYPES as unknown as string[],\n },\n interactive,\n );\n\n options.id = await requireOption(\n \"id\",\n options.id,\n {\n message: \"Image ID to delete:\",\n },\n interactive,\n );\n\n await requireConfirm(`Delete image \"${options.id}\"?`, program);\n\n const client = await getClient(config);\n const imageType = validateImageType(options.type);\n\n try {\n await deleteImage(client, packageName, options.lang, imageType, options.id);\n console.log(`Image \"${options.id}\" deleted.`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // Images export\n images\n .command(\"export\")\n .description(\"Export all images to a local directory\")\n .option(\"--dir <path>\", \"Output directory\", \"images\")\n .option(\"--lang <language>\", \"Language code (BCP 47) — export only this language\")\n .option(\"--type <type>\", \"Image type — export only this type\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n const exportOpts: { lang?: string; type?: ImageType } = {};\n if (options.lang) exportOpts.lang = options.lang;\n if (options.type) {\n exportOpts.type = validateImageType(options.type);\n }\n\n const spinner = createSpinner(\"Exporting images...\");\n if (!program.opts()[\"quiet\"] && process.stderr.isTTY) spinner.start();\n\n try {\n const result = await exportImages(client, packageName, options.dir, exportOpts);\n spinner.stop(\"Images exported\");\n console.log(formatOutput(result, format));\n } catch (error) {\n spinner.fail(\"Image export failed\");\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // Availability\n listings\n .command(\"availability\")\n .description(\"Get country availability for a track\")\n .option(\"--track <track>\", \"Track name\", \"production\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await getCountryAvailability(client, packageName, options.track);\n const countries = (result as Record<string, unknown>)[\"countryTargeting\"] as unknown[] | undefined;\n if (format !== \"json\" && (!countries || (Array.isArray(countries) && countries.length === 0)) && Object.keys(result as object).length === 0) {\n console.log(\"No availability data.\");\n return;\n }\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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F,CAAC;AACL;","names":[]}
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ readJsonFile
4
+ } from "./chunk-FWKYRLKY.js";
2
5
  import {
3
6
  isDryRun,
4
7
  printDryRun
@@ -11,7 +14,6 @@ import {
11
14
  } from "./chunk-NV75I5VP.js";
12
15
 
13
16
  // src/commands/one-time-products.ts
14
- import { readFile } from "fs/promises";
15
17
  import { loadConfig } from "@gpc-cli/config";
16
18
  import { resolveAuth } from "@gpc-cli/auth";
17
19
  import { createApiClient } from "@gpc-cli/api";
@@ -26,6 +28,7 @@ import {
26
28
  createOneTimeOffer,
27
29
  updateOneTimeOffer,
28
30
  deleteOneTimeOffer,
31
+ diffOneTimeProduct,
29
32
  formatOutput,
30
33
  sortResults
31
34
  } from "@gpc-cli/core";
@@ -53,7 +56,22 @@ function registerOneTimeProductsCommands(program) {
53
56
  if (options.sort) {
54
57
  result.oneTimeProducts = sortResults(result.oneTimeProducts, options.sort);
55
58
  }
56
- console.log(formatOutput(result, format));
59
+ const products = result.oneTimeProducts || [];
60
+ if (format !== "json") {
61
+ if (products.length === 0) {
62
+ console.log("No one-time products found.");
63
+ return;
64
+ }
65
+ const summary = products.map((p) => ({
66
+ productId: p.productId,
67
+ purchaseType: p["purchaseType"] || "-",
68
+ listings: p.listings ? Object.keys(p.listings).length : 0,
69
+ firstTitle: p.listings ? Object.values(p.listings)[0]?.title || "-" : "-"
70
+ }));
71
+ console.log(formatOutput(summary, format));
72
+ } else {
73
+ console.log(formatOutput(result, format));
74
+ }
57
75
  } catch (error) {
58
76
  console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
59
77
  process.exit(4);
@@ -90,7 +108,7 @@ function registerOneTimeProductsCommands(program) {
90
108
  }
91
109
  const client = await getClient(config);
92
110
  try {
93
- const data = JSON.parse(await readFile(options.file, "utf-8"));
111
+ const data = await readJsonFile(options.file);
94
112
  const result = await createOneTimeProduct(client, packageName, data);
95
113
  console.log(formatOutput(result, format));
96
114
  } catch (error) {
@@ -98,7 +116,7 @@ function registerOneTimeProductsCommands(program) {
98
116
  process.exit(4);
99
117
  }
100
118
  });
101
- otp.command("update <product-id>").description("Update a one-time product from JSON file").requiredOption("--file <path>", "JSON file with product data").action(async (productId, options) => {
119
+ 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) => {
102
120
  const config = await loadConfig();
103
121
  const packageName = resolvePackageName(program.opts()["app"], config);
104
122
  const format = getOutputFormat(program, config);
@@ -117,8 +135,8 @@ function registerOneTimeProductsCommands(program) {
117
135
  }
118
136
  const client = await getClient(config);
119
137
  try {
120
- const data = JSON.parse(await readFile(options.file, "utf-8"));
121
- const result = await updateOneTimeProduct(client, packageName, productId, data);
138
+ const data = await readJsonFile(options.file);
139
+ const result = await updateOneTimeProduct(client, packageName, productId, data, options.updateMask);
122
140
  console.log(formatOutput(result, format));
123
141
  } catch (error) {
124
142
  console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
@@ -200,7 +218,7 @@ function registerOneTimeProductsCommands(program) {
200
218
  }
201
219
  const client = await getClient(config);
202
220
  try {
203
- const data = JSON.parse(await readFile(options.file, "utf-8"));
221
+ const data = await readJsonFile(options.file);
204
222
  const result = await createOneTimeOffer(client, packageName, productId, data);
205
223
  console.log(formatOutput(result, format));
206
224
  } catch (error) {
@@ -208,7 +226,7 @@ function registerOneTimeProductsCommands(program) {
208
226
  process.exit(4);
209
227
  }
210
228
  });
211
- offers.command("update <product-id> <offer-id>").description("Update an offer from JSON file").requiredOption("--file <path>", "JSON file with offer data").action(async (productId, offerId, options) => {
229
+ 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").action(async (productId, offerId, options) => {
212
230
  const config = await loadConfig();
213
231
  const packageName = resolvePackageName(program.opts()["app"], config);
214
232
  const format = getOutputFormat(program, config);
@@ -227,8 +245,8 @@ function registerOneTimeProductsCommands(program) {
227
245
  }
228
246
  const client = await getClient(config);
229
247
  try {
230
- const data = JSON.parse(await readFile(options.file, "utf-8"));
231
- const result = await updateOneTimeOffer(client, packageName, productId, offerId, data);
248
+ const data = await readJsonFile(options.file);
249
+ const result = await updateOneTimeOffer(client, packageName, productId, offerId, data, options.updateMask);
232
250
  console.log(formatOutput(result, format));
233
251
  } catch (error) {
234
252
  console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
@@ -261,8 +279,26 @@ function registerOneTimeProductsCommands(program) {
261
279
  process.exit(4);
262
280
  }
263
281
  });
282
+ otp.command("diff <product-id>").description("Compare local JSON file against remote one-time product").requiredOption("--file <path>", "Local JSON file to compare against remote").action(async (productId, options) => {
283
+ const config = await loadConfig();
284
+ const packageName = resolvePackageName(program.opts()["app"], config);
285
+ const client = await getClient(config);
286
+ const format = getOutputFormat(program, config);
287
+ try {
288
+ const localData = await readJsonFile(options.file);
289
+ const diffs = await diffOneTimeProduct(client, packageName, productId, localData);
290
+ if (diffs.length === 0) {
291
+ console.log("No differences found.");
292
+ } else {
293
+ console.log(formatOutput(diffs, format));
294
+ }
295
+ } catch (error) {
296
+ console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
297
+ process.exit(4);
298
+ }
299
+ });
264
300
  }
265
301
  export {
266
302
  registerOneTimeProductsCommands
267
303
  };
268
- //# sourceMappingURL=one-time-products-UYXGLH5A.js.map
304
+ //# sourceMappingURL=one-time-products-2PK4QKWE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/one-time-products.ts"],"sourcesContent":["import type { GpcConfig } from \"@gpc-cli/config\";\nimport type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport type { OneTimeProduct } 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\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 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 try {\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 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 } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\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 try {\n const result = await getOneTimeProduct(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 otp\n .command(\"create\")\n .description(\"Create a one-time product from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with product data\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"one-time-products create\",\n action: \"create\",\n target: `one-time product from ${options.file}`,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await createOneTimeProduct(client, packageName, data as any);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n 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 .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: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await updateOneTimeProduct(client, packageName, productId, data as any, options.updateMask);\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 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 try {\n await deleteOneTimeProduct(client, packageName, productId);\n console.log(`One-time product ${productId} 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 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(\"--sort <field>\", \"Sort by field (prefix with - for descending)\")\n .action(async (productId: string, options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await listOneTimeOffers(client, packageName, productId);\n if (options.sort) {\n result.oneTimeOffers = sortResults(result.oneTimeOffers, options.sort);\n }\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n offers\n .command(\"get <product-id> <offer-id>\")\n .description(\"Get an offer for a one-time product\")\n .action(async (productId: string, offerId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await getOneTimeOffer(client, packageName, productId, 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>\")\n .description(\"Create an offer from JSON file\")\n .requiredOption(\"--file <path>\", \"JSON file with offer data\")\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: \"one-time-products offers create\",\n action: \"create offer 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\n try {\n const data = await readJsonFile(options.file);\n const result = await createOneTimeOffer(client, packageName, productId, data as any);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n 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 .action(async (productId: string, offerId: string, options: { file: string; updateMask?: 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: \"one-time-products offers update\",\n action: \"update offer\",\n target: `${productId}/${offerId}`,\n details: { file: options.file },\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const data = await readJsonFile(options.file);\n const result = await updateOneTimeOffer(client, packageName, productId, offerId, data as any, options.updateMask);\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(\"delete <product-id> <offer-id>\")\n .description(\"Delete an offer\")\n .action(async (productId: string, offerId: 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 try {\n await deleteOneTimeOffer(client, packageName, productId, 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 // --- 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 try {\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 } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,gCAAgC,SAAwB;AACtE,QAAM,MAAM,QACT,QAAQ,mBAAmB,EAC3B,MAAM,KAAK,EACX,YAAY,sD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