@gpc-cli/cli 0.9.5 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +126 -6
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-BXJ75Q7M.js → chunk-LQ7FJ4QA.js} +46 -13
- package/dist/chunk-LQ7FJ4QA.js.map +1 -0
- package/dist/completion-3UYUJD6S.js +495 -0
- package/dist/completion-3UYUJD6S.js.map +1 -0
- package/dist/data-safety-M2SFKQ3U.js +91 -0
- package/dist/data-safety-M2SFKQ3U.js.map +1 -0
- package/dist/external-transactions-YRK5CI2D.js +131 -0
- package/dist/external-transactions-YRK5CI2D.js.map +1 -0
- package/dist/{iap-W4UDJMGY.js → iap-ZZS5NVFN.js} +7 -3
- package/dist/iap-ZZS5NVFN.js.map +1 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +5 -3
- package/dist/{listings-42GCDAJU.js → listings-FYNMWTIE.js} +31 -1
- package/dist/listings-FYNMWTIE.js.map +1 -0
- package/dist/{publish-LYU35P5S.js → publish-YP7U64T2.js} +38 -29
- package/dist/publish-YP7U64T2.js.map +1 -0
- package/dist/recovery-ZANX3WIQ.js +118 -0
- package/dist/recovery-ZANX3WIQ.js.map +1 -0
- package/dist/{releases-CDWBN25U.js → releases-GUMQZRFC.js} +26 -19
- package/dist/releases-GUMQZRFC.js.map +1 -0
- package/dist/{reviews-SBR5FGEF.js → reviews-G3HZG3AS.js} +6 -4
- package/dist/reviews-G3HZG3AS.js.map +1 -0
- package/dist/{subscriptions-GSXDPXA4.js → subscriptions-CHQU5VXT.js} +7 -3
- package/dist/subscriptions-CHQU5VXT.js.map +1 -0
- package/dist/{testers-GSONKJAW.js → testers-SB77565D.js} +8 -2
- package/dist/testers-SB77565D.js.map +1 -0
- package/dist/{users-L57T4MCQ.js → users-N2TK6KI7.js} +7 -3
- package/dist/users-N2TK6KI7.js.map +1 -0
- package/package.json +6 -6
- package/dist/chunk-BXJ75Q7M.js.map +0 -1
- package/dist/completion-IHVLP7OK.js +0 -145
- package/dist/completion-IHVLP7OK.js.map +0 -1
- package/dist/iap-W4UDJMGY.js.map +0 -1
- package/dist/listings-42GCDAJU.js.map +0 -1
- package/dist/publish-LYU35P5S.js.map +0 -1
- package/dist/releases-CDWBN25U.js.map +0 -1
- package/dist/reviews-SBR5FGEF.js.map +0 -1
- package/dist/subscriptions-GSXDPXA4.js.map +0 -1
- package/dist/testers-GSONKJAW.js.map +0 -1
- package/dist/users-L57T4MCQ.js.map +0 -1
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/commands/completion.ts
|
|
4
|
+
var SUPPORTED_SHELLS = ["bash", "zsh", "fish", "powershell"];
|
|
5
|
+
function getCommandTree() {
|
|
6
|
+
return {
|
|
7
|
+
auth: {
|
|
8
|
+
description: "Manage authentication",
|
|
9
|
+
subcommands: {
|
|
10
|
+
login: { description: "Authenticate with Google Play Developer API" },
|
|
11
|
+
status: { description: "Show current authentication status" },
|
|
12
|
+
logout: { description: "Remove stored credentials" },
|
|
13
|
+
whoami: { description: "Show the authenticated account" }
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
config: {
|
|
17
|
+
description: "Manage configuration",
|
|
18
|
+
subcommands: {
|
|
19
|
+
init: { description: "Create a configuration file" },
|
|
20
|
+
show: { description: "Show current configuration" },
|
|
21
|
+
set: { description: "Set a configuration value" },
|
|
22
|
+
path: { description: "Show the configuration file path" }
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
apps: {
|
|
26
|
+
description: "Manage applications",
|
|
27
|
+
subcommands: {
|
|
28
|
+
info: { description: "Show app details" },
|
|
29
|
+
update: { description: "Update app details" },
|
|
30
|
+
list: { description: "List configured applications" }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
releases: {
|
|
34
|
+
description: "Manage releases and rollouts",
|
|
35
|
+
subcommands: {
|
|
36
|
+
upload: { description: "Upload AAB/APK and assign to a track" },
|
|
37
|
+
status: { description: "Show current release status across tracks" },
|
|
38
|
+
promote: { description: "Promote a release from one track to another" },
|
|
39
|
+
rollout: {
|
|
40
|
+
description: "Manage staged rollouts",
|
|
41
|
+
subcommands: {
|
|
42
|
+
increase: { description: "Increase a staged rollout" },
|
|
43
|
+
halt: { description: "Halt a staged rollout" },
|
|
44
|
+
resume: { description: "Resume a staged rollout" },
|
|
45
|
+
complete: { description: "Complete a staged rollout" }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
notes: { description: "Set release notes" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
tracks: {
|
|
52
|
+
description: "Manage tracks",
|
|
53
|
+
subcommands: {
|
|
54
|
+
list: { description: "List all tracks" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
status: { description: "Cross-track release overview" },
|
|
58
|
+
listings: {
|
|
59
|
+
description: "Manage store listings and metadata",
|
|
60
|
+
subcommands: {
|
|
61
|
+
get: { description: "Get store listing(s)" },
|
|
62
|
+
update: { description: "Update a store listing" },
|
|
63
|
+
delete: { description: "Delete a store listing for a language" },
|
|
64
|
+
pull: { description: "Download listings to Fastlane-format directory" },
|
|
65
|
+
push: { description: "Upload listings from Fastlane-format directory" },
|
|
66
|
+
images: {
|
|
67
|
+
description: "Manage listing images",
|
|
68
|
+
subcommands: {
|
|
69
|
+
list: { description: "List images for a language and type" },
|
|
70
|
+
upload: { description: "Upload an image" },
|
|
71
|
+
delete: { description: "Delete an image" }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
availability: { description: "Get country availability for a track" }
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
reviews: {
|
|
78
|
+
description: "Manage user reviews and ratings",
|
|
79
|
+
subcommands: {
|
|
80
|
+
list: { description: "List user reviews" },
|
|
81
|
+
get: { description: "Get a single review" },
|
|
82
|
+
reply: { description: "Reply to a review" },
|
|
83
|
+
export: { description: "Export reviews to JSON or CSV" }
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
vitals: {
|
|
87
|
+
description: "Monitor app vitals and performance metrics",
|
|
88
|
+
subcommands: {
|
|
89
|
+
overview: { description: "Dashboard summary of all vital metrics" },
|
|
90
|
+
crashes: { description: "Query crash rate metrics" },
|
|
91
|
+
anr: { description: "Query ANR rate metrics" },
|
|
92
|
+
startup: { description: "Query slow startup metrics" },
|
|
93
|
+
rendering: { description: "Query slow rendering metrics" },
|
|
94
|
+
battery: { description: "Query excessive wakeup metrics" },
|
|
95
|
+
memory: { description: "Query stuck wakelock metrics" },
|
|
96
|
+
anomalies: { description: "Detect anomalies in app vitals" },
|
|
97
|
+
errors: {
|
|
98
|
+
description: "Search and view error issues",
|
|
99
|
+
subcommands: {
|
|
100
|
+
search: { description: "Search error issues" }
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
compare: { description: "Compare metric trend between periods" }
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
subscriptions: {
|
|
107
|
+
description: "Manage subscriptions and base plans",
|
|
108
|
+
subcommands: {
|
|
109
|
+
list: { description: "List subscriptions" },
|
|
110
|
+
get: { description: "Get a subscription" },
|
|
111
|
+
create: { description: "Create a subscription from JSON file" },
|
|
112
|
+
update: { description: "Update a subscription from JSON file" },
|
|
113
|
+
delete: { description: "Delete a subscription" },
|
|
114
|
+
"base-plans": {
|
|
115
|
+
description: "Manage base plans",
|
|
116
|
+
subcommands: {
|
|
117
|
+
activate: { description: "Activate a base plan" },
|
|
118
|
+
deactivate: { description: "Deactivate a base plan" },
|
|
119
|
+
delete: { description: "Delete a base plan" },
|
|
120
|
+
"migrate-prices": { description: "Migrate base plan prices" }
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
offers: {
|
|
124
|
+
description: "Manage subscription offers",
|
|
125
|
+
subcommands: {
|
|
126
|
+
list: { description: "List offers for a base plan" },
|
|
127
|
+
get: { description: "Get an offer" },
|
|
128
|
+
create: { description: "Create an offer from JSON file" },
|
|
129
|
+
update: { description: "Update an offer from JSON file" },
|
|
130
|
+
delete: { description: "Delete an offer" },
|
|
131
|
+
activate: { description: "Activate an offer" },
|
|
132
|
+
deactivate: { description: "Deactivate an offer" }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
iap: {
|
|
138
|
+
description: "Manage in-app products",
|
|
139
|
+
subcommands: {
|
|
140
|
+
list: { description: "List in-app products" },
|
|
141
|
+
get: { description: "Get an in-app product" },
|
|
142
|
+
create: { description: "Create an in-app product from JSON file" },
|
|
143
|
+
update: { description: "Update an in-app product from JSON file" },
|
|
144
|
+
delete: { description: "Delete an in-app product" },
|
|
145
|
+
sync: { description: "Sync in-app products from a directory" }
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
purchases: {
|
|
149
|
+
description: "Manage purchases and orders",
|
|
150
|
+
subcommands: {
|
|
151
|
+
get: { description: "Get a product purchase" },
|
|
152
|
+
acknowledge: { description: "Acknowledge a product purchase" },
|
|
153
|
+
consume: { description: "Consume a product purchase" },
|
|
154
|
+
subscription: {
|
|
155
|
+
description: "Manage subscription purchases",
|
|
156
|
+
subcommands: {
|
|
157
|
+
get: { description: "Get a subscription purchase" },
|
|
158
|
+
cancel: { description: "Cancel a subscription" },
|
|
159
|
+
defer: { description: "Defer a subscription expiry" },
|
|
160
|
+
revoke: { description: "Revoke a subscription" }
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
voided: { description: "List voided purchases" },
|
|
164
|
+
orders: {
|
|
165
|
+
description: "Manage orders",
|
|
166
|
+
subcommands: {
|
|
167
|
+
refund: { description: "Refund an order" }
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
pricing: {
|
|
173
|
+
description: "Pricing and regional price conversion",
|
|
174
|
+
subcommands: {
|
|
175
|
+
convert: { description: "Convert a price to all regional prices" }
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
reports: {
|
|
179
|
+
description: "Download financial and stats reports",
|
|
180
|
+
subcommands: {
|
|
181
|
+
list: { description: "List available report buckets" },
|
|
182
|
+
download: {
|
|
183
|
+
description: "Download a report",
|
|
184
|
+
subcommands: {
|
|
185
|
+
financial: { description: "Download a financial report" },
|
|
186
|
+
stats: { description: "Download a stats report" }
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
users: {
|
|
192
|
+
description: "Manage developer account users and permissions",
|
|
193
|
+
subcommands: {
|
|
194
|
+
list: { description: "List all users in the developer account" },
|
|
195
|
+
get: { description: "Get user details" },
|
|
196
|
+
invite: { description: "Invite a user to the developer account" },
|
|
197
|
+
update: { description: "Update user permissions" },
|
|
198
|
+
remove: { description: "Remove a user from the developer account" }
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
testers: {
|
|
202
|
+
description: "Manage testers and tester groups",
|
|
203
|
+
subcommands: {
|
|
204
|
+
list: { description: "List testers for a track" },
|
|
205
|
+
add: { description: "Add testers to a track" },
|
|
206
|
+
remove: { description: "Remove testers from a track" },
|
|
207
|
+
import: { description: "Import testers from a CSV file" }
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
doctor: { description: "Verify setup and connectivity" },
|
|
211
|
+
docs: { description: "Open documentation in browser" },
|
|
212
|
+
validate: { description: "Pre-submission validation checks" },
|
|
213
|
+
publish: { description: "Validate, upload, and release in one step" },
|
|
214
|
+
completion: {
|
|
215
|
+
description: "Generate shell completions",
|
|
216
|
+
subcommands: {
|
|
217
|
+
bash: { description: "Generate bash completions" },
|
|
218
|
+
zsh: { description: "Generate zsh completions" },
|
|
219
|
+
fish: { description: "Generate fish completions" },
|
|
220
|
+
powershell: { description: "Generate PowerShell completions" }
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
plugins: {
|
|
224
|
+
description: "Manage plugins",
|
|
225
|
+
subcommands: {
|
|
226
|
+
list: { description: "List loaded plugins" },
|
|
227
|
+
init: { description: "Scaffold a new plugin project" },
|
|
228
|
+
approve: { description: "Approve a third-party plugin for loading" },
|
|
229
|
+
revoke: { description: "Revoke approval for a third-party plugin" }
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function registerCompletionCommand(program) {
|
|
235
|
+
const completion = program.command("completion").description("Generate shell completions");
|
|
236
|
+
completion.command("bash").description("Generate bash completions").action(() => {
|
|
237
|
+
console.log(generateBashCompletions());
|
|
238
|
+
});
|
|
239
|
+
completion.command("zsh").description("Generate zsh completions").action(() => {
|
|
240
|
+
console.log(generateZshCompletions());
|
|
241
|
+
});
|
|
242
|
+
completion.command("fish").description("Generate fish completions").action(() => {
|
|
243
|
+
console.log(generateFishCompletions());
|
|
244
|
+
});
|
|
245
|
+
completion.command("powershell").description("Generate PowerShell completions").action(() => {
|
|
246
|
+
console.log(generatePowerShellCompletions());
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function generateBashCompletions() {
|
|
250
|
+
const tree = getCommandTree();
|
|
251
|
+
const topLevelNames = Object.keys(tree).join(" ");
|
|
252
|
+
const caseEntries = [];
|
|
253
|
+
for (const [cmd, def] of Object.entries(tree)) {
|
|
254
|
+
if (def.subcommands) {
|
|
255
|
+
const subNames = Object.keys(def.subcommands).join(" ");
|
|
256
|
+
caseEntries.push(` ${cmd})
|
|
257
|
+
COMPREPLY=( $(compgen -W "${subNames}" -- "\${cur}") )
|
|
258
|
+
return 0
|
|
259
|
+
;;`);
|
|
260
|
+
for (const [sub, subDef] of Object.entries(def.subcommands)) {
|
|
261
|
+
if (subDef.subcommands) {
|
|
262
|
+
const subSubNames = Object.keys(subDef.subcommands).join(" ");
|
|
263
|
+
caseEntries.push(` ${sub})
|
|
264
|
+
COMPREPLY=( $(compgen -W "${subSubNames}" -- "\${cur}") )
|
|
265
|
+
return 0
|
|
266
|
+
;;`);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return `# bash completion for gpc
|
|
272
|
+
# Install: gpc completion bash >> ~/.bashrc
|
|
273
|
+
_gpc() {
|
|
274
|
+
local cur prev commands
|
|
275
|
+
COMPREPLY=()
|
|
276
|
+
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
277
|
+
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
278
|
+
|
|
279
|
+
commands="${topLevelNames}"
|
|
280
|
+
|
|
281
|
+
case "\${prev}" in
|
|
282
|
+
gpc)
|
|
283
|
+
COMPREPLY=( $(compgen -W "\${commands}" -- "\${cur}") )
|
|
284
|
+
return 0
|
|
285
|
+
;;
|
|
286
|
+
${caseEntries.join("\n")}
|
|
287
|
+
esac
|
|
288
|
+
|
|
289
|
+
COMPREPLY=( $(compgen -W "\${commands}" -- "\${cur}") )
|
|
290
|
+
return 0
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
complete -F _gpc gpc`;
|
|
294
|
+
}
|
|
295
|
+
function generateZshCompletions() {
|
|
296
|
+
const tree = getCommandTree();
|
|
297
|
+
const arrayDefs = [];
|
|
298
|
+
const caseBranches = [];
|
|
299
|
+
const topEntries = Object.entries(tree).map(([name, def]) => ` '${name}:${escapeZsh(def.description)}'`).join("\n");
|
|
300
|
+
arrayDefs.push(` commands=(
|
|
301
|
+
${topEntries}
|
|
302
|
+
)`);
|
|
303
|
+
for (const [cmd, def] of Object.entries(tree)) {
|
|
304
|
+
if (def.subcommands) {
|
|
305
|
+
const varName = `${cmd.replace(/-/g, "_")}_commands`;
|
|
306
|
+
const entries = Object.entries(def.subcommands).map(([name, sub]) => ` '${name}:${escapeZsh(sub.description)}'`).join("\n");
|
|
307
|
+
arrayDefs.push(` ${varName}=(
|
|
308
|
+
${entries}
|
|
309
|
+
)`);
|
|
310
|
+
caseBranches.push(` ${cmd})
|
|
311
|
+
_describe -t ${varName} '${cmd} commands' ${varName}
|
|
312
|
+
;;`);
|
|
313
|
+
for (const [sub, subDef] of Object.entries(def.subcommands)) {
|
|
314
|
+
if (subDef.subcommands) {
|
|
315
|
+
const subVarName = `${cmd.replace(/-/g, "_")}_${sub.replace(/-/g, "_")}_commands`;
|
|
316
|
+
const subEntries = Object.entries(subDef.subcommands).map(([name, s]) => ` '${name}:${escapeZsh(s.description)}'`).join("\n");
|
|
317
|
+
arrayDefs.push(` ${subVarName}=(
|
|
318
|
+
${subEntries}
|
|
319
|
+
)`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
const level3Cases = [];
|
|
325
|
+
for (const [cmd, def] of Object.entries(tree)) {
|
|
326
|
+
if (!def.subcommands) continue;
|
|
327
|
+
for (const [sub, subDef] of Object.entries(def.subcommands)) {
|
|
328
|
+
if (subDef.subcommands) {
|
|
329
|
+
const subVarName = `${cmd.replace(/-/g, "_")}_${sub.replace(/-/g, "_")}_commands`;
|
|
330
|
+
level3Cases.push(` ${sub})
|
|
331
|
+
_describe -t ${subVarName} '${sub} commands' ${subVarName}
|
|
332
|
+
;;`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
const varNames = ["commands"];
|
|
337
|
+
for (const [cmd, def] of Object.entries(tree)) {
|
|
338
|
+
if (def.subcommands) {
|
|
339
|
+
varNames.push(`${cmd.replace(/-/g, "_")}_commands`);
|
|
340
|
+
for (const [sub, subDef] of Object.entries(def.subcommands)) {
|
|
341
|
+
if (subDef.subcommands) {
|
|
342
|
+
varNames.push(`${cmd.replace(/-/g, "_")}_${sub.replace(/-/g, "_")}_commands`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
const localDecls = varNames.map((v) => ` local -a ${v}`).join("\n");
|
|
348
|
+
return `#compdef gpc
|
|
349
|
+
# Install: gpc completion zsh > ~/.zsh/completions/_gpc
|
|
350
|
+
|
|
351
|
+
_gpc() {
|
|
352
|
+
${localDecls}
|
|
353
|
+
|
|
354
|
+
${arrayDefs.join("\n\n")}
|
|
355
|
+
|
|
356
|
+
_arguments -C \\
|
|
357
|
+
'1: :->command' \\
|
|
358
|
+
'2: :->subcommand' \\
|
|
359
|
+
'3: :->subsubcommand' \\
|
|
360
|
+
'*::arg:->args'
|
|
361
|
+
|
|
362
|
+
case "$state" in
|
|
363
|
+
command)
|
|
364
|
+
_describe -t commands 'gpc commands' commands
|
|
365
|
+
;;
|
|
366
|
+
subcommand)
|
|
367
|
+
case "$words[2]" in
|
|
368
|
+
${caseBranches.join("\n")}
|
|
369
|
+
esac
|
|
370
|
+
;;
|
|
371
|
+
subsubcommand)
|
|
372
|
+
case "$words[3]" in
|
|
373
|
+
${level3Cases.join("\n")}
|
|
374
|
+
esac
|
|
375
|
+
;;
|
|
376
|
+
esac
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
_gpc "$@"`;
|
|
380
|
+
}
|
|
381
|
+
function generateFishCompletions() {
|
|
382
|
+
const tree = getCommandTree();
|
|
383
|
+
const lines = [
|
|
384
|
+
"# fish completions for gpc",
|
|
385
|
+
"# Install: gpc completion fish > ~/.config/fish/completions/gpc.fish",
|
|
386
|
+
"",
|
|
387
|
+
"# Disable file completions by default",
|
|
388
|
+
"complete -c gpc -f",
|
|
389
|
+
"",
|
|
390
|
+
"# Top-level commands"
|
|
391
|
+
];
|
|
392
|
+
for (const [cmd, def] of Object.entries(tree)) {
|
|
393
|
+
lines.push(
|
|
394
|
+
`complete -c gpc -n '__fish_use_subcommand' -a ${cmd} -d '${escapeFish(def.description)}'`
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
for (const [cmd, def] of Object.entries(tree)) {
|
|
398
|
+
if (!def.subcommands) continue;
|
|
399
|
+
lines.push("");
|
|
400
|
+
lines.push(`# ${cmd} subcommands`);
|
|
401
|
+
for (const [sub, subDef] of Object.entries(def.subcommands)) {
|
|
402
|
+
lines.push(
|
|
403
|
+
`complete -c gpc -n '__fish_seen_subcommand_from ${cmd}; and not __fish_seen_subcommand_from ${Object.keys(def.subcommands).join(" ")}' -a ${sub} -d '${escapeFish(subDef.description)}'`
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
for (const [sub, subDef] of Object.entries(def.subcommands)) {
|
|
407
|
+
if (!subDef.subcommands) continue;
|
|
408
|
+
lines.push("");
|
|
409
|
+
lines.push(`# ${cmd} ${sub} subcommands`);
|
|
410
|
+
for (const [subsub, subsubDef] of Object.entries(subDef.subcommands)) {
|
|
411
|
+
lines.push(
|
|
412
|
+
`complete -c gpc -n '__fish_seen_subcommand_from ${sub}; and not __fish_seen_subcommand_from ${Object.keys(subDef.subcommands).join(" ")}' -a ${subsub} -d '${escapeFish(subsubDef.description)}'`
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return lines.join("\n");
|
|
418
|
+
}
|
|
419
|
+
function generatePowerShellCompletions() {
|
|
420
|
+
const tree = getCommandTree();
|
|
421
|
+
const completionEntries = [];
|
|
422
|
+
for (const [cmd, def] of Object.entries(tree)) {
|
|
423
|
+
completionEntries.push(
|
|
424
|
+
` [CompletionResult]::new('${cmd}', '${cmd}', [CompletionResultType]::ParameterValue, '${escapePowerShell(def.description)}')`
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
const subcommandCases = [];
|
|
428
|
+
const level3Cases = [];
|
|
429
|
+
for (const [cmd, def] of Object.entries(tree)) {
|
|
430
|
+
if (!def.subcommands) continue;
|
|
431
|
+
const subEntries = Object.entries(def.subcommands).map(
|
|
432
|
+
([sub, subDef]) => ` [CompletionResult]::new('${sub}', '${sub}', [CompletionResultType]::ParameterValue, '${escapePowerShell(subDef.description)}')`
|
|
433
|
+
).join("\n");
|
|
434
|
+
subcommandCases.push(` '${cmd}' {
|
|
435
|
+
${subEntries}
|
|
436
|
+
}`);
|
|
437
|
+
for (const [sub, subDef] of Object.entries(def.subcommands)) {
|
|
438
|
+
if (!subDef.subcommands) continue;
|
|
439
|
+
const subSubEntries = Object.entries(subDef.subcommands).map(
|
|
440
|
+
([subsub, subsubDef]) => ` [CompletionResult]::new('${subsub}', '${subsub}', [CompletionResultType]::ParameterValue, '${escapePowerShell(subsubDef.description)}')`
|
|
441
|
+
).join("\n");
|
|
442
|
+
level3Cases.push(` '${sub}' {
|
|
443
|
+
${subSubEntries}
|
|
444
|
+
}`);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
return `# PowerShell completions for gpc
|
|
448
|
+
# Install: gpc completion powershell >> $PROFILE
|
|
449
|
+
|
|
450
|
+
using namespace System.Management.Automation
|
|
451
|
+
|
|
452
|
+
Register-ArgumentCompleter -CommandName gpc -Native -ScriptBlock {
|
|
453
|
+
param($wordToComplete, $commandAst, $cursorPosition)
|
|
454
|
+
|
|
455
|
+
$tokens = $commandAst.ToString().Substring(0, $cursorPosition).Trim() -split '\\s+'
|
|
456
|
+
$tokenCount = $tokens.Count
|
|
457
|
+
|
|
458
|
+
# Determine context
|
|
459
|
+
if ($tokenCount -le 1 -or ($tokenCount -eq 2 -and $wordToComplete)) {
|
|
460
|
+
# Top-level commands
|
|
461
|
+
${completionEntries.join("\n")}
|
|
462
|
+
} elseif ($tokenCount -eq 2 -or ($tokenCount -eq 3 -and $wordToComplete)) {
|
|
463
|
+
# Subcommands
|
|
464
|
+
$command = $tokens[1]
|
|
465
|
+
switch ($command) {
|
|
466
|
+
${subcommandCases.join("\n")}
|
|
467
|
+
}
|
|
468
|
+
} elseif ($tokenCount -eq 3 -or ($tokenCount -eq 4 -and $wordToComplete)) {
|
|
469
|
+
# Sub-subcommands
|
|
470
|
+
$subcommand = $tokens[2]
|
|
471
|
+
switch ($subcommand) {
|
|
472
|
+
${level3Cases.join("\n")}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}`;
|
|
476
|
+
}
|
|
477
|
+
function escapeZsh(str) {
|
|
478
|
+
return str.replace(/'/g, "'\\''");
|
|
479
|
+
}
|
|
480
|
+
function escapeFish(str) {
|
|
481
|
+
return str.replace(/'/g, "\\'");
|
|
482
|
+
}
|
|
483
|
+
function escapePowerShell(str) {
|
|
484
|
+
return str.replace(/'/g, "''");
|
|
485
|
+
}
|
|
486
|
+
export {
|
|
487
|
+
SUPPORTED_SHELLS,
|
|
488
|
+
generateBashCompletions,
|
|
489
|
+
generateFishCompletions,
|
|
490
|
+
generatePowerShellCompletions,
|
|
491
|
+
generateZshCompletions,
|
|
492
|
+
getCommandTree,
|
|
493
|
+
registerCompletionCommand
|
|
494
|
+
};
|
|
495
|
+
//# sourceMappingURL=completion-3UYUJD6S.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/completion.ts"],"sourcesContent":["import type { Command } from \"commander\";\n\nexport type ShellType = \"bash\" | \"zsh\" | \"fish\" | \"powershell\";\n\nexport const SUPPORTED_SHELLS: readonly ShellType[] = [\"bash\", \"zsh\", \"fish\", \"powershell\"] as const;\n\n/**\n * Full command tree for gpc CLI.\n * Each entry maps a command name to its description and optional subcommands.\n */\ninterface CommandDef {\n description: string;\n subcommands?: Record<string, CommandDef>;\n}\n\nexport function getCommandTree(): Record<string, CommandDef> {\n return {\n auth: {\n description: \"Manage authentication\",\n subcommands: {\n login: { description: \"Authenticate with Google Play Developer API\" },\n status: { description: \"Show current authentication status\" },\n logout: { description: \"Remove stored credentials\" },\n whoami: { description: \"Show the authenticated account\" },\n },\n },\n config: {\n description: \"Manage configuration\",\n subcommands: {\n init: { description: \"Create a configuration file\" },\n show: { description: \"Show current configuration\" },\n set: { description: \"Set a configuration value\" },\n path: { description: \"Show the configuration file path\" },\n },\n },\n apps: {\n description: \"Manage applications\",\n subcommands: {\n info: { description: \"Show app details\" },\n update: { description: \"Update app details\" },\n list: { description: \"List configured applications\" },\n },\n },\n releases: {\n description: \"Manage releases and rollouts\",\n subcommands: {\n upload: { description: \"Upload AAB/APK and assign to a track\" },\n status: { description: \"Show current release status across tracks\" },\n promote: { description: \"Promote a release from one track to another\" },\n rollout: {\n description: \"Manage staged rollouts\",\n subcommands: {\n increase: { description: \"Increase a staged rollout\" },\n halt: { description: \"Halt a staged rollout\" },\n resume: { description: \"Resume a staged rollout\" },\n complete: { description: \"Complete a staged rollout\" },\n },\n },\n notes: { description: \"Set release notes\" },\n },\n },\n tracks: {\n description: \"Manage tracks\",\n subcommands: {\n list: { description: \"List all tracks\" },\n },\n },\n status: { description: \"Cross-track release overview\" },\n listings: {\n description: \"Manage store listings and metadata\",\n subcommands: {\n get: { description: \"Get store listing(s)\" },\n update: { description: \"Update a store listing\" },\n delete: { description: \"Delete a store listing for a language\" },\n pull: { description: \"Download listings to Fastlane-format directory\" },\n push: { description: \"Upload listings from Fastlane-format directory\" },\n images: {\n description: \"Manage listing images\",\n subcommands: {\n list: { description: \"List images for a language and type\" },\n upload: { description: \"Upload an image\" },\n delete: { description: \"Delete an image\" },\n },\n },\n availability: { description: \"Get country availability for a track\" },\n },\n },\n reviews: {\n description: \"Manage user reviews and ratings\",\n subcommands: {\n list: { description: \"List user reviews\" },\n get: { description: \"Get a single review\" },\n reply: { description: \"Reply to a review\" },\n export: { description: \"Export reviews to JSON or CSV\" },\n },\n },\n vitals: {\n description: \"Monitor app vitals and performance metrics\",\n subcommands: {\n overview: { description: \"Dashboard summary of all vital metrics\" },\n crashes: { description: \"Query crash rate metrics\" },\n anr: { description: \"Query ANR rate metrics\" },\n startup: { description: \"Query slow startup metrics\" },\n rendering: { description: \"Query slow rendering metrics\" },\n battery: { description: \"Query excessive wakeup metrics\" },\n memory: { description: \"Query stuck wakelock metrics\" },\n anomalies: { description: \"Detect anomalies in app vitals\" },\n errors: {\n description: \"Search and view error issues\",\n subcommands: {\n search: { description: \"Search error issues\" },\n },\n },\n compare: { description: \"Compare metric trend between periods\" },\n },\n },\n subscriptions: {\n description: \"Manage subscriptions and base plans\",\n subcommands: {\n list: { description: \"List subscriptions\" },\n get: { description: \"Get a subscription\" },\n create: { description: \"Create a subscription from JSON file\" },\n update: { description: \"Update a subscription from JSON file\" },\n delete: { description: \"Delete a subscription\" },\n \"base-plans\": {\n description: \"Manage base plans\",\n subcommands: {\n activate: { description: \"Activate a base plan\" },\n deactivate: { description: \"Deactivate a base plan\" },\n delete: { description: \"Delete a base plan\" },\n \"migrate-prices\": { description: \"Migrate base plan prices\" },\n },\n },\n offers: {\n description: \"Manage subscription offers\",\n subcommands: {\n list: { description: \"List offers for a base plan\" },\n get: { description: \"Get an offer\" },\n create: { description: \"Create an offer from JSON file\" },\n update: { description: \"Update an offer from JSON file\" },\n delete: { description: \"Delete an offer\" },\n activate: { description: \"Activate an offer\" },\n deactivate: { description: \"Deactivate an offer\" },\n },\n },\n },\n },\n iap: {\n description: \"Manage in-app products\",\n subcommands: {\n list: { description: \"List in-app products\" },\n get: { description: \"Get an in-app product\" },\n create: { description: \"Create an in-app product from JSON file\" },\n update: { description: \"Update an in-app product from JSON file\" },\n delete: { description: \"Delete an in-app product\" },\n sync: { description: \"Sync in-app products from a directory\" },\n },\n },\n purchases: {\n description: \"Manage purchases and orders\",\n subcommands: {\n get: { description: \"Get a product purchase\" },\n acknowledge: { description: \"Acknowledge a product purchase\" },\n consume: { description: \"Consume a product purchase\" },\n subscription: {\n description: \"Manage subscription purchases\",\n subcommands: {\n get: { description: \"Get a subscription purchase\" },\n cancel: { description: \"Cancel a subscription\" },\n defer: { description: \"Defer a subscription expiry\" },\n revoke: { description: \"Revoke a subscription\" },\n },\n },\n voided: { description: \"List voided purchases\" },\n orders: {\n description: \"Manage orders\",\n subcommands: {\n refund: { description: \"Refund an order\" },\n },\n },\n },\n },\n pricing: {\n description: \"Pricing and regional price conversion\",\n subcommands: {\n convert: { description: \"Convert a price to all regional prices\" },\n },\n },\n reports: {\n description: \"Download financial and stats reports\",\n subcommands: {\n list: { description: \"List available report buckets\" },\n download: {\n description: \"Download a report\",\n subcommands: {\n financial: { description: \"Download a financial report\" },\n stats: { description: \"Download a stats report\" },\n },\n },\n },\n },\n users: {\n description: \"Manage developer account users and permissions\",\n subcommands: {\n list: { description: \"List all users in the developer account\" },\n get: { description: \"Get user details\" },\n invite: { description: \"Invite a user to the developer account\" },\n update: { description: \"Update user permissions\" },\n remove: { description: \"Remove a user from the developer account\" },\n },\n },\n testers: {\n description: \"Manage testers and tester groups\",\n subcommands: {\n list: { description: \"List testers for a track\" },\n add: { description: \"Add testers to a track\" },\n remove: { description: \"Remove testers from a track\" },\n import: { description: \"Import testers from a CSV file\" },\n },\n },\n doctor: { description: \"Verify setup and connectivity\" },\n docs: { description: \"Open documentation in browser\" },\n validate: { description: \"Pre-submission validation checks\" },\n publish: { description: \"Validate, upload, and release in one step\" },\n completion: {\n description: \"Generate shell completions\",\n subcommands: {\n bash: { description: \"Generate bash completions\" },\n zsh: { description: \"Generate zsh completions\" },\n fish: { description: \"Generate fish completions\" },\n powershell: { description: \"Generate PowerShell completions\" },\n },\n },\n plugins: {\n description: \"Manage plugins\",\n subcommands: {\n list: { description: \"List loaded plugins\" },\n init: { description: \"Scaffold a new plugin project\" },\n approve: { description: \"Approve a third-party plugin for loading\" },\n revoke: { description: \"Revoke approval for a third-party plugin\" },\n },\n },\n };\n}\n\nexport function registerCompletionCommand(program: Command): void {\n const completion = program.command(\"completion\").description(\"Generate shell completions\");\n\n completion\n .command(\"bash\")\n .description(\"Generate bash completions\")\n .action(() => {\n console.log(generateBashCompletions());\n });\n\n completion\n .command(\"zsh\")\n .description(\"Generate zsh completions\")\n .action(() => {\n console.log(generateZshCompletions());\n });\n\n completion\n .command(\"fish\")\n .description(\"Generate fish completions\")\n .action(() => {\n console.log(generateFishCompletions());\n });\n\n completion\n .command(\"powershell\")\n .description(\"Generate PowerShell completions\")\n .action(() => {\n console.log(generatePowerShellCompletions());\n });\n}\n\nexport function generateBashCompletions(): string {\n const tree = getCommandTree();\n\n const topLevelNames = Object.keys(tree).join(\" \");\n\n // Build case entries for each command that has subcommands (up to 3 levels)\n const caseEntries: string[] = [];\n\n for (const [cmd, def] of Object.entries(tree)) {\n if (def.subcommands) {\n const subNames = Object.keys(def.subcommands).join(\" \");\n caseEntries.push(` ${cmd})\\n COMPREPLY=( $(compgen -W \"${subNames}\" -- \"\\${cur}\") )\\n return 0\\n ;;`);\n\n // Level 3: subcommands of subcommands\n for (const [sub, subDef] of Object.entries(def.subcommands)) {\n if (subDef.subcommands) {\n const subSubNames = Object.keys(subDef.subcommands).join(\" \");\n caseEntries.push(` ${sub})\\n COMPREPLY=( $(compgen -W \"${subSubNames}\" -- \"\\${cur}\") )\\n return 0\\n ;;`);\n }\n }\n }\n }\n\n return `# bash completion for gpc\n# Install: gpc completion bash >> ~/.bashrc\n_gpc() {\n local cur prev commands\n COMPREPLY=()\n cur=\"\\${COMP_WORDS[COMP_CWORD]}\"\n prev=\"\\${COMP_WORDS[COMP_CWORD-1]}\"\n\n commands=\"${topLevelNames}\"\n\n case \"\\${prev}\" in\n gpc)\n COMPREPLY=( $(compgen -W \"\\${commands}\" -- \"\\${cur}\") )\n return 0\n ;;\n${caseEntries.join(\"\\n\")}\n esac\n\n COMPREPLY=( $(compgen -W \"\\${commands}\" -- \"\\${cur}\") )\n return 0\n}\n\ncomplete -F _gpc gpc`;\n}\n\nexport function generateZshCompletions(): string {\n const tree = getCommandTree();\n\n // Build zsh arrays\n const arrayDefs: string[] = [];\n const caseBranches: string[] = [];\n\n // Top-level\n const topEntries = Object.entries(tree)\n .map(([name, def]) => ` '${name}:${escapeZsh(def.description)}'`)\n .join(\"\\n\");\n arrayDefs.push(` commands=(\\n${topEntries}\\n )`);\n\n // Build subcommand arrays and case branches for level 2\n for (const [cmd, def] of Object.entries(tree)) {\n if (def.subcommands) {\n const varName = `${cmd.replace(/-/g, \"_\")}_commands`;\n const entries = Object.entries(def.subcommands)\n .map(([name, sub]) => ` '${name}:${escapeZsh(sub.description)}'`)\n .join(\"\\n\");\n arrayDefs.push(` ${varName}=(\\n${entries}\\n )`);\n caseBranches.push(` ${cmd})\\n _describe -t ${varName} '${cmd} commands' ${varName}\\n ;;`);\n\n // Level 3\n for (const [sub, subDef] of Object.entries(def.subcommands)) {\n if (subDef.subcommands) {\n const subVarName = `${cmd.replace(/-/g, \"_\")}_${sub.replace(/-/g, \"_\")}_commands`;\n const subEntries = Object.entries(subDef.subcommands)\n .map(([name, s]) => ` '${name}:${escapeZsh(s.description)}'`)\n .join(\"\\n\");\n arrayDefs.push(` ${subVarName}=(\\n${subEntries}\\n )`);\n }\n }\n }\n }\n\n // Build level 3 case for subsubcommand state\n const level3Cases: string[] = [];\n for (const [cmd, def] of Object.entries(tree)) {\n if (!def.subcommands) continue;\n for (const [sub, subDef] of Object.entries(def.subcommands)) {\n if (subDef.subcommands) {\n const subVarName = `${cmd.replace(/-/g, \"_\")}_${sub.replace(/-/g, \"_\")}_commands`;\n level3Cases.push(` ${sub})\\n _describe -t ${subVarName} '${sub} commands' ${subVarName}\\n ;;`);\n }\n }\n }\n\n // Collect all variable names for local declarations\n const varNames: string[] = [\"commands\"];\n for (const [cmd, def] of Object.entries(tree)) {\n if (def.subcommands) {\n varNames.push(`${cmd.replace(/-/g, \"_\")}_commands`);\n for (const [sub, subDef] of Object.entries(def.subcommands)) {\n if (subDef.subcommands) {\n varNames.push(`${cmd.replace(/-/g, \"_\")}_${sub.replace(/-/g, \"_\")}_commands`);\n }\n }\n }\n }\n\n const localDecls = varNames.map((v) => ` local -a ${v}`).join(\"\\n\");\n\n return `#compdef gpc\n# Install: gpc completion zsh > ~/.zsh/completions/_gpc\n\n_gpc() {\n${localDecls}\n\n${arrayDefs.join(\"\\n\\n\")}\n\n _arguments -C \\\\\n '1: :->command' \\\\\n '2: :->subcommand' \\\\\n '3: :->subsubcommand' \\\\\n '*::arg:->args'\n\n case \"$state\" in\n command)\n _describe -t commands 'gpc commands' commands\n ;;\n subcommand)\n case \"$words[2]\" in\n${caseBranches.join(\"\\n\")}\n esac\n ;;\n subsubcommand)\n case \"$words[3]\" in\n${level3Cases.join(\"\\n\")}\n esac\n ;;\n esac\n}\n\n_gpc \"$@\"`;\n}\n\nexport function generateFishCompletions(): string {\n const tree = getCommandTree();\n const lines: string[] = [\n \"# fish completions for gpc\",\n \"# Install: gpc completion fish > ~/.config/fish/completions/gpc.fish\",\n \"\",\n \"# Disable file completions by default\",\n \"complete -c gpc -f\",\n \"\",\n \"# Top-level commands\",\n ];\n\n for (const [cmd, def] of Object.entries(tree)) {\n lines.push(\n `complete -c gpc -n '__fish_use_subcommand' -a ${cmd} -d '${escapeFish(def.description)}'`,\n );\n }\n\n // Level 2 subcommands\n for (const [cmd, def] of Object.entries(tree)) {\n if (!def.subcommands) continue;\n lines.push(\"\");\n lines.push(`# ${cmd} subcommands`);\n for (const [sub, subDef] of Object.entries(def.subcommands)) {\n lines.push(\n `complete -c gpc -n '__fish_seen_subcommand_from ${cmd}; and not __fish_seen_subcommand_from ${Object.keys(def.subcommands).join(\" \")}' -a ${sub} -d '${escapeFish(subDef.description)}'`,\n );\n }\n\n // Level 3 subcommands\n for (const [sub, subDef] of Object.entries(def.subcommands)) {\n if (!subDef.subcommands) continue;\n lines.push(\"\");\n lines.push(`# ${cmd} ${sub} subcommands`);\n for (const [subsub, subsubDef] of Object.entries(subDef.subcommands)) {\n lines.push(\n `complete -c gpc -n '__fish_seen_subcommand_from ${sub}; and not __fish_seen_subcommand_from ${Object.keys(subDef.subcommands).join(\" \")}' -a ${subsub} -d '${escapeFish(subsubDef.description)}'`,\n );\n }\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nexport function generatePowerShellCompletions(): string {\n const tree = getCommandTree();\n\n // Build the completion hashtable entries\n const completionEntries: string[] = [];\n\n // Top-level completions\n for (const [cmd, def] of Object.entries(tree)) {\n completionEntries.push(\n ` [CompletionResult]::new('${cmd}', '${cmd}', [CompletionResultType]::ParameterValue, '${escapePowerShell(def.description)}')`,\n );\n }\n\n // Subcommand completions (level 2)\n const subcommandCases: string[] = [];\n const level3Cases: string[] = [];\n\n for (const [cmd, def] of Object.entries(tree)) {\n if (!def.subcommands) continue;\n const subEntries = Object.entries(def.subcommands)\n .map(\n ([sub, subDef]) =>\n ` [CompletionResult]::new('${sub}', '${sub}', [CompletionResultType]::ParameterValue, '${escapePowerShell(subDef.description)}')`,\n )\n .join(\"\\n\");\n subcommandCases.push(` '${cmd}' {\\n${subEntries}\\n }`);\n\n // Level 3\n for (const [sub, subDef] of Object.entries(def.subcommands)) {\n if (!subDef.subcommands) continue;\n const subSubEntries = Object.entries(subDef.subcommands)\n .map(\n ([subsub, subsubDef]) =>\n ` [CompletionResult]::new('${subsub}', '${subsub}', [CompletionResultType]::ParameterValue, '${escapePowerShell(subsubDef.description)}')`,\n )\n .join(\"\\n\");\n level3Cases.push(` '${sub}' {\\n${subSubEntries}\\n }`);\n }\n }\n\n return `# PowerShell completions for gpc\n# Install: gpc completion powershell >> $PROFILE\n\nusing namespace System.Management.Automation\n\nRegister-ArgumentCompleter -CommandName gpc -Native -ScriptBlock {\n param($wordToComplete, $commandAst, $cursorPosition)\n\n $tokens = $commandAst.ToString().Substring(0, $cursorPosition).Trim() -split '\\\\s+'\n $tokenCount = $tokens.Count\n\n # Determine context\n if ($tokenCount -le 1 -or ($tokenCount -eq 2 -and $wordToComplete)) {\n # Top-level commands\n${completionEntries.join(\"\\n\")}\n } elseif ($tokenCount -eq 2 -or ($tokenCount -eq 3 -and $wordToComplete)) {\n # Subcommands\n $command = $tokens[1]\n switch ($command) {\n${subcommandCases.join(\"\\n\")}\n }\n } elseif ($tokenCount -eq 3 -or ($tokenCount -eq 4 -and $wordToComplete)) {\n # Sub-subcommands\n $subcommand = $tokens[2]\n switch ($subcommand) {\n${level3Cases.join(\"\\n\")}\n }\n }\n}`;\n}\n\nfunction escapeZsh(str: string): string {\n return str.replace(/'/g, \"'\\\\''\");\n}\n\nfunction escapeFish(str: string): string {\n return str.replace(/'/g, \"\\\\'\");\n}\n\nfunction escapePowerShell(str: string): string {\n return str.replace(/'/g, \"''\");\n}\n"],"mappings":";;;AAIO,IAAM,mBAAyC,CAAC,QAAQ,OAAO,QAAQ,YAA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|
|
2
|
+
import {
|
|
3
|
+
isDryRun,
|
|
4
|
+
printDryRun
|
|
5
|
+
} from "./chunk-Y3QZDAKS.js";
|
|
6
|
+
|
|
7
|
+
// src/commands/data-safety.ts
|
|
8
|
+
import { loadConfig } from "@gpc-cli/config";
|
|
9
|
+
import { resolveAuth } from "@gpc-cli/auth";
|
|
10
|
+
import { createApiClient } from "@gpc-cli/api";
|
|
11
|
+
import {
|
|
12
|
+
getDataSafety,
|
|
13
|
+
exportDataSafety,
|
|
14
|
+
importDataSafety,
|
|
15
|
+
detectOutputFormat,
|
|
16
|
+
formatOutput
|
|
17
|
+
} from "@gpc-cli/core";
|
|
18
|
+
function resolvePackageName(packageArg, config) {
|
|
19
|
+
const name = packageArg || config.app;
|
|
20
|
+
if (!name) {
|
|
21
|
+
console.error("Error: No package name. Use --app <package> or gpc config set app <package>");
|
|
22
|
+
process.exit(2);
|
|
23
|
+
}
|
|
24
|
+
return name;
|
|
25
|
+
}
|
|
26
|
+
async function getClient(config) {
|
|
27
|
+
const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });
|
|
28
|
+
return createApiClient({ auth });
|
|
29
|
+
}
|
|
30
|
+
function registerDataSafetyCommands(program) {
|
|
31
|
+
const dataSafety = program.command("data-safety").description("Manage data safety declarations");
|
|
32
|
+
dataSafety.command("get").description("Get the current data safety declaration").action(async () => {
|
|
33
|
+
const config = await loadConfig();
|
|
34
|
+
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
35
|
+
const client = await getClient(config);
|
|
36
|
+
const format = detectOutputFormat();
|
|
37
|
+
try {
|
|
38
|
+
const result = await getDataSafety(client, packageName);
|
|
39
|
+
console.log(formatOutput(result, format));
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
42
|
+
process.exit(4);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
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
|
+
const config = await loadConfig();
|
|
47
|
+
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
48
|
+
const format = detectOutputFormat();
|
|
49
|
+
if (isDryRun(program)) {
|
|
50
|
+
printDryRun(
|
|
51
|
+
{
|
|
52
|
+
command: "data-safety update",
|
|
53
|
+
action: "update data safety from",
|
|
54
|
+
target: options.file
|
|
55
|
+
},
|
|
56
|
+
format,
|
|
57
|
+
formatOutput
|
|
58
|
+
);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const client = await getClient(config);
|
|
62
|
+
try {
|
|
63
|
+
const result = await importDataSafety(client, packageName, options.file);
|
|
64
|
+
console.log(formatOutput(result, format));
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
67
|
+
process.exit(4);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
dataSafety.command("export").description("Export data safety declaration to a JSON file").option("--output <path>", "Output file path", "data-safety.json").action(async (options) => {
|
|
71
|
+
const config = await loadConfig();
|
|
72
|
+
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
73
|
+
const client = await getClient(config);
|
|
74
|
+
const format = detectOutputFormat();
|
|
75
|
+
try {
|
|
76
|
+
const result = await exportDataSafety(client, packageName, options.output);
|
|
77
|
+
if (format === "json") {
|
|
78
|
+
console.log(formatOutput({ file: options.output, dataSafety: result }, format));
|
|
79
|
+
} else {
|
|
80
|
+
console.log(`Data safety declaration exported to ${options.output}`);
|
|
81
|
+
}
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
84
|
+
process.exit(4);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
registerDataSafetyCommands
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=data-safety-M2SFKQ3U.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 detectOutputFormat,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { isDryRun, printDryRun } from \"../dry-run.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 = detectOutputFormat();\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 = detectOutputFormat();\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 = detectOutputFormat();\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,EACA;AAAA,OACK;AAGP,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,mBAAmB;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