bdy 1.16.28-stage → 1.16.30-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/api/client.js +32 -31
- package/distTs/src/command/package/create.js +10 -2
- package/distTs/src/command/package/delete.js +3 -1
- package/distTs/src/command/package/download.js +3 -120
- package/distTs/src/command/package/get.js +1 -1
- package/distTs/src/command/package/list.js +1 -1
- package/distTs/src/command/package/publish.js +4 -3
- package/distTs/src/command/package/version/delete.js +1 -0
- package/distTs/src/command/package/version/get.js +1 -0
- package/distTs/src/command/package/version/list.js +1 -0
- package/distTs/src/command/pipeline/run.js +1 -0
- package/distTs/src/command/sandbox/cp.js +79 -17
- package/distTs/src/command/sandbox/create.js +2 -15
- package/distTs/src/command/sandbox/endpoint/add.js +1 -0
- package/distTs/src/command/sandbox/endpoint/delete.js +1 -0
- package/distTs/src/command/sandbox/endpoint/get.js +1 -0
- package/distTs/src/command/sandbox/endpoint/list.js +1 -0
- package/distTs/src/command/sandbox/endpoint.js +4 -0
- package/distTs/src/command/sandbox/exec/command.js +1 -0
- package/distTs/src/command/sandbox/exec/kill.js +1 -0
- package/distTs/src/command/sandbox/exec/list.js +1 -0
- package/distTs/src/command/sandbox/exec/logs.js +1 -0
- package/distTs/src/command/sandbox/exec/status.js +1 -0
- package/distTs/src/command/sandbox/exec.js +5 -0
- package/distTs/src/command/sandbox/get.js +0 -1
- package/distTs/src/command/sandbox/snapshot/create.js +1 -0
- package/distTs/src/command/sandbox/snapshot/delete.js +1 -0
- package/distTs/src/command/sandbox/snapshot/get.js +1 -0
- package/distTs/src/command/sandbox/snapshot/list.js +2 -1
- package/distTs/src/command/sandbox/snapshot.js +4 -0
- package/distTs/src/command/sandbox/status.js +0 -1
- package/distTs/src/input.js +72 -2
- package/distTs/src/texts.js +234 -16
- package/distTs/src/utils.js +279 -3
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ commandSandboxEndpointList.option('--region <region>', texts_1.OPTION_REST_API_R
|
|
|
15
15
|
commandSandboxEndpointList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
16
16
|
commandSandboxEndpointList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
17
17
|
commandSandboxEndpointList.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
|
+
commandSandboxEndpointList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_ENDPOINT_LIST}`);
|
|
18
19
|
commandSandboxEndpointList.action(async (identifier, options) => {
|
|
19
20
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
20
21
|
const project = input_1.default.restApiProject(options.project);
|
|
@@ -15,4 +15,8 @@ commandSandboxEndpoint.addCommand(list_1.default);
|
|
|
15
15
|
commandSandboxEndpoint.addCommand(get_1.default);
|
|
16
16
|
commandSandboxEndpoint.addCommand(add_1.default);
|
|
17
17
|
commandSandboxEndpoint.addCommand(delete_1.default);
|
|
18
|
+
commandSandboxEndpoint.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_ENDPOINT_CREATE}
|
|
19
|
+
${texts_1.EXAMPLE_SANDBOX_ENDPOINT_DELETE}
|
|
20
|
+
${texts_1.EXAMPLE_SANDBOX_ENDPOINT_GET}
|
|
21
|
+
${texts_1.EXAMPLE_SANDBOX_ENDPOINT_LIST}`);
|
|
18
22
|
exports.default = commandSandboxEndpoint;
|
|
@@ -18,6 +18,7 @@ commandSandboxExecCommand.option('--runtime <runtime>', texts_1.OPTION_SANDBOX_R
|
|
|
18
18
|
commandSandboxExecCommand.option('--wait', texts_1.OPTION_SANDBOX_WAIT);
|
|
19
19
|
commandSandboxExecCommand.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
20
20
|
commandSandboxExecCommand.argument('<command>');
|
|
21
|
+
commandSandboxExecCommand.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_EXEC_COMMAND}`);
|
|
21
22
|
commandSandboxExecCommand.action(async (identifier, command, options) => {
|
|
22
23
|
output_1.default.handleSignals();
|
|
23
24
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
@@ -16,6 +16,7 @@ commandSandboxExecKill.option('-p, --project <name>', texts_1.OPTION_REST_API_PR
|
|
|
16
16
|
commandSandboxExecKill.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
17
17
|
commandSandboxExecKill.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
18
|
commandSandboxExecKill.argument('<command-id>', texts_1.OPTION_SANDBOX_COMMAND_ID);
|
|
19
|
+
commandSandboxExecKill.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_EXEC_KILL}`);
|
|
19
20
|
commandSandboxExecKill.action(async (identifier, commandId, options) => {
|
|
20
21
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
22
|
const project = input_1.default.restApiProject(options.project);
|
|
@@ -15,6 +15,7 @@ commandSandboxExecList.option('--region <region>', texts_1.OPTION_REST_API_REGIO
|
|
|
15
15
|
commandSandboxExecList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
16
16
|
commandSandboxExecList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
17
17
|
commandSandboxExecList.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
|
+
commandSandboxExecList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_EXEC_LIST}`);
|
|
18
19
|
commandSandboxExecList.action(async (identifier, options) => {
|
|
19
20
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
20
21
|
const project = input_1.default.restApiProject(options.project);
|
|
@@ -16,6 +16,7 @@ commandSandboxExecLogs.option('-p, --project <name>', texts_1.OPTION_REST_API_PR
|
|
|
16
16
|
commandSandboxExecLogs.option('--wait', texts_1.OPTION_SANDBOX_WAIT);
|
|
17
17
|
commandSandboxExecLogs.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
18
|
commandSandboxExecLogs.argument('<command-id>', texts_1.OPTION_SANDBOX_COMMAND_ID);
|
|
19
|
+
commandSandboxExecLogs.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_EXEC_LOGS}`);
|
|
19
20
|
commandSandboxExecLogs.action(async (identifier, commandId, options) => {
|
|
20
21
|
output_1.default.handleSignals();
|
|
21
22
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
@@ -15,6 +15,7 @@ commandSandboxExecStatus.option('-w, --workspace <domain>', texts_1.OPTION_REST_
|
|
|
15
15
|
commandSandboxExecStatus.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
16
16
|
commandSandboxExecStatus.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
17
|
commandSandboxExecStatus.argument('<command-id>', texts_1.OPTION_SANDBOX_COMMAND_ID);
|
|
18
|
+
commandSandboxExecStatus.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_EXEC_STATUS}`);
|
|
18
19
|
commandSandboxExecStatus.action(async (identifier, commandId, options) => {
|
|
19
20
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
20
21
|
const project = input_1.default.restApiProject(options.project);
|
|
@@ -16,4 +16,9 @@ commandSandboxExec.addCommand(status_1.default);
|
|
|
16
16
|
commandSandboxExec.addCommand(kill_1.default);
|
|
17
17
|
commandSandboxExec.addCommand(list_1.default);
|
|
18
18
|
commandSandboxExec.addCommand(logs_1.default);
|
|
19
|
+
commandSandboxExec.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_EXEC_COMMAND}
|
|
20
|
+
${texts_1.EXAMPLE_SANDBOX_EXEC_KILL}
|
|
21
|
+
${texts_1.EXAMPLE_SANDBOX_EXEC_LIST}
|
|
22
|
+
${texts_1.EXAMPLE_SANDBOX_EXEC_LOGS}
|
|
23
|
+
${texts_1.EXAMPLE_SANDBOX_EXEC_STATUS}`);
|
|
19
24
|
exports.default = commandSandboxExec;
|
|
@@ -32,7 +32,6 @@ commandSandboxGet.action(async (identifier, options) => {
|
|
|
32
32
|
['Name', sandbox.name || '-'],
|
|
33
33
|
['Status', sandbox.status || '-'],
|
|
34
34
|
['Setup Status', sandbox.setup_status || '-'],
|
|
35
|
-
['App Status', sandbox.app_status || '-'],
|
|
36
35
|
['OS', sandbox.os || '-'],
|
|
37
36
|
['Resources', sandbox.resources || '-'],
|
|
38
37
|
['Tags', (sandbox.tags || []).join(', ') || '-'],
|
|
@@ -18,6 +18,7 @@ commandSandboxSnapshotCreate.option('-p, --project <name>', texts_1.OPTION_REST_
|
|
|
18
18
|
commandSandboxSnapshotCreate.option('-n, --name <name>', texts_1.OPTION_SANDBOX_SNAPSHOT_NAME);
|
|
19
19
|
commandSandboxSnapshotCreate.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
20
20
|
commandSandboxSnapshotCreate.option('--wait [seconds]', texts_1.OPTION_SANDBOX_WAIT);
|
|
21
|
+
commandSandboxSnapshotCreate.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_CREATE}`);
|
|
21
22
|
commandSandboxSnapshotCreate.action(async (identifier, options) => {
|
|
22
23
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
23
24
|
const project = input_1.default.restApiProject(options.project);
|
|
@@ -17,6 +17,7 @@ commandSandboxSnapshotDelete.option('-p, --project <name>', texts_1.OPTION_REST_
|
|
|
17
17
|
commandSandboxSnapshotDelete.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
18
18
|
commandSandboxSnapshotDelete.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
19
19
|
commandSandboxSnapshotDelete.argument('<snapshot-name>', texts_1.OPTION_SANDBOX_SNAPSHOT_NAME_ARG);
|
|
20
|
+
commandSandboxSnapshotDelete.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_DELETE}`);
|
|
20
21
|
commandSandboxSnapshotDelete.action(async (identifier, snapshotName, options) => {
|
|
21
22
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
22
23
|
const project = input_1.default.restApiProject(options.project);
|
|
@@ -15,6 +15,7 @@ commandSandboxSnapshotGet.option('-w, --workspace <domain>', texts_1.OPTION_REST
|
|
|
15
15
|
commandSandboxSnapshotGet.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
16
16
|
commandSandboxSnapshotGet.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
17
|
commandSandboxSnapshotGet.argument('<snapshot-name>', texts_1.OPTION_SANDBOX_SNAPSHOT_NAME_ARG);
|
|
18
|
+
commandSandboxSnapshotGet.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_GET}`);
|
|
18
19
|
commandSandboxSnapshotGet.action(async (identifier, snapshotName, options) => {
|
|
19
20
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
20
21
|
const project = input_1.default.restApiProject(options.project);
|
|
@@ -15,6 +15,7 @@ commandSandboxSnapshotList.option('--region <region>', texts_1.OPTION_REST_API_R
|
|
|
15
15
|
commandSandboxSnapshotList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
16
16
|
commandSandboxSnapshotList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
17
17
|
commandSandboxSnapshotList.argument('[identifier]', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
|
+
commandSandboxSnapshotList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_SNAPSHOT_LIST}`);
|
|
18
19
|
commandSandboxSnapshotList.action(async (identifier, options) => {
|
|
19
20
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
20
21
|
const project = input_1.default.restApiProject(options.project);
|
|
@@ -43,7 +44,7 @@ commandSandboxSnapshotList.action(async (identifier, options) => {
|
|
|
43
44
|
snapshot.name || '-',
|
|
44
45
|
snapshot.status || '-',
|
|
45
46
|
snapshot.create_date || '-',
|
|
46
|
-
snapshot.html_url || '-'
|
|
47
|
+
snapshot.html_url || '-',
|
|
47
48
|
]);
|
|
48
49
|
}
|
|
49
50
|
output_1.default.table(data);
|
|
@@ -15,4 +15,8 @@ commandSandboxSnapshot.addCommand(list_1.default);
|
|
|
15
15
|
commandSandboxSnapshot.addCommand(create_1.default);
|
|
16
16
|
commandSandboxSnapshot.addCommand(get_1.default);
|
|
17
17
|
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}`);
|
|
18
22
|
exports.default = commandSandboxSnapshot;
|
|
@@ -29,7 +29,6 @@ commandSandboxStatus.action(async (identifier, options) => {
|
|
|
29
29
|
['Type', 'Status'],
|
|
30
30
|
['Status', sandbox.status || 'UNKNOWN'],
|
|
31
31
|
['Setup', sandbox.setup_status || 'UNKNOWN'],
|
|
32
|
-
['App', sandbox.app_status || 'UNKNOWN']
|
|
33
32
|
]);
|
|
34
33
|
output_1.default.exitNormal();
|
|
35
34
|
});
|
package/distTs/src/input.js
CHANGED
|
@@ -493,7 +493,28 @@ class Input {
|
|
|
493
493
|
identifier: s[0],
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
|
-
static
|
|
496
|
+
static restApiSandboxIsUpload(destPath) {
|
|
497
|
+
return (destPath || '').split(':').length === 2;
|
|
498
|
+
}
|
|
499
|
+
static restApiSandboxDownloadSourcePath(source) {
|
|
500
|
+
const s = (source || '').split(':');
|
|
501
|
+
if (s.length !== 2) {
|
|
502
|
+
output_1.default.exitError(texts_1.ERR_SANDBOX_CP_INVALID_SOURCE);
|
|
503
|
+
}
|
|
504
|
+
const identifier = s[0];
|
|
505
|
+
let sourcePath = s[1];
|
|
506
|
+
if (!identifier) {
|
|
507
|
+
output_1.default.exitError(texts_1.ERR_SANDBOX_CP_INVALID_SOURCE);
|
|
508
|
+
}
|
|
509
|
+
if (!sourcePath.startsWith('/')) {
|
|
510
|
+
sourcePath = `/${sourcePath}`;
|
|
511
|
+
}
|
|
512
|
+
return {
|
|
513
|
+
identifier,
|
|
514
|
+
sourcePath,
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
static restApiSandboxUploadDestinationPath(destPath) {
|
|
497
518
|
const s = (destPath || '').split(':');
|
|
498
519
|
if (s.length !== 2) {
|
|
499
520
|
output_1.default.exitError(texts_1.ERR_SANDBOX_CP_INVALID_DEST);
|
|
@@ -511,7 +532,56 @@ class Input {
|
|
|
511
532
|
remotePath,
|
|
512
533
|
};
|
|
513
534
|
}
|
|
514
|
-
static
|
|
535
|
+
static restApiSandboxDownloadDestinationPath(destPath, merge, replace) {
|
|
536
|
+
const dirPath = node_path_1.default.resolve(destPath);
|
|
537
|
+
const exists = node_fs_1.default.existsSync(dirPath);
|
|
538
|
+
if (!exists) {
|
|
539
|
+
try {
|
|
540
|
+
node_fs_1.default.mkdirSync(dirPath, {
|
|
541
|
+
recursive: true,
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
catch {
|
|
545
|
+
output_1.default.exitError((0, texts_1.ERR_SANDBOX_CP_MKDIR)(dirPath));
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
else if (replace) {
|
|
549
|
+
try {
|
|
550
|
+
node_fs_1.default.rmSync(dirPath, {
|
|
551
|
+
recursive: true,
|
|
552
|
+
force: true,
|
|
553
|
+
});
|
|
554
|
+
node_fs_1.default.mkdirSync(dirPath, {
|
|
555
|
+
recursive: true,
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
catch {
|
|
559
|
+
output_1.default.exitError((0, texts_1.ERR_SANDBOX_CP_REPLACE)(dirPath));
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
try {
|
|
563
|
+
const stats = node_fs_1.default.statSync(dirPath);
|
|
564
|
+
if (!stats.isDirectory()) {
|
|
565
|
+
output_1.default.exitError((0, texts_1.ERR_SANDBOX_CP_DEST_NOT_FOLDER)(destPath));
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
catch {
|
|
569
|
+
output_1.default.exitError(texts_1.ERR_SWW);
|
|
570
|
+
}
|
|
571
|
+
let empty = true;
|
|
572
|
+
try {
|
|
573
|
+
const entries = node_fs_1.default.readdirSync(dirPath);
|
|
574
|
+
empty = !entries.length;
|
|
575
|
+
}
|
|
576
|
+
catch {
|
|
577
|
+
output_1.default.exitError((0, texts_1.ERR_SANDBOX_CP_READDIR)(dirPath));
|
|
578
|
+
}
|
|
579
|
+
if (!empty && !merge) {
|
|
580
|
+
output_1.default.exitError((0, texts_1.ERR_SANDBOX_CP_NOT_EMPTY_DIR)(dirPath));
|
|
581
|
+
}
|
|
582
|
+
return dirPath;
|
|
583
|
+
}
|
|
584
|
+
static restApiSandboxUploadSourcePath(sourcePath) {
|
|
515
585
|
const s = node_path_1.default.resolve(sourcePath);
|
|
516
586
|
let sourceStats;
|
|
517
587
|
try {
|
package/distTs/src/texts.js
CHANGED
|
@@ -8,17 +8,27 @@ exports.OPTION_PACKAGE_DOWNLOAD_REPLACE = exports.OPTION_PACKAGE_DOWNLOAD_MERGE
|
|
|
8
8
|
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_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 = 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 = void 0;
|
|
9
9
|
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 = 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_DIR = exports.OPTION_SCRAPE_DELAY = exports.OPTION_SCRAPE_DARK_MODE = exports.OPTION_SCRAPE_WAIT_FOR_ELEMENT = exports.OPTION_SCRAPE_DEVICE_PIXEL_RATIO = exports.OPTION_SCRAPE_VIEWPORT = exports.OPTION_SCRAPE_BROWSER = 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 = void 0;
|
|
10
10
|
exports.DESC_COMMAND_SANDBOX_LIST = 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 = 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_TARGET = exports.LOG_DISABLING_AGENT_TARGET = exports.LOG_REMOVING_TUNNEL = void 0;
|
|
11
|
-
exports.OPTION_SANDBOX_COMMAND_KILL_CONFIRM = exports.OPTION_SANDBOX_COMMAND_ID = exports.DESC_COMMAND_SANDBOX_EXEC_KILL = exports.DESC_COMMAND_SANDBOX_EXEC_LOGS = exports.DESC_COMMAND_SANDBOX_EXEC_STATUS = exports.DESC_COMMAND_SANDBOX_EXEC_LIST = exports.TXT_SANDBOX_WAITING_START = exports.TXT_SANDBOX_WAITING_STOP = exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.TXT_PROJECT_NONE = exports.ERR_PROJECT_NO_PROJECTS = exports.TXT_LOGIN_SELECT_PROJECT = exports.TXT_PROJECT_SET_CLEARED = exports.TXT_PROJECT_SET_SUCCESS = void 0;
|
|
11
|
+
exports.DESC_COMMAND_SANDBOX_SNAPSHOT_CREATE = 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_COMMAND_ID = exports.DESC_COMMAND_SANDBOX_EXEC_KILL = exports.DESC_COMMAND_SANDBOX_EXEC_LOGS = exports.DESC_COMMAND_SANDBOX_EXEC_STATUS = exports.DESC_COMMAND_SANDBOX_EXEC_LIST = exports.TXT_SANDBOX_WAITING_START = exports.TXT_SANDBOX_WAITING_STOP = 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_CREATED = exports.TXT_SANDBOX_CREATING = exports.OPTION_SANDBOX_WAIT = 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_SETUP_TIMEOUT = exports.ERR_SANDBOX_SETUP_FAILED = exports.ERR_SANDBOX_INVALID_RESOURCES = exports.ERR_SANDBOX_NOT_FOUND = exports.OPTION_SANDBOX_RUNTIME = exports.OPTION_SANDBOX_APP_TYPE = exports.OPTION_SANDBOX_APP_DIR = exports.OPTION_SANDBOX_RUN_COMMAND = 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.DESC_COMMAND_SANDBOX_EXEC = exports.DESC_COMMAND_SANDBOX_STATUS = 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 = void 0;
|
|
12
|
+
exports.TXT_SANDBOX_EXEC_SUCCESS = exports.TXT_SANDBOX_EXEC_BACKGROUND = 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_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 = void 0;
|
|
13
|
+
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_API_MESSAGE_REPLACER = exports.ERR_LOGIN_INVALID_BASE_URL = exports.ERR_LOGIN_NO_PROJECT_FOUND = 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 = 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_WHOAMI_LOGOUT = exports.TXT_WHOAMI_NO_PROJECT = exports.TXT_WHOAMI_NO_WORKSPACE = exports.DESC_COMMAND_WHOAMI = exports.TXT_SANDBOX_EXEC_FAILED = exports.TXT_SANDBOX_EXEC_INPROGRESS = void 0;
|
|
14
|
+
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 = exports.EXAMPLE_SANDBOX_SNAPSHOT_CREATE = exports.EXAMPLE_SANDBOX_EXEC_STATUS = exports.EXAMPLE_SANDBOX_EXEC_LOGS = exports.EXAMPLE_SANDBOX_EXEC_LIST = exports.EXAMPLE_SANDBOX_EXEC_KILL = exports.EXAMPLE_SANDBOX_EXEC_COMMAND = exports.EXAMPLE_SANDBOX_CREATE = exports.EXAMPLE_SANDBOX_CP = exports.TXT_PROJECT_NONE = exports.ERR_PROJECT_NO_PROJECTS = exports.TXT_LOGIN_SELECT_PROJECT = exports.TXT_PROJECT_SET_CLEARED = exports.TXT_PROJECT_SET_SUCCESS = exports.DESC_COMMAND_PROJECT_GET = exports.ARG_COMMAND_PROJECT_NAME = exports.DESC_COMMAND_PROJECT_SET = exports.DESC_COMMAND_PROJECT_LIST = exports.DESC_COMMAND_PROJECT = exports.TXT_PACKAGE_VERSION_DOWNLOAD = exports.TXT_PACKAGE_PUBLISH = exports.TXT_PACKAGE_CREATED = exports.TXT_PACKAGE_VERSION_DELETED = void 0;
|
|
15
15
|
const utils_1 = require("./utils");
|
|
16
16
|
exports.ERR_REST_API_GENERAL_ERROR = 'Something went wrong';
|
|
17
17
|
exports.ERR_REST_API_NOT_RESPONDING = 'Api endpoint not responding. Try again later...';
|
|
18
18
|
exports.ERR_REST_API_CONNECT_ERROR = 'Connection refused. Check selected endpoint';
|
|
19
19
|
exports.ERR_REST_API_WRONG_TOKEN = 'Valid token with proper scopes is required';
|
|
20
20
|
exports.ERR_REST_API_RESOURCE_NOT_FOUND = 'Resource not found';
|
|
21
|
-
|
|
21
|
+
const ERR_REST_API_RATE_LIMIT = (rateLimitReset) => {
|
|
22
|
+
if (rateLimitReset) {
|
|
23
|
+
const ts = Array.isArray(rateLimitReset)
|
|
24
|
+
? rateLimitReset[0]
|
|
25
|
+
: rateLimitReset;
|
|
26
|
+
const date = new Date(parseInt(ts, 10) * 1000);
|
|
27
|
+
return `Buddy API rate limit exceeded. Window will be reset at ${date.toISOString()}`;
|
|
28
|
+
}
|
|
29
|
+
return 'Buddy API rate limit exceeded';
|
|
30
|
+
};
|
|
31
|
+
exports.ERR_REST_API_RATE_LIMIT = ERR_REST_API_RATE_LIMIT;
|
|
22
32
|
exports.ERR_REST_API_TOKEN = 'Personal access token is required (--token)';
|
|
23
33
|
exports.ERR_REST_API_URL = 'Valid rest api endpoint is required (--api)';
|
|
24
34
|
exports.ERR_REST_API_REGION = 'Valid rest api region is required (eu, us, as, onprem)';
|
|
@@ -514,9 +524,7 @@ exports.ERR_SANDBOX_NOT_FOUND = 'Sandbox not found';
|
|
|
514
524
|
const ERR_SANDBOX_INVALID_RESOURCES = (resources) => `Invalid resources: ${resources}. Use: 1x2, 2x4, 4x8, 8x16, 12x24`;
|
|
515
525
|
exports.ERR_SANDBOX_INVALID_RESOURCES = ERR_SANDBOX_INVALID_RESOURCES;
|
|
516
526
|
exports.ERR_SANDBOX_SETUP_FAILED = 'Sandbox setup failed';
|
|
517
|
-
exports.ERR_SANDBOX_APP_FAILED = 'Sandbox app failed';
|
|
518
527
|
exports.ERR_SANDBOX_SETUP_TIMEOUT = 'Timeout waiting for sandbox setup';
|
|
519
|
-
exports.ERR_SANDBOX_APP_TIMEOUT = 'Timeout waiting for sandbox app';
|
|
520
528
|
exports.ERR_SANDBOX_RUNNING_TIMEOUT = 'Timeout waiting for sandbox running';
|
|
521
529
|
exports.ERR_SANDBOX_SNAPSHOT_TIMEOUT = 'Timeout waiting for sandbox snapshot';
|
|
522
530
|
exports.ERR_SANDBOX_STOP_TIMEOUT = 'Timeout waiting for sandbox stop';
|
|
@@ -525,7 +533,6 @@ exports.ERR_SANDBOX_NO_COMMANDS = 'No commands found for this sandbox';
|
|
|
525
533
|
exports.ERR_SANDBOX_STOP_FAILED = 'Sandbox failed to stop';
|
|
526
534
|
exports.OPTION_SANDBOX_WAIT_RUNNING = 'Wait until sandbox is running';
|
|
527
535
|
exports.OPTION_SANDBOX_WAIT_CONFIGURED = 'Wait until sandbox ran setup commands';
|
|
528
|
-
exports.OPTION_SANDBOX_WAIT_APP = 'Wait until sandbox ran ran app commands';
|
|
529
536
|
exports.OPTION_SANDBOX_WAIT = 'Wait until operation completes';
|
|
530
537
|
// Sandbox success messages
|
|
531
538
|
const TXT_SANDBOX_CREATING = (name, identifier) => `Creating sandbox: ${name} (${identifier})`;
|
|
@@ -544,7 +551,6 @@ const TXT_SANDBOX_STOPPED = (identifier) => `Sandbox stopped: ${identifier}`;
|
|
|
544
551
|
exports.TXT_SANDBOX_STOPPED = TXT_SANDBOX_STOPPED;
|
|
545
552
|
exports.TXT_SANDBOX_WAITING_RUNNING = 'Waiting for sandbox running...';
|
|
546
553
|
exports.TXT_SANDBOX_WAITING_SETUP = 'Waiting for sandbox setup...';
|
|
547
|
-
exports.TXT_SANDBOX_WAITING_APP = 'Waiting for sandbox app...';
|
|
548
554
|
exports.TXT_SANDBOX_WAITING_STOP = 'Waiting for sandbox stop...';
|
|
549
555
|
exports.TXT_SANDBOX_WAITING_START = 'Waiting for sandbox start...';
|
|
550
556
|
// Sandbox command subcommands
|
|
@@ -598,16 +604,34 @@ exports.ERR_SANDBOX_ENDPOINT_NOT_FOUND = 'Endpoint not found';
|
|
|
598
604
|
exports.ERR_SANDBOX_ENDPOINTS_NOT_FOUND = 'No endpoints found';
|
|
599
605
|
// Sandbox cp command
|
|
600
606
|
exports.DESC_COMMAND_SANDBOX_CP = 'Copy files/directories to sandbox';
|
|
601
|
-
exports.OPTION_SANDBOX_CP_SOURCE = '
|
|
602
|
-
exports.OPTION_SANDBOX_CP_DEST = 'Sandbox
|
|
603
|
-
exports.
|
|
604
|
-
|
|
607
|
+
exports.OPTION_SANDBOX_CP_SOURCE = 'Upload: local file (directory) path to upload. Download: sandbox remote file (directory): sandbox-id:/path to download';
|
|
608
|
+
exports.OPTION_SANDBOX_CP_DEST = 'Upload: Sandbox remote directory: sandbox-id:/path to upload to. Download: local directory path to download to';
|
|
609
|
+
exports.OPTION_SANDBOX_CP_DOWNLOAD_MERGE = 'Merge contents of the destination directory with sandbox content';
|
|
610
|
+
exports.OPTION_SANDBOX_CP_DOWNLOAD_REPLACE = 'Replace contents of the destination directory with sandbox content';
|
|
611
|
+
exports.TXT_SANDBOX_CP_DOWNLOAD = 'Downloading...';
|
|
612
|
+
exports.TXT_SANDBOX_CP_DOWNLOAD_DONE = 'Downloading...Done';
|
|
613
|
+
exports.TXT_SANDBOX_UNZIP = 'Unzipping...';
|
|
614
|
+
exports.TXT_SANDBOX_UNZIP_DONE = 'Unzipping...Done';
|
|
615
|
+
const TXT_SANDBOX_UNZIPPING_COUNT = (count) => `Unzipping...${count}`;
|
|
616
|
+
exports.TXT_SANDBOX_UNZIPPING_COUNT = TXT_SANDBOX_UNZIPPING_COUNT;
|
|
617
|
+
const TXT_SANDBOX_CP_PROGRESS = (current, total, file) => `Uploading...[${current}/${total}] ${file}`;
|
|
605
618
|
exports.TXT_SANDBOX_CP_PROGRESS = TXT_SANDBOX_CP_PROGRESS;
|
|
606
619
|
const TXT_SANDBOX_CP_DONE = (count) => `Copied ${count} file(s)`;
|
|
607
620
|
exports.TXT_SANDBOX_CP_DONE = TXT_SANDBOX_CP_DONE;
|
|
608
621
|
const ERR_SANDBOX_CP_SOURCE_NOT_FOUND = (path) => `Source not found: ${path}`;
|
|
609
622
|
exports.ERR_SANDBOX_CP_SOURCE_NOT_FOUND = ERR_SANDBOX_CP_SOURCE_NOT_FOUND;
|
|
623
|
+
const ERR_SANDBOX_CP_DEST_NOT_FOLDER = (path) => `Path ${path} is not a directory. Change path or use --replace flag`;
|
|
624
|
+
exports.ERR_SANDBOX_CP_DEST_NOT_FOLDER = ERR_SANDBOX_CP_DEST_NOT_FOLDER;
|
|
625
|
+
const ERR_SANDBOX_CP_READDIR = (dirPath) => `Error while reading directory ${dirPath}`;
|
|
626
|
+
exports.ERR_SANDBOX_CP_READDIR = ERR_SANDBOX_CP_READDIR;
|
|
627
|
+
const ERR_SANDBOX_CP_NOT_EMPTY_DIR = (dirPath) => `Directory ${dirPath} is not empty. Use --merge or --replace flags`;
|
|
628
|
+
exports.ERR_SANDBOX_CP_NOT_EMPTY_DIR = ERR_SANDBOX_CP_NOT_EMPTY_DIR;
|
|
629
|
+
const ERR_SANDBOX_CP_MKDIR = (dirPath) => `Error while creating directory ${dirPath}`;
|
|
630
|
+
exports.ERR_SANDBOX_CP_MKDIR = ERR_SANDBOX_CP_MKDIR;
|
|
631
|
+
const ERR_SANDBOX_CP_REPLACE = (dirPath) => `Error while replacing directory ${dirPath}`;
|
|
632
|
+
exports.ERR_SANDBOX_CP_REPLACE = ERR_SANDBOX_CP_REPLACE;
|
|
610
633
|
exports.ERR_SANDBOX_CP_INVALID_DEST = 'Invalid destination format. Use: sandbox-identifier:/path';
|
|
634
|
+
exports.ERR_SANDBOX_CP_INVALID_SOURCE = 'Invalid source format. Use: sandbox-identifier:/path';
|
|
611
635
|
// Sandbox exec command
|
|
612
636
|
const TXT_SANDBOX_EXEC_ID = (id) => `Command id: ${id}`;
|
|
613
637
|
exports.TXT_SANDBOX_EXEC_ID = TXT_SANDBOX_EXEC_ID;
|
|
@@ -649,7 +673,7 @@ exports.ERR_LOGIN_NO_WORKSPACES = 'No workspaces found for this token';
|
|
|
649
673
|
exports.ERR_LOGIN_NO_WORKSPACE_FOUND = 'Provided workspace has been not found';
|
|
650
674
|
exports.ERR_LOGIN_NO_PROJECT_FOUND = 'Provided project has been not found';
|
|
651
675
|
exports.ERR_LOGIN_INVALID_BASE_URL = 'Invalid URL format';
|
|
652
|
-
const ERR_API_MESSAGE_REPLACER = (message, path, baseUrl) => {
|
|
676
|
+
const ERR_API_MESSAGE_REPLACER = (message, path, baseUrl, rateLimitTs) => {
|
|
653
677
|
let workspaceUrl = null;
|
|
654
678
|
if (path && baseUrl) {
|
|
655
679
|
const m = /\/workspaces\/([^/]+)\//.exec(path);
|
|
@@ -664,6 +688,9 @@ const ERR_API_MESSAGE_REPLACER = (message, path, baseUrl) => {
|
|
|
664
688
|
message += `: ${workspaceUrl}`;
|
|
665
689
|
}
|
|
666
690
|
}
|
|
691
|
+
if (message === 'Rate limit exceeded') {
|
|
692
|
+
return (0, exports.ERR_REST_API_RATE_LIMIT)(rateLimitTs);
|
|
693
|
+
}
|
|
667
694
|
return message;
|
|
668
695
|
};
|
|
669
696
|
exports.ERR_API_MESSAGE_REPLACER = ERR_API_MESSAGE_REPLACER;
|
|
@@ -692,15 +719,27 @@ exports.OPT_COMMAND_PACKAGE_VERSION = 'Package version';
|
|
|
692
719
|
exports.ERR_COMMAND_PACKAGE_TYPE = 'Wrong package type. Allowed: FILE, CONTAINER';
|
|
693
720
|
exports.TXT_PACKAGE_DELETED = 'Package deleted successfully';
|
|
694
721
|
exports.TXT_PACKAGE_VERSION_DELETED = 'Package version deleted successfully';
|
|
695
|
-
const TXT_PACKAGE_CREATED = (workspace, pkg) => {
|
|
722
|
+
const TXT_PACKAGE_CREATED = (baseUrl, workspace, pkg) => {
|
|
696
723
|
let txt = `Package added: ${pkg.name} (${pkg.identifier})\n${pkg.html_url}\n\n`;
|
|
724
|
+
txt += (0, exports.TXT_PACKAGE_PUBLISH)(baseUrl, workspace, pkg);
|
|
725
|
+
return txt;
|
|
726
|
+
};
|
|
727
|
+
exports.TXT_PACKAGE_CREATED = TXT_PACKAGE_CREATED;
|
|
728
|
+
const TXT_PACKAGE_PUBLISH = (baseUrl, workspace, pkg) => {
|
|
729
|
+
let txt = '';
|
|
697
730
|
if (pkg.type === utils_1.PACKAGE_TYPE.FILE) {
|
|
698
731
|
txt += 'To publish a version:\n';
|
|
699
732
|
txt += ` bdy pkg publish ${pkg.identifier}@1.0.0 ./dist`;
|
|
700
733
|
}
|
|
734
|
+
else if (pkg.type === utils_1.PACKAGE_TYPE.CONTAINER) {
|
|
735
|
+
txt += 'Docker login:\n';
|
|
736
|
+
txt += ' bdy pkg docker login\n';
|
|
737
|
+
txt += 'Push:\n';
|
|
738
|
+
txt += ` docker push ${(0, utils_1.getDockerRegistryHostByApiBaseUrl)(baseUrl)}/${encodeURIComponent(workspace)}/${encodeURIComponent(pkg.identifier)}:latest`;
|
|
739
|
+
}
|
|
701
740
|
return txt;
|
|
702
741
|
};
|
|
703
|
-
exports.
|
|
742
|
+
exports.TXT_PACKAGE_PUBLISH = TXT_PACKAGE_PUBLISH;
|
|
704
743
|
const TXT_PACKAGE_VERSION_DOWNLOAD = (type, identifier, version, versionUrl) => {
|
|
705
744
|
let txt = '';
|
|
706
745
|
if (type === utils_1.PACKAGE_TYPE.FILE) {
|
|
@@ -727,3 +766,182 @@ exports.TXT_PROJECT_SET_CLEARED = 'Project cleared';
|
|
|
727
766
|
exports.TXT_LOGIN_SELECT_PROJECT = 'Select project (optional):';
|
|
728
767
|
exports.ERR_PROJECT_NO_PROJECTS = 'No projects found in this workspace';
|
|
729
768
|
exports.TXT_PROJECT_NONE = 'No project configured. Run "bdy login" or "bdy project set" first.';
|
|
769
|
+
// Examples
|
|
770
|
+
exports.EXAMPLE_SANDBOX_CP = `
|
|
771
|
+
EXAMPLES:
|
|
772
|
+
# copy file from sandbox to new local directory:
|
|
773
|
+
bdy sb cp sandbox-identifier:/path/to/file /path/to/dir
|
|
774
|
+
|
|
775
|
+
# copy contents of directory from sandbox to existing local directory merging it contents:
|
|
776
|
+
bdy sb cp sandbox-identifier:/path/to/dir /path/to/dir --merge
|
|
777
|
+
|
|
778
|
+
# copy contents of directory from sandbox to existing local directory replacing it contents:
|
|
779
|
+
bdy sb co sandbox-identifier:/path/to/dir /path/to/dir --replace
|
|
780
|
+
|
|
781
|
+
# copy local file to sandbox directory:
|
|
782
|
+
bdy sb cp /path/to/file sandbox-identifier:/path/to/dir
|
|
783
|
+
|
|
784
|
+
# copy contents of local directory to sandbox directory:
|
|
785
|
+
bdy sb cp /path/to/dir sandbox-identifier:/path/to/dir`;
|
|
786
|
+
exports.EXAMPLE_SANDBOX_CREATE = `
|
|
787
|
+
EXAMPLES:
|
|
788
|
+
# create ubuntu 22.04 sandbox with name and wait for start:
|
|
789
|
+
bdy sb create -n "name" --os ubuntu:22.04 --wait-for-running
|
|
790
|
+
|
|
791
|
+
# create sandbox with identifier, run install commands and wait for start & commands to complete:
|
|
792
|
+
bdy sb create -i "test" --install-command "apt-get update && apt-get install curl -y" --wait-for-configure
|
|
793
|
+
|
|
794
|
+
# create sandbox with custom resources and tag it:
|
|
795
|
+
bdy sb create --resources 4x8 --tag "tag1" --tag "tag2"`;
|
|
796
|
+
exports.EXAMPLE_SANDBOX_EXEC_COMMAND = `
|
|
797
|
+
# ran command in sandbox:
|
|
798
|
+
bdy sb exec command sandbox-identifier "ls -la"
|
|
799
|
+
|
|
800
|
+
# ran command in sandbox and wait for it to complete:
|
|
801
|
+
bdy sb exec command sandbox-identifier "sleep 10" --wait`;
|
|
802
|
+
exports.EXAMPLE_SANDBOX_EXEC_KILL = `
|
|
803
|
+
# kill command running in sandbox:
|
|
804
|
+
bdy sb exec kill sandbox-identifier command-id
|
|
805
|
+
|
|
806
|
+
# kill command running in sandbox and automatically confirm killing:
|
|
807
|
+
bdy sb exec kill sandbox-identifier command-id -f`;
|
|
808
|
+
exports.EXAMPLE_SANDBOX_EXEC_LIST = `
|
|
809
|
+
# list commands running in sandbox:
|
|
810
|
+
bdy sb exec ls sandbox-identifier
|
|
811
|
+
|
|
812
|
+
# list commands running in sandbox in different project:
|
|
813
|
+
bdy sb exec ls sandbox-identifier -p project`;
|
|
814
|
+
exports.EXAMPLE_SANDBOX_EXEC_LOGS = `
|
|
815
|
+
# show logs from command:
|
|
816
|
+
bdy sb exec logs sandbox-identifier command-id
|
|
817
|
+
|
|
818
|
+
# show logs from command and wait for it to complete:
|
|
819
|
+
bdy sb exec logs sandbox-identifier command-id --wait`;
|
|
820
|
+
exports.EXAMPLE_SANDBOX_EXEC_STATUS = `
|
|
821
|
+
# show status of command:
|
|
822
|
+
bdy sb exec status sandbox-identifier command-id
|
|
823
|
+
|
|
824
|
+
# show status of command in sandbox from another workspace:
|
|
825
|
+
bdy sb exec status sandbox-identifier command-id -w workspace -p project`;
|
|
826
|
+
exports.EXAMPLE_SANDBOX_SNAPSHOT_CREATE = `
|
|
827
|
+
# create snapshot of sandbox with name:
|
|
828
|
+
bdy sb snap create sandbox-identifier -n "my-snapshot"
|
|
829
|
+
|
|
830
|
+
# create snapshot of sandbox and wait for it to complete:
|
|
831
|
+
bdy sb snap create sandbox-identifier --wait`;
|
|
832
|
+
exports.EXAMPLE_SANDBOX_SNAPSHOT_DELETE = `
|
|
833
|
+
# delete snapshot of sandbox:
|
|
834
|
+
bdy sb snap rm sandbox-identifier my-snapshot
|
|
835
|
+
|
|
836
|
+
# delete snapshot of sandbox and automatically confirm deletion:
|
|
837
|
+
bdy sb snap rm sandbox-identifier my-snapshot -f`;
|
|
838
|
+
exports.EXAMPLE_SANDBOX_SNAPSHOT_GET = `
|
|
839
|
+
# get snapshot info:
|
|
840
|
+
bdy sb snap get sandbox-identifier my-snapshot
|
|
841
|
+
|
|
842
|
+
# get snapshot info from sandbox in another project:
|
|
843
|
+
bdy sb snap get sandbox-identifier my-snapshot -p project`;
|
|
844
|
+
exports.EXAMPLE_SANDBOX_SNAPSHOT_LIST = `
|
|
845
|
+
# list snapshots of sandbox:
|
|
846
|
+
bdy sb snap ls sandbox-identifier
|
|
847
|
+
|
|
848
|
+
# list snapshots in default project:
|
|
849
|
+
bdy sb snap ls`;
|
|
850
|
+
exports.EXAMPLE_SANDBOX_ENDPOINT_CREATE = `
|
|
851
|
+
# create http endpoint on port 80
|
|
852
|
+
bdy sb ep create sandbox-identifier -e 80
|
|
853
|
+
|
|
854
|
+
# create http server and serve files from sandbox directory:
|
|
855
|
+
bdy sb ep create sandbox-identifier -s /path/to/dir
|
|
856
|
+
|
|
857
|
+
# create tcp endpoint on port 22 with name:
|
|
858
|
+
bdy sb ep create sandbox-identifier -t TCP -e 22 -n test`;
|
|
859
|
+
exports.EXAMPLE_SANDBOX_ENDPOINT_DELETE = `
|
|
860
|
+
# delete sandbox endpoint:
|
|
861
|
+
bdy sb ep rm sandbox-identifier test
|
|
862
|
+
|
|
863
|
+
# delete sandbox endpoint in another project and automatically confirm deletion:
|
|
864
|
+
bdy sb ep rm sandbox-identifier test -p project -f`;
|
|
865
|
+
exports.EXAMPLE_SANDBOX_ENDPOINT_GET = `
|
|
866
|
+
# get sandbox endpoint:
|
|
867
|
+
bdy sb ep get sandbox-identifier test
|
|
868
|
+
|
|
869
|
+
# get sandbox endpoint in another project:
|
|
870
|
+
bdy sb ep get sandbox-identifier test -p project`;
|
|
871
|
+
exports.EXAMPLE_SANDBOX_ENDPOINT_LIST = `
|
|
872
|
+
# list sandbox endpoints:
|
|
873
|
+
bdy sb ep ls sandbox-identifier
|
|
874
|
+
|
|
875
|
+
# list sandbox endpoints in another project:
|
|
876
|
+
bdy sb ep ls sandbox-identifier -p project`;
|
|
877
|
+
exports.EXAMPLE_PIPELINE_RUN = `
|
|
878
|
+
EXAMPLES:
|
|
879
|
+
# run pipeline with high priority and upload everything from scratch
|
|
880
|
+
bdy pip run pipeline-identifier --priority HIGH -f
|
|
881
|
+
|
|
882
|
+
# run pipeline without cache and wait for execution to complete
|
|
883
|
+
bdy pip run pipeline-identifier --wait -c
|
|
884
|
+
|
|
885
|
+
# run pipeline and pass custom variables to execution
|
|
886
|
+
bdy pip run pipeline-identifier -v key:val -v a:b`;
|
|
887
|
+
exports.EXAMPLE_PACKAGE_PUBLISH = `
|
|
888
|
+
EXAMPLES:
|
|
889
|
+
# publish new version of file package:
|
|
890
|
+
bdy pkg pub package-identifier@version /path/to/dir
|
|
891
|
+
|
|
892
|
+
# create new file package:
|
|
893
|
+
bdy pkg pub package-identifier --create
|
|
894
|
+
|
|
895
|
+
# overwrite existing version:
|
|
896
|
+
bdy pkg pub package-identifier@version /path/to/dir -f`;
|
|
897
|
+
exports.EXAMPLE_PACKAGE_DOWNLOAD = `
|
|
898
|
+
EXAMPLES:
|
|
899
|
+
# download file package version to local directory:
|
|
900
|
+
bdy pkg dd package-identifier@version /path/to/dir
|
|
901
|
+
|
|
902
|
+
# download latest file package version and replace contents of existing local directory:
|
|
903
|
+
bdy pkg dd package-identifier /path/to/dir --replace
|
|
904
|
+
|
|
905
|
+
# download file package version and merge it with existing local directory:
|
|
906
|
+
bdy pkg dd package-identifier@version /path/to/dir --merge`;
|
|
907
|
+
exports.EXAMPLE_PACKAGE_DELETE = `
|
|
908
|
+
EXAMPLES:
|
|
909
|
+
# delete package:
|
|
910
|
+
bdy pkg rm package-identifier
|
|
911
|
+
|
|
912
|
+
# delete package and automatically confirm deletion:
|
|
913
|
+
bdy pkg rm package-identifier -f`;
|
|
914
|
+
exports.EXAMPLE_PACKAGE_CREATE = `
|
|
915
|
+
EXAMPLES:
|
|
916
|
+
# create file package with name:
|
|
917
|
+
bdy pkg create test
|
|
918
|
+
|
|
919
|
+
# create file package with buddy authorization and identifier
|
|
920
|
+
bdy pkg create test -b -i package-identifier
|
|
921
|
+
|
|
922
|
+
# create file package with basic authorization
|
|
923
|
+
bdy pkg create -a user:pass
|
|
924
|
+
|
|
925
|
+
# create docker containers package
|
|
926
|
+
bdy pkg create registry -t CONTAINER`;
|
|
927
|
+
exports.EXAMPLE_PACKAGE_VERSION_LIST = `
|
|
928
|
+
EXAMPLES:
|
|
929
|
+
# list package versions:
|
|
930
|
+
bdy pkg ver ls package-identifier
|
|
931
|
+
|
|
932
|
+
# list 20 package versions from page 2:
|
|
933
|
+
bdy pkg ver ls package-identifier --page 2 --per-page 20`;
|
|
934
|
+
exports.EXAMPLE_PACKAGE_VERSION_GET = `
|
|
935
|
+
EXAMPLES:
|
|
936
|
+
# get package version:
|
|
937
|
+
bdy pkg ver get package-identifier version
|
|
938
|
+
|
|
939
|
+
# get package version in another project:
|
|
940
|
+
bdy pkg ver get package-identifier version -p project`;
|
|
941
|
+
exports.EXAMPLE_PACKAGE_VERSION_DELETE = `
|
|
942
|
+
EXAMPLES:
|
|
943
|
+
# delete package version:
|
|
944
|
+
bdy pkg ver rm package-identifier version
|
|
945
|
+
|
|
946
|
+
# delete package version and automatically confirm deletion:
|
|
947
|
+
bdy pkg ver rm package-identifier version -f`;
|