@quantum-hub/qhubctl 1.1.3 → 1.1.4
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 +4 -5
- package/oclif.manifest.json +103 -103
- 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(),
|
|
@@ -42,13 +42,12 @@ export default class SetContext extends AuthenticatedCommand {
|
|
|
42
42
|
selectedContext = accounts.find(account => account.id === contextId);
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
|
-
const response = await
|
|
45
|
+
const response = await select({
|
|
46
46
|
choices: this.getPromptOptions(accounts),
|
|
47
47
|
message: 'Choose a context',
|
|
48
|
-
|
|
49
|
-
type: 'list',
|
|
48
|
+
default: accounts[0],
|
|
50
49
|
});
|
|
51
|
-
selectedContext = response.
|
|
50
|
+
selectedContext = accounts.find(account => account.id === response.id);
|
|
52
51
|
}
|
|
53
52
|
if (!selectedContext) {
|
|
54
53
|
this.error(`Context with id "${contextId}" not found.`);
|
package/oclif.manifest.json
CHANGED
|
@@ -129,29 +129,6 @@
|
|
|
129
129
|
"index.js"
|
|
130
130
|
]
|
|
131
131
|
},
|
|
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
132
|
"login": {
|
|
156
133
|
"aliases": [],
|
|
157
134
|
"args": {},
|
|
@@ -194,6 +171,29 @@
|
|
|
194
171
|
"index.js"
|
|
195
172
|
]
|
|
196
173
|
},
|
|
174
|
+
"list-contexts": {
|
|
175
|
+
"aliases": [],
|
|
176
|
+
"args": {},
|
|
177
|
+
"description": "Retrieves the available contexts, i.e., the personal or organizational accounts available to you to work with.",
|
|
178
|
+
"examples": [
|
|
179
|
+
"$ qhubctl list-contexts"
|
|
180
|
+
],
|
|
181
|
+
"flags": {},
|
|
182
|
+
"hasDynamicHelp": false,
|
|
183
|
+
"hiddenAliases": [],
|
|
184
|
+
"id": "list-contexts",
|
|
185
|
+
"pluginAlias": "@quantum-hub/qhubctl",
|
|
186
|
+
"pluginName": "@quantum-hub/qhubctl",
|
|
187
|
+
"pluginType": "core",
|
|
188
|
+
"strict": true,
|
|
189
|
+
"isESM": true,
|
|
190
|
+
"relativePath": [
|
|
191
|
+
"dist",
|
|
192
|
+
"commands",
|
|
193
|
+
"list-contexts",
|
|
194
|
+
"index.js"
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
197
|
"logout": {
|
|
198
198
|
"aliases": [],
|
|
199
199
|
"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": {
|
|
@@ -397,85 +476,6 @@
|
|
|
397
476
|
"index.js"
|
|
398
477
|
]
|
|
399
478
|
},
|
|
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
479
|
"up": {
|
|
480
480
|
"aliases": [],
|
|
481
481
|
"args": {},
|
|
@@ -526,5 +526,5 @@
|
|
|
526
526
|
]
|
|
527
527
|
}
|
|
528
528
|
},
|
|
529
|
-
"version": "1.1.
|
|
529
|
+
"version": "1.1.4"
|
|
530
530
|
}
|