@gpc-cli/cli 0.9.52 → 0.9.54

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 (160) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -19
  3. package/dist/{anomalies-V3AFS4LD.js → anomalies-I5P6QQAZ.js} +14 -5
  4. package/dist/anomalies-I5P6QQAZ.js.map +1 -0
  5. package/dist/{apps-4GP3FD7O.js → apps-WPUQOQLL.js} +2 -2
  6. package/dist/{audit-VTWXTXC6.js → audit-M7GYID74.js} +2 -2
  7. package/dist/{auth-BA4FE2PO.js → auth-4DRT7ZH2.js} +10 -4
  8. package/dist/auth-4DRT7ZH2.js.map +1 -0
  9. package/dist/bin.js +2 -2
  10. package/dist/{bundle-F7MUVC5J.js → bundle-PFTE7XMU.js} +4 -2
  11. package/dist/bundle-PFTE7XMU.js.map +1 -0
  12. package/dist/{cache-XKPLZYEB.js → cache-FGNP7Y37.js} +6 -2
  13. package/dist/cache-FGNP7Y37.js.map +1 -0
  14. package/dist/changelog-QLDFG5TV.js +0 -0
  15. package/dist/{chunk-SLNJEAMK.js → chunk-22XCOLZX.js} +4 -2
  16. package/dist/chunk-22XCOLZX.js.map +1 -0
  17. package/dist/chunk-3SJ6OXCZ.js +0 -0
  18. package/dist/{chunk-FXOWADQD.js → chunk-6HIY4IGM.js} +48 -45
  19. package/dist/chunk-6HIY4IGM.js.map +1 -0
  20. package/dist/{chunk-BCBXQC7J.js → chunk-E7SVZ7RF.js} +1 -1
  21. package/dist/chunk-E7SVZ7RF.js.map +1 -0
  22. package/dist/chunk-ELXAK7GI.js +0 -0
  23. package/dist/chunk-FAN4ZITI.js +0 -0
  24. package/dist/{chunk-NQH4G7BI.js → chunk-JDRY7HK5.js} +6 -9
  25. package/dist/chunk-JDRY7HK5.js.map +1 -0
  26. package/dist/{chunk-YFUBD2XB.js → chunk-RZQSEDKI.js} +6 -9
  27. package/dist/chunk-RZQSEDKI.js.map +1 -0
  28. package/dist/{chunk-A7VRCCNS.js → chunk-WSLFHX5X.js} +3 -3
  29. package/dist/chunk-WSLFHX5X.js.map +1 -0
  30. package/dist/chunk-Y3QZDAKS.js +0 -0
  31. package/dist/completion-BCHRJSAT.js +0 -0
  32. package/dist/{config-BLMJ35J2.js → config-PUINDZON.js} +3 -3
  33. package/dist/{data-safety-AFMD6MYI.js → data-safety-46VY64OO.js} +12 -4
  34. package/dist/data-safety-46VY64OO.js.map +1 -0
  35. package/dist/{device-tiers-AQAMUQXI.js → device-tiers-MNZYMG3Y.js} +2 -2
  36. package/dist/device-tiers-MNZYMG3Y.js.map +1 -0
  37. package/dist/{diff-6EO4ID6W.js → diff-OBSHUSTL.js} +2 -2
  38. package/dist/diff-OBSHUSTL.js.map +1 -0
  39. package/dist/{docs-GMFN6V4K.js → docs-GP6AEX4N.js} +8 -4
  40. package/dist/docs-GP6AEX4N.js.map +1 -0
  41. package/dist/{doctor-7LQWPY5P.js → doctor-T3QFYBRV.js} +5 -5
  42. package/dist/doctor-T3QFYBRV.js.map +1 -0
  43. package/dist/enterprise-7PWXMSUN.js +0 -0
  44. package/dist/{external-transactions-LCZALS3V.js → external-transactions-JL3G4IG5.js} +11 -5
  45. package/dist/external-transactions-JL3G4IG5.js.map +1 -0
  46. package/dist/{feedback-7ADYSGRD.js → feedback-AULXQLJ7.js} +3 -3
  47. package/dist/feedback-AULXQLJ7.js.map +1 -0
  48. package/dist/{games-ZSNGEI7A.js → games-SVFN2YIS.js} +2 -2
  49. package/dist/games-SVFN2YIS.js.map +1 -0
  50. package/dist/{generated-apks-RX2IUWSF.js → generated-apks-TC33S2YN.js} +2 -2
  51. package/dist/generated-apks-TC33S2YN.js.map +1 -0
  52. package/dist/{grants-EBPECI26.js → grants-UHNBPIFD.js} +10 -3
  53. package/dist/grants-UHNBPIFD.js.map +1 -0
  54. package/dist/{iap-OUI5YYN4.js → iap-ETOL7OAC.js} +4 -4
  55. package/dist/iap-ETOL7OAC.js.map +1 -0
  56. package/dist/index.js +1 -1
  57. package/dist/{init-WSTQTJOD.js → init-6CCSVJC2.js} +7 -3
  58. package/dist/init-6CCSVJC2.js.map +1 -0
  59. package/dist/{install-skills-JKPYZHYS.js → install-skills-S342NJ7T.js} +7 -3
  60. package/dist/{install-skills-JKPYZHYS.js.map → install-skills-S342NJ7T.js.map} +1 -1
  61. package/dist/{internal-sharing-ONNIWIAT.js → internal-sharing-KW6YENDG.js} +2 -2
  62. package/dist/internal-sharing-KW6YENDG.js.map +1 -0
  63. package/dist/{listings-LNX6MQYN.js → listings-MOHHHNE6.js} +27 -7
  64. package/dist/listings-MOHHHNE6.js.map +1 -0
  65. package/dist/migrate-ZQCJGQQS.js +0 -0
  66. package/dist/one-time-products-Y5RNIPV2.js +472 -0
  67. package/dist/one-time-products-Y5RNIPV2.js.map +1 -0
  68. package/dist/{preflight-W3JAJ4GO.js → preflight-KIWZPFTX.js} +4 -13
  69. package/dist/preflight-KIWZPFTX.js.map +1 -0
  70. package/dist/{pricing-JJZFICFL.js → pricing-HYQRXKNO.js} +3 -3
  71. package/dist/pricing-HYQRXKNO.js.map +1 -0
  72. package/dist/{prompt-GXC2JSLA.js → prompt-HJXNXXAR.js} +2 -2
  73. package/dist/{publish-P5KIGSLI.js → publish-26SSZ2W3.js} +11 -5
  74. package/dist/publish-26SSZ2W3.js.map +1 -0
  75. package/dist/purchase-options-KFWW4JW2.js +0 -0
  76. package/dist/{purchases-UBFLNYZC.js → purchases-AHWGLW6V.js} +35 -32
  77. package/dist/purchases-AHWGLW6V.js.map +1 -0
  78. package/dist/{quickstart-Z5Y3FYJU.js → quickstart-FOWM3OKT.js} +7 -2
  79. package/dist/quickstart-FOWM3OKT.js.map +1 -0
  80. package/dist/quota-MZRWYJGR.js +0 -0
  81. package/dist/{recovery-YE3Z7NIN.js → recovery-B7DZQ6XG.js} +28 -12
  82. package/dist/recovery-B7DZQ6XG.js.map +1 -0
  83. package/dist/{releases-LUAHKIMY.js → releases-XY57V22L.js} +33 -8
  84. package/dist/releases-XY57V22L.js.map +1 -0
  85. package/dist/reports-CIB2T3XT.js +0 -0
  86. package/dist/{reviews-YCBBM656.js → reviews-P4M6BEJI.js} +4 -6
  87. package/dist/reviews-P4M6BEJI.js.map +1 -0
  88. package/dist/{rtdn-LID2B7XZ.js → rtdn-YII4H6SD.js} +29 -21
  89. package/dist/rtdn-YII4H6SD.js.map +1 -0
  90. package/dist/{status-3HXBBXG6.js → status-32AJ7A6O.js} +13 -32
  91. package/dist/status-32AJ7A6O.js.map +1 -0
  92. package/dist/{subscriptions-LURZFPGJ.js → subscriptions-GTVJB4HX.js} +49 -12
  93. package/dist/subscriptions-GTVJB4HX.js.map +1 -0
  94. package/dist/system-apks-L6M7QYB3.js +111 -0
  95. package/dist/system-apks-L6M7QYB3.js.map +1 -0
  96. package/dist/{testers-6CQL4KQV.js → testers-QUWZHO6M.js} +25 -7
  97. package/dist/testers-QUWZHO6M.js.map +1 -0
  98. package/dist/{tracks-I4QZNZ3M.js → tracks-RH3RKVFB.js} +9 -3
  99. package/dist/{tracks-I4QZNZ3M.js.map → tracks-RH3RKVFB.js.map} +1 -1
  100. package/dist/{train-MDD2EBHS.js → train-D2NKUW3M.js} +3 -3
  101. package/dist/train-D2NKUW3M.js.map +1 -0
  102. package/dist/{update-FZ3MNLOH.js → update-73YOR4GP.js} +8 -11
  103. package/dist/{update-FZ3MNLOH.js.map → update-73YOR4GP.js.map} +1 -1
  104. package/dist/{users-UKG7VIQH.js → users-FOMAT7DY.js} +2 -2
  105. package/dist/{validate-QIYSA3N7.js → validate-RHWEZYD2.js} +6 -2
  106. package/dist/validate-RHWEZYD2.js.map +1 -0
  107. package/dist/{verify-UUQNQMPG.js → verify-H4ZUVHMZ.js} +5 -13
  108. package/dist/verify-H4ZUVHMZ.js.map +1 -0
  109. package/dist/{version-VHQBXU2I.js → version-RXLEX62V.js} +3 -3
  110. package/dist/{vitals-PJEQUUAK.js → vitals-PRBPNMVC.js} +26 -8
  111. package/dist/vitals-PRBPNMVC.js.map +1 -0
  112. package/package.json +18 -18
  113. package/dist/anomalies-V3AFS4LD.js.map +0 -1
  114. package/dist/auth-BA4FE2PO.js.map +0 -1
  115. package/dist/bundle-F7MUVC5J.js.map +0 -1
  116. package/dist/cache-XKPLZYEB.js.map +0 -1
  117. package/dist/chunk-A7VRCCNS.js.map +0 -1
  118. package/dist/chunk-BCBXQC7J.js.map +0 -1
  119. package/dist/chunk-FXOWADQD.js.map +0 -1
  120. package/dist/chunk-NQH4G7BI.js.map +0 -1
  121. package/dist/chunk-SLNJEAMK.js.map +0 -1
  122. package/dist/chunk-YFUBD2XB.js.map +0 -1
  123. package/dist/data-safety-AFMD6MYI.js.map +0 -1
  124. package/dist/device-tiers-AQAMUQXI.js.map +0 -1
  125. package/dist/diff-6EO4ID6W.js.map +0 -1
  126. package/dist/docs-GMFN6V4K.js.map +0 -1
  127. package/dist/doctor-7LQWPY5P.js.map +0 -1
  128. package/dist/external-transactions-LCZALS3V.js.map +0 -1
  129. package/dist/feedback-7ADYSGRD.js.map +0 -1
  130. package/dist/games-ZSNGEI7A.js.map +0 -1
  131. package/dist/generated-apks-RX2IUWSF.js.map +0 -1
  132. package/dist/grants-EBPECI26.js.map +0 -1
  133. package/dist/iap-OUI5YYN4.js.map +0 -1
  134. package/dist/init-WSTQTJOD.js.map +0 -1
  135. package/dist/internal-sharing-ONNIWIAT.js.map +0 -1
  136. package/dist/listings-LNX6MQYN.js.map +0 -1
  137. package/dist/one-time-products-MGZTU7OM.js +0 -254
  138. package/dist/one-time-products-MGZTU7OM.js.map +0 -1
  139. package/dist/preflight-W3JAJ4GO.js.map +0 -1
  140. package/dist/pricing-JJZFICFL.js.map +0 -1
  141. package/dist/publish-P5KIGSLI.js.map +0 -1
  142. package/dist/purchases-UBFLNYZC.js.map +0 -1
  143. package/dist/quickstart-Z5Y3FYJU.js.map +0 -1
  144. package/dist/recovery-YE3Z7NIN.js.map +0 -1
  145. package/dist/releases-LUAHKIMY.js.map +0 -1
  146. package/dist/reviews-YCBBM656.js.map +0 -1
  147. package/dist/rtdn-LID2B7XZ.js.map +0 -1
  148. package/dist/status-3HXBBXG6.js.map +0 -1
  149. package/dist/subscriptions-LURZFPGJ.js.map +0 -1
  150. package/dist/testers-6CQL4KQV.js.map +0 -1
  151. package/dist/train-MDD2EBHS.js.map +0 -1
  152. package/dist/validate-QIYSA3N7.js.map +0 -1
  153. package/dist/verify-UUQNQMPG.js.map +0 -1
  154. package/dist/vitals-PJEQUUAK.js.map +0 -1
  155. /package/dist/{apps-4GP3FD7O.js.map → apps-WPUQOQLL.js.map} +0 -0
  156. /package/dist/{audit-VTWXTXC6.js.map → audit-M7GYID74.js.map} +0 -0
  157. /package/dist/{config-BLMJ35J2.js.map → config-PUINDZON.js.map} +0 -0
  158. /package/dist/{prompt-GXC2JSLA.js.map → prompt-HJXNXXAR.js.map} +0 -0
  159. /package/dist/{users-UKG7VIQH.js.map → users-FOMAT7DY.js.map} +0 -0
  160. /package/dist/{version-VHQBXU2I.js.map → version-RXLEX62V.js.map} +0 -0
@@ -67,22 +67,22 @@ function registerPluginCommands(program, manager) {
67
67
  import { Command } from "commander";
68
68
  async function createProgram(pluginManager) {
69
69
  const program = new Command();
70
- program.name("gpc").description("GPC \u2014 Google Play Console CLI").version("0.9.52", "-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").option("--apps <csv>", "Comma-separated package names for multi-app operations").showSuggestionAfterError(false);
70
+ program.name("gpc").description("GPC \u2014 Google Play Console CLI").version("0.9.54", "-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").option("--apps <csv>", "Comma-separated package names for multi-app operations").showSuggestionAfterError(false);
71
71
  const commandLoaders = {
72
72
  auth: async () => {
73
- (await import("./auth-BA4FE2PO.js")).registerAuthCommands(program);
73
+ (await import("./auth-4DRT7ZH2.js")).registerAuthCommands(program);
74
74
  },
75
75
  config: async () => {
76
- (await import("./config-BLMJ35J2.js")).registerConfigCommands(program);
76
+ (await import("./config-PUINDZON.js")).registerConfigCommands(program);
77
77
  },
78
78
  doctor: async () => {
79
- (await import("./doctor-7LQWPY5P.js")).registerDoctorCommand(program);
79
+ (await import("./doctor-T3QFYBRV.js")).registerDoctorCommand(program);
80
80
  },
81
81
  update: async () => {
82
- (await import("./update-FZ3MNLOH.js")).registerUpdateCommand(program);
82
+ (await import("./update-73YOR4GP.js")).registerUpdateCommand(program);
83
83
  },
84
84
  docs: async () => {
85
- (await import("./docs-GMFN6V4K.js")).registerDocsCommand(program);
85
+ (await import("./docs-GP6AEX4N.js")).registerDocsCommand(program);
86
86
  },
87
87
  changelog: async () => {
88
88
  (await import("./changelog-QLDFG5TV.js")).registerChangelogCommand(program);
@@ -91,138 +91,141 @@ async function createProgram(pluginManager) {
91
91
  (await import("./completion-BCHRJSAT.js")).registerCompletionCommand(program);
92
92
  },
93
93
  apps: async () => {
94
- (await import("./apps-4GP3FD7O.js")).registerAppsCommands(program);
94
+ (await import("./apps-WPUQOQLL.js")).registerAppsCommands(program);
95
95
  },
96
96
  releases: async () => {
97
- (await import("./releases-LUAHKIMY.js")).registerReleasesCommands(program);
97
+ (await import("./releases-XY57V22L.js")).registerReleasesCommands(program);
98
98
  },
99
99
  tracks: async () => {
100
- (await import("./tracks-I4QZNZ3M.js")).registerTracksCommands(program);
100
+ (await import("./tracks-RH3RKVFB.js")).registerTracksCommands(program);
101
101
  },
102
102
  status: async () => {
103
- (await import("./status-3HXBBXG6.js")).registerStatusCommand(program);
103
+ (await import("./status-32AJ7A6O.js")).registerStatusCommand(program);
104
104
  },
105
105
  listings: async () => {
106
- (await import("./listings-LNX6MQYN.js")).registerListingsCommands(program);
106
+ (await import("./listings-MOHHHNE6.js")).registerListingsCommands(program);
107
107
  },
108
108
  reviews: async () => {
109
- (await import("./reviews-YCBBM656.js")).registerReviewsCommands(program);
109
+ (await import("./reviews-P4M6BEJI.js")).registerReviewsCommands(program);
110
110
  },
111
111
  vitals: async () => {
112
- (await import("./vitals-PJEQUUAK.js")).registerVitalsCommands(program);
112
+ (await import("./vitals-PRBPNMVC.js")).registerVitalsCommands(program);
113
113
  },
114
114
  subscriptions: async () => {
115
- (await import("./subscriptions-LURZFPGJ.js")).registerSubscriptionsCommands(program);
115
+ (await import("./subscriptions-GTVJB4HX.js")).registerSubscriptionsCommands(program);
116
116
  },
117
117
  iap: async () => {
118
- (await import("./iap-OUI5YYN4.js")).registerIapCommands(program);
118
+ (await import("./iap-ETOL7OAC.js")).registerIapCommands(program);
119
119
  },
120
120
  purchases: async () => {
121
- (await import("./purchases-UBFLNYZC.js")).registerPurchasesCommands(program);
121
+ (await import("./purchases-AHWGLW6V.js")).registerPurchasesCommands(program);
122
122
  },
123
123
  pricing: async () => {
124
- (await import("./pricing-JJZFICFL.js")).registerPricingCommands(program);
124
+ (await import("./pricing-HYQRXKNO.js")).registerPricingCommands(program);
125
125
  },
126
126
  reports: async () => {
127
127
  (await import("./reports-CIB2T3XT.js")).registerReportsCommands(program);
128
128
  },
129
129
  users: async () => {
130
- (await import("./users-UKG7VIQH.js")).registerUsersCommands(program);
130
+ (await import("./users-FOMAT7DY.js")).registerUsersCommands(program);
131
131
  },
132
132
  testers: async () => {
133
- (await import("./testers-6CQL4KQV.js")).registerTestersCommands(program);
133
+ (await import("./testers-QUWZHO6M.js")).registerTestersCommands(program);
134
134
  },
135
135
  validate: async () => {
136
- (await import("./validate-QIYSA3N7.js")).registerValidateCommand(program);
136
+ (await import("./validate-RHWEZYD2.js")).registerValidateCommand(program);
137
137
  },
138
138
  publish: async () => {
139
- (await import("./publish-P5KIGSLI.js")).registerPublishCommand(program);
139
+ (await import("./publish-26SSZ2W3.js")).registerPublishCommand(program);
140
140
  },
141
141
  recovery: async () => {
142
- (await import("./recovery-YE3Z7NIN.js")).registerRecoveryCommands(program);
142
+ (await import("./recovery-B7DZQ6XG.js")).registerRecoveryCommands(program);
143
143
  },
144
144
  "data-safety": async () => {
145
- (await import("./data-safety-AFMD6MYI.js")).registerDataSafetyCommands(program);
145
+ (await import("./data-safety-46VY64OO.js")).registerDataSafetyCommands(program);
146
146
  },
147
147
  "external-transactions": async () => {
148
- (await import("./external-transactions-LCZALS3V.js")).registerExternalTransactionsCommands(
148
+ (await import("./external-transactions-JL3G4IG5.js")).registerExternalTransactionsCommands(
149
149
  program
150
150
  );
151
151
  },
152
152
  "device-tiers": async () => {
153
- (await import("./device-tiers-AQAMUQXI.js")).registerDeviceTiersCommands(program);
153
+ (await import("./device-tiers-MNZYMG3Y.js")).registerDeviceTiersCommands(program);
154
154
  },
155
155
  "one-time-products": async () => {
156
- (await import("./one-time-products-MGZTU7OM.js")).registerOneTimeProductsCommands(program);
156
+ (await import("./one-time-products-Y5RNIPV2.js")).registerOneTimeProductsCommands(program);
157
157
  },
158
158
  "internal-sharing": async () => {
159
- (await import("./internal-sharing-ONNIWIAT.js")).registerInternalSharingCommands(program);
159
+ (await import("./internal-sharing-KW6YENDG.js")).registerInternalSharingCommands(program);
160
160
  },
161
161
  "generated-apks": async () => {
162
- (await import("./generated-apks-RX2IUWSF.js")).registerGeneratedApksCommands(program);
162
+ (await import("./generated-apks-TC33S2YN.js")).registerGeneratedApksCommands(program);
163
+ },
164
+ "system-apks": async () => {
165
+ (await import("./system-apks-L6M7QYB3.js")).registerSystemApksCommands(program);
163
166
  },
164
167
  "purchase-options": async () => {
165
168
  (await import("./purchase-options-KFWW4JW2.js")).registerPurchaseOptionsCommands(program);
166
169
  },
167
170
  bundle: async () => {
168
- (await import("./bundle-F7MUVC5J.js")).registerBundleCommands(program);
171
+ (await import("./bundle-PFTE7XMU.js")).registerBundleCommands(program);
169
172
  },
170
173
  audit: async () => {
171
- (await import("./audit-VTWXTXC6.js")).registerAuditCommands(program);
174
+ (await import("./audit-M7GYID74.js")).registerAuditCommands(program);
172
175
  },
173
176
  migrate: async () => {
174
177
  (await import("./migrate-ZQCJGQQS.js")).registerMigrateCommands(program);
175
178
  },
176
179
  anomalies: async () => {
177
- (await import("./anomalies-V3AFS4LD.js")).registerAnomaliesCommands(program);
180
+ (await import("./anomalies-I5P6QQAZ.js")).registerAnomaliesCommands(program);
178
181
  },
179
182
  "install-skills": async () => {
180
- (await import("./install-skills-JKPYZHYS.js")).registerInstallSkillsCommand(program);
183
+ (await import("./install-skills-S342NJ7T.js")).registerInstallSkillsCommand(program);
181
184
  },
182
185
  verify: async () => {
183
- (await import("./verify-UUQNQMPG.js")).registerVerifyCommand(program);
186
+ (await import("./verify-H4ZUVHMZ.js")).registerVerifyCommand(program);
184
187
  },
185
188
  version: async () => {
186
- (await import("./version-VHQBXU2I.js")).registerVersionCommand(program);
189
+ (await import("./version-RXLEX62V.js")).registerVersionCommand(program);
187
190
  },
188
191
  cache: async () => {
189
- (await import("./cache-XKPLZYEB.js")).registerCacheCommand(program);
192
+ (await import("./cache-FGNP7Y37.js")).registerCacheCommand(program);
190
193
  },
191
194
  feedback: async () => {
192
- (await import("./feedback-7ADYSGRD.js")).registerFeedbackCommand(program);
195
+ (await import("./feedback-AULXQLJ7.js")).registerFeedbackCommand(program);
193
196
  },
194
197
  quickstart: async () => {
195
- (await import("./quickstart-Z5Y3FYJU.js")).registerQuickstartCommand(program);
198
+ (await import("./quickstart-FOWM3OKT.js")).registerQuickstartCommand(program);
196
199
  },
197
200
  grants: async () => {
198
- (await import("./grants-EBPECI26.js")).registerGrantsCommands(program);
201
+ (await import("./grants-UHNBPIFD.js")).registerGrantsCommands(program);
199
202
  },
200
203
  train: async () => {
201
- (await import("./train-MDD2EBHS.js")).registerTrainCommands(program);
204
+ (await import("./train-D2NKUW3M.js")).registerTrainCommands(program);
202
205
  },
203
206
  quota: async () => {
204
207
  (await import("./quota-MZRWYJGR.js")).registerQuotaCommand(program);
205
208
  },
206
209
  games: async () => {
207
- (await import("./games-ZSNGEI7A.js")).registerGamesCommands(program);
210
+ (await import("./games-SVFN2YIS.js")).registerGamesCommands(program);
208
211
  },
209
212
  enterprise: async () => {
210
213
  (await import("./enterprise-7PWXMSUN.js")).registerEnterpriseCommands(program);
211
214
  },
212
215
  diff: async () => {
213
- (await import("./diff-6EO4ID6W.js")).registerDiffCommand(program);
216
+ (await import("./diff-OBSHUSTL.js")).registerDiffCommand(program);
214
217
  },
215
218
  init: async () => {
216
- (await import("./init-WSTQTJOD.js")).registerInitCommand(program);
219
+ (await import("./init-6CCSVJC2.js")).registerInitCommand(program);
217
220
  },
218
221
  preflight: async () => {
219
- (await import("./preflight-W3JAJ4GO.js")).registerPreflightCommand(program);
222
+ (await import("./preflight-KIWZPFTX.js")).registerPreflightCommand(program);
220
223
  },
221
224
  plugins: async () => {
222
225
  registerPluginsCommand(program, pluginManager);
223
226
  },
224
227
  rtdn: async () => {
225
- (await import("./rtdn-LID2B7XZ.js")).registerRtdnCommands(program);
228
+ (await import("./rtdn-YII4H6SD.js")).registerRtdnCommands(program);
226
229
  }
227
230
  };
228
231
  function levenshtein(a, b) {
@@ -457,4 +460,4 @@ export {
457
460
  createProgram,
458
461
  handleCliError
459
462
  };
460
- //# sourceMappingURL=chunk-FXOWADQD.js.map
463
+ //# sourceMappingURL=chunk-6HIY4IGM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugins.ts","../src/program.ts","../src/error-handler.ts"],"sourcesContent":["import { PluginManager, discoverPlugins } from \"@gpc-cli/core\";\nimport type { Command } from \"commander\";\n\n/**\n * Load and initialize all plugins.\n * First-party plugins (@gpc-cli/*) are auto-trusted.\n * Third-party plugins require prior approval stored in config.\n * Plugin loading is disabled in standalone binary mode.\n */\nexport async function loadPlugins(): Promise<PluginManager> {\n const manager = new PluginManager();\n\n // Standalone binary cannot resolve external npm packages at runtime\n if (process.env[\"__GPC_BINARY\"] === \"1\") {\n return manager;\n }\n\n try {\n const { loadConfig } = await import(\"@gpc-cli/config\");\n const config = await loadConfig();\n const plugins = await discoverPlugins({ configPlugins: config.plugins });\n const approved = new Set(config.approvedPlugins ?? []);\n\n for (const plugin of plugins) {\n const isTrusted = plugin.name.startsWith(\"@gpc-cli/\");\n\n if (!isTrusted && !approved.has(plugin.name)) {\n // Skip unapproved third-party plugins silently in non-interactive mode\n // In interactive mode, the user would run `gpc plugins approve <name>` first\n const isQuiet = process.argv.includes(\"--quiet\") || process.argv.includes(\"-q\");\n if (!isQuiet) {\n console.error(\n `Plugin \"${plugin.name}\" is not approved. Run: gpc plugins approve ${plugin.name}`,\n );\n }\n continue;\n }\n\n try {\n await manager.load(plugin);\n } catch {\n // Skip plugins that fail to load — don't block the CLI\n }\n }\n } catch {\n // Config loading failure shouldn't block plugin-free commands\n }\n\n return manager;\n}\n\n/**\n * Register plugin-defined commands with the Commander program.\n */\nexport function registerPluginCommands(program: Command, manager: PluginManager): void {\n for (const def of manager.getRegisteredCommands()) {\n const cmd = program.command(def.name).description(def.description);\n\n if (def.arguments) {\n for (const arg of def.arguments) {\n const syntax = arg.required ? `<${arg.name}>` : `[${arg.name}]`;\n cmd.argument(syntax, arg.description);\n }\n }\n\n if (def.options) {\n for (const opt of def.options) {\n cmd.option(\n opt.flags,\n opt.description,\n opt.defaultValue as string | boolean | string[] | undefined,\n );\n }\n }\n\n cmd.action(async (...rawArgs: unknown[]) => {\n const opts = rawArgs[rawArgs.length - 2] as Record<string, unknown>;\n const args: Record<string, unknown> = {};\n\n if (def.arguments) {\n def.arguments.forEach((argDef, i) => {\n args[argDef.name] = rawArgs[i];\n });\n }\n\n await def.action(args, opts);\n });\n }\n}\n","import { Command } from \"commander\";\nimport type { PluginManager } from \"@gpc-cli/core\";\nimport type { CommandEvent, CommandResult } from \"@gpc-cli/plugin-sdk\";\nimport { registerPluginCommands } from \"./plugins.js\";\n\nexport async function createProgram(pluginManager?: PluginManager): Promise<Command> {\n const program = new Command();\n\n program\n .name(\"gpc\")\n .description(\"GPC — Google Play Console CLI\")\n .version(process.env[\"__GPC_VERSION\"] || \"0.0.0\", \"-V, --version\")\n .option(\"-o, --output <format>\", \"Output format: table, json, yaml, markdown, junit\")\n .option(\"-v, --verbose\", \"Enable debug logging\")\n .option(\"-q, --quiet\", \"Suppress non-essential output\")\n .option(\"-a, --app <package>\", \"App package name\")\n .option(\"-p, --profile <name>\", \"Auth profile name\")\n .option(\"--no-color\", \"Disable colored output\")\n .option(\"--no-interactive\", \"Disable interactive prompts\")\n .option(\"-y, --yes\", \"Skip confirmation prompts\")\n .option(\"--dry-run\", \"Preview changes without executing\")\n .option(\"--notify [target]\", \"Send webhook notification on completion (slack, discord, custom)\")\n .option(\"--ci\", \"Force CI mode (JSON output, no prompts, strict exit codes)\")\n .option(\"-j, --json\", \"Shorthand for --output json\")\n .option(\"--apps <csv>\", \"Comma-separated package names for multi-app operations\")\n .showSuggestionAfterError(false);\n\n const commandLoaders: Record<string, () => Promise<void>> = {\n auth: async () => {\n (await import(\"./commands/auth.js\")).registerAuthCommands(program);\n },\n config: async () => {\n (await import(\"./commands/config.js\")).registerConfigCommands(program);\n },\n doctor: async () => {\n (await import(\"./commands/doctor.js\")).registerDoctorCommand(program);\n },\n update: async () => {\n (await import(\"./commands/update.js\")).registerUpdateCommand(program);\n },\n docs: async () => {\n (await import(\"./commands/docs.js\")).registerDocsCommand(program);\n },\n changelog: async () => {\n (await import(\"./commands/changelog.js\")).registerChangelogCommand(program);\n },\n completion: async () => {\n (await import(\"./commands/completion.js\")).registerCompletionCommand(program);\n },\n apps: async () => {\n (await import(\"./commands/apps.js\")).registerAppsCommands(program);\n },\n releases: async () => {\n (await import(\"./commands/releases.js\")).registerReleasesCommands(program);\n },\n tracks: async () => {\n (await import(\"./commands/tracks.js\")).registerTracksCommands(program);\n },\n status: async () => {\n (await import(\"./commands/status.js\")).registerStatusCommand(program);\n },\n listings: async () => {\n (await import(\"./commands/listings.js\")).registerListingsCommands(program);\n },\n reviews: async () => {\n (await import(\"./commands/reviews.js\")).registerReviewsCommands(program);\n },\n vitals: async () => {\n (await import(\"./commands/vitals.js\")).registerVitalsCommands(program);\n },\n subscriptions: async () => {\n (await import(\"./commands/subscriptions.js\")).registerSubscriptionsCommands(program);\n },\n iap: async () => {\n (await import(\"./commands/iap.js\")).registerIapCommands(program);\n },\n purchases: async () => {\n (await import(\"./commands/purchases.js\")).registerPurchasesCommands(program);\n },\n pricing: async () => {\n (await import(\"./commands/pricing.js\")).registerPricingCommands(program);\n },\n reports: async () => {\n (await import(\"./commands/reports.js\")).registerReportsCommands(program);\n },\n users: async () => {\n (await import(\"./commands/users.js\")).registerUsersCommands(program);\n },\n testers: async () => {\n (await import(\"./commands/testers.js\")).registerTestersCommands(program);\n },\n validate: async () => {\n (await import(\"./commands/validate.js\")).registerValidateCommand(program);\n },\n publish: async () => {\n (await import(\"./commands/publish.js\")).registerPublishCommand(program);\n },\n recovery: async () => {\n (await import(\"./commands/recovery.js\")).registerRecoveryCommands(program);\n },\n \"data-safety\": async () => {\n (await import(\"./commands/data-safety.js\")).registerDataSafetyCommands(program);\n },\n \"external-transactions\": async () => {\n (await import(\"./commands/external-transactions.js\")).registerExternalTransactionsCommands(\n program,\n );\n },\n \"device-tiers\": async () => {\n (await import(\"./commands/device-tiers.js\")).registerDeviceTiersCommands(program);\n },\n \"one-time-products\": async () => {\n (await import(\"./commands/one-time-products.js\")).registerOneTimeProductsCommands(program);\n },\n \"internal-sharing\": async () => {\n (await import(\"./commands/internal-sharing.js\")).registerInternalSharingCommands(program);\n },\n \"generated-apks\": async () => {\n (await import(\"./commands/generated-apks.js\")).registerGeneratedApksCommands(program);\n },\n \"system-apks\": async () => {\n (await import(\"./commands/system-apks.js\")).registerSystemApksCommands(program);\n },\n \"purchase-options\": async () => {\n (await import(\"./commands/purchase-options.js\")).registerPurchaseOptionsCommands(program);\n },\n bundle: async () => {\n (await import(\"./commands/bundle.js\")).registerBundleCommands(program);\n },\n audit: async () => {\n (await import(\"./commands/audit.js\")).registerAuditCommands(program);\n },\n migrate: async () => {\n (await import(\"./commands/migrate.js\")).registerMigrateCommands(program);\n },\n anomalies: async () => {\n (await import(\"./commands/anomalies.js\")).registerAnomaliesCommands(program);\n },\n \"install-skills\": async () => {\n (await import(\"./commands/install-skills.js\")).registerInstallSkillsCommand(program);\n },\n verify: async () => {\n (await import(\"./commands/verify.js\")).registerVerifyCommand(program);\n },\n version: async () => {\n (await import(\"./commands/version.js\")).registerVersionCommand(program);\n },\n cache: async () => {\n (await import(\"./commands/cache.js\")).registerCacheCommand(program);\n },\n feedback: async () => {\n (await import(\"./commands/feedback.js\")).registerFeedbackCommand(program);\n },\n quickstart: async () => {\n (await import(\"./commands/quickstart.js\")).registerQuickstartCommand(program);\n },\n grants: async () => {\n (await import(\"./commands/grants.js\")).registerGrantsCommands(program);\n },\n train: async () => {\n (await import(\"./commands/train.js\")).registerTrainCommands(program);\n },\n quota: async () => {\n (await import(\"./commands/quota.js\")).registerQuotaCommand(program);\n },\n games: async () => {\n (await import(\"./commands/games.js\")).registerGamesCommands(program);\n },\n enterprise: async () => {\n (await import(\"./commands/enterprise.js\")).registerEnterpriseCommands(program);\n },\n diff: async () => {\n (await import(\"./commands/diff.js\")).registerDiffCommand(program);\n },\n init: async () => {\n (await import(\"./commands/init.js\")).registerInitCommand(program);\n },\n preflight: async () => {\n (await import(\"./commands/preflight.js\")).registerPreflightCommand(program);\n },\n plugins: async () => {\n registerPluginsCommand(program, pluginManager);\n },\n rtdn: async () => {\n (await import(\"./commands/rtdn.js\")).registerRtdnCommands(program);\n },\n };\n\n // \"Did you mean?\" suggestions for unknown commands\n function levenshtein(a: string, b: string): number {\n const m = a.length,\n n = b.length;\n const dp: number[][] = Array.from({ length: m + 1 }, (_, i) =>\n Array.from({ length: n + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0)),\n );\n const cell = (r: number, c: number): number => dp[r]?.[c] ?? 0;\n for (let i = 1; i <= m; i++) {\n for (let j = 1; j <= n; j++) {\n (dp[i] as number[])[j] =\n a[i - 1] === b[j - 1]\n ? cell(i - 1, j - 1)\n : 1 + Math.min(cell(i - 1, j), cell(i, j - 1), cell(i - 1, j - 1));\n }\n }\n return cell(m, n);\n }\n\n program.on(\"command:*\", (operands: string[]) => {\n const cmd = operands[0] ?? \"\";\n const names = Object.keys(commandLoaders);\n const best = names\n .map((name) => ({ name, d: levenshtein(cmd, name) }))\n .sort((a, b) => a.d - b.d)[0];\n console.error(`Error: Unknown command \"${cmd}\".`);\n if (best && best.d <= 3) console.error(`Did you mean: gpc ${best.name}?`);\n console.error(`Run \"gpc --help\" to see all commands.`);\n process.exit(2);\n });\n\n // Resolve command aliases for lazy loading\n const commandAliases: Record<string, string> = {\n \"ext-txn\": \"external-transactions\",\n otp: \"one-time-products\",\n };\n\n const rawTarget = process.argv[2];\n const target = rawTarget ? (commandAliases[rawTarget] ?? rawTarget) : undefined;\n\n const loader = target ? commandLoaders[target] : undefined;\n if (loader) {\n await loader();\n } else {\n await Promise.all(Object.values(commandLoaders).map((loader) => loader()));\n }\n\n // Register plugin-defined commands\n if (pluginManager) {\n registerPluginCommands(program, pluginManager);\n }\n\n // Wire plugin lifecycle hooks around command execution\n if (pluginManager) {\n wrapCommandHooks(program, pluginManager);\n }\n\n return program;\n}\n\n/**\n * `gpc plugins` — manage plugins.\n */\nfunction registerPluginsCommand(program: Command, manager?: PluginManager): void {\n const cmd = program.command(\"plugins\").description(\"Manage plugins\");\n\n cmd\n .command(\"list\")\n .description(\"List loaded plugins\")\n .action(() => {\n const plugins = manager?.getLoadedPlugins() ?? [];\n const opts = program.opts();\n\n if (opts[\"output\"] === \"json\") {\n console.log(JSON.stringify(plugins, null, 2));\n return;\n }\n\n if (plugins.length === 0) {\n console.log(\"No plugins loaded.\");\n console.log('\\nConfigure plugins in .gpcrc.json: { \"plugins\": [\"@gpc-cli/plugin-ci\"] }');\n return;\n }\n\n console.log(\"Loaded plugins:\\n\");\n for (const p of plugins) {\n const trust = p.trusted ? \"trusted\" : \"third-party\";\n console.log(` ${p.name}@${p.version} (${trust})`);\n }\n\n const commands = manager?.getRegisteredCommands() ?? [];\n if (commands.length > 0) {\n console.log(\"\\nPlugin commands:\\n\");\n for (const c of commands) {\n console.log(` gpc ${c.name} — ${c.description}`);\n }\n }\n });\n\n cmd\n .command(\"init <name>\")\n .description(\"Scaffold a new plugin project\")\n .option(\"-d, --dir <path>\", \"Output directory (defaults to ./gpc-plugin-<name>)\")\n .option(\"--description <text>\", \"Plugin description\")\n .action(async (name: string, opts: { dir?: string; description?: string }) => {\n const { scaffoldPlugin } = await import(\"@gpc-cli/core\");\n const pluginName = name.startsWith(\"gpc-plugin-\") ? name : `gpc-plugin-${name}`;\n const dir = opts.dir ?? `./${pluginName}`;\n\n const result = await scaffoldPlugin({ name, dir, description: opts.description });\n\n console.log(`Plugin scaffolded at ${result.dir}/\\n`);\n console.log(\"Files created:\");\n for (const f of result.files) {\n console.log(` ${f}`);\n }\n console.log(`\\nNext steps:`);\n console.log(` cd ${pluginName}`);\n console.log(` npm install`);\n console.log(` npm run build`);\n console.log(` npm test`);\n });\n\n cmd\n .command(\"approve <name>\")\n .description(\"Approve a third-party plugin for loading\")\n .action(async (name: string) => {\n const { approvePlugin } = await import(\"@gpc-cli/config\");\n await approvePlugin(name);\n console.log(`Plugin \"${name}\" approved. It will be loaded on next run.`);\n });\n\n cmd\n .command(\"revoke <name>\")\n .description(\"Revoke approval for a third-party plugin\")\n .action(async (name: string) => {\n const { revokePluginApproval } = await import(\"@gpc-cli/config\");\n const removed = await revokePluginApproval(name);\n if (removed) {\n console.log(`Plugin \"${name}\" approval revoked.`);\n } else {\n console.log(`Plugin \"${name}\" was not in the approved list.`);\n }\n });\n\n const REGISTRY_URL =\n \"https://raw.githubusercontent.com/yasserstudio/gpc-plugins/main/registry.json\";\n\n interface RegistryPlugin {\n name: string;\n description: string;\n version: string;\n author?: string;\n tags?: string[];\n }\n\n cmd\n .command(\"search [query]\")\n .description(\"Search the GPC plugin registry\")\n .action(async (query?: string) => {\n try {\n const res = await fetch(REGISTRY_URL);\n if (!res.ok) throw new Error(`Registry fetch failed: ${res.status}`);\n const plugins = (await res.json()) as RegistryPlugin[];\n const filtered = query\n ? plugins.filter(\n (p) =>\n p.name.includes(query) ||\n p.description?.toLowerCase().includes(query.toLowerCase()),\n )\n : plugins;\n\n if (filtered.length === 0) {\n console.log(`No plugins found${query ? ` matching \"${query}\"` : \"\"}.`);\n return;\n }\n\n for (const p of filtered) {\n console.log(` ${p.name}@${p.version}`);\n if (p.description) console.log(` ${p.description}`);\n }\n console.log(`\\nInstall: gpc plugins install <name>`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n cmd\n .command(\"install <name>\")\n .description(\"Install a plugin from npm\")\n .action(async (name: string) => {\n const { spawnSync } = await import(\"node:child_process\");\n console.log(`Installing plugin \"${name}\"...`);\n try {\n // Use spawnSync with an array to avoid shell injection — no shell is invoked\n const result = spawnSync(\"npm\", [\"install\", \"-g\", name], { stdio: \"inherit\" });\n if (result.status !== 0) {\n throw new Error(`npm install exited with code ${result.status ?? \"unknown\"}`);\n }\n const { approvePlugin } = await import(\"@gpc-cli/config\");\n await approvePlugin(name);\n console.log(`\\nPlugin \"${name}\" installed and approved. It will be loaded on next run.`);\n console.log(`Configure it in .gpcrc.json: { \"plugins\": [\"${name}\"] }`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n cmd\n .command(\"uninstall <name>\")\n .description(\"Uninstall a plugin and revoke its approval\")\n .action(async (name: string) => {\n const { spawnSync } = await import(\"node:child_process\");\n console.log(`Uninstalling plugin \"${name}\"...`);\n try {\n // Use spawnSync with an array to avoid shell injection — no shell is invoked\n const result = spawnSync(\"npm\", [\"uninstall\", \"-g\", name], { stdio: \"inherit\" });\n if (result.status !== 0) {\n throw new Error(`npm uninstall exited with code ${result.status ?? \"unknown\"}`);\n }\n const { revokePluginApproval } = await import(\"@gpc-cli/config\");\n await revokePluginApproval(name);\n console.log(`\\nPlugin \"${name}\" uninstalled and approval revoked.`);\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n\n/**\n * Wrap all registered commands so plugin hooks fire before/after each command.\n */\nfunction wrapCommandHooks(program: Command, manager: PluginManager): void {\n program.hook(\"preAction\", async (thisCommand) => {\n const event: CommandEvent = {\n command: getFullCommandName(thisCommand),\n args: thisCommand.opts(),\n app: program.opts()[\"app\"] as string | undefined,\n startedAt: new Date(),\n };\n\n // Store on the command for afterCommand/onError\n (thisCommand as unknown as Record<string, unknown>)[\"__pluginEvent\"] = event;\n\n await manager.runBeforeCommand(event);\n });\n\n program.hook(\"postAction\", async (thisCommand) => {\n const event: CommandEvent = (thisCommand as unknown as Record<string, unknown>)[\n \"__pluginEvent\"\n ] as CommandEvent;\n if (!event) return;\n\n const result: CommandResult = {\n success: true,\n durationMs: Date.now() - event.startedAt.getTime(),\n exitCode: 0,\n };\n\n await manager.runAfterCommand(event, result);\n });\n}\n\nfunction getFullCommandName(cmd: Command): string {\n const parts: string[] = [];\n let current: Command | null = cmd;\n while (current && current.name() !== \"gpc\") {\n parts.unshift(current.name());\n current = current.parent;\n }\n return parts.join(\" \");\n}\n","/**\n * Shared error formatting for CLI output.\n * Extracts error code, message, and suggestion from typed errors (GpcError, AuthError, ApiError, ConfigError).\n */\n\ninterface TypedError {\n message: string;\n code?: string;\n suggestion?: string;\n exitCode?: number;\n /** When true, error handler prints nothing (e.g., user-aborted operations). */\n silent?: boolean;\n}\n\nfunction isTypedError(error: unknown): error is Error & TypedError {\n return (\n error instanceof Error && \"code\" in error && typeof (error as TypedError).code === \"string\"\n );\n}\n\nconst AUTH_KEYWORDS = [\"AUTH\", \"UNAUTHENTICATED\", \"PERMISSION_DENIED\", \"401\", \"403\"];\n\nfunction isAuthRelatedError(error: unknown): boolean {\n if (isTypedError(error)) {\n // Update errors hit GitHub, not Google Play — never an auth issue\n if (error.code?.startsWith(\"UPDATE_\")) return false;\n if (error.exitCode === 3) return true;\n if (error.code && AUTH_KEYWORDS.some((k) => error.code?.includes(k))) return true;\n }\n const msg = error instanceof Error ? error.message : String(error);\n return AUTH_KEYWORDS.some((k) => msg.includes(k));\n}\n\n/**\n * Format an error for CLI output. Prints:\n * Error [CODE]: message\n * Suggestion: suggestion (if available)\n *\n * Returns the appropriate exit code.\n */\nexport function handleCliError(error: unknown): number {\n // Silent errors (e.g., user abort) — don't print anything\n if (isTypedError(error) && error.silent) {\n return error.exitCode ?? 0;\n }\n\n const authHint = isAuthRelatedError(error)\n ? \"\\n\\u2192 Run gpc doctor to diagnose your credentials.\"\n : \"\";\n\n if (isTypedError(error)) {\n console.error(`Error [${error.code}]: ${error.message}`);\n if (error.suggestion) {\n console.error(`Suggestion: ${error.suggestion}`);\n }\n if (authHint) console.error(authHint);\n return error.exitCode ?? 1;\n }\n\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Error: ${message}`);\n if (authHint) console.error(authHint);\n return 1;\n}\n"],"mappings":";;;AAAA,SAAS,eAAe,uBAAuB;AAS/C,eAAsB,cAAsC;AAC1D,QAAM,UAAU,IAAI,cAAc;AAGlC,MAAI,QAAQ,IAAI,cAAc,MAAM,KAAK;AACvC,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,EAAE,WAAW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AyB;AACnD,MAAI,aAAa,KAAK,GAAG;AAEvB,QAAI,MAAM,MAAM,WAAW,SAAS,EAAG,QAAO;AAC9C,QAAI,MAAM,aAAa,EAAG,QAAO;AACjC,QAAI,MAAM,QAAQ,cAAc,KAAK,CAAC,MAAM,MAAM,MAAM,SAAS,CAAC,CAAC,EAAG,QAAO;AAAA,EAC/E;AACA,QAAM,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACjE,SAAO,cAAc,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC,CAAC;AAClD;AASO,SAAS,eAAe,OAAwB;AAErD,MAAI,aAAa,KAAK,KAAK,MAAM,QAAQ;AACvC,WAAO,MAAM,YAAY;AAAA,EAC3B;AAEA,QAAM,WAAW,mBAAmB,KAAK,IACrC,0DACA;AAEJ,MAAI,aAAa,KAAK,GAAG;AACvB,YAAQ,MAAM,UAAU,MAAM,IAAI,MAAM,MAAM,OAAO,EAAE;AACvD,QAAI,MAAM,YAAY;AACpB,cAAQ,MAAM,eAAe,MAAM,UAAU,EAAE;AAAA,IACjD;AACA,QAAI,SAAU,SAAQ,MAAM,QAAQ;AACpC,WAAO,MAAM,YAAY;AAAA,EAC3B;AAEA,QAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,UAAQ,MAAM,UAAU,OAAO,EAAE;AACjC,MAAI,SAAU,SAAQ,MAAM,QAAQ;AACpC,SAAO;AACT;","names":["_","loader"]}
@@ -343,4 +343,4 @@ export {
343
343
  cleanupStaleUpdateFiles,
344
344
  updateBinaryInPlace
345
345
  };
346
- //# sourceMappingURL=chunk-BCBXQC7J.js.map
346
+ //# sourceMappingURL=chunk-E7SVZ7RF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/updater.ts"],"sourcesContent":["/**\n * Self-update logic for `gpc update`.\n *\n * All functions here are pure / testable — no Commander.js dependency.\n * The command layer in commands/update.ts handles output and flags.\n */\n\nimport { createWriteStream } from \"node:fs\";\nimport { rename, chmod, unlink, stat, readdir } from \"node:fs/promises\";\nimport { realpathSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport { createHash } from \"node:crypto\";\nimport { pipeline } from \"node:stream/promises\";\nimport { Readable, Transform } from \"node:stream\";\nimport { spawn } from \"node:child_process\";\nimport { isNewerVersion } from \"./update-check.js\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type InstallMethod = \"npm\" | \"homebrew\" | \"binary\" | \"unknown\";\n\nexport interface GithubAsset {\n name: string;\n browser_download_url: string;\n size: number;\n}\n\nexport interface GithubRelease {\n tag_name: string;\n html_url: string;\n assets: GithubAsset[];\n}\n\nexport interface UpdateCheckResult {\n current: string;\n latest: string;\n latestTag: string;\n updateAvailable: boolean;\n installMethod: InstallMethod;\n release: GithubRelease;\n}\n\nconst GITHUB_API_URL = \"https://api.github.com/repos/yasserstudio/gpc/releases/latest\";\nconst GITHUB_TIMEOUT_MS = 10_000;\nconst DOWNLOAD_TIMEOUT_MS = 120_000;\n\n// ---------------------------------------------------------------------------\n// Install method detection\n// ---------------------------------------------------------------------------\n\n/**\n * Detect how gpc was installed.\n *\n * Priority:\n * 1. __GPC_BINARY env var (injected by esbuild at compile time) → \"binary\"\n * 2. npm_config_prefix env var → \"npm\"\n * 3. realpathSync(process.argv[1]) contains \"cellar\" or \"homebrew\" → \"homebrew\"\n * 4. realpathSync(process.argv[1]) contains \"node_modules\" → \"npm\"\n * 5. fallback → \"unknown\"\n *\n * Using realpathSync(process.argv[1]) instead of shelling to `which gpc`:\n * - No child process spawn\n * - Works on Windows without `where.exe`\n * - Resolves symlinks — critical for Intel Mac Homebrew where the bin path\n * is a symlink but the real path contains \"Cellar\"\n */\nexport function detectInstallMethod(): InstallMethod {\n // 1. Compiled binary — but Homebrew also distributes as compiled binary, check execPath\n if (process.env[\"__GPC_BINARY\"] === \"1\") {\n try {\n const resolved = realpathSync(process.execPath).toLowerCase();\n if (resolved.includes(\"cellar\") || resolved.includes(\"homebrew\")) return \"homebrew\";\n } catch {\n /* ignore */\n }\n return \"binary\";\n }\n\n // 2. npm global install\n if (process.env[\"npm_config_prefix\"]) return \"npm\";\n\n // 3. Resolve symlinks and inspect path\n try {\n const resolved = realpathSync(process.argv[1] ?? \"\").toLowerCase();\n if (resolved.includes(\"cellar\") || resolved.includes(\"homebrew\")) return \"homebrew\";\n if (resolved.includes(\"node_modules\")) return \"npm\";\n } catch {\n // realpathSync can throw if the path doesn't exist — fall through to unknown\n }\n\n return \"unknown\";\n}\n\n// ---------------------------------------------------------------------------\n// Platform asset mapping\n// ---------------------------------------------------------------------------\n\n/**\n * Returns the GitHub release asset name for the current platform/arch,\n * matching the names produced by scripts/build-binary.ts TARGETS map.\n */\nexport function getPlatformAsset(): string | null {\n const arch = process.arch === \"arm64\" ? \"arm64\" : \"x64\";\n switch (process.platform) {\n case \"darwin\":\n return `gpc-darwin-${arch}`;\n case \"linux\":\n return `gpc-linux-${arch}`;\n case \"win32\":\n return \"gpc-windows-x64.exe\";\n default:\n return null;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Current binary path\n// ---------------------------------------------------------------------------\n\n/**\n * Returns the path of the currently running gpc binary.\n * For compiled binaries, process.execPath IS the binary.\n * For npm/dev installs, process.argv[1] is the script entrypoint.\n */\nexport function getCurrentBinaryPath(): string {\n if (process.env[\"__GPC_BINARY\"] === \"1\") return process.execPath;\n return process.argv[1] ?? process.execPath;\n}\n\n// ---------------------------------------------------------------------------\n// GitHub Releases API\n// ---------------------------------------------------------------------------\n\nfunction getGithubToken(): string | undefined {\n return process.env[\"GPC_GITHUB_TOKEN\"] || process.env[\"GITHUB_TOKEN\"] || undefined;\n}\n\nfunction githubApiHeaders(): Record<string, string> {\n const headers: Record<string, string> = {\n \"User-Agent\": \"gpc-cli\",\n Accept: \"application/vnd.github+json\",\n \"X-GitHub-Api-Version\": \"2022-11-28\",\n };\n const token = getGithubToken();\n if (token) {\n headers[\"Authorization\"] = `Bearer ${token}`;\n }\n return headers;\n}\n\nfunction githubDownloadHeaders(): Record<string, string> {\n const headers: Record<string, string> = {\n \"User-Agent\": \"gpc-cli\",\n };\n const token = getGithubToken();\n if (token) {\n headers[\"Authorization\"] = `Bearer ${token}`;\n }\n return headers;\n}\n\nexport async function fetchLatestRelease(): Promise<GithubRelease> {\n let response: Response;\n try {\n response = await fetch(GITHUB_API_URL, {\n headers: githubApiHeaders(),\n signal: AbortSignal.timeout(GITHUB_TIMEOUT_MS),\n });\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n throw Object.assign(new Error(`Network error checking for updates: ${msg}`), {\n code: \"NETWORK_ERROR\",\n exitCode: 5,\n });\n }\n\n if (\n response.status === 429 ||\n (response.status === 403 && response.headers.get(\"x-ratelimit-remaining\") === \"0\")\n ) {\n throw Object.assign(\n new Error(\n \"GitHub API rate limit exceeded. Set GPC_GITHUB_TOKEN or GITHUB_TOKEN to increase the limit.\",\n ),\n {\n code: \"UPDATE_RATE_LIMITED\",\n exitCode: 4,\n suggestion: \"export GPC_GITHUB_TOKEN=ghp_... (a personal access token with no scopes)\",\n },\n );\n }\n\n if (!response.ok) {\n throw Object.assign(new Error(`GitHub API returned HTTP ${response.status}`), {\n code: \"UPDATE_API_ERROR\",\n exitCode: 4,\n });\n }\n\n return (await response.json()) as GithubRelease;\n}\n\n/**\n * Fetch and parse checksums.txt from the release assets.\n * Returns a Map of filename → lowercase sha256 hex.\n * Returns an empty Map if the asset is missing or the fetch fails.\n */\nexport async function fetchChecksums(release: GithubRelease): Promise<Map<string, string>> {\n const asset = release.assets.find((a) => a.name === \"checksums.txt\");\n if (!asset) return new Map();\n\n try {\n const response = await fetch(asset.browser_download_url, {\n headers: githubDownloadHeaders(),\n signal: AbortSignal.timeout(GITHUB_TIMEOUT_MS),\n });\n if (!response.ok) return new Map();\n\n const map = new Map<string, string>();\n for (const line of (await response.text()).split(\"\\n\")) {\n const parts = line.trim().split(/\\s+/);\n const hash = parts[0];\n const name = parts[1];\n if (hash && name) map.set(name, hash.toLowerCase());\n }\n return map;\n } catch {\n return new Map();\n }\n}\n\n// ---------------------------------------------------------------------------\n// High-level update check\n// ---------------------------------------------------------------------------\n\nexport async function checkForUpdate(currentVersion: string): Promise<UpdateCheckResult> {\n const release = await fetchLatestRelease();\n const latest = release.tag_name.replace(/^v/, \"\");\n return {\n current: currentVersion,\n latest,\n latestTag: release.tag_name,\n updateAvailable: isNewerVersion(currentVersion, latest),\n installMethod: detectInstallMethod(),\n release,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Update execution paths\n// ---------------------------------------------------------------------------\n\nexport async function updateViaNpm(options: { silent?: boolean } = {}): Promise<void> {\n return new Promise((resolve, reject) => {\n const proc = spawn(\"npm\", [\"install\", \"-g\", \"@gpc-cli/cli@latest\"], {\n // In silent (JSON) mode, redirect npm's stdout to stderr so it doesn't\n // pollute the machine-readable JSON that gpc writes to stdout.\n stdio: options.silent ? [\"inherit\", process.stderr, process.stderr] : \"inherit\",\n shell: false,\n });\n proc.on(\"close\", (code) => {\n if (code === 0) {\n resolve();\n } else {\n reject(\n Object.assign(new Error(`npm exited with code ${code}`), {\n code: \"UPDATE_NPM_FAILED\",\n exitCode: 1,\n suggestion: \"Run manually: npm install -g @gpc-cli/cli@latest\",\n }),\n );\n }\n });\n proc.on(\"error\", (err) => {\n reject(\n Object.assign(new Error(`Failed to run npm: ${err.message}`), {\n code: \"UPDATE_NPM_SPAWN_FAILED\",\n exitCode: 1,\n suggestion: \"Ensure npm is in your PATH\",\n }),\n );\n });\n });\n}\n\nexport async function updateViaBrew(options: { silent?: boolean } = {}): Promise<void> {\n return new Promise((resolve, reject) => {\n const proc = spawn(\"brew\", [\"upgrade\", \"yasserstudio/tap/gpc\"], {\n // In silent (JSON) mode, redirect brew's stdout to stderr so it doesn't\n // pollute the machine-readable JSON that gpc writes to stdout.\n stdio: options.silent ? [\"inherit\", process.stderr, process.stderr] : \"inherit\",\n shell: false,\n });\n proc.on(\"close\", (code) => {\n if (code === 0) {\n resolve();\n } else {\n reject(\n Object.assign(new Error(`brew exited with code ${code}`), {\n code: \"UPDATE_BREW_FAILED\",\n exitCode: 1,\n suggestion: \"Run manually: brew upgrade yasserstudio/tap/gpc\",\n }),\n );\n }\n });\n proc.on(\"error\", (err) => {\n reject(\n Object.assign(new Error(`Failed to run brew: ${err.message}`), {\n code: \"UPDATE_BREW_SPAWN_FAILED\",\n exitCode: 1,\n suggestion: \"Ensure Homebrew is installed: https://brew.sh\",\n }),\n );\n });\n });\n}\n\n// ---------------------------------------------------------------------------\n// Binary in-place replace\n// ---------------------------------------------------------------------------\n\nfunction isPermissionError(err: unknown): boolean {\n return err instanceof Error && \"code\" in err && (err.code === \"EACCES\" || err.code === \"EPERM\");\n}\n\nasync function sha256File(filePath: string): Promise<string> {\n const hash = createHash(\"sha256\");\n const { size } = await stat(filePath);\n if (size === 0) return hash.digest(\"hex\");\n\n // Read in 64 KB chunks\n const { createReadStream } = await import(\"node:fs\");\n const stream = createReadStream(filePath);\n await new Promise<void>((resolve, reject) => {\n stream.on(\"data\", (chunk: Buffer) => hash.update(chunk));\n stream.on(\"end\", resolve);\n stream.on(\"error\", reject);\n });\n return hash.digest(\"hex\");\n}\n\n/**\n * Clean up stale `.gpc-old-*` and `.gpc-update-*.tmp` files left by\n * previous update attempts (e.g. Windows EBUSY on unlink).\n * Fire-and-forget — errors are silently ignored.\n */\nexport function cleanupStaleUpdateFiles(binaryPath: string): void {\n const dir = dirname(binaryPath);\n readdir(dir)\n .then((files) => {\n for (const f of files) {\n if (f.startsWith(\".gpc-old-\") || f.startsWith(\".gpc-update-\")) {\n unlink(join(dir, f)).catch(() => {});\n }\n }\n })\n .catch(() => {});\n}\n\n/**\n * Download a new binary and atomically replace the current one.\n *\n * macOS/Linux: rename(tmp, current) — safe because open files can be replaced\n * Windows: rename(current, .old) then rename(tmp, current) — avoids EBUSY\n * because Windows locks running executables\n */\nexport async function updateBinaryInPlace(\n assetUrl: string,\n expectedSha256: string,\n currentBinaryPath: string,\n options: { onProgress?: (downloaded: number, total: number) => void } = {},\n): Promise<void> {\n const dir = dirname(currentBinaryPath);\n const tmpPath = join(dir, `.gpc-update-${process.pid}.tmp`);\n const oldPath = join(dir, `.gpc-old-${process.pid}`);\n\n try {\n // 1. Download\n let response: Response;\n try {\n response = await fetch(assetUrl, {\n headers: githubDownloadHeaders(),\n signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS),\n });\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n throw Object.assign(new Error(`Download failed: ${msg}`), {\n code: \"UPDATE_DOWNLOAD_FAILED\",\n exitCode: 5,\n });\n }\n\n if (!response.ok) {\n throw Object.assign(new Error(`Download failed: HTTP ${response.status}`), {\n code: \"UPDATE_DOWNLOAD_FAILED\",\n exitCode: 4,\n });\n }\n if (!response.body) {\n throw Object.assign(new Error(\"Empty response body\"), {\n code: \"UPDATE_DOWNLOAD_FAILED\",\n exitCode: 4,\n });\n }\n\n const contentLength = response.headers.get(\"content-length\");\n const total = contentLength ? parseInt(contentLength, 10) : 0;\n let downloaded = 0;\n\n const dest = createWriteStream(tmpPath);\n const { onProgress } = options;\n\n if (onProgress) {\n const tracker = new Transform({\n transform(chunk: Buffer, _enc, cb) {\n downloaded += chunk.length;\n onProgress(downloaded, total);\n cb(null, chunk);\n },\n });\n await pipeline(\n Readable.fromWeb(response.body as Parameters<typeof Readable.fromWeb>[0]),\n tracker,\n dest,\n );\n } else {\n await pipeline(\n Readable.fromWeb(response.body as Parameters<typeof Readable.fromWeb>[0]),\n dest,\n );\n }\n\n // 2. Verify checksum (skip if no checksum available)\n if (expectedSha256) {\n const actual = await sha256File(tmpPath);\n if (actual !== expectedSha256.toLowerCase()) {\n throw Object.assign(\n new Error(`Checksum mismatch — expected ${expectedSha256}, got ${actual}`),\n {\n code: \"UPDATE_CHECKSUM_MISMATCH\",\n exitCode: 1,\n suggestion: \"The download may be corrupt. Try again.\",\n },\n );\n }\n }\n\n // 3. Set executable bit (no-op on Windows)\n if (process.platform !== \"win32\") {\n await chmod(tmpPath, 0o755);\n }\n\n // 4. Atomic replace\n if (process.platform === \"win32\") {\n // Windows locks running executables, so we rename the current binary\n // out of the way first, then move the new one into place\n await rename(currentBinaryPath, oldPath);\n try {\n await rename(tmpPath, currentBinaryPath);\n } catch (renameErr) {\n // Roll back — restore original binary\n await rename(oldPath, currentBinaryPath).catch(() => {});\n throw renameErr;\n }\n // Delete the old binary in the background (best-effort)\n unlink(oldPath).catch(() => {});\n } else {\n await rename(tmpPath, currentBinaryPath);\n }\n } catch (err) {\n // Clean up temp file on any error\n await unlink(tmpPath).catch(() => {});\n\n if (isPermissionError(err)) {\n throw Object.assign(new Error(`Permission denied replacing ${currentBinaryPath}`), {\n code: \"UPDATE_PERMISSION_DENIED\",\n exitCode: 1,\n suggestion: `Run with elevated permissions: sudo gpc update`,\n });\n }\n throw err;\n }\n}\n"],"mappings":";;;;;;AAOA,SAAS,yBAAyB;AAClC,SAAS,QAAQ,OAAO,QAAQ,MAAM,eAAe;AACrD,SAAS,oBAAoB;AAC7B,SAAS,MAAM,eAAe;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,UAAU,iBAAiB;AACpC,SAAS,aAAa;AA8BtB,IAAM,iBAAiB;AACvB,IAAM,oBAAoB;AAC1B,IAAM,sBAAsB;AAsBrB,SAAS,sBAAqC;AAEnD,MAAI,QAAQ,IAAI,cAAc,MAAM,KAAK;AACvC,QAAI;AACF,YAAM,WAAW,aAAa,QAAQ,QAAQ,EAAE,YAAY;AAC5D,UAAI,SAAS,SAAS,QAAQ,KAAK,SAAS,SAAS,UAAU,EAAG,QAAO;AAAA,IAC3E,QAAQ;AAAA,IAER;AACA,WAAO;AAAA,EACT;AAGA,MAAI,QAAQ,IAAI,mBAAmB,EAAG,QAAO;AAG7C,MAAI;AACF,UAAM,WAAW,aAAa,QAAQ,KAAK,CAAC,KAAK,EAAE,EAAE,YAAY;AACjE,QAAI,SAAS,SAA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G;AAC1B,YAAM,OAAO,OAAO,IAAI,MAAM,+BAA+B,iBAAiB,EAAE,GAAG;AAAA,QACjF,MAAM;AAAA,QACN,UAAU;AAAA,QACV,YAAY;AAAA,MACd,CAAC;AAAA,IACH;AACA,UAAM;AAAA,EACR;AACF;","names":[]}
File without changes
File without changes
@@ -6,14 +6,11 @@ import { createApiClient, createReportingClient } from "@gpc-cli/api";
6
6
  function resolvePackageName(packageArg, config) {
7
7
  const name = packageArg || config.app || process.env["GPC_APP"];
8
8
  if (!name) {
9
- throw Object.assign(
10
- new Error("No package name"),
11
- {
12
- code: "MISSING_PACKAGE_NAME",
13
- exitCode: 2,
14
- suggestion: "Use --app <package> or gpc config set app <package>"
15
- }
16
- );
9
+ throw Object.assign(new Error("No package name"), {
10
+ code: "MISSING_PACKAGE_NAME",
11
+ exitCode: 2,
12
+ suggestion: "Use --app <package> or gpc config set app <package>"
13
+ });
17
14
  }
18
15
  return name;
19
16
  }
@@ -26,4 +23,4 @@ export {
26
23
  resolvePackageName,
27
24
  getClient
28
25
  };
29
- //# sourceMappingURL=chunk-NQH4G7BI.js.map
26
+ //# sourceMappingURL=chunk-JDRY7HK5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resolve.ts"],"sourcesContent":["// Named exports only. No default export.\n\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient, createReportingClient } from \"@gpc-cli/api\";\n\nexport function resolvePackageName(\n packageArg: string | undefined,\n config: { app?: string },\n): string {\n const name = packageArg || config.app || process.env[\"GPC_APP\"];\n if (!name) {\n throw Object.assign(new Error(\"No package name\"), {\n code: \"MISSING_PACKAGE_NAME\",\n exitCode: 2,\n suggestion: \"Use --app <package> or gpc config set app <package>\",\n });\n }\n return name;\n}\n\nexport async function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport async function getReportingClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createReportingClient({ auth });\n}\n"],"mappings":";;;AAGA,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB,6BAA6B;AAEhD,SAAS,mBACd,YACA,QACQ;AACR,QAAM,OAAO,cAAc,OAAO,OAAO,QAAQ,IAAI,SAAS;AAC9D,MAAI,CAAC,MAAM;AACT,UAAM,OAAO,OAAO,IAAI,MAAM,iBAAiB,GAAG;AAAA,MAChD,MAAM;AAAA,MACN,UAAU;AAAA,MACV,YAAY;AAAA,IACd,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAEA,eAAsB,UAAU,QAAmB;AACjD,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;","names":[]}
@@ -27,14 +27,11 @@ async function requireOption(name, value, prompt, interactive) {
27
27
  if (interactive) {
28
28
  return prompt.choices ? promptSelect(prompt.message, prompt.choices, prompt.default) : promptInput(prompt.message, prompt.default);
29
29
  }
30
- throw Object.assign(
31
- new Error(`Missing required option --${name}`),
32
- {
33
- code: "MISSING_REQUIRED_OPTION",
34
- exitCode: 2,
35
- suggestion: `Provide --${name} or run interactively (remove --no-interactive)`
36
- }
37
- );
30
+ throw Object.assign(new Error(`Missing required option --${name}`), {
31
+ code: "MISSING_REQUIRED_OPTION",
32
+ exitCode: 2,
33
+ suggestion: `Provide --${name} or run interactively (remove --no-interactive)`
34
+ });
38
35
  }
39
36
  async function requireConfirm(message, program) {
40
37
  if (skipConfirm(program)) return;
@@ -104,4 +101,4 @@ export {
104
101
  promptSelect,
105
102
  promptConfirm
106
103
  };
107
- //# sourceMappingURL=chunk-YFUBD2XB.js.map
104
+ //# sourceMappingURL=chunk-RZQSEDKI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/prompt.ts"],"sourcesContent":["import { createInterface } from \"node:readline\";\n\n/**\n * Check if interactive prompts are allowed.\n * Disabled by --no-interactive flag, GPC_NO_INTERACTIVE env, or non-TTY stdin.\n */\nexport function isInteractive(program?: { opts(): Record<string, unknown> }): boolean {\n // Commander's --no-interactive sets interactive = false\n if (program) {\n let root: { parent?: unknown; opts(): Record<string, unknown> } = program;\n while (root.parent) root = root.parent as typeof root;\n if (root.opts()[\"interactive\"] === false) return false;\n }\n\n if (process.env[\"GPC_NO_INTERACTIVE\"] === \"1\" || process.env[\"GPC_NO_INTERACTIVE\"] === \"true\") {\n return false;\n }\n\n if (process.env[\"CI\"] === \"true\" || process.env[\"CI\"] === \"1\") {\n return false;\n }\n\n return Boolean(process.stdin.isTTY);\n}\n\n/**\n * Check if --yes flag is set (skip confirmation prompts).\n */\nexport function skipConfirm(program?: { opts(): Record<string, unknown> }): boolean {\n if (!program) return false;\n let root: { parent?: unknown; opts(): Record<string, unknown> } = program;\n while (root.parent) root = root.parent as typeof root;\n return root.opts()[\"yes\"] === true;\n}\n\n/**\n * Require an option value: return existing value, prompt interactively, or exit with error.\n */\nexport async function requireOption(\n name: string,\n value: string | undefined,\n prompt: { message: string; choices?: string[]; default?: string },\n interactive: boolean,\n): Promise<string> {\n if (value) return value;\n if (interactive) {\n return prompt.choices\n ? promptSelect(prompt.message, prompt.choices, prompt.default)\n : promptInput(prompt.message, prompt.default);\n }\n throw Object.assign(new Error(`Missing required option --${name}`), {\n code: \"MISSING_REQUIRED_OPTION\",\n exitCode: 2,\n suggestion: `Provide --${name} or run interactively (remove --no-interactive)`,\n });\n}\n\n/**\n * Require confirmation for destructive operations.\n * Returns true if confirmed (or --yes flag is set / non-interactive).\n * Exits with code 0 if denied.\n */\nexport async function requireConfirm(\n message: string,\n program?: { opts(): Record<string, unknown> },\n): Promise<void> {\n if (skipConfirm(program)) return;\n if (!isInteractive(program)) return;\n const confirmed = await promptConfirm(message, false);\n if (!confirmed) {\n console.log(\"Aborted.\");\n process.exitCode = 0;\n throw Object.assign(new Error(\"\"), { code: \"USER_ABORTED\", exitCode: 0, silent: true });\n }\n}\n\n/**\n * Prompt for text input.\n */\nexport async function promptInput(message: string, defaultValue?: string): Promise<string> {\n const suffix = defaultValue ? ` (${defaultValue})` : \"\";\n const rl = createInterface({ input: process.stdin, output: process.stderr });\n\n return new Promise((resolve) => {\n rl.question(`${message}${suffix}: `, (answer) => {\n rl.close();\n resolve(answer.trim() || defaultValue || \"\");\n });\n });\n}\n\n/**\n * Prompt for selection from a list of choices.\n */\nexport async function promptSelect(\n message: string,\n choices: string[],\n defaultValue?: string,\n): Promise<string> {\n const rl = createInterface({ input: process.stdin, output: process.stderr });\n\n process.stderr.write(`${message}\\n`);\n for (let i = 0; i < choices.length; i++) {\n const marker = choices[i] === defaultValue ? \" (default)\" : \"\";\n process.stderr.write(` ${i + 1}) ${choices[i]}${marker}\\n`);\n }\n\n return new Promise((resolve) => {\n rl.question(\"Choice: \", (answer) => {\n rl.close();\n const trimmed = answer.trim();\n\n // Accept number\n const num = Number(trimmed);\n if (num >= 1 && num <= choices.length) {\n resolve(choices[num - 1] ?? \"\");\n return;\n }\n\n // Accept exact match\n if (choices.includes(trimmed)) {\n resolve(trimmed);\n return;\n }\n\n // Default\n resolve(defaultValue ?? choices[0] ?? \"\");\n });\n });\n}\n\n/**\n * Prompt for yes/no confirmation.\n */\nexport async function promptConfirm(message: string, defaultValue = true): Promise<boolean> {\n const hint = defaultValue ? \"Y/n\" : \"y/N\";\n const rl = createInterface({ input: process.stdin, output: process.stderr });\n\n return new Promise((resolve) => {\n rl.question(`${message} [${hint}]: `, (answer) => {\n rl.close();\n const trimmed = answer.trim().toLowerCase();\n if (trimmed === \"\") resolve(defaultValue);\n else resolve(trimmed === \"y\" || trimmed === \"yes\");\n });\n });\n}\n"],"mappings":";;;AAAA,SAAS,uBAAuB;AAMzB,SAAS,cAAc,SAAwD;AAEpF,MAAI,SAAS;AACX,QAAI,OAA8D;AAClE,WAAO,KAAK,OAAQ,QAAO,KAAK;AAChC,QAAI,KAAK,KAAK,EAAE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AG,SAAS,GAAG,OAAO,KAAK,IAAI,OAAO,CAAC,WAAW;AAChD,SAAG,MAAM;AACT,YAAM,UAAU,OAAO,KAAK,EAAE,YAAY;AAC1C,UAAI,YAAY,GAAI,SAAQ,YAAY;AAAA,UACnC,SAAQ,YAAY,OAAO,YAAY,KAAK;AAAA,IACnD,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
@@ -2,8 +2,8 @@
2
2
 
3
3
  // src/commit-options.ts
4
4
  function buildCommitOptions(opts) {
5
- const notSent = !!opts.changesNotSentForReview;
6
- const errorIfReview = !!opts.errorIfInReview;
5
+ const notSent = !!opts["changesNotSentForReview"];
6
+ const errorIfReview = !!opts["errorIfInReview"];
7
7
  if (!notSent && !errorIfReview) return void 0;
8
8
  return {
9
9
  ...notSent && { changesNotSentForReview: true },
@@ -14,4 +14,4 @@ function buildCommitOptions(opts) {
14
14
  export {
15
15
  buildCommitOptions
16
16
  };
17
- //# sourceMappingURL=chunk-A7VRCCNS.js.map
17
+ //# sourceMappingURL=chunk-WSLFHX5X.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commit-options.ts"],"sourcesContent":["import type { EditCommitOptions } from \"@gpc-cli/api\";\n\nexport function buildCommitOptions(opts: Record<string, unknown>): EditCommitOptions | undefined {\n const notSent = !!opts[\"changesNotSentForReview\"];\n const errorIfReview = !!opts[\"errorIfInReview\"];\n if (!notSent && !errorIfReview) return undefined;\n return {\n ...(notSent && { changesNotSentForReview: true }),\n ...(errorIfReview && { changesInReviewBehavior: \"ERROR_IF_IN_REVIEW\" as const }),\n };\n}\n"],"mappings":";;;AAEO,SAAS,mBAAmB,MAA8D;AAC/F,QAAM,UAAU,CAAC,CAAC,KAAK,yBAAyB;AAChD,QAAM,gBAAgB,CAAC,CAAC,KAAK,iBAAiB;AAC9C,MAAI,CAAC,WAAW,CAAC,cAAe,QAAO;AACvC,SAAO;AAAA,IACL,GAAI,WAAW,EAAE,yBAAyB,KAAK;AAAA,IAC/C,GAAI,iBAAiB,EAAE,yBAAyB,qBAA8B;AAAA,EAChF;AACF;","names":[]}
File without changes
File without changes
@@ -7,7 +7,7 @@ import {
7
7
  promptConfirm,
8
8
  promptInput,
9
9
  promptSelect
10
- } from "./chunk-YFUBD2XB.js";
10
+ } from "./chunk-RZQSEDKI.js";
11
11
 
12
12
  // src/commands/config.ts
13
13
  import { loadConfig, setConfigValue, getUserConfigPath, initConfig } from "@gpc-cli/config";
@@ -78,7 +78,7 @@ Configuration file created: ${path}`);
78
78
  });
79
79
  console.log("\nVerifying setup...");
80
80
  try {
81
- const { registerDoctorCommand } = await import("./doctor-7LQWPY5P.js");
81
+ const { registerDoctorCommand } = await import("./doctor-T3QFYBRV.js");
82
82
  const { Command } = await import("commander");
83
83
  const doctorProgram = new Command();
84
84
  doctorProgram.option("-o, --output <format>", "Output format").option("-j, --json", "JSON mode");
@@ -107,4 +107,4 @@ Configuration file created: ${path}`);
107
107
  export {
108
108
  registerConfigCommands
109
109
  };
110
- //# sourceMappingURL=config-BLMJ35J2.js.map
110
+ //# sourceMappingURL=config-PUINDZON.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getClient,
4
4
  resolvePackageName
5
- } from "./chunk-NQH4G7BI.js";
5
+ } from "./chunk-JDRY7HK5.js";
6
6
  import {
7
7
  isDryRun,
8
8
  printDryRun
@@ -20,7 +20,11 @@ function registerDataSafetyCommands(program) {
20
20
  const err = new Error(
21
21
  "The Google Play Developer API does not provide a GET endpoint for data safety declarations.\n\nData safety labels can only be updated (not read) via the API.\nTo view your current data safety declaration, use the Google Play Console:\n https://play.google.com/console \u2192 App content \u2192 Data safety"
22
22
  );
23
- Object.assign(err, { code: "UNSUPPORTED_OPERATION", exitCode: 2, suggestion: "To update data safety via the API, use: gpc data-safety update --file <csv-file>" });
23
+ Object.assign(err, {
24
+ code: "UNSUPPORTED_OPERATION",
25
+ exitCode: 2,
26
+ suggestion: "To update data safety via the API, use: gpc data-safety update --file <csv-file>"
27
+ });
24
28
  throw err;
25
29
  });
26
30
  dataSafety.command("update").description("Update data safety declaration from a JSON file").requiredOption("--file <path>", "Path to data safety JSON file").action(async (options) => {
@@ -47,11 +51,15 @@ function registerDataSafetyCommands(program) {
47
51
  const err = new Error(
48
52
  "The Google Play Developer API does not provide a GET endpoint for data safety declarations.\nData safety labels cannot be exported via the API."
49
53
  );
50
- Object.assign(err, { code: "UNSUPPORTED_OPERATION", exitCode: 2, suggestion: "To export your data safety declaration, use the Google Play Console: App content \u2192 Data safety \u2192 Export to CSV" });
54
+ Object.assign(err, {
55
+ code: "UNSUPPORTED_OPERATION",
56
+ exitCode: 2,
57
+ suggestion: "To export your data safety declaration, use the Google Play Console: App content \u2192 Data safety \u2192 Export to CSV"
58
+ });
51
59
  throw err;
52
60
  });
53
61
  }
54
62
  export {
55
63
  registerDataSafetyCommands
56
64
  };
57
- //# sourceMappingURL=data-safety-AFMD6MYI.js.map
65
+ //# sourceMappingURL=data-safety-46VY64OO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/data-safety.ts"],"sourcesContent":["import { resolvePackageName, getClient } from \"../resolve.js\";\nimport type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\n\nimport { importDataSafety, formatOutput } from \"@gpc-cli/core\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { getOutputFormat } from \"../format.js\";\n\nexport function registerDataSafetyCommands(program: Command): void {\n const dataSafety = program.command(\"data-safety\").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 const err = new Error(\n \"The Google Play Developer API does not provide a GET endpoint for data safety declarations.\\n\\n\" +\n \"Data safety labels can only be updated (not read) via the API.\\n\" +\n \"To view your current data safety declaration, use the Google Play Console:\\n\" +\n \" https://play.google.com/console → App content → Data safety\",\n );\n Object.assign(err, {\n code: \"UNSUPPORTED_OPERATION\",\n exitCode: 2,\n suggestion:\n \"To update data safety via the API, use: gpc data-safety update --file <csv-file>\",\n });\n throw err;\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 const result = await importDataSafety(client, packageName, options.file);\n console.log(formatOutput(result, format));\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 const err = new Error(\n \"The Google Play Developer API does not provide a GET endpoint for data safety declarations.\\n\" +\n \"Data safety labels cannot be exported via the API.\",\n );\n Object.assign(err, {\n code: \"UNSUPPORTED_OPERATION\",\n exitCode: 2,\n suggestion:\n \"To export your data safety declaration, use the Google Play Console: App content → Data safety → Export to CSV\",\n });\n throw err;\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA,SAAS,kBAAkB;AAE3B,SAAS,kBAAkB,oBAAoB;AAIxC,SAAS,2BAA2B,SAAwB;AACjE,QAAM,aAAa,QAAQ,QAAQ,aAAa,EAAE,YAAY,iCAAiC;AAG/F,aACG,QAAQ,KAAK,EACb,YAAY,yCAAyC,EACrD,OAAO,YAAY;AAClB,UAAM,MAAM,IAAI;AAAA,MACd;AAAA,IAIF;AACA,WAAO,OAAO,KAAK;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,YACE;AAAA,IACJ,CAAC;AACD,UAAM;AAAA,EACR,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,UAAM,SAAS,MAAM,iBAAiB,QAAQ,aAAa,QAAQ,IAAI;AACvE,YAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,EAC1C,CAAC;AAGH,aACG,QAAQ,QAAQ,EAChB,YAAY,+CAA+C,EAC3D,OAAO,mBAAmB,oBAAoB,kBAAkB,EAChE,OAAO,YAAY;AAClB,UAAM,MAAM,IAAI;AAAA,MACd;AAAA,IAEF;AACA,WAAO,OAAO,KAAK;AAAA,MACjB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,YACE;AAAA,IACJ,CAAC;AACD,UAAM;AAAA,EACR,CAAC;AACL;","names":[]}
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getClient,
4
4
  resolvePackageName
5
- } from "./chunk-NQH4G7BI.js";
5
+ } from "./chunk-JDRY7HK5.js";
6
6
  import {
7
7
  isDryRun,
8
8
  printDryRun
@@ -73,4 +73,4 @@ function registerDeviceTiersCommands(program) {
73
73
  export {
74
74
  registerDeviceTiersCommands
75
75
  };
76
- //# sourceMappingURL=device-tiers-AQAMUQXI.js.map
76
+ //# sourceMappingURL=device-tiers-MNZYMG3Y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/device-tiers.ts"],"sourcesContent":["import { resolvePackageName, getClient } from \"../resolve.js\";\nimport type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\n\nimport { listDeviceTiers, getDeviceTier, createDeviceTier, formatOutput } from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { readFile } from \"node:fs/promises\";\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 const result = await listDeviceTiers(client, packageName);\n const configs = (result as unknown as Record<string, unknown>)[\"deviceTierConfigs\"] as\n | Record<string, unknown>[]\n | undefined;\n if (format !== \"json\" && (!configs || configs.length === 0)) {\n console.log(\"No device tier configs found.\");\n return;\n }\n if (format !== \"json\" && configs) {\n const rows = configs.map((c) => ({\n deviceTierConfigId: c[\"deviceTierConfigId\"] || \"-\",\n deviceGroups: Array.isArray(c[\"deviceGroups\"])\n ? (c[\"deviceGroups\"] as unknown[]).length\n : 0,\n deviceTierSet: c[\"deviceTierSet\"] ? \"yes\" : \"no\",\n }));\n console.log(formatOutput(rows, format));\n } else {\n console.log(formatOutput(result, format));\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 const result = await getDeviceTier(client, packageName, configId);\n console.log(formatOutput(result, format));\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 format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"device-tiers create\",\n action: \"create device tier config from\",\n target: opts.file,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\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 });\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA,SAAS,kBAAkB;AAE3B,SAAS,iBAAiB,eAAe,kBAAkB,oBAAoB;AAG/E,SAAS,gBAAgB;AAElB,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,UAAM,SAAS,MAAM,gBAAgB,QAAQ,WAAW;AACxD,UAAM,UAAW,OAA8C,mBAAmB;AAGlF,QAAI,WAAW,WAAW,CAAC,WAAW,QAAQ,WAAW,IAAI;AAC3D,cAAQ,IAAI,+BAA+B;AAC3C;AAAA,IACF;AACA,QAAI,WAAW,UAAU,SAAS;AAChC,YAAM,OAAO,QAAQ,IAAI,CAAC,OAAO;AAAA,QAC/B,oBAAoB,EAAE,oBAAoB,KAAK;AAAA,QAC/C,cAAc,MAAM,QAAQ,EAAE,cAAc,CAAC,IACxC,EAAE,cAAc,EAAgB,SACjC;AAAA,QACJ,eAAe,EAAE,eAAe,IAAI,QAAQ;AAAA,MAC9C,EAAE;AACF,cAAQ,IAAI,aAAa,MAAM,MAAM,CAAC;AAAA,IACxC,OAAO;AACL,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C;AAAA,EACF,CAAC;AAEH,KAAG,QAAQ,iBAAiB,EACzB,YAAY,iCAAiC,EAC7C,OAAO,OAAO,aAAqB;AAClC,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,SAAS,MAAM,UAAU,MAAM;AACrC,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,UAAM,SAAS,MAAM,cAAc,QAAQ,aAAa,QAAQ;AAChE,YAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,EAC1C,CAAC;AAEH,KAAG,QAAQ,QAAQ,EAChB,YAAY,qDAAqD,EACjE,eAAe,iBAAiB,0BAA0B,EAC1D,OAAO,OAAO,SAA2B;AACxC,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,KAAK;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA;AAAA,IACF;AAEA,UAAM,SAAS,MAAM,UAAU,MAAM;AAErC,UAAM,MAAM,MAAM,SAAS,KAAK,MAAM,OAAO;AAC7C,UAAM,aAAa,KAAK,MAAM,GAAG;AACjC,UAAM,SAAS,MAAM,iBAAiB,QAAQ,aAAa,UAAU;AACrE,YAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,EAC1C,CAAC;AACL;","names":[]}
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolvePackageName
4
- } from "./chunk-NQH4G7BI.js";
4
+ } from "./chunk-JDRY7HK5.js";
5
5
  import {
6
6
  bold,
7
7
  dim,
@@ -88,4 +88,4 @@ function registerDiffCommand(program) {
88
88
  export {
89
89
  registerDiffCommand
90
90
  };
91
- //# sourceMappingURL=diff-6EO4ID6W.js.map
91
+ //# sourceMappingURL=diff-OBSHUSTL.js.map