@gpc-cli/cli 0.9.14 → 0.9.15

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 (96) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{apps-5YQPQ3KB.js → apps-CVBURB5V.js} +8 -5
  3. package/dist/apps-CVBURB5V.js.map +1 -0
  4. package/dist/{auth-CIITFC3C.js → auth-5XAQMZRV.js} +9 -6
  5. package/dist/auth-5XAQMZRV.js.map +1 -0
  6. package/dist/bin.js +1 -1
  7. package/dist/chunk-ELXAK7GI.js +11 -0
  8. package/dist/chunk-ELXAK7GI.js.map +1 -0
  9. package/dist/chunk-NV75I5VP.js +0 -0
  10. package/dist/{chunk-JL4BM7MD.js → chunk-NYGU5OUZ.js} +28 -28
  11. package/dist/chunk-Y3QZDAKS.js +0 -0
  12. package/dist/completion-C3PPWNS7.js +0 -0
  13. package/dist/{config-VLIIRPDQ.js → config-R5U7GV56.js} +6 -3
  14. package/dist/config-R5U7GV56.js.map +1 -0
  15. package/dist/{data-safety-M2SFKQ3U.js → data-safety-TNG3QMJX.js} +7 -5
  16. package/dist/data-safety-TNG3QMJX.js.map +1 -0
  17. package/dist/{device-tiers-FUZC6IHD.js → device-tiers-WFBZWCTY.js} +7 -5
  18. package/dist/device-tiers-WFBZWCTY.js.map +1 -0
  19. package/dist/docs-CVTWIVMS.js +0 -0
  20. package/dist/doctor-TEIKODLP.js +0 -0
  21. package/dist/{external-transactions-5U3PMAAG.js → external-transactions-HCL7ROMN.js} +7 -5
  22. package/dist/external-transactions-HCL7ROMN.js.map +1 -0
  23. package/dist/{generated-apks-HF7VYA54.js → generated-apks-N4S5PIQH.js} +6 -4
  24. package/dist/generated-apks-N4S5PIQH.js.map +1 -0
  25. package/dist/{iap-2CV6SJUF.js → iap-HDSHNFVG.js} +20 -19
  26. package/dist/iap-HDSHNFVG.js.map +1 -0
  27. package/dist/index.js +1 -1
  28. package/dist/install-skills-OV4HVANW.js +0 -0
  29. package/dist/{internal-sharing-FEZFTPWE.js → internal-sharing-OS3HVIY5.js} +5 -3
  30. package/dist/internal-sharing-OS3HVIY5.js.map +1 -0
  31. package/dist/{listings-4QCTOEWL.js → listings-AKOLKWLW.js} +14 -12
  32. package/dist/listings-AKOLKWLW.js.map +1 -0
  33. package/dist/{migrate-5IA6WGMO.js → migrate-V6G5YUVH.js} +7 -3
  34. package/dist/migrate-V6G5YUVH.js.map +1 -0
  35. package/dist/{one-time-products-BHE6WPZI.js → one-time-products-UYXGLH5A.js} +14 -12
  36. package/dist/one-time-products-UYXGLH5A.js.map +1 -0
  37. package/dist/{pricing-CQXQDB74.js → pricing-OB3MSWID.js} +6 -3
  38. package/dist/pricing-OB3MSWID.js.map +1 -0
  39. package/dist/prompt-BSV22CQZ.js +0 -0
  40. package/dist/{publish-YP7U64T2.js → publish-PZRWX3TH.js} +6 -3
  41. package/dist/publish-PZRWX3TH.js.map +1 -0
  42. package/dist/{purchase-options-2NUBLODI.js → purchase-options-PIOSWZOW.js} +9 -7
  43. package/dist/purchase-options-PIOSWZOW.js.map +1 -0
  44. package/dist/{purchases-FI25MLBU.js → purchases-NB5P4FL4.js} +13 -11
  45. package/dist/purchases-NB5P4FL4.js.map +1 -0
  46. package/dist/{recovery-DC66ZTGD.js → recovery-Q2I2HV6Q.js} +11 -9
  47. package/dist/recovery-Q2I2HV6Q.js.map +1 -0
  48. package/dist/{releases-HDCDARH5.js → releases-KXKLLIRR.js} +10 -7
  49. package/dist/releases-KXKLLIRR.js.map +1 -0
  50. package/dist/{reports-T6GBAYUK.js → reports-ZFVKYI4C.js} +5 -3
  51. package/dist/reports-ZFVKYI4C.js.map +1 -0
  52. package/dist/{reviews-G3HZG3AS.js → reviews-6V3DO4NB.js} +7 -5
  53. package/dist/reviews-6V3DO4NB.js.map +1 -0
  54. package/dist/{status-TBPVS7YR.js → status-S3FAEXNH.js} +6 -3
  55. package/dist/status-S3FAEXNH.js.map +1 -0
  56. package/dist/{subscriptions-ZBBYZYP2.js → subscriptions-L4YWMG3F.js} +20 -18
  57. package/dist/subscriptions-L4YWMG3F.js.map +1 -0
  58. package/dist/{testers-NXWT2PFS.js → testers-QSAXJM7W.js} +8 -6
  59. package/dist/testers-QSAXJM7W.js.map +1 -0
  60. package/dist/{tracks-D6FUNJ75.js → tracks-TP6TDO56.js} +8 -5
  61. package/dist/tracks-TP6TDO56.js.map +1 -0
  62. package/dist/{users-N2TK6KI7.js → users-KUVAYRJC.js} +9 -7
  63. package/dist/users-KUVAYRJC.js.map +1 -0
  64. package/dist/{validate-TPKVSIMR.js → validate-UYXICKBO.js} +8 -3
  65. package/dist/validate-UYXICKBO.js.map +1 -0
  66. package/dist/{vitals-VP2GKG3G.js → vitals-I6FKKKPO.js} +9 -7
  67. package/dist/vitals-I6FKKKPO.js.map +1 -0
  68. package/package.json +17 -17
  69. package/dist/apps-5YQPQ3KB.js.map +0 -1
  70. package/dist/auth-CIITFC3C.js.map +0 -1
  71. package/dist/config-VLIIRPDQ.js.map +0 -1
  72. package/dist/data-safety-M2SFKQ3U.js.map +0 -1
  73. package/dist/device-tiers-FUZC6IHD.js.map +0 -1
  74. package/dist/external-transactions-5U3PMAAG.js.map +0 -1
  75. package/dist/generated-apks-HF7VYA54.js.map +0 -1
  76. package/dist/iap-2CV6SJUF.js.map +0 -1
  77. package/dist/internal-sharing-FEZFTPWE.js.map +0 -1
  78. package/dist/listings-4QCTOEWL.js.map +0 -1
  79. package/dist/migrate-5IA6WGMO.js.map +0 -1
  80. package/dist/one-time-products-BHE6WPZI.js.map +0 -1
  81. package/dist/pricing-CQXQDB74.js.map +0 -1
  82. package/dist/publish-YP7U64T2.js.map +0 -1
  83. package/dist/purchase-options-2NUBLODI.js.map +0 -1
  84. package/dist/purchases-FI25MLBU.js.map +0 -1
  85. package/dist/recovery-DC66ZTGD.js.map +0 -1
  86. package/dist/releases-HDCDARH5.js.map +0 -1
  87. package/dist/reports-T6GBAYUK.js.map +0 -1
  88. package/dist/reviews-G3HZG3AS.js.map +0 -1
  89. package/dist/status-TBPVS7YR.js.map +0 -1
  90. package/dist/subscriptions-ZBBYZYP2.js.map +0 -1
  91. package/dist/testers-NXWT2PFS.js.map +0 -1
  92. package/dist/tracks-D6FUNJ75.js.map +0 -1
  93. package/dist/users-N2TK6KI7.js.map +0 -1
  94. package/dist/validate-TPKVSIMR.js.map +0 -1
  95. package/dist/vitals-VP2GKG3G.js.map +0 -1
  96. /package/dist/{chunk-JL4BM7MD.js.map → chunk-NYGU5OUZ.js.map} +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GPC Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -3,13 +3,16 @@ import {
3
3
  isDryRun,
4
4
  printDryRun
5
5
  } from "./chunk-Y3QZDAKS.js";
6
+ import {
7
+ getOutputFormat
8
+ } from "./chunk-ELXAK7GI.js";
6
9
 
7
10
  // src/commands/apps.ts
8
11
  import { loadConfig } from "@gpc-cli/config";
9
12
  import { resolveAuth } from "@gpc-cli/auth";
10
13
  import { createApiClient } from "@gpc-cli/api";
11
14
  import { getAppInfo, updateAppDetails } from "@gpc-cli/core";
12
- import { detectOutputFormat, formatOutput } from "@gpc-cli/core";
15
+ import { formatOutput } from "@gpc-cli/core";
13
16
  function registerAppsCommands(program) {
14
17
  const apps = program.command("apps").description("Manage applications");
15
18
  apps.command("info [package]").description("Show app details").action(async (packageArg) => {
@@ -27,7 +30,7 @@ function registerAppsCommands(program) {
27
30
  });
28
31
  const client = createApiClient({ auth });
29
32
  const info = await getAppInfo(client, packageName);
30
- const format = detectOutputFormat();
33
+ const format = getOutputFormat(program, config);
31
34
  console.log(formatOutput(info, format));
32
35
  } catch (error) {
33
36
  console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
@@ -53,7 +56,7 @@ function registerAppsCommands(program) {
53
56
  );
54
57
  process.exit(2);
55
58
  }
56
- const format = detectOutputFormat();
59
+ const format = getOutputFormat(program, config);
57
60
  if (isDryRun(program)) {
58
61
  printDryRun(
59
62
  {
@@ -81,7 +84,7 @@ function registerAppsCommands(program) {
81
84
  });
82
85
  apps.command("list").description("List configured applications").option("--limit <n>", "Maximum results to return").option("--next-page <token>", "Pagination token for next page").action(async (options) => {
83
86
  const config = await loadConfig();
84
- const format = detectOutputFormat();
87
+ const format = getOutputFormat(program, config);
85
88
  if (config.app) {
86
89
  const apps2 = [{ packageName: config.app, source: "config" }];
87
90
  console.log(formatOutput(apps2, format));
@@ -99,4 +102,4 @@ function registerAppsCommands(program) {
99
102
  export {
100
103
  registerAppsCommands
101
104
  };
102
- //# sourceMappingURL=apps-5YQPQ3KB.js.map
105
+ //# sourceMappingURL=apps-CVBURB5V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/apps.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport { getAppInfo, updateAppDetails } from \"@gpc-cli/core\";\nimport { formatOutput } from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\n\nexport function registerAppsCommands(program: Command): void {\n const apps = program.command(\"apps\").description(\"Manage applications\");\n\n apps\n .command(\"info [package]\")\n .description(\"Show app details\")\n .action(async (packageArg?: string) => {\n const config = await loadConfig();\n const packageName = packageArg || config.app;\n\n if (!packageName) {\n console.error(\"Error: No package name provided.\");\n console.error(\"Usage: gpc apps info <package>\");\n console.error(\"Or set a default: gpc config set app com.example.app\");\n process.exit(2);\n }\n\n try {\n const auth = await resolveAuth({\n serviceAccountPath: config.auth?.serviceAccount,\n });\n const client = createApiClient({ auth });\n const info = await getAppInfo(client, packageName);\n const format = getOutputFormat(program, config);\n console.log(formatOutput(info, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n apps\n .command(\"update\")\n .description(\"Update app details\")\n .option(\"--email <email>\", \"Contact email\")\n .option(\"--phone <phone>\", \"Contact phone\")\n .option(\"--website <url>\", \"Contact website\")\n .option(\"--default-lang <lang>\", \"Default language\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = options[\"app\"] || program.opts()[\"app\"] || config.app;\n\n if (!packageName) {\n console.error(\"Error: No package name provided.\");\n console.error(\"Usage: gpc apps update --email user@example.com\");\n process.exit(2);\n }\n\n const data: Record<string, string> = {};\n if (options[\"email\"]) data[\"contactEmail\"] = options[\"email\"];\n if (options[\"phone\"]) data[\"contactPhone\"] = options[\"phone\"];\n if (options[\"website\"]) data[\"contactWebsite\"] = options[\"website\"];\n if (options[\"defaultLang\"]) data[\"defaultLanguage\"] = options[\"defaultLang\"];\n\n if (Object.keys(data).length === 0) {\n console.error(\n \"Error: Provide at least one field to update (--email, --phone, --website, --default-lang).\",\n );\n process.exit(2);\n }\n\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"apps update\",\n action: \"update app details for\",\n target: packageName,\n details: data,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n try {\n const auth = await resolveAuth({\n serviceAccountPath: config.auth?.serviceAccount,\n });\n const client = createApiClient({ auth });\n const result = await updateAppDetails(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 apps\n .command(\"list\")\n .description(\"List configured applications\")\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 format = getOutputFormat(program, config);\n\n if (config.app) {\n const apps = [{ packageName: config.app, source: \"config\" }];\n console.log(formatOutput(apps, format));\n } else {\n console.log(\"No apps configured.\");\n console.log(\"\");\n console.log(\"Set a default app:\");\n console.log(\" gpc config set app com.example.myapp\");\n console.log(\"\");\n console.log(\"Or use the --app flag:\");\n console.log(\" gpc apps info --app com.example.myapp\");\n }\n });\n}\n"],"mappings":";;;;;;;;;;AACA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,YAAY,wBAAwB;AAC7C,SAAS,oBAAoB;AAItB,SAAS,qBAAqB,SAAwB;AAC3D,QAAM,OAAO,QAAQ,QAAQ,MAAM,EAAE,YAAY,qBAAqB;AAEtE,OACG,QAAQ,gBAAgB,EACxB,YAAY,kBAAkB,EAC9B,OAAO,OAAO,eAAwB;AACrC,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,cAAc,OAAO;AAEzC,QAAI,CAAC,aAAa;AAChB,cAAQ,MAAM,kCAAkC;AAChD,cAAQ,MAAM,gCAAgC;AAC9C,cAAQ,MAAM,sDAAsD;AACpE,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,QAAI;AACF,YAAM,OAAO,MAAM,YAAY;AA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
3
6
  // src/commands/auth.ts
4
7
  import { resolveAuth, loadServiceAccountKey, clearTokenCache, AuthError } from "@gpc-cli/auth";
5
8
  import { loadConfig, getCacheDir } from "@gpc-cli/config";
6
- import { detectOutputFormat, formatOutput } from "@gpc-cli/core";
9
+ import { formatOutput } from "@gpc-cli/core";
7
10
  function registerAuthCommands(program) {
8
11
  const auth = program.command("auth").description("Manage authentication");
9
12
  auth.command("login").description("Authenticate with Google Play Developer API").option("--service-account <path>", "Path to service account JSON key file").option("--adc", "Use Application Default Credentials").option("--profile <name>", "Store credentials under a named profile").action(async (options) => {
@@ -46,13 +49,13 @@ function registerAuthCommands(program) {
46
49
  }
47
50
  });
48
51
  auth.command("status").description("Show current authentication status").action(async () => {
52
+ const config = await loadConfig();
49
53
  try {
50
- const config = await loadConfig();
51
54
  const client = await resolveAuth({
52
55
  serviceAccountPath: config.auth?.serviceAccount,
53
56
  cachePath: getCacheDir()
54
57
  });
55
- const format = detectOutputFormat();
58
+ const format = getOutputFormat(program, config);
56
59
  const data = {
57
60
  authenticated: true,
58
61
  account: client.getClientEmail(),
@@ -62,7 +65,7 @@ function registerAuthCommands(program) {
62
65
  console.log(formatOutput(data, format));
63
66
  } catch (error) {
64
67
  if (error instanceof AuthError) {
65
- const format = detectOutputFormat();
68
+ const format = getOutputFormat(program, config);
66
69
  const data = {
67
70
  authenticated: false,
68
71
  error: error.message,
@@ -111,7 +114,7 @@ function registerAuthCommands(program) {
111
114
  const { listProfiles } = await import("@gpc-cli/config");
112
115
  const config = await loadConfig();
113
116
  const profiles = await listProfiles();
114
- const format = detectOutputFormat();
117
+ const format = getOutputFormat(program, config);
115
118
  if (profiles.length === 0) {
116
119
  console.log(
117
120
  "No profiles configured. Use: gpc auth login --service-account <path> --profile <name>"
@@ -128,4 +131,4 @@ function registerAuthCommands(program) {
128
131
  export {
129
132
  registerAuthCommands
130
133
  };
131
- //# sourceMappingURL=auth-CIITFC3C.js.map
134
+ //# sourceMappingURL=auth-5XAQMZRV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/auth.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport { resolveAuth, loadServiceAccountKey, clearTokenCache, AuthError } from \"@gpc-cli/auth\";\nimport { loadConfig, getCacheDir } from \"@gpc-cli/config\";\nimport { formatOutput } from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\n\nexport function registerAuthCommands(program: Command): void {\n const auth = program.command(\"auth\").description(\"Manage authentication\");\n\n auth\n .command(\"login\")\n .description(\"Authenticate with Google Play Developer API\")\n .option(\"--service-account <path>\", \"Path to service account JSON key file\")\n .option(\"--adc\", \"Use Application Default Credentials\")\n .option(\"--profile <name>\", \"Store credentials under a named profile\")\n .action(async (options: { serviceAccount?: string; adc?: boolean; profile?: string }) => {\n try {\n if (options.serviceAccount) {\n const key = await loadServiceAccountKey(options.serviceAccount);\n\n if (options.profile) {\n const { setProfileConfig } = await import(\"@gpc-cli/config\");\n await setProfileConfig(options.profile, {\n auth: { serviceAccount: options.serviceAccount },\n });\n console.log(`Profile \"${options.profile}\" configured with ${key.client_email}`);\n } else {\n const { setConfigValue } = await import(\"@gpc-cli/config\");\n await setConfigValue(\"auth.serviceAccount\", options.serviceAccount);\n console.log(`Authenticated as ${key.client_email}`);\n }\n console.log(`Project: ${key.project_id}`);\n } else if (options.adc) {\n const client = await resolveAuth();\n console.log(`Authenticated via Application Default Credentials`);\n console.log(`Account: ${client.getClientEmail()}`);\n } else {\n console.log(\"Usage: gpc auth login --service-account <path>\");\n console.log(\"\");\n console.log(\"Authentication methods:\");\n console.log(\" --service-account <path> Service account JSON key file\");\n console.log(\" --adc Application Default Credentials\");\n console.log(\"\");\n console.log(\"Options:\");\n console.log(\" --profile <name> Store under a named profile\");\n }\n } catch (error) {\n if (error instanceof AuthError) {\n console.error(`Error: ${error.message}`);\n if (error.suggestion) console.error(`Suggestion: ${error.suggestion}`);\n process.exit(3);\n }\n throw error;\n }\n });\n\n auth\n .command(\"status\")\n .description(\"Show current authentication status\")\n .action(async () => {\n const config = await loadConfig();\n try {\n const client = await resolveAuth({\n serviceAccountPath: config.auth?.serviceAccount,\n cachePath: getCacheDir(),\n });\n const format = getOutputFormat(program, config);\n const data = {\n authenticated: true,\n account: client.getClientEmail(),\n project: client.getProjectId(),\n ...(config.profile && { profile: config.profile }),\n };\n console.log(formatOutput(data, format));\n } catch (error) {\n if (error instanceof AuthError) {\n const format = getOutputFormat(program, config);\n const data = {\n authenticated: false,\n error: error.message,\n suggestion: error.suggestion,\n };\n console.log(formatOutput(data, format));\n process.exit(3);\n }\n throw error;\n }\n });\n\n auth\n .command(\"logout\")\n .description(\"Clear stored credentials and token cache\")\n .action(async () => {\n const { setConfigValue } = await import(\"@gpc-cli/config\");\n await setConfigValue(\"auth.serviceAccount\", \"\");\n await clearTokenCache(getCacheDir());\n console.log(\"Credentials and token cache cleared.\");\n });\n\n auth\n .command(\"whoami\")\n .description(\"Show current authenticated identity\")\n .action(async () => {\n try {\n const config = await loadConfig();\n const client = await resolveAuth({\n serviceAccountPath: config.auth?.serviceAccount,\n cachePath: getCacheDir(),\n });\n console.log(client.getClientEmail());\n } catch {\n console.error(\"Not authenticated. Run: gpc auth login\");\n process.exit(3);\n }\n });\n\n auth\n .command(\"switch <profile>\")\n .description(\"Switch to a named profile\")\n .action(async (profile: string) => {\n try {\n // Verify profile exists\n const config = await loadConfig({ profile });\n const { setConfigValue } = await import(\"@gpc-cli/config\");\n await setConfigValue(\"profile\", profile);\n console.log(`Switched to profile \"${profile}\"`);\n if (config.auth?.serviceAccount) {\n console.log(`Service account: ${config.auth.serviceAccount}`);\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(2);\n }\n });\n\n auth\n .command(\"profiles\")\n .description(\"List configured profiles\")\n .action(async () => {\n const { listProfiles } = await import(\"@gpc-cli/config\");\n const config = await loadConfig();\n const profiles = await listProfiles();\n const format = getOutputFormat(program, config);\n\n if (profiles.length === 0) {\n console.log(\n \"No profiles configured. Use: gpc auth login --service-account <path> --profile <name>\",\n );\n return;\n }\n\n const data = profiles.map((name) => ({\n name,\n active: name === config.profile,\n }));\n console.log(formatOutput(data, format));\n });\n}\n"],"mappings":";;;;;;AACA,SAAS,aAAa,uBAAuB,iBAAiB,iBAAiB;AAC/E,SAAS,YAAY,mBAAmB;AACxC,SAAS,oBAAoB;AAGtB,SAAS,qBAAqB,SAAwB;AAC3D,QAAM,OAAO,QAAQ,QAAQ,MAAM,EAAE,YAAY,uBAAuB;AAExE,OACG,QAAQ,OAAO,EACf,YAAY,6CAA6C,EACzD,OAAO,4BAA4B,uCAAuC,EAC1E,OAAO,SAAS,qCAAqC,EACrD,OAAO,oBAAoB,yCAAyC,EACpE,OAAO,OAAO,YAA0E;AACvF,QAAI;AACF,UAAI,QAAQ,gBAAgB;AAC1B,cAAM,MAAM,MAAM,sBAAsB,QAAQ,cAAc;AAE9D,YAAI,QAAQ,SAAS;AACnB,gBAAM,EAAE,iBAAiB,IAAI,MAAM,OAAO,iBAAiB;AAC3D,gBAAM,iBAAiB,QAAQ,SAAS;AAAA,YACtC,MAAM,EAAE,gBAAgB,QAAQ,eAAe;AAAA,UACjD,CAAC;AACD,kBAAQ,IAAI,YAAY,QAAQ,OAAO,qBAAqB,IAAI,YAAY,EAAE;AAAA,QAChF,OAAO;AACL,gBAAM,EAAE,eAAe,IAAI,MAAM,OAAO,iBAAiB;AACzD,gBAAM,eAAe,uBAAuB,QAAQ,cAAc;AAClE,kBAAQ,IAAI,oBAAoB,IAAI,YAAY,EAAE;AAAA,QACpD;AACA,gBAAQ,IAAI,YAAY,IAAI,UAAU,EAAE;AAAA,MAC1C,WAAW,QAAQ,KAAK;AACtB,cAAM,SAAS,MAAM,YAAY;AACjC,gBAAQ,IAAI,mDAAmD;AAC/D,gBAAQ,IAAI,YAAY,OAAO,eAAe,CAAC,EAAE;AAAA,MACnD,OAAO;AACL,gBAAQ,IAAI,gDAAgD;AAC5D,gBAAQ,IAAI,E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AM;AAE9C,QAAI,SAAS,WAAW,GAAG;AACzB,cAAQ;AAAA,QACN;AAAA,MACF;AACA;AAAA,IACF;AAEA,UAAM,OAAO,SAAS,IAAI,CAAC,UAAU;AAAA,MACnC;AAAA,MACA,QAAQ,SAAS,OAAO;AAAA,IAC1B,EAAE;AACF,YAAQ,IAAI,aAAa,MAAM,MAAM,CAAC;AAAA,EACxC,CAAC;AACL;","names":[]}
package/dist/bin.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  createProgram,
4
4
  handleCliError,
5
5
  loadPlugins
6
- } from "./chunk-JL4BM7MD.js";
6
+ } from "./chunk-NYGU5OUZ.js";
7
7
 
8
8
  // src/networking.ts
9
9
  async function setupNetworking() {
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/format.ts
4
+ function getOutputFormat(program, config) {
5
+ return program.opts()["output"] || config.output || "table";
6
+ }
7
+
8
+ export {
9
+ getOutputFormat
10
+ };
11
+ //# sourceMappingURL=chunk-ELXAK7GI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/format.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { OutputFormat } from \"@gpc-cli/config\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\n\nexport function getOutputFormat(program: Command, config: GpcConfig): OutputFormat {\n return (program.opts()[\"output\"] as OutputFormat | undefined) || config.output || \"table\";\n}\n"],"mappings":";;;AAIO,SAAS,gBAAgB,SAAkB,QAAiC;AACjF,SAAQ,QAAQ,KAAK,EAAE,QAAQ,KAAkC,OAAO,UAAU;AACpF;","names":[]}
File without changes
@@ -70,10 +70,10 @@ async function createProgram(pluginManager) {
70
70
  program.name("gpc").description("The complete Google Play CLI").version(process.env["__GPC_VERSION"] || "0.0.0", "-V, --version").option("-o, --output <format>", "Output format: table, json, yaml, markdown, junit").option("-v, --verbose", "Enable debug logging").option("-q, --quiet", "Suppress non-essential output").option("-a, --app <package>", "App package name").option("-p, --profile <name>", "Auth profile name").option("--no-color", "Disable colored output").option("--no-interactive", "Disable interactive prompts").option("-y, --yes", "Skip confirmation prompts").option("--dry-run", "Preview changes without executing").option("--notify [target]", "Send webhook notification on completion (slack, discord, custom)").option("--ci", "Force CI mode (JSON output, no prompts, strict exit codes)").option("-j, --json", "Shorthand for --output json").showSuggestionAfterError(true);
71
71
  const commandLoaders = {
72
72
  auth: async () => {
73
- (await import("./auth-CIITFC3C.js")).registerAuthCommands(program);
73
+ (await import("./auth-5XAQMZRV.js")).registerAuthCommands(program);
74
74
  },
75
75
  config: async () => {
76
- (await import("./config-VLIIRPDQ.js")).registerConfigCommands(program);
76
+ (await import("./config-R5U7GV56.js")).registerConfigCommands(program);
77
77
  },
78
78
  doctor: async () => {
79
79
  (await import("./doctor-TEIKODLP.js")).registerDoctorCommand(program);
@@ -85,81 +85,81 @@ async function createProgram(pluginManager) {
85
85
  (await import("./completion-C3PPWNS7.js")).registerCompletionCommand(program);
86
86
  },
87
87
  apps: async () => {
88
- (await import("./apps-5YQPQ3KB.js")).registerAppsCommands(program);
88
+ (await import("./apps-CVBURB5V.js")).registerAppsCommands(program);
89
89
  },
90
90
  releases: async () => {
91
- (await import("./releases-HDCDARH5.js")).registerReleasesCommands(program);
91
+ (await import("./releases-KXKLLIRR.js")).registerReleasesCommands(program);
92
92
  },
93
93
  tracks: async () => {
94
- (await import("./tracks-D6FUNJ75.js")).registerTracksCommands(program);
94
+ (await import("./tracks-TP6TDO56.js")).registerTracksCommands(program);
95
95
  },
96
96
  status: async () => {
97
- (await import("./status-TBPVS7YR.js")).registerStatusCommand(program);
97
+ (await import("./status-S3FAEXNH.js")).registerStatusCommand(program);
98
98
  },
99
99
  listings: async () => {
100
- (await import("./listings-4QCTOEWL.js")).registerListingsCommands(program);
100
+ (await import("./listings-AKOLKWLW.js")).registerListingsCommands(program);
101
101
  },
102
102
  reviews: async () => {
103
- (await import("./reviews-G3HZG3AS.js")).registerReviewsCommands(program);
103
+ (await import("./reviews-6V3DO4NB.js")).registerReviewsCommands(program);
104
104
  },
105
105
  vitals: async () => {
106
- (await import("./vitals-VP2GKG3G.js")).registerVitalsCommands(program);
106
+ (await import("./vitals-I6FKKKPO.js")).registerVitalsCommands(program);
107
107
  },
108
108
  subscriptions: async () => {
109
- (await import("./subscriptions-ZBBYZYP2.js")).registerSubscriptionsCommands(program);
109
+ (await import("./subscriptions-L4YWMG3F.js")).registerSubscriptionsCommands(program);
110
110
  },
111
111
  iap: async () => {
112
- (await import("./iap-2CV6SJUF.js")).registerIapCommands(program);
112
+ (await import("./iap-HDSHNFVG.js")).registerIapCommands(program);
113
113
  },
114
114
  purchases: async () => {
115
- (await import("./purchases-FI25MLBU.js")).registerPurchasesCommands(program);
115
+ (await import("./purchases-NB5P4FL4.js")).registerPurchasesCommands(program);
116
116
  },
117
117
  pricing: async () => {
118
- (await import("./pricing-CQXQDB74.js")).registerPricingCommands(program);
118
+ (await import("./pricing-OB3MSWID.js")).registerPricingCommands(program);
119
119
  },
120
120
  reports: async () => {
121
- (await import("./reports-T6GBAYUK.js")).registerReportsCommands(program);
121
+ (await import("./reports-ZFVKYI4C.js")).registerReportsCommands(program);
122
122
  },
123
123
  users: async () => {
124
- (await import("./users-N2TK6KI7.js")).registerUsersCommands(program);
124
+ (await import("./users-KUVAYRJC.js")).registerUsersCommands(program);
125
125
  },
126
126
  testers: async () => {
127
- (await import("./testers-NXWT2PFS.js")).registerTestersCommands(program);
127
+ (await import("./testers-QSAXJM7W.js")).registerTestersCommands(program);
128
128
  },
129
129
  validate: async () => {
130
- (await import("./validate-TPKVSIMR.js")).registerValidateCommand(program);
130
+ (await import("./validate-UYXICKBO.js")).registerValidateCommand(program);
131
131
  },
132
132
  publish: async () => {
133
- (await import("./publish-YP7U64T2.js")).registerPublishCommand(program);
133
+ (await import("./publish-PZRWX3TH.js")).registerPublishCommand(program);
134
134
  },
135
135
  recovery: async () => {
136
- (await import("./recovery-DC66ZTGD.js")).registerRecoveryCommands(program);
136
+ (await import("./recovery-Q2I2HV6Q.js")).registerRecoveryCommands(program);
137
137
  },
138
138
  "data-safety": async () => {
139
- (await import("./data-safety-M2SFKQ3U.js")).registerDataSafetyCommands(program);
139
+ (await import("./data-safety-TNG3QMJX.js")).registerDataSafetyCommands(program);
140
140
  },
141
141
  "external-transactions": async () => {
142
- (await import("./external-transactions-5U3PMAAG.js")).registerExternalTransactionsCommands(
142
+ (await import("./external-transactions-HCL7ROMN.js")).registerExternalTransactionsCommands(
143
143
  program
144
144
  );
145
145
  },
146
146
  "device-tiers": async () => {
147
- (await import("./device-tiers-FUZC6IHD.js")).registerDeviceTiersCommands(program);
147
+ (await import("./device-tiers-WFBZWCTY.js")).registerDeviceTiersCommands(program);
148
148
  },
149
149
  "one-time-products": async () => {
150
- (await import("./one-time-products-BHE6WPZI.js")).registerOneTimeProductsCommands(program);
150
+ (await import("./one-time-products-UYXGLH5A.js")).registerOneTimeProductsCommands(program);
151
151
  },
152
152
  "internal-sharing": async () => {
153
- (await import("./internal-sharing-FEZFTPWE.js")).registerInternalSharingCommands(program);
153
+ (await import("./internal-sharing-OS3HVIY5.js")).registerInternalSharingCommands(program);
154
154
  },
155
155
  "generated-apks": async () => {
156
- (await import("./generated-apks-HF7VYA54.js")).registerGeneratedApksCommands(program);
156
+ (await import("./generated-apks-N4S5PIQH.js")).registerGeneratedApksCommands(program);
157
157
  },
158
158
  "purchase-options": async () => {
159
- (await import("./purchase-options-2NUBLODI.js")).registerPurchaseOptionsCommands(program);
159
+ (await import("./purchase-options-PIOSWZOW.js")).registerPurchaseOptionsCommands(program);
160
160
  },
161
161
  migrate: async () => {
162
- (await import("./migrate-5IA6WGMO.js")).registerMigrateCommands(program);
162
+ (await import("./migrate-V6G5YUVH.js")).registerMigrateCommands(program);
163
163
  },
164
164
  "install-skills": async () => {
165
165
  (await import("./install-skills-OV4HVANW.js")).registerInstallSkillsCommand(program);
@@ -302,4 +302,4 @@ export {
302
302
  createProgram,
303
303
  handleCliError
304
304
  };
305
- //# sourceMappingURL=chunk-JL4BM7MD.js.map
305
+ //# sourceMappingURL=chunk-NYGU5OUZ.js.map
File without changes
File without changes
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ getOutputFormat
4
+ } from "./chunk-ELXAK7GI.js";
2
5
  import {
3
6
  isInteractive,
4
7
  promptInput,
@@ -7,7 +10,7 @@ import {
7
10
 
8
11
  // src/commands/config.ts
9
12
  import { loadConfig, setConfigValue, getUserConfigPath, initConfig } from "@gpc-cli/config";
10
- import { detectOutputFormat, formatOutput, writeAuditLog, createAuditEntry } from "@gpc-cli/core";
13
+ import { formatOutput, writeAuditLog, createAuditEntry } from "@gpc-cli/core";
11
14
  function registerConfigCommands(program) {
12
15
  const config = program.command("config").description("Manage configuration");
13
16
  config.command("init").description("Create a configuration file").option("--global", "Create in user config directory (~/.config/gpc/)").action(async (_options) => {
@@ -31,7 +34,7 @@ function registerConfigCommands(program) {
31
34
  });
32
35
  config.command("show").description("Display resolved configuration").action(async () => {
33
36
  const resolved = await loadConfig();
34
- const format = detectOutputFormat();
37
+ const format = getOutputFormat(program, resolved);
35
38
  console.log(formatOutput(resolved, format));
36
39
  });
37
40
  config.command("set <key> <value>").description("Set a configuration value").action(async (key, value) => {
@@ -45,4 +48,4 @@ function registerConfigCommands(program) {
45
48
  export {
46
49
  registerConfigCommands
47
50
  };
48
- //# sourceMappingURL=config-VLIIRPDQ.js.map
51
+ //# sourceMappingURL=config-R5U7GV56.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/config.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport { loadConfig, setConfigValue, getUserConfigPath, initConfig } from \"@gpc-cli/config\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { formatOutput, writeAuditLog, createAuditEntry } from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isInteractive, promptInput, promptSelect } from \"../prompt.js\";\n\nexport function registerConfigCommands(program: Command): void {\n const config = program.command(\"config\").description(\"Manage configuration\");\n\n config\n .command(\"init\")\n .description(\"Create a configuration file\")\n .option(\"--global\", \"Create in user config directory (~/.config/gpc/)\")\n .action(async (_options: { global?: boolean }) => {\n const initialConfig: Record<string, unknown> = {};\n\n if (isInteractive(program)) {\n const app = await promptInput(\"Default package name (e.g. com.example.app, blank to skip)\");\n if (app) initialConfig[\"app\"] = app;\n\n const output = await promptSelect(\n \"Default output format:\",\n [\"table\", \"json\", \"yaml\", \"markdown\"],\n \"table\",\n );\n if (output !== \"table\") initialConfig[\"output\"] = output;\n\n const sa = await promptInput(\"Service account JSON path (blank to skip)\");\n if (sa) initialConfig[\"auth\"] = { serviceAccount: sa };\n }\n\n const path = await initConfig(initialConfig as GpcConfig);\n console.log(`Configuration file created at: ${path}`);\n writeAuditLog(createAuditEntry(\"config init\", { path })).catch(() => {});\n });\n\n config\n .command(\"show\")\n .description(\"Display resolved configuration\")\n .action(async () => {\n const resolved = await loadConfig();\n const format = getOutputFormat(program, resolved);\n console.log(formatOutput(resolved, format));\n });\n\n config\n .command(\"set <key> <value>\")\n .description(\"Set a configuration value\")\n .action(async (key: string, value: string) => {\n await setConfigValue(key, value);\n console.log(`Set ${key} = ${value}`);\n });\n\n config\n .command(\"path\")\n .description(\"Show configuration file path\")\n .action(() => {\n console.log(getUserConfigPath());\n });\n}\n"],"mappings":";;;;;;;;;;;AACA,SAAS,YAAY,gBAAgB,mBAAmB,kBAAkB;AAE1E,SAAS,cAAc,eAAe,wBAAwB;AAIvD,SAAS,uBAAuB,SAAwB;AAC7D,QAAM,SAAS,QAAQ,QAAQ,QAAQ,EAAE,YAAY,sBAAsB;AAE3E,SACG,QAAQ,MAAM,EACd,YAAY,6BAA6B,EACzC,OAAO,YAAY,kDAAkD,EACrE,OAAO,OAAO,aAAmC;AAChD,UAAM,gBAAyC,CAAC;AAEhD,QAAI,cAAc,OAAO,GAAG;AAC1B,YAAM,MAAM,MAAM,YAAY,4DAA4D;AAC1F,UAAI,IAAK,eAAc,KAAK,IAAI;AAEhC,YAAM,SAAS,MAAM;AAAA,QACnB;AAAA,QACA,CAAC,SAAS,QAAQ,QAAQ,UAAU;AAAA,QACpC;AAAA,MACF;AACA,UAAI,WAAW,QAAS,eAAc,QAAQ,IAAI;AAElD,YAAM,KAAK,MAAM,YAAY,2CAA2C;AACxE,UAAI,GAAI,eAAc,MAAM,IAAI,EAAE,gBAAgB,GAAG;AAAA,IACvD;AAEA,UAAM,OAAO,MAAM,WAAW,aAA0B;AACxD,YAAQ,IAAI,kCAAkC,IAAI,EAAE;AACpD,kBAAc,iBAAiB,eAAe,EAAE,KAAK,CAAC,CAAC,EAAE,MAAM,MAAM;AAAA,IAAC,CAAC;AAAA,EACzE,CAAC;AAEH,SACG,QAAQ,MAAM,EACd,YAAY,gCAAgC,EAC5C,OAAO,YAAY;AAClB,UAAM,WAAW,MAAM,WAAW;AAClC,UAAM,SAAS,gBAAgB,SAAS,QAAQ;AAChD,YAAQ,IAAI,aAAa,UAAU,MAAM,CAAC;AAAA,EAC5C,CAAC;AAEH,SACG,QAAQ,mBAAmB,EAC3B,YAAY,2BAA2B,EACvC,OAAO,OAAO,KAAa,UAAkB;AAC5C,UAAM,eAAe,KAAK,KAAK;AAC/B,YAAQ,IAAI,OAAO,GAAG,MAAM,KAAK,EAAE;AAAA,EACrC,CAAC;AAEH,SACG,QAAQ,MAAM,EACd,YAAY,8BAA8B,EAC1C,OAAO,MAAM;AACZ,YAAQ,IAAI,kBAAkB,CAAC;AAAA,EACjC,CAAC;AACL;","names":[]}
@@ -3,6 +3,9 @@ import {
3
3
  isDryRun,
4
4
  printDryRun
5
5
  } from "./chunk-Y3QZDAKS.js";
6
+ import {
7
+ getOutputFormat
8
+ } from "./chunk-ELXAK7GI.js";
6
9
 
7
10
  // src/commands/data-safety.ts
8
11
  import { loadConfig } from "@gpc-cli/config";
@@ -12,7 +15,6 @@ import {
12
15
  getDataSafety,
13
16
  exportDataSafety,
14
17
  importDataSafety,
15
- detectOutputFormat,
16
18
  formatOutput
17
19
  } from "@gpc-cli/core";
18
20
  function resolvePackageName(packageArg, config) {
@@ -33,7 +35,7 @@ function registerDataSafetyCommands(program) {
33
35
  const config = await loadConfig();
34
36
  const packageName = resolvePackageName(program.opts()["app"], config);
35
37
  const client = await getClient(config);
36
- const format = detectOutputFormat();
38
+ const format = getOutputFormat(program, config);
37
39
  try {
38
40
  const result = await getDataSafety(client, packageName);
39
41
  console.log(formatOutput(result, format));
@@ -45,7 +47,7 @@ function registerDataSafetyCommands(program) {
45
47
  dataSafety.command("update").description("Update data safety declaration from a JSON file").requiredOption("--file <path>", "Path to data safety JSON file").action(async (options) => {
46
48
  const config = await loadConfig();
47
49
  const packageName = resolvePackageName(program.opts()["app"], config);
48
- const format = detectOutputFormat();
50
+ const format = getOutputFormat(program, config);
49
51
  if (isDryRun(program)) {
50
52
  printDryRun(
51
53
  {
@@ -71,7 +73,7 @@ function registerDataSafetyCommands(program) {
71
73
  const config = await loadConfig();
72
74
  const packageName = resolvePackageName(program.opts()["app"], config);
73
75
  const client = await getClient(config);
74
- const format = detectOutputFormat();
76
+ const format = getOutputFormat(program, config);
75
77
  try {
76
78
  const result = await exportDataSafety(client, packageName, options.output);
77
79
  if (format === "json") {
@@ -88,4 +90,4 @@ function registerDataSafetyCommands(program) {
88
90
  export {
89
91
  registerDataSafetyCommands
90
92
  };
91
- //# sourceMappingURL=data-safety-M2SFKQ3U.js.map
93
+ //# sourceMappingURL=data-safety-TNG3QMJX.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\n dataSafety\n .command(\"get\")\n .description(\"Get the current data safety declaration\")\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 getDataSafety(client, packageName);\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 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\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 (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 exportDataSafety(client, packageName, options.output);\n if (format === \"json\") {\n console.log(formatOutput({ file: options.output, dataSafety: result }, format));\n } else {\n console.log(`Data safety declaration exported to ${options.output}`);\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAEA;AAAA,EACA;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,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,SAAS,MAAM,UAAU,MAAM;AACrC,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,QAAI;AACF,YAAM,SAAS,MAAM,cAAc,QAAQ,WAAW;AACtD,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,iDA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,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
+ getOutputFormat
4
+ } from "./chunk-ELXAK7GI.js";
2
5
 
3
6
  // src/commands/device-tiers.ts
4
7
  import { loadConfig } from "@gpc-cli/config";
@@ -8,7 +11,6 @@ import {
8
11
  listDeviceTiers,
9
12
  getDeviceTier,
10
13
  createDeviceTier,
11
- detectOutputFormat,
12
14
  formatOutput
13
15
  } from "@gpc-cli/core";
14
16
  import { readFile } from "fs/promises";
@@ -30,7 +32,7 @@ function registerDeviceTiersCommands(program) {
30
32
  const config = await loadConfig();
31
33
  const packageName = resolvePackageName(program.opts()["app"], config);
32
34
  const client = await getClient(config);
33
- const format = detectOutputFormat();
35
+ const format = getOutputFormat(program, config);
34
36
  try {
35
37
  const result = await listDeviceTiers(client, packageName);
36
38
  console.log(formatOutput(result, format));
@@ -43,7 +45,7 @@ function registerDeviceTiersCommands(program) {
43
45
  const config = await loadConfig();
44
46
  const packageName = resolvePackageName(program.opts()["app"], config);
45
47
  const client = await getClient(config);
46
- const format = detectOutputFormat();
48
+ const format = getOutputFormat(program, config);
47
49
  try {
48
50
  const result = await getDeviceTier(client, packageName, configId);
49
51
  console.log(formatOutput(result, format));
@@ -56,7 +58,7 @@ function registerDeviceTiersCommands(program) {
56
58
  const config = await loadConfig();
57
59
  const packageName = resolvePackageName(program.opts()["app"], config);
58
60
  const client = await getClient(config);
59
- const format = detectOutputFormat();
61
+ const format = getOutputFormat(program, config);
60
62
  try {
61
63
  const raw = await readFile(opts.file, "utf-8");
62
64
  const tierConfig = JSON.parse(raw);
@@ -71,4 +73,4 @@ function registerDeviceTiersCommands(program) {
71
73
  export {
72
74
  registerDeviceTiersCommands
73
75
  };
74
- //# sourceMappingURL=device-tiers-FUZC6IHD.js.map
76
+ //# sourceMappingURL=device-tiers-WFBZWCTY.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 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,MAAM,EACd,YAAY,iCAAiC,EAC7C,OAAO,YAAY;AAClB,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,SAAS,MAAM,UAAU,MAAM;AACrC,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,QAAI;AACF,YAAM,SAAS,MAAM,gBAAgB,QAAQ,WAAW;AACxD,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C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,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
File without changes
File without changes
@@ -3,6 +3,9 @@ import {
3
3
  isDryRun,
4
4
  printDryRun
5
5
  } from "./chunk-Y3QZDAKS.js";
6
+ import {
7
+ getOutputFormat
8
+ } from "./chunk-ELXAK7GI.js";
6
9
  import {
7
10
  requireConfirm
8
11
  } from "./chunk-NV75I5VP.js";
@@ -15,7 +18,6 @@ import {
15
18
  createExternalTransaction,
16
19
  getExternalTransaction,
17
20
  refundExternalTransaction,
18
- detectOutputFormat,
19
21
  formatOutput
20
22
  } from "@gpc-cli/core";
21
23
  import { readFileSync } from "fs";
@@ -36,7 +38,7 @@ function registerExternalTransactionsCommands(program) {
36
38
  extTxn.command("create").description("Create a new external transaction").requiredOption("--file <path>", "Path to JSON file with transaction data").action(async (options) => {
37
39
  const config = await loadConfig();
38
40
  const packageName = resolvePackageName(program.opts()["app"], config);
39
- const format = detectOutputFormat();
41
+ const format = getOutputFormat(program, config);
40
42
  let data;
41
43
  try {
42
44
  data = JSON.parse(readFileSync(options.file, "utf-8"));
@@ -72,7 +74,7 @@ function registerExternalTransactionsCommands(program) {
72
74
  const config = await loadConfig();
73
75
  const packageName = resolvePackageName(program.opts()["app"], config);
74
76
  const client = await getClient(config);
75
- const format = detectOutputFormat();
77
+ const format = getOutputFormat(program, config);
76
78
  try {
77
79
  const result = await getExternalTransaction(client, packageName, id);
78
80
  console.log(formatOutput(result, format));
@@ -87,7 +89,7 @@ function registerExternalTransactionsCommands(program) {
87
89
  ).option("--currency <code>", "Currency code for partial refund (e.g. USD)").action(async (id, options) => {
88
90
  const config = await loadConfig();
89
91
  const packageName = resolvePackageName(program.opts()["app"], config);
90
- const format = detectOutputFormat();
92
+ const format = getOutputFormat(program, config);
91
93
  const refundData = {};
92
94
  if (options.full) {
93
95
  refundData.fullRefund = {};
@@ -128,4 +130,4 @@ function registerExternalTransactionsCommands(program) {
128
130
  export {
129
131
  registerExternalTransactionsCommands
130
132
  };
131
- //# sourceMappingURL=external-transactions-5U3PMAAG.js.map
133
+ //# sourceMappingURL=external-transactions-HCL7ROMN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/external-transactions.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 createExternalTransaction,\n getExternalTransaction,\n refundExternalTransaction,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { requireConfirm } from \"../prompt.js\";\nimport { readFileSync } from \"node:fs\";\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 registerExternalTransactionsCommands(program: Command): void {\n const extTxn = program\n .command(\"external-transactions\")\n .alias(\"ext-txn\")\n .description(\"Manage external transactions (alternative billing)\");\n\n extTxn\n .command(\"create\")\n .description(\"Create a new external transaction\")\n .requiredOption(\"--file <path>\", \"Path to JSON file with transaction 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 let data: Record<string, unknown>;\n try {\n data = JSON.parse(readFileSync(options.file, \"utf-8\"));\n } catch (err) {\n console.error(\n `Error: Could not read transaction data from ${options.file}: ${err instanceof Error ? err.message : String(err)}`,\n );\n process.exit(2);\n }\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"external-transactions create\",\n action: \"create external transaction\",\n target: packageName,\n details: data,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await createExternalTransaction(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 extTxn\n .command(\"get <id>\")\n .description(\"Get an external transaction by ID\")\n .action(async (id: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await getExternalTransaction(client, packageName, id);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n extTxn\n .command(\"refund <id>\")\n .description(\"Refund an external transaction\")\n .option(\"--full\", \"Full refund\")\n .option(\n \"--partial-amount <micros>\",\n \"Partial refund pre-tax amount in micros (e.g., 1990000)\",\n )\n .option(\"--currency <code>\", \"Currency code for partial refund (e.g. USD)\")\n .action(async (id: string, options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n const refundData: Record<string, unknown> = {};\n if (options.full) {\n refundData.fullRefund = {};\n } else if (options.partialAmount) {\n refundData.partialRefund = {\n refundPreTaxAmount: {\n priceMicros: options.partialAmount,\n currency: options.currency,\n },\n };\n } else {\n refundData.fullRefund = {};\n }\n\n await requireConfirm(`Refund external transaction \"${id}\"?`, program);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"external-transactions refund\",\n action: \"refund external transaction\",\n target: id,\n details: refundData,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await refundExternalTransaction(client, packageName, id, refundData);\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,uB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AAAA,QACpB;AAAA,MACF;AAAA,IACF,OAAO;AACL,iBAAW,aAAa,CAAC;AAAA,IAC3B;AAEA,UAAM,eAAe,gCAAgC,EAAE,MAAM,OAAO;AAEpE,QAAI,SAAS,OAAO,GAAG;AACrB;AAAA,QACE;AAAA,UACE,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,SAAS;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA;AAAA,IACF;AAEA,UAAM,SAAS,MAAM,UAAU,MAAM;AAErC,QAAI;AACF,YAAM,SAAS,MAAM,0BAA0B,QAAQ,aAAa,IAAI,UAAU;AAClF,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
+ getOutputFormat
4
+ } from "./chunk-ELXAK7GI.js";
2
5
 
3
6
  // src/commands/generated-apks.ts
4
7
  import { loadConfig } from "@gpc-cli/config";
@@ -7,7 +10,6 @@ import { createApiClient } from "@gpc-cli/api";
7
10
  import {
8
11
  listGeneratedApks,
9
12
  downloadGeneratedApk,
10
- detectOutputFormat,
11
13
  formatOutput
12
14
  } from "@gpc-cli/core";
13
15
  function resolvePackageName(packageArg, config) {
@@ -28,7 +30,7 @@ function registerGeneratedApksCommands(program) {
28
30
  const config = await loadConfig();
29
31
  const packageName = resolvePackageName(program.opts()["app"], config);
30
32
  const client = await getClient(config);
31
- const format = detectOutputFormat();
33
+ const format = getOutputFormat(program, config);
32
34
  const versionCode = parseInt(versionCodeStr, 10);
33
35
  if (isNaN(versionCode)) {
34
36
  console.error("Error: version-code must be a number");
@@ -46,7 +48,7 @@ function registerGeneratedApksCommands(program) {
46
48
  const config = await loadConfig();
47
49
  const packageName = resolvePackageName(program.opts()["app"], config);
48
50
  const client = await getClient(config);
49
- const format = detectOutputFormat();
51
+ const format = getOutputFormat(program, config);
50
52
  const versionCode = parseInt(versionCodeStr, 10);
51
53
  if (isNaN(versionCode)) {
52
54
  console.error("Error: version-code must be a number");
@@ -70,4 +72,4 @@ function registerGeneratedApksCommands(program) {
70
72
  export {
71
73
  registerGeneratedApksCommands
72
74
  };
73
- //# sourceMappingURL=generated-apks-HF7VYA54.js.map
75
+ //# sourceMappingURL=generated-apks-N4S5PIQH.js.map