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
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
exports.finishExec = finishExec;
|
|
7
|
+
const output_1 = __importDefault(require("../../output"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
const texts_1 = require("../../texts");
|
|
10
|
+
async function finishExec(client, workspace, sandboxId, identifier, commandId, follow, jsonl) {
|
|
11
|
+
const body = await client.streamSandboxCommandLogs(workspace, sandboxId, commandId, follow);
|
|
12
|
+
await output_1.default.streamCommandLogs(body, jsonl);
|
|
13
|
+
const cmdExit = await client.getSandboxCommand(workspace, sandboxId, commandId);
|
|
14
|
+
if (jsonl) {
|
|
15
|
+
output_1.default.json({
|
|
16
|
+
type: 'exit',
|
|
17
|
+
status: cmdExit.status,
|
|
18
|
+
exit_code: cmdExit.exit_code ?? null,
|
|
19
|
+
});
|
|
20
|
+
if ([utils_1.SANDBOX_EXEC_STATUS.SUCCESSFUL, utils_1.SANDBOX_EXEC_STATUS.INPROGRESS].includes(cmdExit.status)) {
|
|
21
|
+
output_1.default.exitNormal();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (cmdExit.status === utils_1.SANDBOX_EXEC_STATUS.SUCCESSFUL) {
|
|
25
|
+
output_1.default.exitSuccess((0, texts_1.TXT_SANDBOX_EXEC_SUCCESS)(identifier, commandId));
|
|
26
|
+
}
|
|
27
|
+
else if (cmdExit.status === utils_1.SANDBOX_EXEC_STATUS.INPROGRESS) {
|
|
28
|
+
output_1.default.exitNormal((0, texts_1.TXT_SANDBOX_EXEC_INPROGRESS)(identifier, commandId));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
output_1.default.exitError((0, texts_1.TXT_SANDBOX_EXEC_FAILED)(identifier, commandId));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -7,15 +7,28 @@ const utils_1 = require("../../utils");
|
|
|
7
7
|
const texts_1 = require("../../texts");
|
|
8
8
|
const input_1 = __importDefault(require("../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../output"));
|
|
10
|
-
const commandSandboxLogs = (0, utils_1.newCommand)('logs', texts_1.DESC_COMMAND_SANDBOX_LOGS);
|
|
10
|
+
const commandSandboxLogs = (0, utils_1.newCommand)('logs', texts_1.DESC_COMMAND_SANDBOX_LOGS, { examples: texts_1.EXAMPLE_SANDBOX_LOGS });
|
|
11
11
|
commandSandboxLogs.hideVersionUpdate = true;
|
|
12
12
|
(0, utils_1.sandboxScopeOptions)(commandSandboxLogs);
|
|
13
13
|
commandSandboxLogs.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
14
|
+
commandSandboxLogs.option('--format <text|jsonl>', texts_1.OPTION_FORMAT_JSONL);
|
|
14
15
|
commandSandboxLogs.action(async (identifier, options) => {
|
|
15
16
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
16
17
|
const client = input_1.default.restApiTokenClient();
|
|
17
18
|
const sandboxId = await input_1.default.sandboxId(client, workspace, options, identifier);
|
|
18
19
|
const { boot_logs } = await client.getSandbox(workspace, sandboxId);
|
|
20
|
+
if (options.format === 'jsonl') {
|
|
21
|
+
for (const log of boot_logs || []) {
|
|
22
|
+
output_1.default.json(typeof log === 'string'
|
|
23
|
+
? { type: 'log', data: log }
|
|
24
|
+
: {
|
|
25
|
+
type: 'log',
|
|
26
|
+
data: log.data ?? JSON.stringify(log),
|
|
27
|
+
...(log.source ? { source: log.source } : {}),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
output_1.default.exitNormal();
|
|
31
|
+
}
|
|
19
32
|
output_1.default.exitNormal((boot_logs || []).join('\n'));
|
|
20
33
|
});
|
|
21
34
|
exports.default = commandSandboxLogs;
|
|
@@ -7,13 +7,13 @@ const utils_1 = require("../../../utils");
|
|
|
7
7
|
const texts_1 = require("../../../texts");
|
|
8
8
|
const output_1 = __importDefault(require("../../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../../input"));
|
|
10
|
-
const commandSandboxSnapshotCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT_CREATE);
|
|
10
|
+
const commandSandboxSnapshotCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT_CREATE, { examples: texts_1.EXAMPLE_SANDBOX_SNAPSHOT_CREATE });
|
|
11
11
|
commandSandboxSnapshotCreate.alias('add');
|
|
12
12
|
(0, utils_1.sandboxScopeOptions)(commandSandboxSnapshotCreate);
|
|
13
13
|
commandSandboxSnapshotCreate.option('-n, --name <name>', texts_1.OPTION_SANDBOX_SNAPSHOT_NAME);
|
|
14
14
|
commandSandboxSnapshotCreate.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
15
15
|
commandSandboxSnapshotCreate.option('--wait [seconds]', texts_1.OPTION_SANDBOX_WAIT);
|
|
16
|
-
commandSandboxSnapshotCreate.
|
|
16
|
+
commandSandboxSnapshotCreate.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
17
17
|
commandSandboxSnapshotCreate.action(async (identifier, options) => {
|
|
18
18
|
const humanId = require('human-id').default;
|
|
19
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
@@ -27,7 +27,8 @@ commandSandboxSnapshotCreate.action(async (identifier, options) => {
|
|
|
27
27
|
const snapshot = await client.createSandboxSnapshot(workspace, sandboxId, body);
|
|
28
28
|
const snapshotId = snapshot.id;
|
|
29
29
|
if (options.wait) {
|
|
30
|
-
|
|
30
|
+
if (options.format !== 'json')
|
|
31
|
+
output_1.default.normal(texts_1.TXT_SANDBOX_SNAPSHOT_WAITING);
|
|
31
32
|
const timeout = parseInt(options.wait, 10) || 300;
|
|
32
33
|
try {
|
|
33
34
|
const status = await client.sandboxWaitForSnapshot(workspace, sandboxId, snapshotId, timeout);
|
|
@@ -39,6 +40,12 @@ commandSandboxSnapshotCreate.action(async (identifier, options) => {
|
|
|
39
40
|
output_1.default.exitError(texts_1.ERR_SANDBOX_SNAPSHOT_TIMEOUT);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
43
|
+
if (options.format === 'json') {
|
|
44
|
+
output_1.default.json(options.wait
|
|
45
|
+
? await client.getSandboxSnapshot(workspace, sandboxId, snapshotId)
|
|
46
|
+
: snapshot);
|
|
47
|
+
output_1.default.exitNormal();
|
|
48
|
+
}
|
|
42
49
|
output_1.default.exitSuccess((0, texts_1.TXT_SANDBOX_SNAPSHOT_CREATED)(snapshotName));
|
|
43
50
|
});
|
|
44
51
|
exports.default = commandSandboxSnapshotCreate;
|
|
@@ -7,13 +7,12 @@ const utils_1 = require("../../../utils");
|
|
|
7
7
|
const texts_1 = require("../../../texts");
|
|
8
8
|
const output_1 = __importDefault(require("../../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../../input"));
|
|
10
|
-
const commandSandboxSnapshotDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT_DELETE);
|
|
10
|
+
const commandSandboxSnapshotDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT_DELETE, { examples: texts_1.EXAMPLE_SANDBOX_SNAPSHOT_DELETE });
|
|
11
11
|
commandSandboxSnapshotDelete.alias('rm');
|
|
12
12
|
(0, utils_1.sandboxScopeOptions)(commandSandboxSnapshotDelete);
|
|
13
13
|
commandSandboxSnapshotDelete.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
14
14
|
commandSandboxSnapshotDelete.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
15
15
|
commandSandboxSnapshotDelete.argument('<snapshot-name>', texts_1.OPTION_SANDBOX_SNAPSHOT_NAME_ARG);
|
|
16
|
-
commandSandboxSnapshotDelete.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_DELETE}`);
|
|
17
16
|
commandSandboxSnapshotDelete.action(async (identifier, snapshotName, options) => {
|
|
18
17
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
19
18
|
const client = input_1.default.restApiTokenClient();
|
|
@@ -7,12 +7,11 @@ const utils_1 = require("../../../utils");
|
|
|
7
7
|
const texts_1 = require("../../../texts");
|
|
8
8
|
const output_1 = __importDefault(require("../../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../../input"));
|
|
10
|
-
const commandSandboxSnapshotGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT_GET);
|
|
10
|
+
const commandSandboxSnapshotGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT_GET, { examples: texts_1.EXAMPLE_SANDBOX_SNAPSHOT_GET });
|
|
11
11
|
(0, utils_1.sandboxScopeOptions)(commandSandboxSnapshotGet);
|
|
12
12
|
commandSandboxSnapshotGet.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
13
13
|
commandSandboxSnapshotGet.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
14
14
|
commandSandboxSnapshotGet.argument('<snapshot-name>', texts_1.OPTION_SANDBOX_SNAPSHOT_NAME_ARG);
|
|
15
|
-
commandSandboxSnapshotGet.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_GET}`);
|
|
16
15
|
commandSandboxSnapshotGet.action(async (identifier, snapshotName, options) => {
|
|
17
16
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
18
17
|
const client = input_1.default.restApiTokenClient();
|
|
@@ -7,12 +7,11 @@ const utils_1 = require("../../../utils");
|
|
|
7
7
|
const texts_1 = require("../../../texts");
|
|
8
8
|
const output_1 = __importDefault(require("../../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../../input"));
|
|
10
|
-
const commandSandboxSnapshotList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT_LIST);
|
|
10
|
+
const commandSandboxSnapshotList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT_LIST, { examples: texts_1.EXAMPLE_SANDBOX_SNAPSHOT_LIST });
|
|
11
11
|
commandSandboxSnapshotList.alias('ls');
|
|
12
12
|
(0, utils_1.sandboxScopeOptions)(commandSandboxSnapshotList);
|
|
13
13
|
commandSandboxSnapshotList.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
14
14
|
commandSandboxSnapshotList.argument('[identifier]', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
15
|
-
commandSandboxSnapshotList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_LIST}`);
|
|
16
15
|
commandSandboxSnapshotList.action(async (identifier, options) => {
|
|
17
16
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
18
17
|
const client = input_1.default.restApiTokenClient();
|
|
@@ -9,14 +9,17 @@ const list_1 = __importDefault(require("./snapshot/list"));
|
|
|
9
9
|
const create_1 = __importDefault(require("./snapshot/create"));
|
|
10
10
|
const get_1 = __importDefault(require("./snapshot/get"));
|
|
11
11
|
const delete_1 = __importDefault(require("./snapshot/delete"));
|
|
12
|
-
const commandSandboxSnapshot = (0, utils_1.newCommand)('snapshot', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT
|
|
12
|
+
const commandSandboxSnapshot = (0, utils_1.newCommand)('snapshot', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT, {
|
|
13
|
+
examples: [
|
|
14
|
+
...texts_1.EXAMPLE_SANDBOX_SNAPSHOT_CREATE,
|
|
15
|
+
...texts_1.EXAMPLE_SANDBOX_SNAPSHOT_DELETE,
|
|
16
|
+
...texts_1.EXAMPLE_SANDBOX_SNAPSHOT_GET,
|
|
17
|
+
...texts_1.EXAMPLE_SANDBOX_SNAPSHOT_LIST,
|
|
18
|
+
],
|
|
19
|
+
});
|
|
13
20
|
commandSandboxSnapshot.alias('snap');
|
|
14
21
|
commandSandboxSnapshot.addCommand(list_1.default);
|
|
15
22
|
commandSandboxSnapshot.addCommand(create_1.default);
|
|
16
23
|
commandSandboxSnapshot.addCommand(get_1.default);
|
|
17
24
|
commandSandboxSnapshot.addCommand(delete_1.default);
|
|
18
|
-
commandSandboxSnapshot.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_CREATE}
|
|
19
|
-
${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_DELETE}
|
|
20
|
-
${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_GET}
|
|
21
|
-
${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_LIST}`);
|
|
22
25
|
exports.default = commandSandboxSnapshot;
|
|
@@ -8,14 +8,15 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../input"));
|
|
10
10
|
const path_1 = require("path");
|
|
11
|
-
const commandSandboxSsh = (0, utils_1.newCommand)('ssh', texts_1.DESC_COMMAND_SANDBOX_SSH
|
|
11
|
+
const commandSandboxSsh = (0, utils_1.newCommand)('ssh', texts_1.DESC_COMMAND_SANDBOX_SSH, {
|
|
12
|
+
examples: texts_1.EXAMPLE_SANDBOX_SSH,
|
|
13
|
+
});
|
|
12
14
|
commandSandboxSsh.alias('connect');
|
|
13
15
|
(0, utils_1.sandboxScopeOptions)(commandSandboxSsh);
|
|
14
16
|
commandSandboxSsh.option('-i, --identity <path>', texts_1.OPTION_SANDBOX_SSH_IDENTITY);
|
|
15
17
|
commandSandboxSsh.option('--print', texts_1.OPTION_SANDBOX_SSH_PRINT);
|
|
16
18
|
commandSandboxSsh.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
19
|
commandSandboxSsh.argument('[args...]', texts_1.OPTION_SANDBOX_SSH_ARGS);
|
|
18
|
-
commandSandboxSsh.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_SSH}`);
|
|
19
20
|
// ssh keeps the FIRST value it is given for a keyword, so every default below would silently beat
|
|
20
21
|
// the same -o coming from the user. Only add ours when they did not set that keyword themselves.
|
|
21
22
|
const hasSshOption = (args, keyword) => {
|
|
@@ -8,7 +8,9 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../input"));
|
|
10
10
|
const scope_1 = require("./scope");
|
|
11
|
-
const commandTargetCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_TARGET_CREATE
|
|
11
|
+
const commandTargetCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_TARGET_CREATE, {
|
|
12
|
+
examples: texts_1.EXAMPLE_TARGET_CREATE,
|
|
13
|
+
});
|
|
12
14
|
commandTargetCreate.alias('add');
|
|
13
15
|
commandTargetCreate.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
16
|
commandTargetCreate.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -16,7 +18,7 @@ commandTargetCreate.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPE
|
|
|
16
18
|
commandTargetCreate.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
|
|
17
19
|
commandTargetCreate.option('--scope <scope>', texts_1.OPT_COMMAND_TARGET_SCOPE);
|
|
18
20
|
commandTargetCreate.option('--yaml <content|@path>', texts_1.OPTION_TARGET_YAML);
|
|
19
|
-
commandTargetCreate.
|
|
21
|
+
commandTargetCreate.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
20
22
|
commandTargetCreate.action(async (options) => {
|
|
21
23
|
const yaml = input_1.default.restApiYaml(options.yaml);
|
|
22
24
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
@@ -28,6 +30,10 @@ commandTargetCreate.action(async (options) => {
|
|
|
28
30
|
yaml: Buffer.from(yaml, 'utf8').toString('base64'),
|
|
29
31
|
};
|
|
30
32
|
const result = await client.createTargetByYaml(workspace, scopeParams, body);
|
|
33
|
+
if (options.format === 'json') {
|
|
34
|
+
output_1.default.json(result);
|
|
35
|
+
output_1.default.exitNormal();
|
|
36
|
+
}
|
|
31
37
|
output_1.default.exitSuccess((0, texts_1.TXT_TARGET_CREATED)(result.identifier, result.html_url));
|
|
32
38
|
});
|
|
33
39
|
exports.default = commandTargetCreate;
|
|
@@ -8,7 +8,9 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../input"));
|
|
10
10
|
const scope_1 = require("./scope");
|
|
11
|
-
const commandTargetDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_TARGET_DELETE
|
|
11
|
+
const commandTargetDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_TARGET_DELETE, {
|
|
12
|
+
examples: texts_1.EXAMPLE_TARGET_DELETE,
|
|
13
|
+
});
|
|
12
14
|
commandTargetDelete.alias('rm');
|
|
13
15
|
commandTargetDelete.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
16
|
commandTargetDelete.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -16,7 +18,6 @@ commandTargetDelete.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPE
|
|
|
16
18
|
commandTargetDelete.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
|
|
17
19
|
commandTargetDelete.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
18
20
|
commandTargetDelete.argument('<identifier>', texts_1.OPTION_TARGET_IDENTIFIER);
|
|
19
|
-
commandTargetDelete.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_DELETE}`);
|
|
20
21
|
commandTargetDelete.action(async (identifier, options) => {
|
|
21
22
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
22
23
|
const client = input_1.default.restApiTokenClient();
|
|
@@ -10,7 +10,7 @@ const output_1 = __importDefault(require("../../../output"));
|
|
|
10
10
|
const input_1 = __importDefault(require("../../../input"));
|
|
11
11
|
const scope_1 = require("../scope");
|
|
12
12
|
const EXEC_WAIT_MS = 10000;
|
|
13
|
-
const commandTargetExecCommand = (0, utils_1.newCommand)('command', texts_1.
|
|
13
|
+
const commandTargetExecCommand = (0, utils_1.newCommand)('command', texts_1.DESC_COMMAND_TARGET_EXEC_COMMAND, { examples: texts_1.EXAMPLE_TARGET_EXEC_COMMAND });
|
|
14
14
|
commandTargetExecCommand.alias('cmd');
|
|
15
15
|
commandTargetExecCommand.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
16
16
|
commandTargetExecCommand.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -21,7 +21,6 @@ commandTargetExecCommand.option('--file <path>', texts_1.OPTION_TARGET_EXEC_FILE
|
|
|
21
21
|
commandTargetExecCommand.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
22
22
|
commandTargetExecCommand.argument('<identifier>', texts_1.OPTION_TARGET_IDENTIFIER);
|
|
23
23
|
commandTargetExecCommand.argument('[command]', texts_1.OPTION_TARGET_EXEC_COMMAND);
|
|
24
|
-
commandTargetExecCommand.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_COMMAND}`);
|
|
25
24
|
commandTargetExecCommand.action(async (identifier, command, options) => {
|
|
26
25
|
output_1.default.handleSignals();
|
|
27
26
|
if (options.file && command !== undefined) {
|
|
@@ -7,11 +7,10 @@ const utils_1 = require("../../../utils");
|
|
|
7
7
|
const texts_1 = require("../../../texts");
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
|
-
const commandTargetExecKill = (0, utils_1.newCommand)('kill', texts_1.DESC_COMMAND_TARGET_EXEC_KILL);
|
|
10
|
+
const commandTargetExecKill = (0, utils_1.newCommand)('kill', texts_1.DESC_COMMAND_TARGET_EXEC_KILL, { examples: texts_1.EXAMPLE_TARGET_EXEC_KILL });
|
|
11
11
|
commandTargetExecKill.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
12
12
|
commandTargetExecKill.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
13
13
|
commandTargetExecKill.argument('<exec-id>', texts_1.OPTION_TARGET_EXEC_ID);
|
|
14
|
-
commandTargetExecKill.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_KILL}`);
|
|
15
14
|
commandTargetExecKill.action(async (execId, options) => {
|
|
16
15
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
17
16
|
const client = input_1.default.restApiTokenClient();
|
|
@@ -8,7 +8,7 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
10
|
const scope_1 = require("../scope");
|
|
11
|
-
const commandTargetExecList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_TARGET_EXEC_LIST);
|
|
11
|
+
const commandTargetExecList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_TARGET_EXEC_LIST, { examples: texts_1.EXAMPLE_TARGET_EXEC_LIST });
|
|
12
12
|
commandTargetExecList.alias('ls');
|
|
13
13
|
commandTargetExecList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
14
|
commandTargetExecList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -17,7 +17,6 @@ commandTargetExecList.option('--environment <identifier>', texts_1.OPTION_TARGET
|
|
|
17
17
|
commandTargetExecList.option('--limit <n>', texts_1.OPTION_TARGET_EXEC_LIMIT);
|
|
18
18
|
commandTargetExecList.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
19
19
|
commandTargetExecList.argument('<identifier>', texts_1.OPTION_TARGET_IDENTIFIER);
|
|
20
|
-
commandTargetExecList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_LIST}`);
|
|
21
20
|
commandTargetExecList.action(async (identifier, options) => {
|
|
22
21
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
23
22
|
const client = input_1.default.restApiTokenClient();
|
|
@@ -8,20 +8,32 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
10
|
const scope_1 = require("../scope");
|
|
11
|
-
const commandTargetExecLogs = (0, utils_1.newCommand)('logs', texts_1.DESC_COMMAND_TARGET_EXEC_LOGS);
|
|
11
|
+
const commandTargetExecLogs = (0, utils_1.newCommand)('logs', texts_1.DESC_COMMAND_TARGET_EXEC_LOGS, { helpText: texts_1.HELP_TARGET_EXEC_LOGS_JSONL, examples: texts_1.EXAMPLE_TARGET_EXEC_LOGS });
|
|
12
12
|
commandTargetExecLogs.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
13
13
|
commandTargetExecLogs.option('--offset <n>', texts_1.OPTION_TARGET_EXEC_LOG_OFFSET);
|
|
14
14
|
commandTargetExecLogs.option('--limit <n>', texts_1.OPTION_TARGET_EXEC_LOG_LIMIT);
|
|
15
15
|
commandTargetExecLogs.argument('<exec-id>', texts_1.OPTION_TARGET_EXEC_ID);
|
|
16
|
-
commandTargetExecLogs.
|
|
16
|
+
commandTargetExecLogs.option('--format <text|jsonl>', texts_1.OPTION_FORMAT_JSONL);
|
|
17
17
|
commandTargetExecLogs.action(async (execId, options) => {
|
|
18
18
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
19
19
|
const client = input_1.default.restApiTokenClient();
|
|
20
20
|
const offset = options.offset ? parseInt(options.offset, 10) : 0;
|
|
21
21
|
const limit = options.limit ? parseInt(options.limit, 10) : undefined;
|
|
22
|
-
const { truncated } = await (0, scope_1.forwardExecLog)(client, workspace, execId, offset,
|
|
22
|
+
const { truncated } = await (0, scope_1.forwardExecLog)(client, workspace, execId, offset, options.format === 'jsonl'
|
|
23
|
+
? (lines) => lines.forEach((data) => output_1.default.json({ type: 'log', data }))
|
|
24
|
+
: undefined, limit);
|
|
23
25
|
if (truncated)
|
|
24
26
|
output_1.default.noteWarning(texts_1.WARN_TARGET_EXEC_TRUNCATED);
|
|
27
|
+
if (options.format === 'jsonl') {
|
|
28
|
+
const exec = await client.getTargetExec(workspace, execId);
|
|
29
|
+
output_1.default.json({
|
|
30
|
+
type: 'exit',
|
|
31
|
+
status: exec.status,
|
|
32
|
+
exit_code: exec.exit_code ?? null,
|
|
33
|
+
truncated,
|
|
34
|
+
});
|
|
35
|
+
output_1.default.exitNormal();
|
|
36
|
+
}
|
|
25
37
|
output_1.default.exitNormal();
|
|
26
38
|
});
|
|
27
39
|
exports.default = commandTargetExecLogs;
|
|
@@ -7,11 +7,10 @@ const utils_1 = require("../../../utils");
|
|
|
7
7
|
const texts_1 = require("../../../texts");
|
|
8
8
|
const input_1 = __importDefault(require("../../../input"));
|
|
9
9
|
const output_1 = __importDefault(require("../../../output"));
|
|
10
|
-
const commandTargetExecStatus = (0, utils_1.newCommand)('status', texts_1.DESC_COMMAND_TARGET_EXEC_STATUS);
|
|
10
|
+
const commandTargetExecStatus = (0, utils_1.newCommand)('status', texts_1.DESC_COMMAND_TARGET_EXEC_STATUS, { examples: texts_1.EXAMPLE_TARGET_EXEC_STATUS });
|
|
11
11
|
commandTargetExecStatus.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
12
12
|
commandTargetExecStatus.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
13
13
|
commandTargetExecStatus.argument('<exec-id>', texts_1.OPTION_TARGET_EXEC_ID);
|
|
14
|
-
commandTargetExecStatus.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_STATUS}`);
|
|
15
14
|
commandTargetExecStatus.action(async (execId, options) => {
|
|
16
15
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
17
16
|
const client = input_1.default.restApiTokenClient();
|
|
@@ -10,15 +10,18 @@ const status_1 = __importDefault(require("./exec/status"));
|
|
|
10
10
|
const kill_1 = __importDefault(require("./exec/kill"));
|
|
11
11
|
const list_1 = __importDefault(require("./exec/list"));
|
|
12
12
|
const logs_1 = __importDefault(require("./exec/logs"));
|
|
13
|
-
const commandTargetExec = (0, utils_1.newCommand)('exec', texts_1.DESC_COMMAND_TARGET_EXEC
|
|
13
|
+
const commandTargetExec = (0, utils_1.newCommand)('exec', texts_1.DESC_COMMAND_TARGET_EXEC, {
|
|
14
|
+
examples: [
|
|
15
|
+
...texts_1.EXAMPLE_TARGET_EXEC_COMMAND,
|
|
16
|
+
...texts_1.EXAMPLE_TARGET_EXEC_KILL,
|
|
17
|
+
...texts_1.EXAMPLE_TARGET_EXEC_LIST,
|
|
18
|
+
...texts_1.EXAMPLE_TARGET_EXEC_LOGS,
|
|
19
|
+
...texts_1.EXAMPLE_TARGET_EXEC_STATUS,
|
|
20
|
+
],
|
|
21
|
+
});
|
|
14
22
|
commandTargetExec.addCommand(command_1.default);
|
|
15
23
|
commandTargetExec.addCommand(status_1.default);
|
|
16
24
|
commandTargetExec.addCommand(kill_1.default);
|
|
17
25
|
commandTargetExec.addCommand(list_1.default);
|
|
18
26
|
commandTargetExec.addCommand(logs_1.default);
|
|
19
|
-
commandTargetExec.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_COMMAND}
|
|
20
|
-
${texts_1.EXAMPLE_TARGET_EXEC_KILL}
|
|
21
|
-
${texts_1.EXAMPLE_TARGET_EXEC_LIST}
|
|
22
|
-
${texts_1.EXAMPLE_TARGET_EXEC_LOGS}
|
|
23
|
-
${texts_1.EXAMPLE_TARGET_EXEC_STATUS}`);
|
|
24
27
|
exports.default = commandTargetExec;
|
|
@@ -8,14 +8,15 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../input"));
|
|
10
10
|
const scope_1 = require("./scope");
|
|
11
|
-
const commandTargetGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_TARGET_GET
|
|
11
|
+
const commandTargetGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_TARGET_GET, {
|
|
12
|
+
examples: texts_1.EXAMPLE_TARGET_GET,
|
|
13
|
+
});
|
|
12
14
|
commandTargetGet.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
13
15
|
commandTargetGet.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
14
16
|
commandTargetGet.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPELINE);
|
|
15
17
|
commandTargetGet.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
|
|
16
18
|
commandTargetGet.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
17
19
|
commandTargetGet.argument('<identifier>', texts_1.OPTION_TARGET_IDENTIFIER);
|
|
18
|
-
commandTargetGet.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_GET}`);
|
|
19
20
|
commandTargetGet.action(async (identifier, options) => {
|
|
20
21
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
22
|
const client = input_1.default.restApiTokenClient();
|
|
@@ -8,7 +8,9 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../input"));
|
|
10
10
|
const scope_1 = require("./scope");
|
|
11
|
-
const commandTargetList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_TARGET_LIST
|
|
11
|
+
const commandTargetList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_TARGET_LIST, {
|
|
12
|
+
examples: texts_1.EXAMPLE_TARGET_LIST,
|
|
13
|
+
});
|
|
12
14
|
commandTargetList.alias('ls');
|
|
13
15
|
commandTargetList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
16
|
commandTargetList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -16,7 +18,6 @@ commandTargetList.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPELI
|
|
|
16
18
|
commandTargetList.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
|
|
17
19
|
commandTargetList.option('--scope <scope>', texts_1.OPT_COMMAND_TARGET_SCOPE);
|
|
18
20
|
commandTargetList.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
19
|
-
commandTargetList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_LIST}`);
|
|
20
21
|
commandTargetList.action(async (options) => {
|
|
21
22
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
22
23
|
const project = input_1.default.restApiProject(options.project, true);
|
|
@@ -8,7 +8,9 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../input"));
|
|
10
10
|
const scope_1 = require("./scope");
|
|
11
|
-
const commandTargetUpdate = (0, utils_1.newCommand)('update', texts_1.DESC_COMMAND_TARGET_UPDATE
|
|
11
|
+
const commandTargetUpdate = (0, utils_1.newCommand)('update', texts_1.DESC_COMMAND_TARGET_UPDATE, {
|
|
12
|
+
examples: texts_1.EXAMPLE_TARGET_UPDATE,
|
|
13
|
+
});
|
|
12
14
|
commandTargetUpdate.alias('edit');
|
|
13
15
|
commandTargetUpdate.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
16
|
commandTargetUpdate.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
@@ -16,7 +18,7 @@ commandTargetUpdate.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPE
|
|
|
16
18
|
commandTargetUpdate.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
|
|
17
19
|
commandTargetUpdate.option('--yaml <content|@path>', texts_1.OPTION_TARGET_YAML);
|
|
18
20
|
commandTargetUpdate.argument('<identifier>', texts_1.OPTION_TARGET_IDENTIFIER);
|
|
19
|
-
commandTargetUpdate.
|
|
21
|
+
commandTargetUpdate.option('--format <text|json>', texts_1.OPTION_FORMAT);
|
|
20
22
|
commandTargetUpdate.action(async (identifier, options) => {
|
|
21
23
|
const yaml = input_1.default.restApiYaml(options.yaml);
|
|
22
24
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
@@ -27,6 +29,10 @@ commandTargetUpdate.action(async (identifier, options) => {
|
|
|
27
29
|
yaml: Buffer.from(yaml, 'utf8').toString('base64'),
|
|
28
30
|
};
|
|
29
31
|
const result = await client.updateTargetByYaml(workspace, target_id, body);
|
|
32
|
+
if (options.format === 'json') {
|
|
33
|
+
output_1.default.json(result);
|
|
34
|
+
output_1.default.exitNormal();
|
|
35
|
+
}
|
|
30
36
|
output_1.default.exitSuccess((0, texts_1.TXT_TARGET_UPDATED)(result.identifier, result.html_url));
|
|
31
37
|
});
|
|
32
38
|
exports.default = commandTargetUpdate;
|
|
@@ -7,7 +7,9 @@ const utils_1 = require("../../utils");
|
|
|
7
7
|
const texts_1 = require("../../texts");
|
|
8
8
|
const output_1 = __importDefault(require("../../output"));
|
|
9
9
|
const node_fs_1 = require("node:fs");
|
|
10
|
-
const commandCapture = (0, utils_1.newCommand)('capture', texts_1.DESC_COMMAND_CAPTURE
|
|
10
|
+
const commandCapture = (0, utils_1.newCommand)('capture', texts_1.DESC_COMMAND_CAPTURE, {
|
|
11
|
+
examples: texts_1.EXAMPLE_TESTS_CAPTURE,
|
|
12
|
+
});
|
|
11
13
|
commandCapture.option('--urls <urls>', texts_1.OPTION_COMPARE_URLS);
|
|
12
14
|
commandCapture.option('--sitemap <sitemap>', texts_1.OPTION_COMPARE_SITEMAP);
|
|
13
15
|
commandCapture.option('--urlsFile <urlsFile>', texts_1.OPTION_COMPARE_URLS_FILE);
|
|
@@ -100,5 +102,4 @@ function filterDuplicates(urls) {
|
|
|
100
102
|
duplicates: Array.from(duplicates),
|
|
101
103
|
};
|
|
102
104
|
}
|
|
103
|
-
commandCapture.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TESTS_CAPTURE}`);
|
|
104
105
|
exports.default = commandCapture;
|
|
@@ -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 commandUtLink = (0, utils_1.newCommand)('link', texts_1.DESC_COMMAND_UT_LINK
|
|
9
|
+
const commandUtLink = (0, utils_1.newCommand)('link', texts_1.DESC_COMMAND_UT_LINK, {
|
|
10
|
+
examples: texts_1.EXAMPLE_TESTS_UNIT_LINK,
|
|
11
|
+
});
|
|
10
12
|
commandUtLink.option('-w, --workspace <workspace>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
11
13
|
commandUtLink.option('-p, --project <project>', texts_1.OPTION_REST_API_PROJECT);
|
|
12
14
|
commandUtLink.option('-s, --suite <suite>', texts_1.OPTION_SUITE_IDENTIFIER);
|
|
@@ -58,5 +60,4 @@ commandUtLink.action(async (options) => {
|
|
|
58
60
|
output_1.default.okSign();
|
|
59
61
|
output_1.default.exitSuccess(texts_1.TXT_COMMAND_UT_LINK_SUCCESS);
|
|
60
62
|
});
|
|
61
|
-
commandUtLink.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TESTS_UNIT_LINK}`);
|
|
62
63
|
exports.default = commandUtLink;
|
|
@@ -8,7 +8,9 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../../output"));
|
|
9
9
|
const commander_1 = require("commander");
|
|
10
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
-
const commandUtUpload = (0, utils_1.newCommand)('upload', texts_1.DESC_COMMAND_UT_UPLOAD
|
|
11
|
+
const commandUtUpload = (0, utils_1.newCommand)('upload', texts_1.DESC_COMMAND_UT_UPLOAD, {
|
|
12
|
+
examples: texts_1.EXAMPLE_TESTS_UNIT_UPLOAD,
|
|
13
|
+
});
|
|
12
14
|
commandUtUpload.argument('<glob>', texts_1.OPTION_UPLOAD_REPORT_GLOB);
|
|
13
15
|
commandUtUpload.addOption(new commander_1.Option('--format <format>', texts_1.OPTION_UPLOAD_REPORT_FORMAT)
|
|
14
16
|
.choices(['junit-xml'])
|
|
@@ -42,7 +44,6 @@ commandUtUpload.action(async (input, options) => {
|
|
|
42
44
|
await sendUploadRequest(ctx, files);
|
|
43
45
|
output_1.default.exitSuccess('Upload completed');
|
|
44
46
|
});
|
|
45
|
-
commandUtUpload.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TESTS_UNIT_UPLOAD}`);
|
|
46
47
|
exports.default = commandUtUpload;
|
|
47
48
|
function validateInputAndOptions(input, options) {
|
|
48
49
|
const z = require('zod');
|
|
@@ -7,10 +7,9 @@ const utils_1 = require("../../utils");
|
|
|
7
7
|
const texts_1 = require("../../texts");
|
|
8
8
|
const upload_1 = __importDefault(require("./unit/upload"));
|
|
9
9
|
const link_1 = __importDefault(require("./unit/link"));
|
|
10
|
-
const commandUnit = (0, utils_1.newCommand)('unit', texts_1.DESC_COMMAND_UNIT
|
|
10
|
+
const commandUnit = (0, utils_1.newCommand)('unit', texts_1.DESC_COMMAND_UNIT, {
|
|
11
|
+
examples: [...texts_1.EXAMPLE_TESTS_UNIT_UPLOAD, ...texts_1.EXAMPLE_TESTS_UNIT_LINK],
|
|
12
|
+
});
|
|
11
13
|
commandUnit.addCommand(upload_1.default);
|
|
12
14
|
commandUnit.addCommand(link_1.default);
|
|
13
|
-
commandUnit.addHelpText('after', `
|
|
14
|
-
EXAMPLES:${texts_1.EXAMPLE_TESTS_UNIT_UPLOAD}
|
|
15
|
-
${texts_1.EXAMPLE_TESTS_UNIT_LINK}`);
|
|
16
15
|
exports.default = commandUnit;
|
|
@@ -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 commandVisualLink = (0, utils_1.newCommand)('link', texts_1.DESC_COMMAND_VT_LINK
|
|
9
|
+
const commandVisualLink = (0, utils_1.newCommand)('link', texts_1.DESC_COMMAND_VT_LINK, {
|
|
10
|
+
examples: texts_1.EXAMPLE_TESTS_VISUAL_LINK,
|
|
11
|
+
});
|
|
10
12
|
commandVisualLink.option('-w, --workspace <workspace>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
11
13
|
commandVisualLink.option('-p, --project <project>', texts_1.OPTION_REST_API_PROJECT);
|
|
12
14
|
commandVisualLink.option('-s, --suite <suite>', texts_1.OPTION_SUITE_IDENTIFIER);
|
|
@@ -58,5 +60,4 @@ commandVisualLink.action(async (options) => {
|
|
|
58
60
|
output_1.default.okSign();
|
|
59
61
|
output_1.default.exitSuccess(texts_1.TXT_COMMAND_VT_LINK_SUCCESS);
|
|
60
62
|
});
|
|
61
|
-
commandVisualLink.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TESTS_VISUAL_LINK}`);
|
|
62
63
|
exports.default = commandVisualLink;
|
|
@@ -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 commandSessionClose = (0, utils_1.newCommand)('close', texts_1.DESC_COMMAND_SESSION_CLOSE
|
|
9
|
+
const commandSessionClose = (0, utils_1.newCommand)('close', texts_1.DESC_COMMAND_SESSION_CLOSE, {
|
|
10
|
+
examples: texts_1.EXAMPLE_TESTS_VISUAL_SESSION_CLOSE,
|
|
11
|
+
});
|
|
10
12
|
commandSessionClose.action(async () => {
|
|
11
13
|
const { checkBuildId } = require('../../../../visualTest/validation');
|
|
12
14
|
const { closeSession } = require('../../../../visualTest/requests');
|
|
@@ -29,5 +31,4 @@ commandSessionClose.action(async () => {
|
|
|
29
31
|
output_1.default.exitError(`${error}`);
|
|
30
32
|
}
|
|
31
33
|
});
|
|
32
|
-
commandSessionClose.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TESTS_VISUAL_SESSION_CLOSE}`);
|
|
33
34
|
exports.default = commandSessionClose;
|
|
@@ -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 commandSessionCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_SESSION_CREATE
|
|
9
|
+
const commandSessionCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_SESSION_CREATE, {
|
|
10
|
+
examples: texts_1.EXAMPLE_TESTS_VISUAL_SESSION_CREATE,
|
|
11
|
+
});
|
|
10
12
|
commandSessionCreate.argument('<command>', texts_1.OPTION_EXEC_COMMAND);
|
|
11
13
|
commandSessionCreate.option('--skipDiscovery', texts_1.OPTION_EXEC_SKIP_DISCOVERY);
|
|
12
14
|
commandSessionCreate.option('--oneByOne', texts_1.OPTION_EXEC_ONE_BY_ONE);
|
|
@@ -82,5 +84,4 @@ commandSessionCreate.action(async (command, options) => {
|
|
|
82
84
|
output_1.default.exitError(`${error}`);
|
|
83
85
|
}
|
|
84
86
|
});
|
|
85
|
-
commandSessionCreate.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TESTS_VISUAL_SESSION_CREATE}`);
|
|
86
87
|
exports.default = commandSessionCreate;
|
|
@@ -7,10 +7,12 @@ const utils_1 = require("../../../utils");
|
|
|
7
7
|
const texts_1 = require("../../../texts");
|
|
8
8
|
const create_1 = __importDefault(require("./session/create"));
|
|
9
9
|
const close_1 = __importDefault(require("./session/close"));
|
|
10
|
-
const commandSession = (0, utils_1.newCommand)('session', texts_1.DESC_COMMAND_SESSION
|
|
10
|
+
const commandSession = (0, utils_1.newCommand)('session', texts_1.DESC_COMMAND_SESSION, {
|
|
11
|
+
examples: [
|
|
12
|
+
...texts_1.EXAMPLE_TESTS_VISUAL_SESSION_CREATE,
|
|
13
|
+
...texts_1.EXAMPLE_TESTS_VISUAL_SESSION_CLOSE,
|
|
14
|
+
],
|
|
15
|
+
});
|
|
11
16
|
commandSession.addCommand(create_1.default);
|
|
12
17
|
commandSession.addCommand(close_1.default);
|
|
13
|
-
commandSession.addHelpText('after', `
|
|
14
|
-
EXAMPLES:${texts_1.EXAMPLE_TESTS_VISUAL_SESSION_CREATE}
|
|
15
|
-
${texts_1.EXAMPLE_TESTS_VISUAL_SESSION_CLOSE}`);
|
|
16
18
|
exports.default = commandSession;
|
|
@@ -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 commandVisualSetup = (0, utils_1.newCommand)('setup', texts_1.DESC_COMMAND_VISUAL_SETUP
|
|
9
|
+
const commandVisualSetup = (0, utils_1.newCommand)('setup', texts_1.DESC_COMMAND_VISUAL_SETUP, {
|
|
10
|
+
examples: texts_1.EXAMPLE_TESTS_VISUAL_SETUP,
|
|
11
|
+
});
|
|
10
12
|
commandVisualSetup.action(async () => {
|
|
11
13
|
try {
|
|
12
14
|
const { installBrowser } = require('../../../visualTest/browser');
|
|
@@ -17,5 +19,4 @@ commandVisualSetup.action(async () => {
|
|
|
17
19
|
output_1.default.exitError(`${error}`);
|
|
18
20
|
}
|
|
19
21
|
});
|
|
20
|
-
commandVisualSetup.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TESTS_VISUAL_SETUP}`);
|
|
21
22
|
exports.default = commandVisualSetup;
|
|
@@ -9,7 +9,9 @@ const output_1 = __importDefault(require("../../../output"));
|
|
|
9
9
|
const node_fs_1 = require("node:fs");
|
|
10
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
11
11
|
const node_zlib_1 = require("node:zlib");
|
|
12
|
-
const commandVisualUpload = (0, utils_1.newCommand)('upload', texts_1.DESC_COMMAND_VISUAL_UPLOAD
|
|
12
|
+
const commandVisualUpload = (0, utils_1.newCommand)('upload', texts_1.DESC_COMMAND_VISUAL_UPLOAD, {
|
|
13
|
+
examples: texts_1.EXAMPLE_TESTS_VISUAL_UPLOAD,
|
|
14
|
+
});
|
|
13
15
|
commandVisualUpload.argument('[directory]', texts_1.OPTION_STORYBOOK_DIRECTORY);
|
|
14
16
|
commandVisualUpload.action(async (directory) => {
|
|
15
17
|
const { getCiAndGitInfo, formattedCiInfo } = require('@buddy-works/ci-info');
|
|
@@ -142,5 +144,4 @@ function getStorybookSnapshots(storiesList) {
|
|
|
142
144
|
output_1.default.normal((0, texts_1.TXT_STORIES_AMOUNT)(stories.length));
|
|
143
145
|
return stories;
|
|
144
146
|
}
|
|
145
|
-
commandVisualUpload.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TESTS_VISUAL_UPLOAD}`);
|
|
146
147
|
exports.default = commandVisualUpload;
|