bdy 1.18.4-dev → 1.18.6-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 +1 -1
- package/distTs/src/agent/manager.js +20 -18
- package/distTs/src/api/client.js +48 -0
- package/distTs/src/autocomplete.js +10 -5
- package/distTs/src/command/agent/debug.js +6 -6
- package/distTs/src/command/agent/disable.js +2 -2
- package/distTs/src/command/agent/enable.js +2 -2
- package/distTs/src/command/agent/install.js +31 -26
- package/distTs/src/command/agent/proxy/disable.js +2 -2
- package/distTs/src/command/agent/proxy/enable.js +2 -2
- package/distTs/src/command/agent/proxy/status.js +2 -2
- package/distTs/src/command/agent/restart.js +6 -6
- package/distTs/src/command/agent/run.js +3 -3
- package/distTs/src/command/agent/start.js +7 -7
- package/distTs/src/command/agent/stop.js +6 -6
- package/distTs/src/command/agent/tags/get.js +2 -2
- package/distTs/src/command/agent/tags/set.js +2 -2
- package/distTs/src/command/agent/target/disable.js +2 -2
- package/distTs/src/command/agent/target/enable.js +2 -2
- package/distTs/src/command/agent/target/status.js +2 -2
- package/distTs/src/command/agent/tunnel/disable.js +2 -2
- package/distTs/src/command/agent/tunnel/enable.js +2 -2
- package/distTs/src/command/agent/tunnel/http.js +7 -7
- package/distTs/src/command/agent/tunnel/list.js +2 -2
- package/distTs/src/command/agent/tunnel/remove.js +2 -2
- package/distTs/src/command/agent/tunnel/start.js +5 -5
- package/distTs/src/command/agent/tunnel/status.js +4 -4
- package/distTs/src/command/agent/tunnel/tcp.js +7 -7
- package/distTs/src/command/agent/tunnel/tls.js +7 -7
- package/distTs/src/command/agent/uninstall.js +12 -12
- package/distTs/src/command/agent/update.js +9 -9
- package/distTs/src/command/api/info.js +2 -1
- package/distTs/src/command/api/list.js +2 -1
- package/distTs/src/command/api/request.js +2 -2
- package/distTs/src/command/login.js +8 -6
- package/distTs/src/command/package/create.js +2 -2
- package/distTs/src/command/package/download.js +5 -37
- package/distTs/src/command/package/publish.js +7 -6
- package/distTs/src/command/pre.js +5 -5
- package/distTs/src/command/project/link.js +4 -3
- package/distTs/src/command/sandbox/app/list.js +35 -0
- package/distTs/src/command/sandbox/app/logs.js +43 -0
- package/distTs/src/command/sandbox/app/start.js +27 -0
- package/distTs/src/command/sandbox/app/status.js +35 -0
- package/distTs/src/command/sandbox/app/stop.js +27 -0
- package/distTs/src/command/sandbox/app.js +25 -0
- package/distTs/src/command/sandbox/cp.js +7 -39
- package/distTs/src/command/sandbox/create.js +22 -12
- package/distTs/src/command/sandbox/logs.js +26 -0
- package/distTs/src/command/sandbox/snapshot/create.js +2 -2
- package/distTs/src/command/sandbox/update.js +14 -0
- package/distTs/src/command/sandbox.js +4 -0
- package/distTs/src/command/scrape.js +15 -14
- package/distTs/src/command/tunnel/http.js +8 -8
- package/distTs/src/command/tunnel/start.js +9 -9
- package/distTs/src/command/tunnel/tcp.js +8 -8
- package/distTs/src/command/tunnel/tls.js +8 -8
- package/distTs/src/command/ut/upload.js +16 -48
- package/distTs/src/command/vt/close.js +5 -5
- package/distTs/src/command/vt/compare.js +18 -16
- package/distTs/src/command/vt/exec.js +28 -28
- package/distTs/src/command/vt/installBrowser.js +2 -2
- package/distTs/src/command/vt/storybook.js +14 -14
- package/distTs/src/input.js +8 -7
- package/distTs/src/logger.js +3 -3
- package/distTs/src/openapi.js +24 -0
- package/distTs/src/output.js +21 -16
- package/distTs/src/sshKeygen.js +9 -0
- package/distTs/src/texts.js +42 -8
- package/distTs/src/tunnel/cfg.js +17 -20
- package/distTs/src/tunnel/tunnel.js +2 -1
- package/distTs/src/utils.js +9 -28
- package/package.json +1 -1
|
@@ -5,70 +5,70 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const texts_1 = require("../../texts");
|
|
8
|
-
const validation_1 = require("../../visualTest/validation");
|
|
9
|
-
const requests_1 = require("../../visualTest/requests");
|
|
10
8
|
const output_1 = __importDefault(require("../../output"));
|
|
11
|
-
const context_1 = require("../../visualTest/context");
|
|
12
|
-
const server_1 = require("../../visualTest/server");
|
|
13
|
-
const which_1 = __importDefault(require("which"));
|
|
14
|
-
const snapshots_1 = require("../../visualTest/snapshots");
|
|
15
|
-
const exec_1 = require("../../visualTest/exec");
|
|
16
|
-
const browser_1 = require("../../visualTest/browser");
|
|
17
|
-
const ci_info_1 = require("@buddy-works/ci-info");
|
|
18
9
|
const commandVtExec = (0, utils_1.newCommand)('exec', texts_1.DESC_COMMAND_VT_EXEC);
|
|
19
10
|
commandVtExec.argument('<command>', texts_1.OPTION_EXEC_COMMAND);
|
|
20
11
|
commandVtExec.option('--skipDiscovery', texts_1.OPTION_EXEC_SKIP_DISCOVERY);
|
|
21
12
|
commandVtExec.option('--oneByOne', texts_1.OPTION_EXEC_ONE_BY_ONE);
|
|
22
13
|
commandVtExec.option('--parallel', texts_1.OPTION_EXEC_PARALLEL);
|
|
23
14
|
commandVtExec.action(async (command, options) => {
|
|
24
|
-
|
|
15
|
+
const which = require('which');
|
|
16
|
+
const { getCiAndGitInfo, formattedCiInfo } = require('@buddy-works/ci-info');
|
|
17
|
+
const { checkParallel, checkToken } = require('../../visualTest/validation');
|
|
18
|
+
const { getDefaultSettings } = require('../../visualTest/requests');
|
|
19
|
+
const { debug, setBrowserPath, setCiAndCommitInfo, setExecOptions } = require('../../visualTest/context');
|
|
20
|
+
const { createServer } = require('../../visualTest/server');
|
|
21
|
+
const { finishProcessingSnapshots, setDefaultSettings, showSessionLink } = require('../../visualTest/snapshots');
|
|
22
|
+
const { testExec } = require('../../visualTest/exec');
|
|
23
|
+
const { getBrowserPath } = require('../../visualTest/browser');
|
|
24
|
+
setExecOptions(options);
|
|
25
25
|
try {
|
|
26
|
-
const browserPath = await
|
|
27
|
-
|
|
26
|
+
const browserPath = await getBrowserPath();
|
|
27
|
+
setBrowserPath(browserPath);
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
30
|
output_1.default.exitError(`${error}`);
|
|
31
31
|
}
|
|
32
|
-
if (!
|
|
32
|
+
if (!checkToken('vt')) {
|
|
33
33
|
output_1.default.exitError(texts_1.ERR_MISSING_VT_TOKEN);
|
|
34
34
|
}
|
|
35
|
-
if (!
|
|
35
|
+
if (!checkParallel()) {
|
|
36
36
|
output_1.default.exitError(texts_1.ERR_MISSING_BUILD_ID);
|
|
37
37
|
}
|
|
38
|
-
const app = await
|
|
38
|
+
const app = await createServer();
|
|
39
39
|
const [mainCommand, ...mainCommandArguments] = command.split(' ');
|
|
40
40
|
output_1.default.normal((0, texts_1.LOG_RUNNING_EXEC_COMMAND)(`${mainCommand} ${[...mainCommandArguments].join(' ')}`));
|
|
41
|
-
const resolved = await (
|
|
41
|
+
const resolved = await which(mainCommand, { nothrow: true });
|
|
42
42
|
if (!resolved) {
|
|
43
43
|
output_1.default.exitError((0, texts_1.ERR_MISSING_EXEC_COMMAND)(`${mainCommand} ${[...mainCommandArguments].join(' ')}`));
|
|
44
44
|
}
|
|
45
45
|
try {
|
|
46
46
|
let t1, t11;
|
|
47
|
-
if (
|
|
47
|
+
if (debug) {
|
|
48
48
|
t1 = performance.now();
|
|
49
49
|
}
|
|
50
|
-
const defaultSettings = await
|
|
51
|
-
|
|
52
|
-
const ciAndGitInfo = await
|
|
50
|
+
const defaultSettings = await getDefaultSettings();
|
|
51
|
+
setDefaultSettings(defaultSettings);
|
|
52
|
+
const ciAndGitInfo = await getCiAndGitInfo({
|
|
53
53
|
baseBranch: defaultSettings.baseBranch,
|
|
54
54
|
logger: output_1.default.warning,
|
|
55
55
|
});
|
|
56
|
-
|
|
57
|
-
output_1.default.normal(
|
|
58
|
-
if (
|
|
56
|
+
setCiAndCommitInfo(ciAndGitInfo);
|
|
57
|
+
output_1.default.normal(formattedCiInfo(ciAndGitInfo));
|
|
58
|
+
if (debug) {
|
|
59
59
|
t11 = performance.now();
|
|
60
60
|
}
|
|
61
|
-
const spawnedProcessExitCode = await
|
|
61
|
+
const spawnedProcessExitCode = await testExec(mainCommand, [
|
|
62
62
|
...mainCommandArguments,
|
|
63
63
|
]);
|
|
64
|
-
if (
|
|
64
|
+
if (debug && t11) {
|
|
65
65
|
const t22 = performance.now();
|
|
66
66
|
output_1.default.normal((0, texts_1.DEBUG_EXEC_TEST_COMMAND)(t22 - t11));
|
|
67
67
|
}
|
|
68
68
|
await app.close();
|
|
69
|
-
await
|
|
70
|
-
|
|
71
|
-
if (
|
|
69
|
+
await finishProcessingSnapshots(spawnedProcessExitCode);
|
|
70
|
+
showSessionLink();
|
|
71
|
+
if (debug && t1) {
|
|
72
72
|
const t2 = performance.now();
|
|
73
73
|
output_1.default.normal((0, texts_1.DEBUG_EXEC_COMMAND)(t2 - t1));
|
|
74
74
|
}
|
|
@@ -6,11 +6,11 @@ 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 browser_1 = require("../../visualTest/browser");
|
|
10
9
|
const commandVtInstallBrowser = (0, utils_1.newCommand)('install-browser', texts_1.DESC_COMMAND_VT_INSTALL_BROWSER);
|
|
11
10
|
commandVtInstallBrowser.action(async () => {
|
|
12
11
|
try {
|
|
13
|
-
|
|
12
|
+
const { installBrowser } = require('../../visualTest/browser');
|
|
13
|
+
await installBrowser();
|
|
14
14
|
output_1.default.exitNormal('');
|
|
15
15
|
}
|
|
16
16
|
catch (error) {
|
|
@@ -5,19 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const texts_1 = require("../../texts");
|
|
8
|
-
const validation_1 = require("../../visualTest/validation");
|
|
9
|
-
const requests_1 = require("../../visualTest/requests");
|
|
10
8
|
const output_1 = __importDefault(require("../../output"));
|
|
11
|
-
const snapshots_1 = require("../../visualTest/snapshots");
|
|
12
|
-
const context_1 = require("../../visualTest/context");
|
|
13
9
|
const node_fs_1 = require("node:fs");
|
|
14
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
15
|
-
const ci_info_1 = require("@buddy-works/ci-info");
|
|
16
|
-
const tar_stream_1 = __importDefault(require("tar-stream"));
|
|
17
11
|
const node_zlib_1 = require("node:zlib");
|
|
18
12
|
const commandVtStorybook = (0, utils_1.newCommand)('storybook', texts_1.DESC_COMMAND_VT_STORYBOOK);
|
|
19
13
|
commandVtStorybook.action(async () => {
|
|
20
|
-
|
|
14
|
+
const { getCiAndGitInfo, formattedCiInfo } = require('@buddy-works/ci-info');
|
|
15
|
+
const { checkToken } = require('../../visualTest/validation');
|
|
16
|
+
const { getDefaultSettings, sendStorybook } = require('../../visualTest/requests');
|
|
17
|
+
const { setDefaultSettings } = require('../../visualTest/snapshots');
|
|
18
|
+
const { setCiAndCommitInfo } = require('../../visualTest/context');
|
|
19
|
+
if (!checkToken('vt')) {
|
|
21
20
|
output_1.default.exitError(texts_1.ERR_MISSING_VT_TOKEN);
|
|
22
21
|
}
|
|
23
22
|
const currentDirectoryFiles = getCurrentDirectoryFiles();
|
|
@@ -27,17 +26,17 @@ commandVtStorybook.action(async () => {
|
|
|
27
26
|
const storybookStoriesIndex = getStorybookStoriesIndex(currentDirectoryFiles);
|
|
28
27
|
const storiesList = getStoriesList(storybookStoriesIndex);
|
|
29
28
|
const storybookSnapshots = getStorybookSnapshots(storiesList);
|
|
30
|
-
const defaultSettings = await
|
|
31
|
-
|
|
32
|
-
const ciAndGitInfo = await
|
|
29
|
+
const defaultSettings = await getDefaultSettings();
|
|
30
|
+
setDefaultSettings(defaultSettings);
|
|
31
|
+
const ciAndGitInfo = await getCiAndGitInfo({
|
|
33
32
|
baseBranch: defaultSettings.baseBranch,
|
|
34
33
|
logger: output_1.default.warning,
|
|
35
34
|
});
|
|
36
|
-
|
|
37
|
-
output_1.default.normal(
|
|
35
|
+
setCiAndCommitInfo(ciAndGitInfo);
|
|
36
|
+
output_1.default.normal(formattedCiInfo(ciAndGitInfo));
|
|
38
37
|
try {
|
|
39
38
|
const compressedStorybookDirectory = await createCompressedStorybookDirectory(currentDirectoryFiles);
|
|
40
|
-
const { message } = await
|
|
39
|
+
const { message } = await sendStorybook(storybookSnapshots, compressedStorybookDirectory);
|
|
41
40
|
output_1.default.exitSuccess(message);
|
|
42
41
|
}
|
|
43
42
|
catch (error) {
|
|
@@ -57,6 +56,7 @@ function getCurrentDirectoryFiles() {
|
|
|
57
56
|
});
|
|
58
57
|
}
|
|
59
58
|
async function createCompressedStorybookDirectory(files) {
|
|
59
|
+
const tar = require('tar-stream');
|
|
60
60
|
const cwd = process.cwd();
|
|
61
61
|
const chunks = [];
|
|
62
62
|
return new Promise((resolve, reject) => {
|
|
@@ -72,7 +72,7 @@ async function createCompressedStorybookDirectory(files) {
|
|
|
72
72
|
resolve(Buffer.concat(chunks));
|
|
73
73
|
});
|
|
74
74
|
compressStream.on('error', reject);
|
|
75
|
-
const packStream =
|
|
75
|
+
const packStream = tar.pack();
|
|
76
76
|
packStream.pipe(compressStream);
|
|
77
77
|
let filesProcessed = 0;
|
|
78
78
|
for (const file of files) {
|
package/distTs/src/input.js
CHANGED
|
@@ -42,14 +42,11 @@ const punycode_1 = __importDefault(require("punycode/"));
|
|
|
42
42
|
const node_fs_1 = __importStar(require("node:fs"));
|
|
43
43
|
const tls_1 = __importDefault(require("tls"));
|
|
44
44
|
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
45
|
-
const jsonwebtoken_1 = require("jsonwebtoken");
|
|
46
45
|
const utils_1 = require("./utils");
|
|
47
46
|
const texts_1 = require("./texts");
|
|
48
47
|
const tunnel_1 = require("./types/tunnel");
|
|
49
48
|
const node_path_1 = __importStar(require("node:path"));
|
|
50
49
|
const cfg_1 = __importDefault(require("./tunnel/cfg"));
|
|
51
|
-
const cfg_2 = __importDefault(require("./project/cfg"));
|
|
52
|
-
const client_1 = __importDefault(require("./api/client"));
|
|
53
50
|
class Input {
|
|
54
51
|
static timeout(timeout) {
|
|
55
52
|
const t = parseInt(timeout, 10);
|
|
@@ -336,9 +333,10 @@ class Input {
|
|
|
336
333
|
return result;
|
|
337
334
|
}
|
|
338
335
|
static restApiTokenClient(allowNoToken = false, api = '', region = '', token = '') {
|
|
336
|
+
const ApiClient = require('./api/client').default;
|
|
339
337
|
const baseUrl = this.restApiBaseUrl(api, region);
|
|
340
338
|
const { token: t, refreshToken, clientId, clientToken, clientSecret, } = this.restApiToken(allowNoToken, token);
|
|
341
|
-
return new
|
|
339
|
+
return new ApiClient(baseUrl, t, refreshToken, clientId, clientSecret, clientToken);
|
|
342
340
|
}
|
|
343
341
|
static packageType(type) {
|
|
344
342
|
if (!type)
|
|
@@ -478,11 +476,12 @@ class Input {
|
|
|
478
476
|
return p;
|
|
479
477
|
}
|
|
480
478
|
static restApiWorkspace(workspace, allowNull) {
|
|
479
|
+
const ProjectCfg = require('./project/cfg').default;
|
|
481
480
|
let w = process.env.BUDDY_WORKSPACE;
|
|
482
481
|
if (workspace)
|
|
483
482
|
w = workspace;
|
|
484
483
|
if (!w)
|
|
485
|
-
w =
|
|
484
|
+
w = ProjectCfg.getWorkspace();
|
|
486
485
|
if (!w)
|
|
487
486
|
w = cfg_1.default.getWorkspace();
|
|
488
487
|
if (!w) {
|
|
@@ -647,11 +646,12 @@ class Input {
|
|
|
647
646
|
return null;
|
|
648
647
|
}
|
|
649
648
|
static restApiProject(project, allowNull) {
|
|
649
|
+
const ProjectCfg = require('./project/cfg').default;
|
|
650
650
|
let p = process.env.BUDDY_PROJECT;
|
|
651
651
|
if (project)
|
|
652
652
|
p = project;
|
|
653
653
|
if (!p)
|
|
654
|
-
p =
|
|
654
|
+
p = ProjectCfg.getProject();
|
|
655
655
|
if (!p) {
|
|
656
656
|
if (allowNull)
|
|
657
657
|
return null;
|
|
@@ -728,7 +728,8 @@ class Input {
|
|
|
728
728
|
}
|
|
729
729
|
if (!token)
|
|
730
730
|
throw new Error(texts_1.ERR_TOKEN_NOT_PROVIDED);
|
|
731
|
-
const
|
|
731
|
+
const { decode } = require('jsonwebtoken');
|
|
732
|
+
const d = decode(token);
|
|
732
733
|
if (d === null) {
|
|
733
734
|
throw new Error(texts_1.ERR_WRONG_TOKEN);
|
|
734
735
|
}
|
package/distTs/src/logger.js
CHANGED
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const pino_1 = __importDefault(require("pino"));
|
|
7
6
|
const path_1 = require("path");
|
|
8
7
|
const fs_1 = __importDefault(require("fs"));
|
|
9
8
|
const utils_1 = require("./utils");
|
|
@@ -48,7 +47,8 @@ class Logger {
|
|
|
48
47
|
catch {
|
|
49
48
|
// do nothing
|
|
50
49
|
}
|
|
51
|
-
|
|
50
|
+
const pino = require('pino');
|
|
51
|
+
this.p = pino({
|
|
52
52
|
level: this.debugOn ? 'debug' : 'info',
|
|
53
53
|
timestamp: () => `, "time": "${new Date().toISOString()}"`,
|
|
54
54
|
formatters: {
|
|
@@ -57,7 +57,7 @@ class Logger {
|
|
|
57
57
|
level: label.toUpperCase(),
|
|
58
58
|
}),
|
|
59
59
|
},
|
|
60
|
-
},
|
|
60
|
+
}, pino.destination(this.logStream));
|
|
61
61
|
this.checkLogSize();
|
|
62
62
|
this.ts = setInterval(() => {
|
|
63
63
|
this.checkLogSize();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchOpenApiSchema = fetchOpenApiSchema;
|
|
4
|
+
const bundle_1 = require("@scalar/json-magic/bundle");
|
|
5
|
+
const node_1 = require("@scalar/json-magic/bundle/plugins/node");
|
|
6
|
+
const openapi_parser_1 = require("@scalar/openapi-parser");
|
|
7
|
+
const texts_1 = require("./texts");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
async function fetchOpenApiSchema(baseUrl) {
|
|
10
|
+
try {
|
|
11
|
+
const url = (0, utils_1.getOpenApiEndpointByApiBaseUrl)(baseUrl);
|
|
12
|
+
const data = await (0, bundle_1.bundle)(url, {
|
|
13
|
+
plugins: [(0, node_1.readFiles)(), (0, node_1.fetchUrls)(), (0, node_1.parseYaml)(), (0, node_1.parseJson)()],
|
|
14
|
+
treeShake: true,
|
|
15
|
+
});
|
|
16
|
+
const { schema } = await (0, openapi_parser_1.dereference)(data);
|
|
17
|
+
if (schema)
|
|
18
|
+
return schema;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// do nothing
|
|
22
|
+
}
|
|
23
|
+
throw new Error(texts_1.ERR_SCHEMA_FETCH_FAILED);
|
|
24
|
+
}
|
package/distTs/src/output.js
CHANGED
|
@@ -5,16 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
const termkit_no_lazy_require_1 = __importDefault(require("terminal-kit/lib/termkit-no-lazy-require"));
|
|
8
|
-
const tunnel_1 = __importDefault(require("./tunnel/output/
|
|
9
|
-
const tunnel_2 = __importDefault(require("./tunnel/output/noninteractive/tunnel"));
|
|
10
|
-
const tunnel_3 = __importDefault(require("./tunnel/output/noninteractive/config/tunnel"));
|
|
8
|
+
const tunnel_1 = __importDefault(require("./tunnel/output/noninteractive/tunnel"));
|
|
9
|
+
const tunnel_2 = __importDefault(require("./tunnel/output/noninteractive/config/tunnel"));
|
|
11
10
|
const tunnels_1 = __importDefault(require("./tunnel/output/noninteractive/config/tunnels"));
|
|
12
11
|
const texts_1 = require("./texts");
|
|
13
12
|
const tunnels_2 = __importDefault(require("./tunnel/output/noninteractive/agent/tunnels"));
|
|
14
|
-
const context_1 = require("./visualTest/context");
|
|
15
13
|
const utils_1 = require("./utils");
|
|
16
14
|
const chalk_1 = __importDefault(require("chalk"));
|
|
17
|
-
const prompts_1 = __importDefault(require("@inquirer/prompts"));
|
|
18
15
|
const terminal = termkit_no_lazy_require_1.default.terminal;
|
|
19
16
|
class Output {
|
|
20
17
|
static s;
|
|
@@ -127,12 +124,14 @@ class Output {
|
|
|
127
124
|
this.normal(this.getCyanColor(txt), newLine);
|
|
128
125
|
}
|
|
129
126
|
static debug(txt) {
|
|
130
|
-
|
|
127
|
+
const { debug } = require('./visualTest/context');
|
|
128
|
+
if (debug) {
|
|
131
129
|
this.normal(txt);
|
|
132
130
|
}
|
|
133
131
|
}
|
|
134
132
|
static async debugAction(text, action) {
|
|
135
|
-
|
|
133
|
+
const { debug } = require('./visualTest/context');
|
|
134
|
+
if (debug) {
|
|
136
135
|
const t1 = performance.now();
|
|
137
136
|
const result = await action;
|
|
138
137
|
const t2 = performance.now();
|
|
@@ -170,12 +169,13 @@ class Output {
|
|
|
170
169
|
}
|
|
171
170
|
static tunnelInteractive(tunnel) {
|
|
172
171
|
this.killSpinner();
|
|
173
|
-
const
|
|
172
|
+
const OutputInteractiveTunnel = require('./tunnel/output/interactive/tunnel').default;
|
|
173
|
+
const oi = new OutputInteractiveTunnel(terminal, tunnel);
|
|
174
174
|
oi.start();
|
|
175
175
|
}
|
|
176
176
|
static tunnelNonInteractive(tunnel) {
|
|
177
177
|
this.killSpinner();
|
|
178
|
-
const on = new
|
|
178
|
+
const on = new tunnel_1.default(terminal, tunnel);
|
|
179
179
|
on.start();
|
|
180
180
|
}
|
|
181
181
|
static newCliVersion(version) {
|
|
@@ -231,7 +231,7 @@ class Output {
|
|
|
231
231
|
on.start(this);
|
|
232
232
|
}
|
|
233
233
|
static configTunnel(tunnel) {
|
|
234
|
-
const on = new
|
|
234
|
+
const on = new tunnel_2.default(terminal, tunnel);
|
|
235
235
|
on.start(this);
|
|
236
236
|
}
|
|
237
237
|
static handleSignals() {
|
|
@@ -247,7 +247,8 @@ class Output {
|
|
|
247
247
|
}
|
|
248
248
|
static async confirm(message = 'Are you sure?') {
|
|
249
249
|
if (this.isStdInTTY()) {
|
|
250
|
-
|
|
250
|
+
const prompts = require('@inquirer/prompts');
|
|
251
|
+
return await prompts.confirm({
|
|
251
252
|
message,
|
|
252
253
|
theme: this.getInquirerTheme(),
|
|
253
254
|
default: false,
|
|
@@ -260,7 +261,8 @@ class Output {
|
|
|
260
261
|
}
|
|
261
262
|
static async inputString(message, def) {
|
|
262
263
|
if (this.isStdInTTY()) {
|
|
263
|
-
|
|
264
|
+
const prompts = require('@inquirer/prompts');
|
|
265
|
+
return await prompts.input({
|
|
264
266
|
message,
|
|
265
267
|
default: def,
|
|
266
268
|
theme: this.getInquirerTheme(),
|
|
@@ -276,8 +278,9 @@ class Output {
|
|
|
276
278
|
return '';
|
|
277
279
|
}
|
|
278
280
|
static async inputMenuAdv(message, items) {
|
|
281
|
+
const prompts = require('@inquirer/prompts');
|
|
279
282
|
if (this.isStdInTTY()) {
|
|
280
|
-
return await
|
|
283
|
+
return await prompts.select({
|
|
281
284
|
message,
|
|
282
285
|
theme: this.getInquirerTheme(),
|
|
283
286
|
loop: false,
|
|
@@ -287,7 +290,7 @@ class Output {
|
|
|
287
290
|
else {
|
|
288
291
|
this.cyan('? ', false);
|
|
289
292
|
this.normal(message, false);
|
|
290
|
-
const item = items.find((item) => !
|
|
293
|
+
const item = items.find((item) => !prompts.Separator.isSeparator(item) && !item.disabled);
|
|
291
294
|
if (item && item.name && item.value) {
|
|
292
295
|
this.cyan(` ${item.name}`);
|
|
293
296
|
return item.value;
|
|
@@ -315,7 +318,8 @@ class Output {
|
|
|
315
318
|
return this.getDimColor(`${domain} (Unavailable)`);
|
|
316
319
|
}
|
|
317
320
|
static createMenuSeparator(text) {
|
|
318
|
-
|
|
321
|
+
const prompts = require('@inquirer/prompts');
|
|
322
|
+
return new prompts.Separator(text);
|
|
319
323
|
}
|
|
320
324
|
static createMenuItem(name, value, description, disabled) {
|
|
321
325
|
const item = {
|
|
@@ -330,7 +334,8 @@ class Output {
|
|
|
330
334
|
}
|
|
331
335
|
static async inputMenu(message, items) {
|
|
332
336
|
if (this.isStdInTTY()) {
|
|
333
|
-
|
|
337
|
+
const prompts = require('@inquirer/prompts');
|
|
338
|
+
return await prompts.select({
|
|
334
339
|
message,
|
|
335
340
|
theme: this.getInquirerTheme(),
|
|
336
341
|
loop: false,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSshHostKey = void 0;
|
|
4
|
+
const createSshHostKey = () => {
|
|
5
|
+
const Ssh2 = require('ssh2');
|
|
6
|
+
const keys = Ssh2.utils.generateKeyPairSync('ed25519', {});
|
|
7
|
+
return keys.private;
|
|
8
|
+
};
|
|
9
|
+
exports.createSshHostKey = createSshHostKey;
|
package/distTs/src/texts.js
CHANGED
|
@@ -8,12 +8,13 @@ exports.OPTION_DEFAULT_REGION = exports.OPTION_REGION = exports.TXT_PACKAGE_UNZI
|
|
|
8
8
|
exports.OPTION_TARGET = exports.OPTION_TLS_TERMINATE = exports.OPTION_TLS_CA = exports.OPTION_TLS_CERT = exports.OPTION_TLS_KEY = exports.OPTION_HTTP_CIRCUIT_BREAKER = exports.OPTION_HTTP_COMPRESSION = exports.OPTION_HTTP_2 = exports.OPTION_HTTP_VERIFY = exports.OPTION_HTTP_LOG = exports.OPTION_HTTP_AUTH_BUDDY = exports.OPTION_HTTP_AUTH = exports.OPTION_HTTP_HOST = exports.OPTION_CONFIRM_FORCE = exports.OPTION_FORCE = exports.OPTION_TOKEN = exports.OPTION_TIMEOUT = exports.OPTION_FOLLOW = exports.OPTION_SERVE = exports.OPTION_HEADER_USER_AGENT = exports.OPTION_RESPONSE_HEADER = exports.OPTION_HEADER = exports.OPTION_WHITELIST = exports.OPTION_REST_API_PER_PAGE = exports.OPTION_REST_API_PAGE = exports.OPTION_REST_API_PROJECT = exports.OPTION_REST_API_WORKSPACE = exports.OPTION_PIPELINE_RUN_WAIT = exports.OPTION_PIPELINE_RUN_ACTION = exports.OPTION_REST_API_TOKEN = exports.OPTION_PACKAGE_DOWNLOAD_REPLACE = exports.OPTION_PACKAGE_DOWNLOAD_MERGE = exports.OPTION_PACKAGE_PUBLISH_OVERWRITE_VERSION = exports.OPTION_PACKAGE_PUBLISH_CREATE = exports.OPTION_PACKAGE_ID = exports.OPTION_PACKAGE_DOWNLOAD_PATH = exports.OPTION_PACKAGE_PUBLISH_PATH = exports.OPTION_PIPELINE_RUN_ARGUMENT = exports.OPTION_PIPELINE_RUN_DELAY = exports.OPTION_PIPELINE_RUN_VAR = exports.OPTION_PIPELINE_RUN_PRIORITY = exports.OPTION_PIPELINE_RUN_CLEAR_CACHE = exports.OPTION_PIPELINE_RUN_REFRESH = exports.OPTION_PIPELINE_RUN_COMMENT = exports.OPTION_PIPELINE_RUN_PULL_REQUEST = exports.OPTION_PIPELINE_RUN_REVISION = exports.OPTION_PIPELINE_RUN_TAG = exports.OPTION_PIPELINE_RUN_BRANCH = exports.OPTION_REST_API_REGION = exports.OPTION_REST_API_ENDPOINT = void 0;
|
|
9
9
|
exports.LOG_ERROR_SAVING_AGENT_SYSTEM_CONFIG = exports.LOG_SAVING_AGENT_LOCAL_CONFIG = exports.LOG_REMOVING_AGENT_PROC_ID = exports.LOG_SAVING_AGENT_PROC_ID = exports.LOG_SAVING_AGENT_SYSTEM_CONFIG = exports.LOG_REGISTERING_AGENT = exports.OPTION_SCRAPE_OUTPUT_TYPES = exports.OPTION_SCRAPE_OUTPUT_DIR = exports.OPTION_SCRAPE_DELAY = exports.OPTION_SCRAPE_LOCAL_STORAGE = exports.OPTION_SCRAPE_DEVICES = exports.OPTION_SCRAPE_BROWSERS = exports.OPTION_SCRAPE_COLOR_SCHEME = exports.OPTION_SCRAPE_XPATH_SELECTOR = exports.OPTION_SCRAPE_CSS_SELECTOR = exports.OPTION_SCRAPE_FULL_PAGE = exports.OPTION_SCRAPE_QUALITY = exports.OPTION_SCRAPE_OUTPUT_TYPE = exports.OPTION_SCRAPE_FOLLOW = exports.OPTION_SCRAPE_URL = exports.OPTION_COMPARE_WAIT_FOR = exports.OPTION_COMPARE_DELAY = exports.OPTION_COMPARE_HEADER = exports.OPTION_COMPARE_COOKIE = exports.OPTION_COMPARE_IGNORE = exports.OPTION_COMPARE_IGNORE_URLS = exports.OPTION_COMPARE_DRY_RUN = exports.OPTION_COMPARE_URLS_FILE = exports.OPTION_COMPARE_SITEMAP = exports.OPTION_COMPARE_URLS = exports.OPTION_COMPARE_RESPECT_ROBOTS = exports.OPTION_COMPARE_FOLLOW = exports.OPTION_EXEC_PARALLEL = exports.OPTION_EXEC_ONE_BY_ONE = exports.OPTION_EXEC_SKIP_DISCOVERY = exports.OPTION_EXEC_COMMAND = exports.OPTION_AGENT_DEBUG = exports.OPTION_AGENT_PORT = exports.OPTION_AGENT_TAG = exports.OPTION_AGENT_TUNNELING = exports.OPTION_AGENT_PROXY = exports.OPTION_AGENT_TARGET = exports.OPTION_PASS = exports.OPTION_APP = exports.OPTION_USER = exports.OPTION_AGENT_TOKEN = exports.OPTION_AGENT_START = exports.OPTION_AGENT_ID = exports.OPTION_ID = exports.OPTION_NAME = void 0;
|
|
10
10
|
exports.LOG_TUNNEL_HTTP_CIRCUIT_BREAKER_OPEN = exports.LOG_TUNNEL_HTTP_RATE_LIMIT = exports.LOG_TUNNEL_HTTP_WRON_AUTH = exports.LOG_TUNNEL_IDENTIFIED = exports.LOG_TUNNEL_DISCONNECTED = exports.LOG_TUNNEL_FAILED = exports.LOG_TUNNEL_CONNECTED = exports.LOG_AGENT_STARTED = exports.LOG_AGENT_SERVER_STARTED = exports.LOG_ERROR_STARTING_AGENT_SERVER = exports.LOG_SSH_CONNECTION = exports.LOG_WRONG_STREAM = exports.LOG_DETECTED_STREAM = exports.LOG_HTTP2_REQUEST = exports.LOG_HTTP2_CONNECTION = exports.LOG_HTTP1_REQUEST = exports.LOG_HTTP1_CONNECTION = exports.LOG_ERROR = exports.LOG_STOPPING_TUNNEL = exports.LOG_STARTING_TUNNEL = exports.LOG_ENABLING_AGENT_TUNNELING = exports.LOG_ENABLING_AGENT_PROXY = exports.LOG_ENABLING_AGENT_TARGET = exports.LOG_DISABLING_AGENT_TUNNELING = exports.LOG_DISABLING_AGENT_PROXY = exports.LOG_DISABLING_AGENT_TARGET = exports.LOG_REMOVING_TUNNEL = exports.LOG_TUNNEL_REGISTERED = exports.LOG_ERROR_WHILE_REFRESHING_AGENT = exports.LOG_REGISTERING_TUNNEL = exports.LOG_GETTING_AGENT = exports.LOG_UNREGISTERING_AGENT = exports.LOG_REGION_DETECTED = exports.LOG_AGENT_REGISTERED = exports.LOG_SOCKET_DISCONNECTED = exports.LOG_SOCKET_CONNECTED = exports.LOG_AGENT_NSSM_CLEARING = exports.LOG_AGENT_NSSM_EXTRACTING = exports.LOG_AGENT_NSSM_DOWNLOADING = exports.LOG_AGENT_ENABLED = exports.LOG_AGENT_STARTING_SYSTEM = exports.LOG_AGENT_STOPPING_SYSTEM = exports.LOG_AGENT_ENABLING_SYSTEM = exports.LOG_AGENT_SYSTEM_SERVICE_CONFIG = exports.LOG_AGENT_EXTRACTING_ARCHIVE = exports.LOG_AGENT_DOWNLOADING_ARCHIVE = exports.LOG_AGENT_SYSTEM_DIR = exports.LOG_ERROR_SAVING_AGENT_LOCAL_CONFIG = exports.LOG_ERROR_REMOVING_AGENT_STANDALONE_LOCK_FILE = exports.LOG_ERROR_SAVING_AGENT_STANDALONE_CONFIG = void 0;
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
11
|
+
exports.OPTION_SANDBOX_YAML = exports.OPTION_SANDBOX_TAGS = exports.OPTION_SANDBOX_INSTALL_COMMANDS = exports.OPTION_SANDBOX_RESOURCES = exports.OPTION_SANDBOX_OS = exports.OPTION_SANDBOX_NAME = exports.OPTION_SANDBOX_IDENTIFIER = exports.TXT_AUTOCOMPLETE_UNINSTALLED = exports.TXT_AUTOCOMPLETE_INSTALLED = exports.DESC_COMMAND_AUTOCOMPLETE_UNINSTALL = exports.DESC_COMMAND_AUTOCOMPLETE_INSTALL = exports.DESC_COMMAND_AUTOCOMPLETE = exports.DESC_COMMAND_SANDBOX_APP = exports.DESC_COMMAND_SANDBOX_EXEC = exports.DESC_COMMAND_SANDBOX_STATUS = exports.DESC_COMMAND_SANDBOX_LOGS = exports.DESC_COMMAND_SANDBOX_RESTART = exports.DESC_COMMAND_SANDBOX_STOP = exports.DESC_COMMAND_SANDBOX_START = exports.DESC_COMMAND_SANDBOX_DESTROY = exports.DESC_COMMAND_SANDBOX_GET = exports.DESC_COMMAND_SANDBOX_LIST = exports.DESC_COMMAND_SANDBOX_UPDATE = exports.DESC_COMMAND_SANDBOX_GET_YAML = exports.DESC_COMMAND_SANDBOX_CREATE = exports.DESC_COMMAND_SANDBOX = exports.DEBUG_WAIT_FOR_IDLE_TIMEOUT = exports.DEBUG_WAIT_FOR_IDLE = exports.DEBUG_RESOURCE_DISCOVERY_TIMEOUT = exports.DEBUG_AUTO_WIDTH = exports.DEBUG_AUTO_SCROLL = exports.DEBUG_RESOURCE_SCRAPPING_URL = exports.DEBUG_SNAPSHOT_PROCESSING = exports.DEBUG_SNAPSHOTS_PROCESSING = exports.DEBUG_EXEC_COMMAND = exports.DEBUG_EXEC_TEST_COMMAND = exports.LOG_INSTALLED_BROWSER = exports.LOG_SESSION_LINK = exports.LOG_SENDING_DATA = exports.LOG_SENDING_REQUEST = exports.LOG_PROCESSING_SNAPSHOTS = exports.LOG_RUNNING_EXEC_COMMAND = exports.LOG_TUNNEL_SSH_STREAM = exports.LOG_TUNNEL_TLS_AGENT_STREAM = exports.LOG_TUNNEL_TLS_REGION_STREAM = exports.LOG_TUNNEL_TLS_TARGET_STREAM = exports.LOG_TUNNEL_HTTP2_STREAM = exports.LOG_TUNNEL_HTTP1_STREAM = exports.LOG_TUNNEL_TCP_STREAM = exports.LOG_TUNNEL_HTTP_WRONG_USER_AGENTS = void 0;
|
|
12
|
+
exports.DESC_COMMAND_SANDBOX_SNAPSHOT_LIST = exports.DESC_COMMAND_SANDBOX_SNAPSHOT = exports.TXT_SANDBOX_COMMAND_KILLED = exports.OPTION_SANDBOX_COMMAND_KILL_CONFIRM = exports.OPTION_SANDBOX_LOGS_LIMIT = exports.OPTION_SANDBOX_APP_ID = exports.OPTION_SANDBOX_COMMAND_ID = exports.DESC_COMMAND_SANDBOX_EXEC_KILL = exports.DESC_COMMAND_SANDBOX_EXEC_LOGS = exports.DESC_COMMAND_SANDBOX_APP_START = exports.DESC_COMMAND_SANDBOX_APP_STOP = exports.DESC_COMMAND_SANDBOX_APP_STATUS = exports.DESC_COMMAND_SANDBOX_APP_LOGS = exports.DESC_COMMAND_SANDBOX_EXEC_STATUS = exports.DESC_COMMAND_SANDBOX_EXEC_LIST = exports.DESC_COMMAND_SANDBOX_APP_LIST = exports.TXT_SANDBOX_WAITING_START = exports.TXT_SANDBOX_WAITING_STOP = exports.TXT_SANDBOX_WAITING_APPS = exports.TXT_SANDBOX_WAITING_SETUP = exports.TXT_SANDBOX_WAITING_RUNNING = exports.TXT_SANDBOX_STOPPED = exports.TXT_SANDBOX_STARTED = exports.TXT_SANDBOX_DESTROYED = exports.TXT_SANDBOX_DESTROY_CONFIRM = exports.TXT_SANDBOX_UPDATED = exports.TXT_SANDBOX_CREATED = exports.TXT_SANDBOX_CREATING = exports.TXT_SANDBOX_APP_STARTED = exports.TXT_SANDBOX_APP_STOPPED = exports.OPTION_SANDBOX_WAIT = exports.OPTION_SANDBOX_WAIT_APPS = exports.OPTION_SANDBOX_WAIT_CONFIGURED = exports.OPTION_SANDBOX_WAIT_RUNNING = exports.ERR_SANDBOX_STOP_FAILED = exports.ERR_SANDBOX_NO_COMMANDS = exports.ERR_SANDBOX_RUNNING_FAILED = exports.ERR_SANDBOX_STOP_TIMEOUT = exports.ERR_SANDBOX_SNAPSHOT_TIMEOUT = exports.ERR_SANDBOX_RUNNING_TIMEOUT = exports.ERR_SANDBOX_APPS_TIMEOUT = exports.ERR_SANDBOX_SETUP_TIMEOUT = exports.ERR_SANDBOX_APP_FAILED = exports.ERR_SANDBOX_SETUP_FAILED = exports.ERR_SANDBOX_INVALID_RESOURCES = exports.ERR_SANDBOX_APP_NOT_FOUND = exports.ERR_SANDBOX_NOT_FOUND = exports.OPTION_SANDBOX_RUNTIME = exports.OPTION_SANDBOX_APP_DIR = exports.OPTION_SANDBOX_APP_COMMAND = void 0;
|
|
13
|
+
exports.TXT_SANDBOX_EXEC_ID = exports.ERR_SANDBOX_CP_INVALID_SOURCE = exports.ERR_SANDBOX_CP_INVALID_DEST = exports.ERR_SANDBOX_CP_REPLACE = exports.ERR_SANDBOX_CP_MKDIR = exports.ERR_SANDBOX_CP_PATH_EXISTS = exports.ERR_SANDBOX_CP_NOT_EMPTY_DIR = exports.ERR_SANDBOX_CP_READDIR = exports.ERR_SANDBOX_CP_DEST_NOT_FOLDER = exports.ERR_SANDBOX_CP_SOURCE_NOT_FOUND = exports.TXT_SANDBOX_CP_DONE = exports.TXT_SANDBOX_CP_PROGRESS = exports.TXT_SANDBOX_UNZIPPING_COUNT = exports.TXT_SANDBOX_UNZIP_DONE = exports.TXT_SANDBOX_UNZIP = exports.TXT_SANDBOX_CP_DOWNLOAD_DONE = exports.TXT_SANDBOX_CP_DOWNLOAD = exports.OPTION_SANDBOX_CP_DOWNLOAD_REPLACE = exports.OPTION_SANDBOX_CP_DOWNLOAD_MERGE = exports.OPTION_SANDBOX_CP_DEST = exports.OPTION_SANDBOX_CP_SOURCE = exports.DESC_COMMAND_SANDBOX_CP = exports.ERR_SANDBOX_ENDPOINTS_NOT_FOUND = exports.ERR_SANDBOX_ENDPOINT_NOT_FOUND = exports.ERR_SANDBOX_ENDPOINT_EXISTS = exports.TXT_SANDBOX_ENDPOINT_DELETED = exports.TXT_SANDBOX_ENDPOINT_DELETE_CONFIRM = exports.TXT_SANDBOX_ENDPOINT_ADDED = exports.OPTION_SANDBOX_ENDPOINT_TYPE = exports.OPTION_SANDBOX_ENDPOINT_PORT = exports.OPTION_SANDBOX_ENDPOINT_NAME_ARG = exports.OPTION_SANDBOX_ENDPOINT_NAME = exports.DESC_COMMAND_SANDBOX_ENDPOINT_DELETE = exports.DESC_COMMAND_SANDBOX_ENDPOINT_ADD = exports.DESC_COMMAND_SANDBOX_ENDPOINT_GET = exports.DESC_COMMAND_SANDBOX_ENDPOINT_LIST = exports.DESC_COMMAND_SANDBOX_ENDPOINT = exports.ERR_SANDBOX_SNAPSHOTS_NOT_FOUND = exports.ERR_SANDBOX_SNAPSHOT_NOT_FOUND = exports.ERR_SANDBOX_SNAPSHOT_FAILED = exports.TXT_SANDBOX_SNAPSHOT_WAITING = exports.TXT_SANDBOX_SNAPSHOT_DELETE_CONFIRM = exports.TXT_SANDBOX_SNAPSHOT_DELETED = exports.TXT_SANDBOX_SNAPSHOT_CREATED = exports.OPTION_SANDBOX_FROM_SNAPSHOT = exports.OPTION_SANDBOX_SNAPSHOT_NAME_ARG = exports.OPTION_SANDBOX_SNAPSHOT_NAME = exports.DESC_COMMAND_SANDBOX_SNAPSHOT_DELETE = exports.DESC_COMMAND_SANDBOX_SNAPSHOT_GET = exports.DESC_COMMAND_SANDBOX_SNAPSHOT_CREATE = void 0;
|
|
14
|
+
exports.TXT_LOGIN_SELECT_REGION = exports.TXT_WORKSPACE_NONE = exports.TXT_WORKSPACE_SET_SUCCESS = exports.ARG_COMMAND_WORKSPACE = exports.DESC_COMMAND_WORKSPACE_GET = exports.DESC_COMMAND_WORKSPACE_SET = exports.DESC_COMMAND_WORKSPACE_LIST = exports.DESC_COMMAND_WORKSPACE = exports.TXT_LOGOUT_SUCCESS = exports.DESC_COMMAND_LOGOUT = exports.DESC_COMMAND_LOGIN = exports.ERR_API_MEDIA_TYPE_NOT_IMPLEMENTED = exports.ERR_API_PARAMETER_NOT_REPLACED = exports.TXT_API_ENDPOINT_REQUIRED_SCOPES = exports.ERR_API_ENDPOINT_NOT_FOUND = exports.ERR_API_WRONG_METHOD = exports.ERR_SCHEMA_FETCH_FAILED = exports.OPT_COMMAND_API_INFO_URL = exports.OPT_COMMAND_API_INFO_SCHEMA = exports.OPT_COMMAND_API_INFO_METHOD = exports.OPT_COMMAND_API_LIST_SEARCH = exports.OPT_COMMAND_API_LIST_METHOD = exports.ERR_API_REQUEST_BODY_VALUE = exports.ERR_API_REQUEST_QUERY_VALUE = exports.ERR_API_REQUEST_INVALID_JSON = exports.ERR_API_REQUEST_FILE_ERROR = exports.ERR_API_REQUEST_OUTPUT_EXISTS = exports.DESC_COMMAND_API_INFO = exports.DESC_COMMAND_API_FORM = exports.DESC_COMMAND_API_JSON = exports.DESC_COMMAND_API_DATA = exports.DESC_COMMAND_API_OUTPUT = exports.DESC_COMMAND_API_REQUEST_QUERY = exports.DESC_COMMAND_API_PROJECT = exports.DESC_COMMAND_API_WORKSPACE = exports.DESC_COMMAND_API_REQUEST_URL = exports.DESC_COMMAND_API_GET = exports.DESC_COMMAND_API_PATCH = exports.DESC_COMMAND_API_DELETE = exports.DESC_COMMAND_API_PUT = exports.DESC_COMMAND_API_POST = exports.DESC_COMMAND_API_LIST = exports.DESC_COMMAND_API = exports.ERR_WHOAMI_LOGOUT = exports.TXT_WHOAMI_NO_WORKSPACE = exports.DESC_COMMAND_WHOAMI = exports.TXT_SANDBOX_EXEC_FAILED = exports.TXT_SANDBOX_EXEC_INPROGRESS = exports.TXT_SANDBOX_EXEC_SUCCESS = exports.TXT_SANDBOX_EXEC_BACKGROUND = void 0;
|
|
15
|
+
exports.TXT_PACKAGE_PUBLISH = exports.TXT_PACKAGE_CREATED = exports.TXT_PACKAGE_VERSION_DELETED = exports.TXT_PACKAGE_DELETED = exports.ERR_COMMAND_PACKAGE_TYPE = exports.OPT_COMMAND_PACKAGE_VERSION = exports.OPT_COMMAND_PACKAGE_IDENTIFIER = exports.OPT_COMMAND_PACKAGE_CREATE_IDENTIFIER = exports.OPT_COMMAND_PACKAGE_NAME = exports.OPT_COMMAND_PACKAGE_TYPE = exports.DESC_COMMAND_PACKAGE_CREATE = exports.DESC_COMMAND_PACKAGE_GET = exports.TXT_PACKAGE_DOCKER_LOGIN_FAILED = exports.TXT_PACKAGE_DOCKER_LOGIN_SUCCESS = exports.TXT_PACKAGE_VERSION_DELETE_CONFIRM = exports.TXT_PACKAGE_DELETE_CONFIRM = exports.DESC_COMMAND_PACKAGE_DELETE = exports.ERR_COMMAND_PACKAGE_NO_PROJECTS = exports.DESC_COMMAND_PACKAGE_VERSION_GET = exports.DESC_COMMAND_PACKAGE_VERSION_LIST = exports.DESC_COMMAND_PACKAGE_VERSION_DELETE = exports.DESC_COMMAND_PACKAGE_DOCKER_LOGIN = exports.DESC_COMMAND_PACKAGE_LIST = exports.DESC_COMMAND_PACKAGE_VERSION = exports.ERR_COMMAND_DOMAIN_UNAVAILABLE = exports.OPTION_COMMAND_DOMAIN_IDENTIFIER = exports.ERR_COMMAND_DOMAIN_NO_DOMAINS = exports.TXT_COMMAND_DOMAIN_PROMPT_REQUIRED = exports.TXT_COMMAND_DOMAIN_BUY_SELECT_DOMAIN = exports.TXT_COMMAND_DOMAIN_PROVIDE_PROMPT = exports.ERR_COMMAND_DOMAIN_NOT_FOUND = exports.OPT_COMMAND_DOMAIN_PHRASE = exports.OPT_COMMAND_DOMAIN_BUY_OWNER = exports.OPT_COMMAND_DOMAIN_BUY_TLD = exports.DESC_COMMAND_DOMAIN_GET = exports.DESC_COMMAND_DOMAIN_LIST = exports.DESC_COMMAND_DOMAIN_SEARCH = exports.DESC_COMMAND_DOMAIN_BUY = exports.DESC_COMMAND_DOMAIN = exports.ERR_API_MESSAGE_REPLACER = exports.ERR_LOGIN_INVALID_BASE_URL = exports.ERR_LOGIN_NO_WORKSPACE_FOUND = exports.ERR_LOGIN_NO_WORKSPACES = exports.ERR_LOGIN_HTTP_SUCCESS = exports.ERR_LOGIN_HTTP_FAILED = exports.TXT_LOGIN_OAUTH = exports.ERR_LOGIN_HTTP_SERVER_PORT_TAKEN = exports.TXT_LOGIN_SUCCESS = exports.TXT_LOGIN_SELECT_WORKSPACE = exports.TXT_LOGIN_ENTER_BASE_URL = void 0;
|
|
16
|
+
exports.EXAMPLE_SANDBOX_SNAPSHOT_CREATE = exports.EXAMPLE_SANDBOX_EXEC_STATUS = exports.EXAMPLE_SANDBOX_EXEC_LOGS = exports.EXAMPLE_SANDBOX_APP_STATUS = exports.EXAMPLE_SANDBOX_APP_STOP = exports.EXAMPLE_SANDBOX_APP_START = exports.EXAMPLE_SANDBOX_APP_LOGS = exports.EXAMPLE_SANDBOX_EXEC_LIST = exports.EXAMPLE_SANDBOX_APP_LIST = exports.EXAMPLE_SANDBOX_EXEC_KILL = exports.EXAMPLE_SANDBOX_EXEC_COMMAND = exports.EXAMPLE_TUNNEL_START = exports.EXAMPLE_TUNNEL_TCP = exports.EXAMPLE_TUNNEL_TLS = exports.EXAMPLE_AGENT_TUNNEL_START = exports.EXAMPLE_AGENT_TUNNEL_STATUS = exports.EXAMPLE_AGENT_TUNNEL_REMOVE = exports.EXAMPLE_AGENT_TUNNEL_LIST = exports.EXAMPLE_TUNNEL_HTTP = exports.EXAMPLE_SANDBOX_CREATE = exports.EXAMPLE_SANDBOX_CP = exports.ERR_PROJECT_NO_PROJECTS = exports.TXT_LOGIN_SELECT_PROJECT = exports.TXT_COMMAND_PROJECT_CREATED = exports.TXT_COMMAND_PROJECT_LINK_NOT_FOUND = exports.TXT_COMMAND_PROJECT_LINK_NAME = exports.TXT_COMMAND_PROJECT_LINK_SELECT_PROJECT = exports.TXT_COMMAND_PROJECT_LINK_TO = exports.TXT_COMMAND_PROJECT_LINK_EXISTING_DESC = exports.TXT_COMMAND_PROJECT_LINK_EXISTING = exports.TXT_COMMAND_PROJECT_LINK_CREATE_NEW_DESC = exports.TXT_COMMAND_PROJECT_LINK_CREATE_NEW = exports.ERR_COMMAND_PROJECT_LINK_DIR_NOT_DIR = exports.TXT_COMMAND_PROJECT_LINK_GIT_REPO_INITIALIZED = exports.TXT_COMMAND_PROJECT_LINK_GIT_REPO = exports.TXT_COMMAND_PROJECT_LINK_DIR_CONFIRM = exports.TXT_COMMAND_PROJECT_LINK_DIR_LINKED = exports.ERR_COMMAND_PROJECT_LINK_DIR_CREATE = exports.OPT_COMMAND_PROJECT_LINK_TRY_NOW = exports.OPT_COMMAND_PROJECT_LINK_SET_GIT_REMOTE = exports.OPT_COMMAND_PROJECT_LINK_HAS_REMOTE = exports.OPT_COMMAND_PROJECT_LINK_DIRECTORY = exports.OPT_COMMAND_PROJECT_LINK_GIT = exports.OPT_COMMAND_PROJECT_LINK_RELINK = exports.DESC_COMMAND_PROJECT_LINK = exports.DESC_COMMAND_PROJECT_LIST = exports.DESC_COMMAND_PROJECT_GIT = exports.DESC_COMMAND_PROJECT_GIT_CREDENTIAL = exports.DESC_COMMAND_PROJECT = exports.TXT_PACKAGE_VERSION_DOWNLOAD = void 0;
|
|
17
|
+
exports.EXAMPLE_PACKAGE_VERSION_DELETE = exports.EXAMPLE_PACKAGE_VERSION_GET = exports.EXAMPLE_PACKAGE_VERSION_LIST = exports.EXAMPLE_PACKAGE_CREATE = exports.EXAMPLE_PACKAGE_DELETE = exports.EXAMPLE_PACKAGE_DOWNLOAD = exports.EXAMPLE_PACKAGE_PUBLISH = exports.EXAMPLE_PIPELINE_RUN = exports.EXAMPLE_SANDBOX_ENDPOINT_LIST = exports.EXAMPLE_SANDBOX_ENDPOINT_GET = exports.EXAMPLE_SANDBOX_ENDPOINT_DELETE = exports.EXAMPLE_SANDBOX_ENDPOINT_CREATE = exports.EXAMPLE_SANDBOX_SNAPSHOT_LIST = exports.EXAMPLE_SANDBOX_SNAPSHOT_GET = exports.EXAMPLE_SANDBOX_SNAPSHOT_DELETE = void 0;
|
|
17
18
|
const utils_1 = require("./utils");
|
|
18
19
|
exports.ERR_REST_API_GENERAL_ERROR = 'Something went wrong';
|
|
19
20
|
exports.ERR_REST_API_NOT_RESPONDING = 'Api endpoint not responding. Try again later...';
|
|
@@ -538,8 +539,10 @@ exports.DESC_COMMAND_SANDBOX_DESTROY = 'Delete a sandbox';
|
|
|
538
539
|
exports.DESC_COMMAND_SANDBOX_START = 'Start a stopped sandbox';
|
|
539
540
|
exports.DESC_COMMAND_SANDBOX_STOP = 'Stop a running sandbox';
|
|
540
541
|
exports.DESC_COMMAND_SANDBOX_RESTART = 'Restart a sandbox';
|
|
542
|
+
exports.DESC_COMMAND_SANDBOX_LOGS = 'Get sandbox logs';
|
|
541
543
|
exports.DESC_COMMAND_SANDBOX_STATUS = 'Get sandbox status';
|
|
542
544
|
exports.DESC_COMMAND_SANDBOX_EXEC = 'Execute a command in sandbox';
|
|
545
|
+
exports.DESC_COMMAND_SANDBOX_APP = 'Manage sandbox apps';
|
|
543
546
|
// autocomplete
|
|
544
547
|
exports.DESC_COMMAND_AUTOCOMPLETE = 'Manage program autocomplete';
|
|
545
548
|
exports.DESC_COMMAND_AUTOCOMPLETE_INSTALL = 'Install program autocomplete';
|
|
@@ -554,16 +557,18 @@ exports.OPTION_SANDBOX_RESOURCES = 'Resource allocation: 1x2, 2x4, 4x8, 8x16, 12
|
|
|
554
557
|
exports.OPTION_SANDBOX_INSTALL_COMMANDS = 'Setup commands to run on creation (can be used multiple times)';
|
|
555
558
|
exports.OPTION_SANDBOX_TAGS = 'Tags to add on creation (can be used multiple times)';
|
|
556
559
|
exports.OPTION_SANDBOX_YAML = 'Complete sandbox YAML. To specify file use @path/to/file format in value';
|
|
557
|
-
exports.
|
|
560
|
+
exports.OPTION_SANDBOX_APP_COMMAND = 'Application command to run at startup (can be used multiple times)';
|
|
558
561
|
exports.OPTION_SANDBOX_APP_DIR = 'Application directory of the sandbox';
|
|
559
|
-
exports.OPTION_SANDBOX_APP_TYPE = 'Application type of the sandbox (CMD, SERVICE)';
|
|
560
562
|
exports.OPTION_SANDBOX_RUNTIME = 'Command runtime: BASH, JAVASCRIPT, TYPESCRIPT, PYTHON (default: BASH)';
|
|
561
563
|
// Sandbox errors
|
|
562
564
|
exports.ERR_SANDBOX_NOT_FOUND = 'Sandbox not found';
|
|
565
|
+
exports.ERR_SANDBOX_APP_NOT_FOUND = 'Sandbox app not found';
|
|
563
566
|
const ERR_SANDBOX_INVALID_RESOURCES = (resources) => `Invalid resources: ${resources}. Use: 1x2, 2x4, 4x8, 8x16, 12x24`;
|
|
564
567
|
exports.ERR_SANDBOX_INVALID_RESOURCES = ERR_SANDBOX_INVALID_RESOURCES;
|
|
565
568
|
exports.ERR_SANDBOX_SETUP_FAILED = 'Sandbox setup failed';
|
|
569
|
+
exports.ERR_SANDBOX_APP_FAILED = 'Sandbox app failed';
|
|
566
570
|
exports.ERR_SANDBOX_SETUP_TIMEOUT = 'Timeout waiting for sandbox setup';
|
|
571
|
+
exports.ERR_SANDBOX_APPS_TIMEOUT = 'Timeout waiting for sandbox apps';
|
|
567
572
|
exports.ERR_SANDBOX_RUNNING_TIMEOUT = 'Timeout waiting for sandbox running';
|
|
568
573
|
exports.ERR_SANDBOX_SNAPSHOT_TIMEOUT = 'Timeout waiting for sandbox snapshot';
|
|
569
574
|
exports.ERR_SANDBOX_STOP_TIMEOUT = 'Timeout waiting for sandbox stop';
|
|
@@ -572,8 +577,11 @@ exports.ERR_SANDBOX_NO_COMMANDS = 'No commands found for this sandbox';
|
|
|
572
577
|
exports.ERR_SANDBOX_STOP_FAILED = 'Sandbox failed to stop';
|
|
573
578
|
exports.OPTION_SANDBOX_WAIT_RUNNING = 'Wait until sandbox is running';
|
|
574
579
|
exports.OPTION_SANDBOX_WAIT_CONFIGURED = 'Wait until sandbox ran setup commands';
|
|
580
|
+
exports.OPTION_SANDBOX_WAIT_APPS = 'Wait until sandbox apps are running';
|
|
575
581
|
exports.OPTION_SANDBOX_WAIT = 'Wait until operation completes';
|
|
576
582
|
// Sandbox success messages
|
|
583
|
+
exports.TXT_SANDBOX_APP_STOPPED = `Sandbox app stopped`;
|
|
584
|
+
exports.TXT_SANDBOX_APP_STARTED = `Sandbox app started`;
|
|
577
585
|
const TXT_SANDBOX_CREATING = (name, identifier) => {
|
|
578
586
|
if (!name && !identifier)
|
|
579
587
|
return 'Creating sandbox';
|
|
@@ -598,14 +606,22 @@ const TXT_SANDBOX_STOPPED = (identifier) => `Sandbox stopped: ${identifier}`;
|
|
|
598
606
|
exports.TXT_SANDBOX_STOPPED = TXT_SANDBOX_STOPPED;
|
|
599
607
|
exports.TXT_SANDBOX_WAITING_RUNNING = 'Waiting for sandbox running...';
|
|
600
608
|
exports.TXT_SANDBOX_WAITING_SETUP = 'Waiting for sandbox setup...';
|
|
609
|
+
exports.TXT_SANDBOX_WAITING_APPS = 'Waiting for sandbox apps...';
|
|
601
610
|
exports.TXT_SANDBOX_WAITING_STOP = 'Waiting for sandbox stop...';
|
|
602
611
|
exports.TXT_SANDBOX_WAITING_START = 'Waiting for sandbox start...';
|
|
603
612
|
// Sandbox command subcommands
|
|
613
|
+
exports.DESC_COMMAND_SANDBOX_APP_LIST = 'List all apps';
|
|
604
614
|
exports.DESC_COMMAND_SANDBOX_EXEC_LIST = 'List all commands';
|
|
605
615
|
exports.DESC_COMMAND_SANDBOX_EXEC_STATUS = 'Get command status';
|
|
616
|
+
exports.DESC_COMMAND_SANDBOX_APP_LOGS = 'Get app logs';
|
|
617
|
+
exports.DESC_COMMAND_SANDBOX_APP_STATUS = 'Get app status';
|
|
618
|
+
exports.DESC_COMMAND_SANDBOX_APP_STOP = 'Stop sandbox app';
|
|
619
|
+
exports.DESC_COMMAND_SANDBOX_APP_START = 'Start sandbox app';
|
|
606
620
|
exports.DESC_COMMAND_SANDBOX_EXEC_LOGS = 'Get command logs';
|
|
607
621
|
exports.DESC_COMMAND_SANDBOX_EXEC_KILL = 'Kill a running command';
|
|
608
622
|
exports.OPTION_SANDBOX_COMMAND_ID = 'Command ID';
|
|
623
|
+
exports.OPTION_SANDBOX_APP_ID = 'App ID';
|
|
624
|
+
exports.OPTION_SANDBOX_LOGS_LIMIT = 'Sandbox logs limit. Default: 100 lines';
|
|
609
625
|
const OPTION_SANDBOX_COMMAND_KILL_CONFIRM = (identifier, commandId) => `Are you sure you want to kill sandbox '${identifier}' command '${commandId}'?`;
|
|
610
626
|
exports.OPTION_SANDBOX_COMMAND_KILL_CONFIRM = OPTION_SANDBOX_COMMAND_KILL_CONFIRM;
|
|
611
627
|
const TXT_SANDBOX_COMMAND_KILLED = (commandId) => `Command killed: ${commandId}`;
|
|
@@ -996,12 +1012,30 @@ exports.EXAMPLE_SANDBOX_EXEC_KILL = `
|
|
|
996
1012
|
|
|
997
1013
|
# kill command running in sandbox and automatically confirm killing:
|
|
998
1014
|
bdy sb exec kill sandbox-identifier command-id -f`;
|
|
1015
|
+
exports.EXAMPLE_SANDBOX_APP_LIST = `
|
|
1016
|
+
# list apps running in sandbox:
|
|
1017
|
+
bdy sb app ls sandbox-identifier
|
|
1018
|
+
|
|
1019
|
+
# list apps running in sandbox in different project:
|
|
1020
|
+
bdy sb app ls sandbox-identifier -p project`;
|
|
999
1021
|
exports.EXAMPLE_SANDBOX_EXEC_LIST = `
|
|
1000
1022
|
# list commands running in sandbox:
|
|
1001
1023
|
bdy sb exec ls sandbox-identifier
|
|
1002
1024
|
|
|
1003
1025
|
# list commands running in sandbox in different project:
|
|
1004
1026
|
bdy sb exec ls sandbox-identifier -p project`;
|
|
1027
|
+
exports.EXAMPLE_SANDBOX_APP_LOGS = `
|
|
1028
|
+
# show logs from app:
|
|
1029
|
+
bdy sb app logs sandbox-identifier app-id`;
|
|
1030
|
+
exports.EXAMPLE_SANDBOX_APP_START = `
|
|
1031
|
+
# start sandbox app:
|
|
1032
|
+
bdy sb app start sandbox-identifier app-id`;
|
|
1033
|
+
exports.EXAMPLE_SANDBOX_APP_STOP = `
|
|
1034
|
+
# stop sandbox app:
|
|
1035
|
+
bdy sb app stop sandbox-identifier app-id`;
|
|
1036
|
+
exports.EXAMPLE_SANDBOX_APP_STATUS = `
|
|
1037
|
+
# show status from app:
|
|
1038
|
+
bdy sb app status sandbox-identifier app-id`;
|
|
1005
1039
|
exports.EXAMPLE_SANDBOX_EXEC_LOGS = `
|
|
1006
1040
|
# show logs from command:
|
|
1007
1041
|
bdy sb exec logs sandbox-identifier command-id
|