@quantum-hub/qhubctl 1.1.3 → 1.1.5
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/commands/set-context/index.js +7 -11
- package/oclif.manifest.json +131 -131
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Args, ux } from '@oclif/core';
|
|
2
|
-
import inquirer from 'inquirer';
|
|
3
2
|
import { AuthenticatedCommand } from '../../model/command.js';
|
|
4
3
|
import QuantumHubService from '../../service/quantum-hub-service.js';
|
|
5
4
|
import { writeUserConfig } from '../../service/user-config-service.js';
|
|
5
|
+
import { select } from "@inquirer/prompts";
|
|
6
6
|
export default class SetContext extends AuthenticatedCommand {
|
|
7
7
|
static args = {
|
|
8
8
|
contextId: Args.string(),
|
|
@@ -29,8 +29,7 @@ export default class SetContext extends AuthenticatedCommand {
|
|
|
29
29
|
}
|
|
30
30
|
async run() {
|
|
31
31
|
const { args } = await this.parse(SetContext);
|
|
32
|
-
|
|
33
|
-
let selectedContext;
|
|
32
|
+
let { contextId } = args;
|
|
34
33
|
if (!contextId) {
|
|
35
34
|
ux.action.start('Loading available contexts');
|
|
36
35
|
}
|
|
@@ -38,18 +37,15 @@ export default class SetContext extends AuthenticatedCommand {
|
|
|
38
37
|
if (!contextId) {
|
|
39
38
|
ux.action.stop('Done');
|
|
40
39
|
}
|
|
41
|
-
if (contextId) {
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
const response = await inquirer.prompt({
|
|
40
|
+
if (!contextId) {
|
|
41
|
+
const response = await select({
|
|
46
42
|
choices: this.getPromptOptions(accounts),
|
|
47
43
|
message: 'Choose a context',
|
|
48
|
-
|
|
49
|
-
type: 'list',
|
|
44
|
+
default: accounts[0],
|
|
50
45
|
});
|
|
51
|
-
|
|
46
|
+
contextId = response.id;
|
|
52
47
|
}
|
|
48
|
+
const selectedContext = accounts.find(account => account.id === contextId);
|
|
53
49
|
if (!selectedContext) {
|
|
54
50
|
this.error(`Context with id "${contextId}" not found.`);
|
|
55
51
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -90,6 +90,29 @@
|
|
|
90
90
|
"index.js"
|
|
91
91
|
]
|
|
92
92
|
},
|
|
93
|
+
"list-contexts": {
|
|
94
|
+
"aliases": [],
|
|
95
|
+
"args": {},
|
|
96
|
+
"description": "Retrieves the available contexts, i.e., the personal or organizational accounts available to you to work with.",
|
|
97
|
+
"examples": [
|
|
98
|
+
"$ qhubctl list-contexts"
|
|
99
|
+
],
|
|
100
|
+
"flags": {},
|
|
101
|
+
"hasDynamicHelp": false,
|
|
102
|
+
"hiddenAliases": [],
|
|
103
|
+
"id": "list-contexts",
|
|
104
|
+
"pluginAlias": "@quantum-hub/qhubctl",
|
|
105
|
+
"pluginName": "@quantum-hub/qhubctl",
|
|
106
|
+
"pluginType": "core",
|
|
107
|
+
"strict": true,
|
|
108
|
+
"isESM": true,
|
|
109
|
+
"relativePath": [
|
|
110
|
+
"dist",
|
|
111
|
+
"commands",
|
|
112
|
+
"list-contexts",
|
|
113
|
+
"index.js"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
93
116
|
"init": {
|
|
94
117
|
"aliases": [],
|
|
95
118
|
"args": {},
|
|
@@ -129,29 +152,6 @@
|
|
|
129
152
|
"index.js"
|
|
130
153
|
]
|
|
131
154
|
},
|
|
132
|
-
"list-contexts": {
|
|
133
|
-
"aliases": [],
|
|
134
|
-
"args": {},
|
|
135
|
-
"description": "Retrieves the available contexts, i.e., the personal or organizational accounts available to you to work with.",
|
|
136
|
-
"examples": [
|
|
137
|
-
"$ qhubctl list-contexts"
|
|
138
|
-
],
|
|
139
|
-
"flags": {},
|
|
140
|
-
"hasDynamicHelp": false,
|
|
141
|
-
"hiddenAliases": [],
|
|
142
|
-
"id": "list-contexts",
|
|
143
|
-
"pluginAlias": "@quantum-hub/qhubctl",
|
|
144
|
-
"pluginName": "@quantum-hub/qhubctl",
|
|
145
|
-
"pluginType": "core",
|
|
146
|
-
"strict": true,
|
|
147
|
-
"isESM": true,
|
|
148
|
-
"relativePath": [
|
|
149
|
-
"dist",
|
|
150
|
-
"commands",
|
|
151
|
-
"list-contexts",
|
|
152
|
-
"index.js"
|
|
153
|
-
]
|
|
154
|
-
},
|
|
155
155
|
"login": {
|
|
156
156
|
"aliases": [],
|
|
157
157
|
"args": {},
|
|
@@ -217,6 +217,85 @@
|
|
|
217
217
|
"index.js"
|
|
218
218
|
]
|
|
219
219
|
},
|
|
220
|
+
"openapi": {
|
|
221
|
+
"aliases": [],
|
|
222
|
+
"args": {},
|
|
223
|
+
"description": "Generates the OpenAPI description for your project based on the parameter and return types of your run() method. The output of this command will be used when creating or updating your service. Supports PYTHON_TEMPLATE (with src/program.py), PYTHON and DOCKER runtimes (with explicit entrypoint). The Python dependency \"qhub-commons\" must be installed in your activated Python environment to use this command.",
|
|
224
|
+
"examples": [
|
|
225
|
+
"$ qhubctl openapi",
|
|
226
|
+
"$ qhubctl openapi --file=./openapi.yaml --format=yaml --force",
|
|
227
|
+
"$ qhubctl openapi --entrypoint=src.program:run",
|
|
228
|
+
"$ qhubctl openapi --package=src.program --method=run",
|
|
229
|
+
"$ qhubctl openapi --package=src.program"
|
|
230
|
+
],
|
|
231
|
+
"flags": {
|
|
232
|
+
"force": {
|
|
233
|
+
"char": "f",
|
|
234
|
+
"description": "Overwrite the output file if it already exists",
|
|
235
|
+
"name": "force",
|
|
236
|
+
"required": false,
|
|
237
|
+
"allowNo": false,
|
|
238
|
+
"type": "boolean"
|
|
239
|
+
},
|
|
240
|
+
"file": {
|
|
241
|
+
"description": "The file to write the OpenAPI description to",
|
|
242
|
+
"name": "file",
|
|
243
|
+
"required": false,
|
|
244
|
+
"hasDynamicHelp": false,
|
|
245
|
+
"multiple": false,
|
|
246
|
+
"type": "option"
|
|
247
|
+
},
|
|
248
|
+
"format": {
|
|
249
|
+
"description": "The format to generate the OpenAPI description [possible values: yaml]",
|
|
250
|
+
"name": "format",
|
|
251
|
+
"required": false,
|
|
252
|
+
"hasDynamicHelp": false,
|
|
253
|
+
"multiple": false,
|
|
254
|
+
"options": [
|
|
255
|
+
"yaml"
|
|
256
|
+
],
|
|
257
|
+
"type": "option"
|
|
258
|
+
},
|
|
259
|
+
"entrypoint": {
|
|
260
|
+
"description": "The entrypoint to your program in the format \"package.module:function\" (default: \"src.program:run\"). Overrides package and method flags.",
|
|
261
|
+
"name": "entrypoint",
|
|
262
|
+
"required": false,
|
|
263
|
+
"hasDynamicHelp": false,
|
|
264
|
+
"multiple": false,
|
|
265
|
+
"type": "option"
|
|
266
|
+
},
|
|
267
|
+
"package": {
|
|
268
|
+
"description": "The package/module path to your program (e.g., \"src.program\" or \"my_package.main\"). Only used if entrypoint is not provided.",
|
|
269
|
+
"name": "package",
|
|
270
|
+
"required": false,
|
|
271
|
+
"hasDynamicHelp": false,
|
|
272
|
+
"multiple": false,
|
|
273
|
+
"type": "option"
|
|
274
|
+
},
|
|
275
|
+
"method": {
|
|
276
|
+
"description": "The method/function name in your program (default: \"run\"). Only used if entrypoint is not provided.",
|
|
277
|
+
"name": "method",
|
|
278
|
+
"required": false,
|
|
279
|
+
"hasDynamicHelp": false,
|
|
280
|
+
"multiple": false,
|
|
281
|
+
"type": "option"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"hasDynamicHelp": false,
|
|
285
|
+
"hiddenAliases": [],
|
|
286
|
+
"id": "openapi",
|
|
287
|
+
"pluginAlias": "@quantum-hub/qhubctl",
|
|
288
|
+
"pluginName": "@quantum-hub/qhubctl",
|
|
289
|
+
"pluginType": "core",
|
|
290
|
+
"strict": true,
|
|
291
|
+
"isESM": true,
|
|
292
|
+
"relativePath": [
|
|
293
|
+
"dist",
|
|
294
|
+
"commands",
|
|
295
|
+
"openapi",
|
|
296
|
+
"index.js"
|
|
297
|
+
]
|
|
298
|
+
},
|
|
220
299
|
"run": {
|
|
221
300
|
"aliases": [],
|
|
222
301
|
"args": {
|
|
@@ -369,113 +448,6 @@
|
|
|
369
448
|
"index.js"
|
|
370
449
|
]
|
|
371
450
|
},
|
|
372
|
-
"set-context": {
|
|
373
|
-
"aliases": [],
|
|
374
|
-
"args": {
|
|
375
|
-
"contextId": {
|
|
376
|
-
"name": "contextId"
|
|
377
|
-
}
|
|
378
|
-
},
|
|
379
|
-
"description": "Set the current context, i.e., the personal or organization account you are currently working with.",
|
|
380
|
-
"examples": [
|
|
381
|
-
"$ qhubctl set-context",
|
|
382
|
-
"$ qhubctl set-context <context-id>"
|
|
383
|
-
],
|
|
384
|
-
"flags": {},
|
|
385
|
-
"hasDynamicHelp": false,
|
|
386
|
-
"hiddenAliases": [],
|
|
387
|
-
"id": "set-context",
|
|
388
|
-
"pluginAlias": "@quantum-hub/qhubctl",
|
|
389
|
-
"pluginName": "@quantum-hub/qhubctl",
|
|
390
|
-
"pluginType": "core",
|
|
391
|
-
"strict": true,
|
|
392
|
-
"isESM": true,
|
|
393
|
-
"relativePath": [
|
|
394
|
-
"dist",
|
|
395
|
-
"commands",
|
|
396
|
-
"set-context",
|
|
397
|
-
"index.js"
|
|
398
|
-
]
|
|
399
|
-
},
|
|
400
|
-
"openapi": {
|
|
401
|
-
"aliases": [],
|
|
402
|
-
"args": {},
|
|
403
|
-
"description": "Generates the OpenAPI description for your project based on the parameter and return types of your run() method. The output of this command will be used when creating or updating your service. Supports PYTHON_TEMPLATE (with src/program.py), PYTHON and DOCKER runtimes (with explicit entrypoint). The Python dependency \"qhub-commons\" must be installed in your activated Python environment to use this command.",
|
|
404
|
-
"examples": [
|
|
405
|
-
"$ qhubctl openapi",
|
|
406
|
-
"$ qhubctl openapi --file=./openapi.yaml --format=yaml --force",
|
|
407
|
-
"$ qhubctl openapi --entrypoint=src.program:run",
|
|
408
|
-
"$ qhubctl openapi --package=src.program --method=run",
|
|
409
|
-
"$ qhubctl openapi --package=src.program"
|
|
410
|
-
],
|
|
411
|
-
"flags": {
|
|
412
|
-
"force": {
|
|
413
|
-
"char": "f",
|
|
414
|
-
"description": "Overwrite the output file if it already exists",
|
|
415
|
-
"name": "force",
|
|
416
|
-
"required": false,
|
|
417
|
-
"allowNo": false,
|
|
418
|
-
"type": "boolean"
|
|
419
|
-
},
|
|
420
|
-
"file": {
|
|
421
|
-
"description": "The file to write the OpenAPI description to",
|
|
422
|
-
"name": "file",
|
|
423
|
-
"required": false,
|
|
424
|
-
"hasDynamicHelp": false,
|
|
425
|
-
"multiple": false,
|
|
426
|
-
"type": "option"
|
|
427
|
-
},
|
|
428
|
-
"format": {
|
|
429
|
-
"description": "The format to generate the OpenAPI description [possible values: yaml]",
|
|
430
|
-
"name": "format",
|
|
431
|
-
"required": false,
|
|
432
|
-
"hasDynamicHelp": false,
|
|
433
|
-
"multiple": false,
|
|
434
|
-
"options": [
|
|
435
|
-
"yaml"
|
|
436
|
-
],
|
|
437
|
-
"type": "option"
|
|
438
|
-
},
|
|
439
|
-
"entrypoint": {
|
|
440
|
-
"description": "The entrypoint to your program in the format \"package.module:function\" (default: \"src.program:run\"). Overrides package and method flags.",
|
|
441
|
-
"name": "entrypoint",
|
|
442
|
-
"required": false,
|
|
443
|
-
"hasDynamicHelp": false,
|
|
444
|
-
"multiple": false,
|
|
445
|
-
"type": "option"
|
|
446
|
-
},
|
|
447
|
-
"package": {
|
|
448
|
-
"description": "The package/module path to your program (e.g., \"src.program\" or \"my_package.main\"). Only used if entrypoint is not provided.",
|
|
449
|
-
"name": "package",
|
|
450
|
-
"required": false,
|
|
451
|
-
"hasDynamicHelp": false,
|
|
452
|
-
"multiple": false,
|
|
453
|
-
"type": "option"
|
|
454
|
-
},
|
|
455
|
-
"method": {
|
|
456
|
-
"description": "The method/function name in your program (default: \"run\"). Only used if entrypoint is not provided.",
|
|
457
|
-
"name": "method",
|
|
458
|
-
"required": false,
|
|
459
|
-
"hasDynamicHelp": false,
|
|
460
|
-
"multiple": false,
|
|
461
|
-
"type": "option"
|
|
462
|
-
}
|
|
463
|
-
},
|
|
464
|
-
"hasDynamicHelp": false,
|
|
465
|
-
"hiddenAliases": [],
|
|
466
|
-
"id": "openapi",
|
|
467
|
-
"pluginAlias": "@quantum-hub/qhubctl",
|
|
468
|
-
"pluginName": "@quantum-hub/qhubctl",
|
|
469
|
-
"pluginType": "core",
|
|
470
|
-
"strict": true,
|
|
471
|
-
"isESM": true,
|
|
472
|
-
"relativePath": [
|
|
473
|
-
"dist",
|
|
474
|
-
"commands",
|
|
475
|
-
"openapi",
|
|
476
|
-
"index.js"
|
|
477
|
-
]
|
|
478
|
-
},
|
|
479
451
|
"up": {
|
|
480
452
|
"aliases": [],
|
|
481
453
|
"args": {},
|
|
@@ -524,7 +496,35 @@
|
|
|
524
496
|
"up",
|
|
525
497
|
"index.js"
|
|
526
498
|
]
|
|
499
|
+
},
|
|
500
|
+
"set-context": {
|
|
501
|
+
"aliases": [],
|
|
502
|
+
"args": {
|
|
503
|
+
"contextId": {
|
|
504
|
+
"name": "contextId"
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
"description": "Set the current context, i.e., the personal or organization account you are currently working with.",
|
|
508
|
+
"examples": [
|
|
509
|
+
"$ qhubctl set-context",
|
|
510
|
+
"$ qhubctl set-context <context-id>"
|
|
511
|
+
],
|
|
512
|
+
"flags": {},
|
|
513
|
+
"hasDynamicHelp": false,
|
|
514
|
+
"hiddenAliases": [],
|
|
515
|
+
"id": "set-context",
|
|
516
|
+
"pluginAlias": "@quantum-hub/qhubctl",
|
|
517
|
+
"pluginName": "@quantum-hub/qhubctl",
|
|
518
|
+
"pluginType": "core",
|
|
519
|
+
"strict": true,
|
|
520
|
+
"isESM": true,
|
|
521
|
+
"relativePath": [
|
|
522
|
+
"dist",
|
|
523
|
+
"commands",
|
|
524
|
+
"set-context",
|
|
525
|
+
"index.js"
|
|
526
|
+
]
|
|
527
527
|
}
|
|
528
528
|
},
|
|
529
|
-
"version": "1.1.
|
|
529
|
+
"version": "1.1.5"
|
|
530
530
|
}
|