@quantum-hub/qhubctl 2.2.2-next.1 → 2.2.3-next.1
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/README.md +4 -2
- package/dist/commands/compress.d.ts +1 -1
- package/dist/commands/compress.js +15 -15
- package/dist/commands/datapool-upload.d.ts +1 -1
- package/dist/commands/datapool-upload.js +35 -35
- package/dist/commands/get-context.d.ts +1 -1
- package/dist/commands/get-context.js +5 -5
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.js +33 -29
- package/dist/commands/list-contexts.d.ts +1 -1
- package/dist/commands/list-contexts.js +21 -13
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.js +16 -16
- package/dist/commands/logout.d.ts +1 -1
- package/dist/commands/logout.js +10 -10
- package/dist/commands/openapi.d.ts +1 -1
- package/dist/commands/openapi.js +112 -94
- package/dist/commands/run.d.ts +3 -3
- package/dist/commands/run.js +37 -34
- package/dist/commands/serve.d.ts +1 -1
- package/dist/commands/serve.js +30 -19
- package/dist/commands/services-build-logs.d.ts +2 -2
- package/dist/commands/services-build-logs.js +26 -26
- package/dist/commands/services-build-status.d.ts +1 -1
- package/dist/commands/services-build-status.js +21 -21
- package/dist/commands/services-list.d.ts +1 -1
- package/dist/commands/services-list.js +20 -17
- package/dist/commands/set-context.d.ts +1 -1
- package/dist/commands/set-context.js +18 -16
- package/dist/commands/up.d.ts +1 -1
- package/dist/commands/up.js +50 -48
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/command.js +2 -2
- package/dist/lib/config-dir.js +3 -3
- package/dist/lib/debug.js +1 -1
- package/dist/lib/entrypoint-resolver.js +15 -15
- package/dist/lib/error.js +4 -4
- package/dist/lib/fetch.js +3 -1
- package/dist/lib/init-user-input.d.ts +1 -1
- package/dist/lib/init-user-input.js +28 -26
- package/dist/lib/output.d.ts +2 -2
- package/dist/lib/output.js +3 -3
- package/dist/lib/random-name.js +147 -147
- package/dist/lib/random-string.js +2 -2
- package/dist/lib/repository.js +5 -5
- package/dist/lib/stream-to-blob.d.ts +1 -1
- package/dist/lib/stream-to-blob.js +5 -5
- package/dist/lib/up/get-description.js +8 -8
- package/dist/lib/up/ignore.js +8 -8
- package/dist/lib/up/qhubignore-help.js +10 -10
- package/dist/lib/up/required-files.js +17 -12
- package/dist/lib/up/source.d.ts +2 -2
- package/dist/lib/up/source.js +7 -7
- package/dist/lib/up/zip.js +8 -8
- package/dist/main.js +3 -3
- package/dist/model/command.d.ts +2 -2
- package/dist/model/command.js +9 -9
- package/dist/model/managed-service-config.d.ts +1 -1
- package/dist/model/user-config.js +1 -1
- package/dist/program.d.ts +1 -1
- package/dist/program.js +24 -24
- package/dist/service/auth-service.d.ts +3 -3
- package/dist/service/auth-service.js +11 -9
- package/dist/service/command-service.d.ts +1 -1
- package/dist/service/quantum-hub-service.d.ts +3 -3
- package/dist/service/quantum-hub-service.js +34 -20
- package/dist/service/service-config-service.d.ts +1 -1
- package/dist/service/service-config-service.js +8 -8
- package/dist/service/user-config-service.d.ts +1 -1
- package/dist/service/user-config-service.js +7 -7
- package/dist/service/user-service.d.ts +2 -2
- package/dist/service/user-service.js +4 -4
- package/package.json +9 -3
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import fsExtra from
|
|
1
|
+
import fsExtra from "fs-extra";
|
|
2
2
|
const { createFileSync, readJsonSync, writeJsonSync } = fsExtra;
|
|
3
|
-
import fs from
|
|
4
|
-
import path from
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
5
|
export const readUserConfig = (location) => {
|
|
6
|
-
const file = path.join(location,
|
|
6
|
+
const file = path.join(location, "config.json");
|
|
7
7
|
if (!fs.existsSync(file)) {
|
|
8
8
|
return {};
|
|
9
9
|
}
|
|
10
|
-
return readJsonSync(file, { encoding:
|
|
10
|
+
return readJsonSync(file, { encoding: "utf8" });
|
|
11
11
|
};
|
|
12
12
|
export const writeUserConfig = (location, userConfig) => {
|
|
13
|
-
const file = path.join(location,
|
|
13
|
+
const file = path.join(location, "config.json");
|
|
14
14
|
if (!fs.existsSync(file)) {
|
|
15
15
|
createFileSync(file);
|
|
16
16
|
}
|
|
17
|
-
writeJsonSync(file, userConfig, { encoding:
|
|
17
|
+
writeJsonSync(file, userConfig, { encoding: "utf8", spaces: 2 });
|
|
18
18
|
return readUserConfig(location);
|
|
19
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HubUser, HubUserClient } from
|
|
2
|
-
import UserConfig from
|
|
1
|
+
import { HubUser, HubUserClient } from "@quantum-hub/qhub-api/user";
|
|
2
|
+
import UserConfig from "../model/user-config.js";
|
|
3
3
|
export default class UserService {
|
|
4
4
|
basePath: string;
|
|
5
5
|
defaultHeaders: Record<string, string>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { HubUserClient } from
|
|
2
|
-
import { handleError } from
|
|
3
|
-
import { defaultBasePath } from
|
|
1
|
+
import { HubUserClient } from "@quantum-hub/qhub-api/user";
|
|
2
|
+
import { handleError } from "../lib/error.js";
|
|
3
|
+
import { defaultBasePath } from "../model/user-config.js";
|
|
4
4
|
export default class UserService {
|
|
5
5
|
basePath;
|
|
6
6
|
defaultHeaders;
|
|
7
7
|
apiClient;
|
|
8
8
|
constructor(userConfig) {
|
|
9
|
-
this.basePath = (userConfig.endpoint?.basePath || defaultBasePath) +
|
|
9
|
+
this.basePath = (userConfig.endpoint?.basePath || defaultBasePath) + "/user-service";
|
|
10
10
|
this.defaultHeaders = userConfig.endpoint?.defaultHeaders || {};
|
|
11
11
|
const apiKey = userConfig.auth?.value;
|
|
12
12
|
this.apiClient = new HubUserClient({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantum-hub/qhubctl",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3-next.1",
|
|
4
4
|
"description": "Kipu Quantum Hub CLI",
|
|
5
5
|
"author": "Kipu Quantum GmbH",
|
|
6
6
|
"contributors": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@inquirer/prompts": "^8",
|
|
29
|
-
"@quantum-hub/qhub-api": "^
|
|
29
|
+
"@quantum-hub/qhub-api": "^3.0.0",
|
|
30
30
|
"adm-zip": "^0.6.0",
|
|
31
31
|
"async-wait-until": "^2",
|
|
32
32
|
"commander": "^14",
|
|
@@ -48,8 +48,10 @@
|
|
|
48
48
|
"@types/update-notifier": "^6",
|
|
49
49
|
"chai": "^6",
|
|
50
50
|
"eslint": "^10",
|
|
51
|
+
"eslint-config-prettier": "^10.1.8",
|
|
51
52
|
"mocha": "^11",
|
|
52
53
|
"nyc": "^18",
|
|
54
|
+
"prettier": "^3.9.6",
|
|
53
55
|
"shx": "^0.4.0",
|
|
54
56
|
"ts-node": "^10",
|
|
55
57
|
"tsx": "^4",
|
|
@@ -60,7 +62,11 @@
|
|
|
60
62
|
"build": "shx rm -rf dist && tsc -b && shx chmod +x dist/main.js",
|
|
61
63
|
"dev": "tsc -b --watch",
|
|
62
64
|
"docs:generate": "node scripts/generate-docs.mjs --out docs/cli-reference.md",
|
|
63
|
-
"lint": "
|
|
65
|
+
"lint": "npm run lint:code && npm run lint:format",
|
|
66
|
+
"lint:code": "eslint .",
|
|
67
|
+
"lint:code:fix": "eslint . --fix",
|
|
68
|
+
"lint:format": "prettier --check .",
|
|
69
|
+
"format": "prettier --write .",
|
|
64
70
|
"posttest": "npm run lint",
|
|
65
71
|
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
66
72
|
"test:coverage": "nyc --reporter=lcov --reporter=text-lcov mocha --forbid-only \"test/**/*.test.ts\""
|