bdy 1.25.2-stage → 1.25.4-dev
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/distTs/package.json +20 -19
- package/distTs/src/agent/socket/tunnel.js +2 -0
- package/distTs/src/cliCommand.js +28 -0
- package/distTs/src/cliIndex.js +3 -1
- package/distTs/src/command/agent/proxy/status.js +9 -2
- package/distTs/src/command/agent/status.js +22 -6
- package/distTs/src/command/agent/tags/get.js +9 -2
- package/distTs/src/command/agent/target/status.js +9 -2
- package/distTs/src/command/agent/tunnel/http.js +4 -3
- package/distTs/src/command/agent/tunnel/list.js +7 -3
- package/distTs/src/command/agent/tunnel/remove.js +1 -2
- package/distTs/src/command/agent/tunnel/start.js +1 -2
- package/distTs/src/command/agent/tunnel/status.js +14 -3
- package/distTs/src/command/agent/tunnel/tcp.js +4 -3
- package/distTs/src/command/agent/tunnel/tls.js +4 -3
- package/distTs/src/command/agent/tunnel.js +11 -8
- package/distTs/src/command/agent/version.js +7 -2
- package/distTs/src/command/api/info.js +50 -2
- package/distTs/src/command/api/list.js +18 -2
- package/distTs/src/command/artifact/composer/publish.js +4 -2
- package/distTs/src/command/artifact/create.js +9 -2
- package/distTs/src/command/artifact/delete.js +4 -2
- package/distTs/src/command/artifact/docker.js +1 -1
- package/distTs/src/command/artifact/download.js +4 -2
- package/distTs/src/command/artifact/get.js +3 -1
- package/distTs/src/command/artifact/list.js +3 -1
- package/distTs/src/command/artifact/publish.js +24 -24
- package/distTs/src/command/artifact/version/create.js +9 -2
- package/distTs/src/command/artifact/version/delete.js +4 -2
- package/distTs/src/command/artifact/version/get.js +4 -2
- package/distTs/src/command/artifact/version/list.js +4 -2
- package/distTs/src/command/config/get/tunnel.js +8 -3
- package/distTs/src/command/config/get/tunnels.js +8 -3
- package/distTs/src/command/crawl/link.js +3 -2
- package/distTs/src/command/crawl/run.js +3 -2
- package/distTs/src/command/crawl.js +3 -4
- package/distTs/src/command/discover.js +34 -0
- package/distTs/src/command/distro/create.js +9 -2
- package/distTs/src/command/distro/delete.js +4 -2
- package/distTs/src/command/distro/get.js +4 -2
- package/distTs/src/command/distro/list.js +4 -2
- package/distTs/src/command/distro/route/create.js +9 -2
- package/distTs/src/command/distro/route/delete.js +4 -2
- package/distTs/src/command/distro/route/get.js +4 -2
- package/distTs/src/command/distro/route/list.js +4 -2
- package/distTs/src/command/distro/route/update.js +9 -2
- package/distTs/src/command/distro/route.js +9 -6
- package/distTs/src/command/distro/update.js +9 -2
- package/distTs/src/command/distro.js +14 -11
- package/distTs/src/command/domain/search.js +31 -10
- package/distTs/src/command/environment/create.js +6 -2
- package/distTs/src/command/environment/delete.js +1 -2
- package/distTs/src/command/environment/get.js +3 -2
- package/distTs/src/command/environment/list.js +1 -2
- package/distTs/src/command/environment/update.js +6 -2
- package/distTs/src/command/mcp.js +3 -2
- package/distTs/src/command/pipeline/create.js +4 -2
- package/distTs/src/command/pipeline/delete.js +4 -2
- package/distTs/src/command/pipeline/get.js +4 -2
- package/distTs/src/command/pipeline/list.js +4 -2
- package/distTs/src/command/pipeline/run/approve.js +5 -3
- package/distTs/src/command/pipeline/run/cancel.js +5 -3
- package/distTs/src/command/pipeline/run/list.js +4 -2
- package/distTs/src/command/pipeline/run/logs.js +5 -3
- package/distTs/src/command/pipeline/run/retry.js +5 -3
- package/distTs/src/command/pipeline/run/start.js +5 -3
- package/distTs/src/command/pipeline/run/status.js +5 -3
- package/distTs/src/command/pipeline/run.js +11 -9
- package/distTs/src/command/pipeline/update.js +4 -2
- package/distTs/src/command/pipeline/yaml.js +4 -2
- package/distTs/src/command/pipeline.js +17 -15
- package/distTs/src/command/pre.js +2 -1
- package/distTs/src/command/sandbox/app/add.js +10 -3
- package/distTs/src/command/sandbox/app/list.js +1 -2
- package/distTs/src/command/sandbox/app/logs.js +10 -6
- package/distTs/src/command/sandbox/app/remove.js +1 -2
- package/distTs/src/command/sandbox/app/start.js +1 -2
- package/distTs/src/command/sandbox/app/status.js +1 -2
- package/distTs/src/command/sandbox/app/stop.js +1 -2
- package/distTs/src/command/sandbox/app.js +11 -9
- package/distTs/src/command/sandbox/cp.js +3 -2
- package/distTs/src/command/sandbox/create.js +16 -7
- package/distTs/src/command/sandbox/endpoint/add.js +6 -2
- package/distTs/src/command/sandbox/endpoint/delete.js +1 -2
- package/distTs/src/command/sandbox/endpoint/get.js +1 -2
- package/distTs/src/command/sandbox/endpoint/list.js +1 -2
- package/distTs/src/command/sandbox/endpoint.js +8 -5
- package/distTs/src/command/sandbox/exec/command.js +15 -31
- package/distTs/src/command/sandbox/exec/kill.js +1 -2
- package/distTs/src/command/sandbox/exec/list.js +1 -2
- package/distTs/src/command/sandbox/exec/logs.js +4 -30
- package/distTs/src/command/sandbox/exec/status.js +1 -2
- package/distTs/src/command/sandbox/exec.js +9 -6
- package/distTs/src/command/sandbox/finishExec.js +33 -0
- package/distTs/src/command/sandbox/logs.js +14 -1
- package/distTs/src/command/sandbox/snapshot/create.js +10 -3
- package/distTs/src/command/sandbox/snapshot/delete.js +1 -2
- package/distTs/src/command/sandbox/snapshot/get.js +1 -2
- package/distTs/src/command/sandbox/snapshot/list.js +1 -2
- package/distTs/src/command/sandbox/snapshot.js +8 -5
- package/distTs/src/command/sandbox/ssh.js +3 -2
- package/distTs/src/command/target/create.js +8 -2
- package/distTs/src/command/target/delete.js +3 -2
- package/distTs/src/command/target/exec/command.js +1 -2
- package/distTs/src/command/target/exec/kill.js +1 -2
- package/distTs/src/command/target/exec/list.js +1 -2
- package/distTs/src/command/target/exec/logs.js +15 -3
- package/distTs/src/command/target/exec/status.js +1 -2
- package/distTs/src/command/target/exec.js +9 -6
- package/distTs/src/command/target/get.js +3 -2
- package/distTs/src/command/target/list.js +3 -2
- package/distTs/src/command/target/update.js +8 -2
- package/distTs/src/command/tests/capture.js +3 -2
- package/distTs/src/command/tests/unit/link.js +3 -2
- package/distTs/src/command/tests/unit/upload.js +3 -2
- package/distTs/src/command/tests/unit.js +3 -4
- package/distTs/src/command/tests/visual/link.js +3 -2
- package/distTs/src/command/tests/visual/session/close.js +3 -2
- package/distTs/src/command/tests/visual/session/create.js +3 -2
- package/distTs/src/command/tests/visual/session.js +6 -4
- package/distTs/src/command/tests/visual/setup.js +3 -2
- package/distTs/src/command/tests/visual/upload.js +3 -2
- package/distTs/src/command/tests/visual.js +9 -7
- package/distTs/src/command/tests.js +12 -10
- package/distTs/src/command/tunnel/http.js +3 -2
- package/distTs/src/command/tunnel/start.js +3 -2
- package/distTs/src/command/tunnel/tcp.js +1 -2
- package/distTs/src/command/tunnel/tls.js +1 -2
- package/distTs/src/command/tunnel.js +8 -5
- package/distTs/src/command/version.js +2 -1
- package/distTs/src/command/yaml/actions/info.js +1 -2
- package/distTs/src/command/yaml/actions/list.js +1 -2
- package/distTs/src/command/yaml/actions.js +3 -4
- package/distTs/src/command/yaml/pipeline.js +3 -2
- package/distTs/src/command/yaml/validate.js +114 -54
- package/distTs/src/command/yaml.js +8 -6
- package/distTs/src/discovery.js +119 -0
- package/distTs/src/openapi.js +8 -1
- package/distTs/src/output.js +39 -0
- package/distTs/src/texts.js +1570 -736
- package/distTs/src/utils.js +46 -17
- package/package.json +20 -19
|
@@ -8,14 +8,16 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../output"));
|
|
10
10
|
const distro_1 = require("../../types/distro");
|
|
11
|
-
const commandArtifactDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_ARTIFACT_DELETE
|
|
11
|
+
const commandArtifactDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_ARTIFACT_DELETE, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.ARTIFACT_MANAGE],
|
|
13
|
+
examples: texts_1.EXAMPLE_ARTIFACT_DELETE,
|
|
14
|
+
});
|
|
12
15
|
commandArtifactDelete.alias('rm');
|
|
13
16
|
commandArtifactDelete.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
17
|
commandArtifactDelete.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
15
18
|
commandArtifactDelete.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
16
19
|
commandArtifactDelete.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
17
20
|
commandArtifactDelete.argument('<identifier>', texts_1.OPT_COMMAND_ARTIFACT_IDENTIFIER);
|
|
18
|
-
commandArtifactDelete.addHelpText('after', texts_1.EXAMPLE_ARTIFACT_DELETE);
|
|
19
21
|
commandArtifactDelete.action(async (identifier, options) => {
|
|
20
22
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
23
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const texts_1 = require("../../texts");
|
|
8
8
|
const login_1 = __importDefault(require("./docker/login"));
|
|
9
|
-
const commandArtifactDocker = (0, utils_1.newCommand)('docker', texts_1.
|
|
9
|
+
const commandArtifactDocker = (0, utils_1.newCommand)('docker', texts_1.DESC_COMMAND_ARTIFACT_DOCKER);
|
|
10
10
|
commandArtifactDocker.addCommand(login_1.default);
|
|
11
11
|
exports.default = commandArtifactDocker;
|
|
@@ -12,7 +12,10 @@ const path_1 = require("path");
|
|
|
12
12
|
const fs_1 = __importDefault(require("fs"));
|
|
13
13
|
const promises_1 = __importDefault(require("node:stream/promises"));
|
|
14
14
|
const distro_1 = require("../../types/distro");
|
|
15
|
-
const commandArtifactDownload = (0, utils_1.newCommand)('download', texts_1.DESC_COMMAND_ARTIFACT_DOWNLOAD
|
|
15
|
+
const commandArtifactDownload = (0, utils_1.newCommand)('download', texts_1.DESC_COMMAND_ARTIFACT_DOWNLOAD, {
|
|
16
|
+
requiredScopes: [utils_1.REST_API_SCOPE.ARTIFACT_READ],
|
|
17
|
+
examples: texts_1.EXAMPLE_ARTIFACT_DOWNLOAD,
|
|
18
|
+
});
|
|
16
19
|
commandArtifactDownload.alias('dd');
|
|
17
20
|
commandArtifactDownload.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
18
21
|
commandArtifactDownload.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
@@ -21,7 +24,6 @@ commandArtifactDownload.option('-m, --merge', texts_1.OPTION_ARTIFACT_DOWNLOAD_M
|
|
|
21
24
|
commandArtifactDownload.option('-r, --replace', texts_1.OPTION_ARTIFACT_DOWNLOAD_REPLACE);
|
|
22
25
|
commandArtifactDownload.argument('<identifier>', texts_1.OPTION_ARTIFACT_ID);
|
|
23
26
|
commandArtifactDownload.argument('<directory>', texts_1.OPTION_ARTIFACT_DOWNLOAD_PATH);
|
|
24
|
-
commandArtifactDownload.addHelpText('after', texts_1.EXAMPLE_ARTIFACT_DOWNLOAD);
|
|
25
27
|
commandArtifactDownload.action(async (id, path, options) => {
|
|
26
28
|
const { v4 } = require('uuid');
|
|
27
29
|
const ArchiverExtract = require('../../unzipper').default;
|
|
@@ -8,7 +8,9 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../output"));
|
|
10
10
|
const distro_1 = require("../../types/distro");
|
|
11
|
-
const commandArtifactGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_ARTIFACT_GET
|
|
11
|
+
const commandArtifactGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_ARTIFACT_GET, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.ARTIFACT_READ],
|
|
13
|
+
});
|
|
12
14
|
commandArtifactGet.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
13
15
|
commandArtifactGet.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
14
16
|
commandArtifactGet.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -8,7 +8,9 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
9
|
const input_1 = __importDefault(require("../../input"));
|
|
10
10
|
const distro_1 = require("../../types/distro");
|
|
11
|
-
const commandArtifactList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_ARTIFACT_LIST
|
|
11
|
+
const commandArtifactList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_ARTIFACT_LIST, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.ARTIFACT_READ],
|
|
13
|
+
});
|
|
12
14
|
commandArtifactList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
13
15
|
commandArtifactList.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
14
16
|
commandArtifactList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -11,7 +11,10 @@ const logger_1 = __importDefault(require("../../logger"));
|
|
|
11
11
|
const fs_1 = __importDefault(require("fs"));
|
|
12
12
|
const path_1 = require("path");
|
|
13
13
|
const distro_1 = require("../../types/distro");
|
|
14
|
-
const commandArtifactPublish = (0, utils_1.newCommand)('publish', texts_1.DESC_COMMAND_ARTIFACT_PUBLISH
|
|
14
|
+
const commandArtifactPublish = (0, utils_1.newCommand)('publish', texts_1.DESC_COMMAND_ARTIFACT_PUBLISH, {
|
|
15
|
+
requiredScopes: [utils_1.REST_API_SCOPE.ARTIFACT_WRITE],
|
|
16
|
+
examples: texts_1.EXAMPLE_ARTIFACT_PUBLISH,
|
|
17
|
+
});
|
|
15
18
|
commandArtifactPublish.alias('pub');
|
|
16
19
|
commandArtifactPublish.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
17
20
|
commandArtifactPublish.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
@@ -22,9 +25,10 @@ commandArtifactPublish.option('--agent-note <note>', texts_1.OPTION_ARTIFACT_VER
|
|
|
22
25
|
commandArtifactPublish.option('-f, --force', texts_1.OPTION_ARTIFACT_PUBLISH_OVERWRITE_VERSION);
|
|
23
26
|
commandArtifactPublish.argument('<identifier>', texts_1.OPTION_ARTIFACT_ID);
|
|
24
27
|
commandArtifactPublish.argument('<directory>', texts_1.OPTION_ARTIFACT_PUBLISH_PATH);
|
|
25
|
-
commandArtifactPublish.
|
|
28
|
+
commandArtifactPublish.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
26
29
|
commandArtifactPublish.action(async (id, path, options) => {
|
|
27
30
|
const { v4 } = require('uuid');
|
|
31
|
+
const say = output_1.default.progress(options.format === 'json');
|
|
28
32
|
let dirPath = input_1.default.resolvePath(path);
|
|
29
33
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
30
34
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -64,20 +68,15 @@ commandArtifactPublish.action(async (id, path, options) => {
|
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
let artifactVersionId = data.artifact_version_id;
|
|
67
|
-
let url;
|
|
68
71
|
if (artifactVersionId && !options.force) {
|
|
69
72
|
output_1.default.exitError(texts_1.ERR_ARTIFACT_VERSION_EXISTS);
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const d = await client.getArtifactVersion(workspace, artifactId, artifactVersionId);
|
|
78
|
-
url = d.version_url;
|
|
79
|
-
}
|
|
80
|
-
output_1.default.normal(texts_1.TXT_ARTIFACT_SCANNING_DIR, false);
|
|
74
|
+
const artifactVersion = !artifactVersionId
|
|
75
|
+
? await client.createArtifactVersion(workspace, artifactId, version, options.note, options.agentNote)
|
|
76
|
+
: await client.getArtifactVersion(workspace, artifactId, artifactVersionId);
|
|
77
|
+
const url = artifactVersion.version_url;
|
|
78
|
+
artifactVersionId = artifactVersion.id;
|
|
79
|
+
say(texts_1.TXT_ARTIFACT_SCANNING_DIR, false);
|
|
81
80
|
const stat = fs_1.default.statSync(dirPath);
|
|
82
81
|
let entries;
|
|
83
82
|
if (stat.isDirectory()) {
|
|
@@ -104,6 +103,10 @@ commandArtifactPublish.action(async (id, path, options) => {
|
|
|
104
103
|
dirPath = parentPath;
|
|
105
104
|
}
|
|
106
105
|
const outputSuccess = () => {
|
|
106
|
+
if (options.format === 'json') {
|
|
107
|
+
output_1.default.json(artifactVersion);
|
|
108
|
+
output_1.default.exitNormal();
|
|
109
|
+
}
|
|
107
110
|
output_1.default.object({
|
|
108
111
|
Version: `${identifier}:${version}`,
|
|
109
112
|
URL: url || '-',
|
|
@@ -112,16 +115,16 @@ commandArtifactPublish.action(async (id, path, options) => {
|
|
|
112
115
|
output_1.default.exitNormal();
|
|
113
116
|
};
|
|
114
117
|
if (!entries.length) {
|
|
115
|
-
|
|
118
|
+
say(texts_1.TXT_ARTIFACT_NO_ENTRIES_FOUND);
|
|
116
119
|
outputSuccess();
|
|
117
120
|
}
|
|
118
121
|
else if (entries.length === 1) {
|
|
119
|
-
|
|
122
|
+
say(texts_1.TXT_ARTIFACT_ONE_ENTRY_FOUND);
|
|
120
123
|
}
|
|
121
124
|
else {
|
|
122
|
-
|
|
125
|
+
say((0, texts_1.TXT_ARTIFACT_ENTRIES_FOUND)(entries.length));
|
|
123
126
|
}
|
|
124
|
-
|
|
127
|
+
say((0, texts_1.TXT_ARTIFACT_ZIP_ENTRIES)(0));
|
|
125
128
|
const zipPath = (0, path_1.join)((0, utils_1.getHomeDirectory)(), `${v4()}.zip`);
|
|
126
129
|
const clearZip = () => {
|
|
127
130
|
try {
|
|
@@ -136,11 +139,9 @@ commandArtifactPublish.action(async (id, path, options) => {
|
|
|
136
139
|
let proc = 0;
|
|
137
140
|
await (0, utils_1.createZip)(dirPath, zipPath, entries, () => {
|
|
138
141
|
proc += 1;
|
|
139
|
-
|
|
140
|
-
output_1.default.normal((0, texts_1.TXT_ARTIFACT_ZIP_ENTRIES)(proc));
|
|
142
|
+
say((0, texts_1.TXT_ARTIFACT_ZIP_ENTRIES)(proc), true, true);
|
|
141
143
|
});
|
|
142
|
-
|
|
143
|
-
output_1.default.normal(texts_1.TXT_ARTIFACT_ZIPPED);
|
|
144
|
+
say(texts_1.TXT_ARTIFACT_ZIPPED, true, true);
|
|
144
145
|
blob = await fs_1.default.openAsBlob(zipPath);
|
|
145
146
|
}
|
|
146
147
|
catch (err) {
|
|
@@ -149,10 +150,9 @@ commandArtifactPublish.action(async (id, path, options) => {
|
|
|
149
150
|
output_1.default.exitError(texts_1.ERR_SWW);
|
|
150
151
|
}
|
|
151
152
|
try {
|
|
152
|
-
|
|
153
|
+
say(texts_1.TXT_ARTIFACT_UPLOADING);
|
|
153
154
|
await client.createArtifactVersionZip(workspace, artifactId, artifactVersionId, blob);
|
|
154
|
-
|
|
155
|
-
output_1.default.normal(texts_1.TXT_ARTIFACT_UPLOADED);
|
|
155
|
+
say(texts_1.TXT_ARTIFACT_UPLOADED, true, true);
|
|
156
156
|
clearZip();
|
|
157
157
|
outputSuccess();
|
|
158
158
|
}
|
|
@@ -8,7 +8,10 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const distro_1 = require("../../../types/distro");
|
|
10
10
|
const output_1 = __importDefault(require("../../../output"));
|
|
11
|
-
const commandArtifactVersionCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_ARTIFACT_VERSION_CREATE
|
|
11
|
+
const commandArtifactVersionCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_ARTIFACT_VERSION_CREATE, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.ARTIFACT_WRITE],
|
|
13
|
+
examples: texts_1.EXAMPLE_ARTIFACT_VERSION_CREATE,
|
|
14
|
+
});
|
|
12
15
|
commandArtifactVersionCreate.alias('add');
|
|
13
16
|
commandArtifactVersionCreate.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
17
|
commandArtifactVersionCreate.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
@@ -18,7 +21,7 @@ commandArtifactVersionCreate.option('--note <note>', texts_1.OPTION_ARTIFACT_VER
|
|
|
18
21
|
commandArtifactVersionCreate.option('--agent-note <note>', texts_1.OPTION_ARTIFACT_VERSION_AGENT_NOTE);
|
|
19
22
|
commandArtifactVersionCreate.option('--from <version>', texts_1.OPTION_ARTIFACT_VERSION_FROM);
|
|
20
23
|
commandArtifactVersionCreate.argument('<identifier>', texts_1.OPTION_ARTIFACT_ID);
|
|
21
|
-
commandArtifactVersionCreate.
|
|
24
|
+
commandArtifactVersionCreate.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
22
25
|
commandArtifactVersionCreate.action(async (id, options) => {
|
|
23
26
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
24
27
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -62,6 +65,10 @@ commandArtifactVersionCreate.action(async (id, options) => {
|
|
|
62
65
|
output_1.default.exitError(texts_1.ERR_ARTIFACT_VERSION_EXISTS_NO_FORCE);
|
|
63
66
|
}
|
|
64
67
|
const d = await client.createArtifactVersion(workspace, artifactId, version, options.note, options.agentNote, options.from);
|
|
68
|
+
if (options.format === 'json') {
|
|
69
|
+
output_1.default.json(d);
|
|
70
|
+
output_1.default.exitNormal();
|
|
71
|
+
}
|
|
65
72
|
const url = d.version_url;
|
|
66
73
|
output_1.default.object({
|
|
67
74
|
Version: `${identifier}:${version}`,
|
|
@@ -8,7 +8,10 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
10
|
const distro_1 = require("../../../types/distro");
|
|
11
|
-
const commandArtifactVersionDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_ARTIFACT_VERSION_DELETE
|
|
11
|
+
const commandArtifactVersionDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_ARTIFACT_VERSION_DELETE, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.ARTIFACT_MANAGE],
|
|
13
|
+
examples: texts_1.EXAMPLE_ARTIFACT_VERSION_DELETE,
|
|
14
|
+
});
|
|
12
15
|
commandArtifactVersionDelete.alias('rm');
|
|
13
16
|
commandArtifactVersionDelete.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
17
|
commandArtifactVersionDelete.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -16,7 +19,6 @@ commandArtifactVersionDelete.argument('<identifier>', texts_1.OPT_COMMAND_ARTIFA
|
|
|
16
19
|
commandArtifactVersionDelete.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
17
20
|
commandArtifactVersionDelete.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
18
21
|
commandArtifactVersionDelete.argument('<version>', texts_1.OPT_COMMAND_ARTIFACT_VERSION);
|
|
19
|
-
commandArtifactVersionDelete.addHelpText('after', texts_1.EXAMPLE_ARTIFACT_VERSION_DELETE);
|
|
20
22
|
commandArtifactVersionDelete.action(async (identifier, version, options) => {
|
|
21
23
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
22
24
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -8,14 +8,16 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
10
|
const distro_1 = require("../../../types/distro");
|
|
11
|
-
const commandArtifactVersionGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_ARTIFACT_VERSION_GET
|
|
11
|
+
const commandArtifactVersionGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_ARTIFACT_VERSION_GET, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.ARTIFACT_READ],
|
|
13
|
+
examples: texts_1.EXAMPLE_ARTIFACT_VERSION_GET,
|
|
14
|
+
});
|
|
12
15
|
commandArtifactVersionGet.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
13
16
|
commandArtifactVersionGet.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
14
17
|
commandArtifactVersionGet.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
15
18
|
commandArtifactVersionGet.argument('<identifier>', texts_1.OPT_COMMAND_ARTIFACT_IDENTIFIER);
|
|
16
19
|
commandArtifactVersionGet.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
17
20
|
commandArtifactVersionGet.argument('<version>', texts_1.OPT_COMMAND_ARTIFACT_VERSION);
|
|
18
|
-
commandArtifactVersionGet.addHelpText('after', texts_1.EXAMPLE_ARTIFACT_VERSION_GET);
|
|
19
21
|
commandArtifactVersionGet.action(async (identifier, version, options) => {
|
|
20
22
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
23
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -8,7 +8,10 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
10
|
const distro_1 = require("../../../types/distro");
|
|
11
|
-
const commandArtifactVersionList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_ARTIFACT_VERSION_LIST
|
|
11
|
+
const commandArtifactVersionList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_ARTIFACT_VERSION_LIST, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.ARTIFACT_READ],
|
|
13
|
+
examples: texts_1.EXAMPLE_ARTIFACT_VERSION_LIST,
|
|
14
|
+
});
|
|
12
15
|
commandArtifactVersionList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
13
16
|
commandArtifactVersionList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
14
17
|
commandArtifactVersionList.option('--page <number>', texts_1.OPTION_REST_API_PAGE, '1');
|
|
@@ -17,7 +20,6 @@ commandArtifactVersionList.option('--format <text|json>', texts_1.OPTION_FORMAT)
|
|
|
17
20
|
commandArtifactVersionList.alias('ls');
|
|
18
21
|
commandArtifactVersionList.argument('<identifier>', texts_1.OPT_COMMAND_ARTIFACT_IDENTIFIER);
|
|
19
22
|
commandArtifactVersionList.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
20
|
-
commandArtifactVersionList.addHelpText('after', texts_1.EXAMPLE_ARTIFACT_VERSION_LIST);
|
|
21
23
|
commandArtifactVersionList.action(async (identifier, options) => {
|
|
22
24
|
const page = input_1.default.restApiPage(options.page);
|
|
23
25
|
const perPage = input_1.default.restApiPerPage(options.perPage);
|
|
@@ -7,13 +7,18 @@ const cfg_1 = __importDefault(require("../../../tunnel/cfg"));
|
|
|
7
7
|
const output_1 = __importDefault(require("../../../output"));
|
|
8
8
|
const texts_1 = require("../../../texts");
|
|
9
9
|
const utils_1 = require("../../../utils");
|
|
10
|
-
const commandConfigGetTunnel = (0, utils_1.newCommand)('tunnel', texts_1.DESC_COMMAND_CONFIG_GET_TUNNEL);
|
|
10
|
+
const commandConfigGetTunnel = (0, utils_1.newCommand)('tunnel', texts_1.DESC_COMMAND_CONFIG_GET_TUNNEL, { examples: texts_1.EXAMPLE_CONFIG_GET_TUNNEL });
|
|
11
11
|
commandConfigGetTunnel.argument('<name>', texts_1.OPTION_NAME);
|
|
12
|
-
commandConfigGetTunnel.
|
|
12
|
+
commandConfigGetTunnel.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
13
|
+
commandConfigGetTunnel.action((name, options) => {
|
|
13
14
|
if (!cfg_1.default.hasTunnel(name)) {
|
|
14
15
|
output_1.default.exitError((0, texts_1.ERR_TUNNEL_NOT_FOUND)(name));
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
if (options.format === 'json') {
|
|
18
|
+
output_1.default.json(cfg_1.default.getTunnel(name));
|
|
19
|
+
}
|
|
20
|
+
else
|
|
21
|
+
output_1.default.configTunnel(cfg_1.default.getTunnel(name));
|
|
17
22
|
output_1.default.exitNormal();
|
|
18
23
|
});
|
|
19
24
|
exports.default = commandConfigGetTunnel;
|
|
@@ -7,9 +7,14 @@ const cfg_1 = __importDefault(require("../../../tunnel/cfg"));
|
|
|
7
7
|
const output_1 = __importDefault(require("../../../output"));
|
|
8
8
|
const texts_1 = require("../../../texts");
|
|
9
9
|
const utils_1 = require("../../../utils");
|
|
10
|
-
const commandConfigGetTunnels = (0, utils_1.newCommand)('tunnels', texts_1.DESC_COMMAND_CONFIG_GET_TUNNELS);
|
|
11
|
-
commandConfigGetTunnels.
|
|
12
|
-
|
|
10
|
+
const commandConfigGetTunnels = (0, utils_1.newCommand)('tunnels', texts_1.DESC_COMMAND_CONFIG_GET_TUNNELS, { examples: texts_1.EXAMPLE_CONFIG_GET_TUNNELS });
|
|
11
|
+
commandConfigGetTunnels.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
12
|
+
commandConfigGetTunnels.action((options) => {
|
|
13
|
+
if (options.format === 'json') {
|
|
14
|
+
output_1.default.json(cfg_1.default.getTunnels());
|
|
15
|
+
}
|
|
16
|
+
else
|
|
17
|
+
output_1.default.configTunnels(cfg_1.default.getTunnels());
|
|
13
18
|
output_1.default.exitNormal();
|
|
14
19
|
});
|
|
15
20
|
exports.default = commandConfigGetTunnels;
|
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const texts_1 = require("../../texts");
|
|
8
8
|
const output_1 = __importDefault(require("../../output"));
|
|
9
|
-
const commandCrawlLink = (0, utils_1.newCommand)('link', texts_1.DESC_COMMAND_CRAWL_LINK
|
|
9
|
+
const commandCrawlLink = (0, utils_1.newCommand)('link', texts_1.DESC_COMMAND_CRAWL_LINK, {
|
|
10
|
+
examples: texts_1.EXAMPLE_CRAWL_LINK,
|
|
11
|
+
});
|
|
10
12
|
commandCrawlLink.option('-w, --workspace <workspace>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
11
13
|
commandCrawlLink.option('-p, --project <project>', texts_1.OPTION_REST_API_PROJECT);
|
|
12
14
|
commandCrawlLink.option('-s, --suite <suite>', texts_1.OPTION_SUITE_IDENTIFIER);
|
|
@@ -58,5 +60,4 @@ commandCrawlLink.action(async (options) => {
|
|
|
58
60
|
output_1.default.okSign();
|
|
59
61
|
output_1.default.exitSuccess(texts_1.TXT_COMMAND_CRAWL_LINK_SUCCESS);
|
|
60
62
|
});
|
|
61
|
-
commandCrawlLink.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_CRAWL_LINK}`);
|
|
62
63
|
exports.default = commandCrawlLink;
|
|
@@ -12,7 +12,9 @@ const promises_1 = require("node:stream/promises");
|
|
|
12
12
|
const node_fs_1 = require("node:fs");
|
|
13
13
|
const node_path_1 = __importDefault(require("node:path"));
|
|
14
14
|
const promises_2 = require("node:fs/promises");
|
|
15
|
-
const commandCrawlRun = (0, utils_1.newCommand)('run', texts_1.DESC_COMMAND_CRAWL_RUN
|
|
15
|
+
const commandCrawlRun = (0, utils_1.newCommand)('run', texts_1.DESC_COMMAND_CRAWL_RUN, {
|
|
16
|
+
examples: texts_1.EXAMPLE_CRAWL_RUN,
|
|
17
|
+
});
|
|
16
18
|
commandCrawlRun.argument('[url]', texts_1.OPTION_CRAWL_URL);
|
|
17
19
|
commandCrawlRun.option('--follow', texts_1.OPTION_CRAWL_FOLLOW, false);
|
|
18
20
|
commandCrawlRun.option('--respectRobots', texts_1.OPTION_COMPARE_RESPECT_ROBOTS, false);
|
|
@@ -144,5 +146,4 @@ async function watchSessionStatus(ctx, buildId) {
|
|
|
144
146
|
});
|
|
145
147
|
});
|
|
146
148
|
}
|
|
147
|
-
commandCrawlRun.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_CRAWL_RUN}`);
|
|
148
149
|
exports.default = commandCrawlRun;
|
|
@@ -7,10 +7,9 @@ const utils_1 = require("../utils");
|
|
|
7
7
|
const texts_1 = require("../texts");
|
|
8
8
|
const run_1 = __importDefault(require("./crawl/run"));
|
|
9
9
|
const link_1 = __importDefault(require("./crawl/link"));
|
|
10
|
-
const commandCrawl = (0, utils_1.newCommand)('crawl', texts_1.DESC_COMMAND_CRAWL
|
|
10
|
+
const commandCrawl = (0, utils_1.newCommand)('crawl', texts_1.DESC_COMMAND_CRAWL, {
|
|
11
|
+
examples: [...texts_1.EXAMPLE_CRAWL_RUN, ...texts_1.EXAMPLE_CRAWL_LINK],
|
|
12
|
+
});
|
|
11
13
|
commandCrawl.addCommand(run_1.default);
|
|
12
14
|
commandCrawl.addCommand(link_1.default);
|
|
13
|
-
commandCrawl.addHelpText('after', `
|
|
14
|
-
EXAMPLES:${texts_1.EXAMPLE_CRAWL_RUN}
|
|
15
|
-
${texts_1.EXAMPLE_CRAWL_LINK}`);
|
|
16
15
|
exports.default = commandCrawl;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const discovery_1 = require("../discovery");
|
|
7
|
+
const output_1 = __importDefault(require("../output"));
|
|
8
|
+
const texts_1 = require("../texts");
|
|
9
|
+
const utils_1 = require("../utils");
|
|
10
|
+
const commandDiscover = (0, utils_1.newCommand)('discover', texts_1.DESC_COMMAND_DISCOVER, {
|
|
11
|
+
requiredScopes: [],
|
|
12
|
+
examples: texts_1.EXAMPLE_DISCOVER,
|
|
13
|
+
helpText: texts_1.HELP_COMMAND_DISCOVER,
|
|
14
|
+
});
|
|
15
|
+
commandDiscover.skipPre = true;
|
|
16
|
+
commandDiscover.showSuggestionAfterError(false);
|
|
17
|
+
commandDiscover.configureOutput({
|
|
18
|
+
outputError: (message) => output_1.default.json({
|
|
19
|
+
error: {
|
|
20
|
+
code: 'usage_error',
|
|
21
|
+
message: message.trim(),
|
|
22
|
+
hint: texts_1.TXT_DISCOVER_USAGE_HINT,
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
commandDiscover.argument('[command...]', texts_1.OPTION_DISCOVER_COMMAND);
|
|
27
|
+
commandDiscover.option('--full', texts_1.OPTION_DISCOVER_FULL);
|
|
28
|
+
commandDiscover.action((path, options, command) => {
|
|
29
|
+
const result = (0, discovery_1.discoverCommands)(command.parent, path, (0, utils_1.getVersion)(), options.full);
|
|
30
|
+
output_1.default.json(result);
|
|
31
|
+
if ('error' in result)
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
});
|
|
34
|
+
exports.default = commandDiscover;
|
|
@@ -8,7 +8,10 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../output"));
|
|
10
10
|
const distro_1 = require("../../types/distro");
|
|
11
|
-
const commandDistroCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_DISTRO_CREATE
|
|
11
|
+
const commandDistroCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_DISTRO_CREATE, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.DISTRIBUTION_WRITE],
|
|
13
|
+
examples: texts_1.EXAMPLE_DISTRO_CREATE,
|
|
14
|
+
});
|
|
12
15
|
commandDistroCreate.alias('add');
|
|
13
16
|
commandDistroCreate.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
17
|
commandDistroCreate.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -17,7 +20,7 @@ commandDistroCreate.option('-i, --identifier <identifier>', texts_1.OPT_COMMAND_
|
|
|
17
20
|
commandDistroCreate.option('-n, --name <name>', texts_1.OPT_COMMAND_DISTRO_NAME);
|
|
18
21
|
commandDistroCreate.option('--note <note>', texts_1.OPT_COMMAND_DISTRO_NOTE);
|
|
19
22
|
commandDistroCreate.option('--agent-note <note>', texts_1.OPT_COMMAND_DISTRO_AGENT_NOTE);
|
|
20
|
-
commandDistroCreate.
|
|
23
|
+
commandDistroCreate.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
21
24
|
commandDistroCreate.action(async (options) => {
|
|
22
25
|
const humanId = require('human-id').default;
|
|
23
26
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
@@ -41,6 +44,10 @@ commandDistroCreate.action(async (options) => {
|
|
|
41
44
|
if (project && scope === distro_1.SCOPE.PROJECT)
|
|
42
45
|
body.project_name = project;
|
|
43
46
|
const result = await client.createDistro(workspace, body);
|
|
47
|
+
if (options.format === 'json') {
|
|
48
|
+
output_1.default.json(result);
|
|
49
|
+
output_1.default.exitNormal();
|
|
50
|
+
}
|
|
44
51
|
output_1.default.identifier(result.identifier);
|
|
45
52
|
output_1.default.cyan(result.html_url);
|
|
46
53
|
output_1.default.green(texts_1.TXT_COMMAND_DISTRO_CREATED);
|
|
@@ -8,14 +8,16 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../output"));
|
|
10
10
|
const distro_1 = require("../../types/distro");
|
|
11
|
-
const commandDistroDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_DISTRO_DELETE
|
|
11
|
+
const commandDistroDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_DISTRO_DELETE, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.DISTRIBUTION_MANAGE],
|
|
13
|
+
examples: texts_1.EXAMPLE_DISTRO_DELETE,
|
|
14
|
+
});
|
|
12
15
|
commandDistroDelete.alias('rm');
|
|
13
16
|
commandDistroDelete.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
17
|
commandDistroDelete.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
15
18
|
commandDistroDelete.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
16
19
|
commandDistroDelete.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
17
20
|
commandDistroDelete.argument('<identifier>', texts_1.OPT_COMMAND_DISTRO_IDENTIFIER);
|
|
18
|
-
commandDistroDelete.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_DISTRO_DELETE}`);
|
|
19
21
|
commandDistroDelete.action(async (identifier, options) => {
|
|
20
22
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
23
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -8,13 +8,15 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../output"));
|
|
10
10
|
const distro_1 = require("../../types/distro");
|
|
11
|
-
const commandDistroGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_DISTRO_GET
|
|
11
|
+
const commandDistroGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_DISTRO_GET, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.DISTRIBUTION_READ],
|
|
13
|
+
examples: texts_1.EXAMPLE_DISTRO_GET,
|
|
14
|
+
});
|
|
12
15
|
commandDistroGet.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
13
16
|
commandDistroGet.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
14
17
|
commandDistroGet.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
15
18
|
commandDistroGet.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
16
19
|
commandDistroGet.argument('<identifier>', texts_1.OPT_COMMAND_DISTRO_IDENTIFIER);
|
|
17
|
-
commandDistroGet.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_DISTRO_GET}`);
|
|
18
20
|
commandDistroGet.action(async (identifier, options) => {
|
|
19
21
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
20
22
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -8,12 +8,14 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../output"));
|
|
10
10
|
const distro_1 = require("../../types/distro");
|
|
11
|
-
const commandDistroList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_DISTRO_LIST
|
|
11
|
+
const commandDistroList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_DISTRO_LIST, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.DISTRIBUTION_READ],
|
|
13
|
+
examples: texts_1.EXAMPLE_DISTRO_LIST,
|
|
14
|
+
});
|
|
12
15
|
commandDistroList.alias('ls');
|
|
13
16
|
commandDistroList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
17
|
commandDistroList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
15
18
|
commandDistroList.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
16
|
-
commandDistroList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_DISTRO_LIST}`);
|
|
17
19
|
commandDistroList.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
18
20
|
commandDistroList.action(async (options) => {
|
|
19
21
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
@@ -8,7 +8,10 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
10
|
const distro_1 = require("../../../types/distro");
|
|
11
|
-
const commandDistroRouteCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_ROUTE_CREATE
|
|
11
|
+
const commandDistroRouteCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_ROUTE_CREATE, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.DISTRIBUTION_WRITE],
|
|
13
|
+
examples: texts_1.EXAMPLE_ROUTE_CREATE,
|
|
14
|
+
});
|
|
12
15
|
commandDistroRouteCreate.alias('add');
|
|
13
16
|
commandDistroRouteCreate.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
17
|
commandDistroRouteCreate.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -21,7 +24,7 @@ commandDistroRouteCreate.option('--note <note>', texts_1.OPT_COMMAND_ROUTE_NOTE)
|
|
|
21
24
|
commandDistroRouteCreate.option('--agent-note <note>', texts_1.OPT_COMMAND_ROUTE_AGENT_NOTE);
|
|
22
25
|
commandDistroRouteCreate.option('--target <targets...>', texts_1.OPT_COMMAND_ROUTE_TARGET);
|
|
23
26
|
commandDistroRouteCreate.argument('<identifier>', texts_1.OPT_COMMAND_DISTRO_IDENTIFIER);
|
|
24
|
-
commandDistroRouteCreate.
|
|
27
|
+
commandDistroRouteCreate.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
25
28
|
commandDistroRouteCreate.action(async (identifier, options) => {
|
|
26
29
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
27
30
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -51,6 +54,10 @@ commandDistroRouteCreate.action(async (identifier, options) => {
|
|
|
51
54
|
}
|
|
52
55
|
body.targets = await input_1.default.routeTarget(client, workspace, scope === distro_1.SCOPE.PROJECT ? project : null, options.target);
|
|
53
56
|
const result = await client.createRoute(workspace, scope === distro_1.SCOPE.PROJECT ? project : null, data.distribution_id, body);
|
|
57
|
+
if (options.format === 'json') {
|
|
58
|
+
output_1.default.json(result);
|
|
59
|
+
output_1.default.exitNormal();
|
|
60
|
+
}
|
|
54
61
|
output_1.default.id(result.id);
|
|
55
62
|
output_1.default.cyan(result.html_url);
|
|
56
63
|
output_1.default.green(texts_1.TXT_COMMAND_ROUTE_CREATED);
|
|
@@ -8,7 +8,10 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
10
|
const distro_1 = require("../../../types/distro");
|
|
11
|
-
const commandDistroRouteDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_ROUTE_DELETE
|
|
11
|
+
const commandDistroRouteDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_ROUTE_DELETE, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.DISTRIBUTION_MANAGE],
|
|
13
|
+
examples: texts_1.EXAMPLE_ROUTE_DELETE,
|
|
14
|
+
});
|
|
12
15
|
commandDistroRouteDelete.alias('rm');
|
|
13
16
|
commandDistroRouteDelete.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
17
|
commandDistroRouteDelete.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -16,7 +19,6 @@ commandDistroRouteDelete.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
|
16
19
|
commandDistroRouteDelete.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
17
20
|
commandDistroRouteDelete.argument('<identifier>', texts_1.OPT_COMMAND_DISTRO_IDENTIFIER);
|
|
18
21
|
commandDistroRouteDelete.argument('<route-id>', texts_1.OPT_COMMAND_ROUTE_ID);
|
|
19
|
-
commandDistroRouteDelete.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_ROUTE_DELETE}`);
|
|
20
22
|
commandDistroRouteDelete.action(async (identifier, routeId, options) => {
|
|
21
23
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
22
24
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -17,14 +17,16 @@ const targetText = (target) => {
|
|
|
17
17
|
}
|
|
18
18
|
return target.external_url || '-';
|
|
19
19
|
};
|
|
20
|
-
const commandDistroRouteGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_ROUTE_GET
|
|
20
|
+
const commandDistroRouteGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_ROUTE_GET, {
|
|
21
|
+
requiredScopes: [utils_1.REST_API_SCOPE.DISTRIBUTION_READ],
|
|
22
|
+
examples: texts_1.EXAMPLE_ROUTE_GET,
|
|
23
|
+
});
|
|
21
24
|
commandDistroRouteGet.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
22
25
|
commandDistroRouteGet.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
23
26
|
commandDistroRouteGet.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
24
27
|
commandDistroRouteGet.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
25
28
|
commandDistroRouteGet.argument('<identifier>', texts_1.OPT_COMMAND_DISTRO_IDENTIFIER);
|
|
26
29
|
commandDistroRouteGet.argument('<route-id>', texts_1.OPT_COMMAND_ROUTE_ID);
|
|
27
|
-
commandDistroRouteGet.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_ROUTE_GET}`);
|
|
28
30
|
commandDistroRouteGet.action(async (identifier, routeId, options) => {
|
|
29
31
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
30
32
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -8,14 +8,16 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
10
|
const distro_1 = require("../../../types/distro");
|
|
11
|
-
const commandDistroRouteList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_ROUTE_LIST
|
|
11
|
+
const commandDistroRouteList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_ROUTE_LIST, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.DISTRIBUTION_READ],
|
|
13
|
+
examples: texts_1.EXAMPLE_ROUTE_LIST,
|
|
14
|
+
});
|
|
12
15
|
commandDistroRouteList.alias('ls');
|
|
13
16
|
commandDistroRouteList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
17
|
commandDistroRouteList.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
15
18
|
commandDistroRouteList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
16
19
|
commandDistroRouteList.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
17
20
|
commandDistroRouteList.argument('<identifier>', texts_1.OPT_COMMAND_DISTRO_IDENTIFIER);
|
|
18
|
-
commandDistroRouteList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_ROUTE_LIST}`);
|
|
19
21
|
commandDistroRouteList.action(async (identifier, options) => {
|
|
20
22
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
23
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -8,7 +8,10 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
10
|
const distro_1 = require("../../../types/distro");
|
|
11
|
-
const commandDistroRouteUpdate = (0, utils_1.newCommand)('update', texts_1.DESC_COMMAND_ROUTE_UPDATE
|
|
11
|
+
const commandDistroRouteUpdate = (0, utils_1.newCommand)('update', texts_1.DESC_COMMAND_ROUTE_UPDATE, {
|
|
12
|
+
requiredScopes: [utils_1.REST_API_SCOPE.DISTRIBUTION_WRITE],
|
|
13
|
+
examples: texts_1.EXAMPLE_ROUTE_UPDATE,
|
|
14
|
+
});
|
|
12
15
|
commandDistroRouteUpdate.alias('edit');
|
|
13
16
|
commandDistroRouteUpdate.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
17
|
commandDistroRouteUpdate.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
|
|
@@ -22,7 +25,7 @@ commandDistroRouteUpdate.option('--agent-note <note>', texts_1.OPT_COMMAND_ROUTE
|
|
|
22
25
|
commandDistroRouteUpdate.option('--target <targets...>', texts_1.OPT_COMMAND_ROUTE_TARGET);
|
|
23
26
|
commandDistroRouteUpdate.argument('<identifier>', texts_1.OPT_COMMAND_DISTRO_IDENTIFIER);
|
|
24
27
|
commandDistroRouteUpdate.argument('<route-id>', texts_1.OPT_COMMAND_ROUTE_ID);
|
|
25
|
-
commandDistroRouteUpdate.
|
|
28
|
+
commandDistroRouteUpdate.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
26
29
|
commandDistroRouteUpdate.action(async (identifier, routeId, options) => {
|
|
27
30
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
28
31
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -80,6 +83,10 @@ commandDistroRouteUpdate.action(async (identifier, routeId, options) => {
|
|
|
80
83
|
output_1.default.exitError(texts_1.ERR_COMMAND_NO_UPDATE);
|
|
81
84
|
}
|
|
82
85
|
const result = await client.updateRoute(workspace, scope === distro_1.SCOPE.PROJECT ? project : null, data.distribution_id, routeId, body);
|
|
86
|
+
if (options.format === 'json') {
|
|
87
|
+
output_1.default.json(result);
|
|
88
|
+
output_1.default.exitNormal();
|
|
89
|
+
}
|
|
83
90
|
output_1.default.id(result.id);
|
|
84
91
|
output_1.default.cyan(result.html_url);
|
|
85
92
|
output_1.default.green(texts_1.TXT_COMMAND_ROUTE_UPDATED);
|