bdy 1.16.27-dev → 1.16.28-stage
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/system.js +3 -1
- package/distTs/src/api/client.js +45 -22
- package/distTs/src/command/agent/install.js +1 -1
- package/distTs/src/command/agent/uninstall.js +5 -1
- package/distTs/src/command/package/create.js +59 -0
- package/distTs/src/command/package/delete.js +37 -0
- package/distTs/src/command/package/docker/login.js +26 -0
- package/distTs/src/command/package/docker.js +11 -0
- package/distTs/src/command/package/download.js +1 -2
- package/distTs/src/command/package/get.js +39 -0
- package/distTs/src/command/package/list.js +4 -3
- package/distTs/src/command/package/publish.js +17 -3
- package/distTs/src/command/package/version/delete.js +41 -0
- package/distTs/src/command/package/version/get.js +47 -0
- package/distTs/src/command/package/version/list.js +49 -0
- package/distTs/src/command/package/version.js +16 -0
- package/distTs/src/command/package.js +10 -0
- package/distTs/src/command/pipeline/run.js +1 -2
- package/distTs/src/command/project/list.js +2 -8
- package/distTs/src/command/project/set.js +1 -2
- package/distTs/src/command/sandbox/cp.js +1 -2
- package/distTs/src/command/sandbox/create.js +2 -2
- package/distTs/src/command/sandbox/destroy.js +7 -3
- package/distTs/src/command/sandbox/endpoint/add.js +2 -2
- package/distTs/src/command/sandbox/endpoint/delete.js +7 -2
- package/distTs/src/command/sandbox/endpoint/get.js +2 -3
- package/distTs/src/command/sandbox/endpoint/list.js +2 -2
- package/distTs/src/command/sandbox/exec/command.js +1 -2
- package/distTs/src/command/sandbox/exec/kill.js +6 -2
- package/distTs/src/command/sandbox/exec/list.js +1 -2
- package/distTs/src/command/sandbox/exec/logs.js +1 -2
- package/distTs/src/command/sandbox/exec/status.js +1 -2
- package/distTs/src/command/sandbox/get.js +2 -3
- package/distTs/src/command/sandbox/list.js +2 -3
- package/distTs/src/command/sandbox/restart.js +1 -2
- package/distTs/src/command/sandbox/snapshot/create.js +2 -2
- package/distTs/src/command/sandbox/snapshot/delete.js +7 -2
- package/distTs/src/command/sandbox/snapshot/get.js +2 -3
- package/distTs/src/command/sandbox/snapshot/list.js +1 -2
- package/distTs/src/command/sandbox/start.js +1 -2
- package/distTs/src/command/sandbox/status.js +1 -2
- package/distTs/src/command/sandbox/stop.js +1 -2
- package/distTs/src/command/workspace/list.js +2 -3
- package/distTs/src/command/workspace/set.js +1 -2
- package/distTs/src/input.js +27 -2
- package/distTs/src/output.js +13 -4
- package/distTs/src/texts.js +150 -90
- package/distTs/src/utils.js +95 -16
- package/package.json +1 -1
|
@@ -14,21 +14,15 @@ commandProjectList.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
|
14
14
|
commandProjectList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
15
15
|
commandProjectList.alias('ls');
|
|
16
16
|
commandProjectList.action(async (options) => {
|
|
17
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
18
17
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
19
|
-
const client = input_1.default.restApiTokenClient(
|
|
18
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
20
19
|
const response = await client.getProjects(workspace);
|
|
21
20
|
if (!response.projects || response.projects.length === 0) {
|
|
22
21
|
output_1.default.exitError(texts_1.ERR_PROJECT_NO_PROJECTS);
|
|
23
22
|
}
|
|
24
23
|
const data = [['NAME', 'DISPLAY NAME', 'STATUS', 'URL']];
|
|
25
24
|
for (const proj of response.projects) {
|
|
26
|
-
data.push([
|
|
27
|
-
proj.name,
|
|
28
|
-
proj.display_name,
|
|
29
|
-
proj.status,
|
|
30
|
-
(0, utils_1.getAppProjectUrl)(baseUrl, workspace, proj.name),
|
|
31
|
-
]);
|
|
25
|
+
data.push([proj.name, proj.display_name, proj.status, proj.html_url]);
|
|
32
26
|
}
|
|
33
27
|
output_1.default.table(data);
|
|
34
28
|
output_1.default.exitNormal();
|
|
@@ -16,9 +16,8 @@ commandProjectSet.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WOR
|
|
|
16
16
|
commandProjectSet.argument('[project]', texts_1.ARG_COMMAND_PROJECT_NAME);
|
|
17
17
|
commandProjectSet.action(async (projectName, options) => {
|
|
18
18
|
output_1.default.handleSignals();
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
|
-
const client = input_1.default.restApiTokenClient(
|
|
20
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
22
21
|
const response = await client.getProjects(workspace);
|
|
23
22
|
if (!response.projects || response.projects.length === 0) {
|
|
24
23
|
output_1.default.exitError(texts_1.ERR_PROJECT_NO_PROJECTS);
|
|
@@ -19,10 +19,9 @@ commandSandboxCp.option('-s, --silent', texts_1.OPTION_SANDBOX_CP_SILENT);
|
|
|
19
19
|
commandSandboxCp.argument('<source>', texts_1.OPTION_SANDBOX_CP_SOURCE);
|
|
20
20
|
commandSandboxCp.argument('<destination>', texts_1.OPTION_SANDBOX_CP_DEST);
|
|
21
21
|
commandSandboxCp.action(async (source, destination, options) => {
|
|
22
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
23
22
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
24
23
|
const project = input_1.default.restApiProject(options.project);
|
|
25
|
-
const client = input_1.default.restApiTokenClient(
|
|
24
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
26
25
|
const result = await client.listSandboxes(workspace, project);
|
|
27
26
|
const sandboxes = result.sandboxes || [];
|
|
28
27
|
const { identifier, remotePath } = input_1.default.restApiSandboxDestinationPath(destination);
|
|
@@ -23,6 +23,7 @@ const VALID_RESOURCES = [
|
|
|
23
23
|
'12x24',
|
|
24
24
|
];
|
|
25
25
|
const commandSandboxCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_SANDBOX_CREATE);
|
|
26
|
+
commandSandboxCreate.alias('add');
|
|
26
27
|
commandSandboxCreate.option('--token <token>', texts_1.OPTION_REST_API_TOKEN);
|
|
27
28
|
commandSandboxCreate.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
28
29
|
commandSandboxCreate.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
@@ -42,10 +43,9 @@ commandSandboxCreate.option('--wait-for-running [seconds]', texts_1.OPTION_SANDB
|
|
|
42
43
|
commandSandboxCreate.option('--wait-for-configured [seconds]', texts_1.OPTION_SANDBOX_WAIT_CONFIGURED);
|
|
43
44
|
commandSandboxCreate.option('--wait-for-app [seconds]', texts_1.OPTION_SANDBOX_WAIT_APP);
|
|
44
45
|
commandSandboxCreate.action(async (options) => {
|
|
45
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
46
46
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
47
47
|
const project = input_1.default.restApiProject(options.project);
|
|
48
|
-
const client = input_1.default.restApiTokenClient(
|
|
48
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
49
49
|
if (options.resources && !VALID_RESOURCES.includes(options.resources)) {
|
|
50
50
|
output_1.default.exitError((0, texts_1.ERR_SANDBOX_INVALID_RESOURCES)(options.resources));
|
|
51
51
|
}
|
|
@@ -8,24 +8,28 @@ const texts_1 = require("../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../input"));
|
|
10
10
|
const commandSandboxDestroy = (0, utils_1.newCommand)('destroy', texts_1.DESC_COMMAND_SANDBOX_DESTROY);
|
|
11
|
-
commandSandboxDestroy.
|
|
11
|
+
commandSandboxDestroy.aliases(['delete', 'rm']);
|
|
12
12
|
commandSandboxDestroy.option('--token <token>', texts_1.OPTION_REST_API_TOKEN);
|
|
13
13
|
commandSandboxDestroy.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
14
14
|
commandSandboxDestroy.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
15
15
|
commandSandboxDestroy.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
16
16
|
commandSandboxDestroy.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
17
|
+
commandSandboxDestroy.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
17
18
|
commandSandboxDestroy.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
19
|
commandSandboxDestroy.action(async (identifier, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
20
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
21
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
22
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
23
|
const result = await client.listSandboxes(workspace, project);
|
|
24
24
|
const sandboxes = result.sandboxes || [];
|
|
25
25
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
26
26
|
if (!found) {
|
|
27
27
|
output_1.default.exitError(texts_1.ERR_SANDBOX_NOT_FOUND);
|
|
28
28
|
}
|
|
29
|
+
const confirmed = options.force ||
|
|
30
|
+
(await output_1.default.confirm((0, texts_1.TXT_SANDBOX_DESTROY_CONFIRM)(identifier)));
|
|
31
|
+
if (!confirmed)
|
|
32
|
+
output_1.default.exitNormal();
|
|
29
33
|
await client.deleteSandbox(workspace, found.id);
|
|
30
34
|
output_1.default.exitSuccess((0, texts_1.TXT_SANDBOX_DESTROYED)(identifier));
|
|
31
35
|
});
|
|
@@ -9,11 +9,11 @@ const output_1 = __importDefault(require("../../../output"));
|
|
|
9
9
|
const input_1 = __importDefault(require("../../../input"));
|
|
10
10
|
const logger_1 = __importDefault(require("../../../logger"));
|
|
11
11
|
const commandSandboxEndpointAdd = (0, utils_1.getBasicCommandSandboxEndpoint)('add', texts_1.DESC_COMMAND_SANDBOX_ENDPOINT_ADD);
|
|
12
|
+
commandSandboxEndpointAdd.alias('create');
|
|
12
13
|
commandSandboxEndpointAdd.action(async (identifier, options) => {
|
|
13
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
14
14
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
15
15
|
const project = input_1.default.restApiProject(options.project);
|
|
16
|
-
const client = input_1.default.restApiTokenClient(
|
|
16
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
17
17
|
const result = await client.listSandboxes(workspace, project);
|
|
18
18
|
const sandboxes = result.sandboxes || [];
|
|
19
19
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -8,18 +8,19 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../../input"));
|
|
10
10
|
const commandSandboxEndpointDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_SANDBOX_ENDPOINT_DELETE);
|
|
11
|
+
commandSandboxEndpointDelete.alias('rm');
|
|
11
12
|
commandSandboxEndpointDelete.option('--token <token>', texts_1.OPTION_REST_API_TOKEN);
|
|
12
13
|
commandSandboxEndpointDelete.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
13
14
|
commandSandboxEndpointDelete.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
14
15
|
commandSandboxEndpointDelete.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
15
16
|
commandSandboxEndpointDelete.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
17
|
+
commandSandboxEndpointDelete.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
16
18
|
commandSandboxEndpointDelete.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
19
|
commandSandboxEndpointDelete.argument('<endpoint-name>', texts_1.OPTION_SANDBOX_ENDPOINT_NAME_ARG);
|
|
18
20
|
commandSandboxEndpointDelete.action(async (identifier, endpointName, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
21
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
22
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
23
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
24
|
const result = await client.listSandboxes(workspace, project);
|
|
24
25
|
const sandboxes = result.sandboxes || [];
|
|
25
26
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -33,6 +34,10 @@ commandSandboxEndpointDelete.action(async (identifier, endpointName, options) =>
|
|
|
33
34
|
output_1.default.exitError(texts_1.ERR_SANDBOX_ENDPOINT_NOT_FOUND);
|
|
34
35
|
}
|
|
35
36
|
const updatedEndpoints = endpoints.filter((ep) => ep.name !== endpointName);
|
|
37
|
+
const confirmed = options.force ||
|
|
38
|
+
(await output_1.default.confirm((0, texts_1.TXT_SANDBOX_ENDPOINT_DELETE_CONFIRM)(identifier, endpointName)));
|
|
39
|
+
if (!confirmed)
|
|
40
|
+
output_1.default.exitNormal();
|
|
36
41
|
await client.updateSandbox(workspace, found.id, {
|
|
37
42
|
endpoints: updatedEndpoints,
|
|
38
43
|
});
|
|
@@ -16,10 +16,9 @@ commandSandboxEndpointGet.option('-p, --project <name>', texts_1.OPTION_REST_API
|
|
|
16
16
|
commandSandboxEndpointGet.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
17
|
commandSandboxEndpointGet.argument('<endpoint-name>', texts_1.OPTION_SANDBOX_ENDPOINT_NAME_ARG);
|
|
18
18
|
commandSandboxEndpointGet.action(async (identifier, endpointName, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
20
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
21
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
22
|
const result = await client.listSandboxes(workspace, project);
|
|
24
23
|
const sandboxes = result.sandboxes || [];
|
|
25
24
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -33,7 +32,7 @@ commandSandboxEndpointGet.action(async (identifier, endpointName, options) => {
|
|
|
33
32
|
output_1.default.exitError(texts_1.ERR_SANDBOX_ENDPOINT_NOT_FOUND);
|
|
34
33
|
}
|
|
35
34
|
const data = [
|
|
36
|
-
['
|
|
35
|
+
['Field', 'Value'],
|
|
37
36
|
['Name', endpoint.name || '-'],
|
|
38
37
|
['Endpoint', endpoint.endpoint || '-'],
|
|
39
38
|
['Type', endpoint.type || '-'],
|
|
@@ -8,6 +8,7 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../../input"));
|
|
10
10
|
const commandSandboxEndpointList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_SANDBOX_ENDPOINT_LIST);
|
|
11
|
+
commandSandboxEndpointList.alias('ls');
|
|
11
12
|
commandSandboxEndpointList.option('--token <token>', texts_1.OPTION_REST_API_TOKEN);
|
|
12
13
|
commandSandboxEndpointList.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
13
14
|
commandSandboxEndpointList.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
@@ -15,10 +16,9 @@ commandSandboxEndpointList.option('-w, --workspace <domain>', texts_1.OPTION_RES
|
|
|
15
16
|
commandSandboxEndpointList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
16
17
|
commandSandboxEndpointList.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
18
|
commandSandboxEndpointList.action(async (identifier, options) => {
|
|
18
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
19
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
20
20
|
const project = input_1.default.restApiProject(options.project);
|
|
21
|
-
const client = input_1.default.restApiTokenClient(
|
|
21
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
22
22
|
const result = await client.listSandboxes(workspace, project);
|
|
23
23
|
const sandboxes = result.sandboxes || [];
|
|
24
24
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -20,10 +20,9 @@ commandSandboxExecCommand.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTI
|
|
|
20
20
|
commandSandboxExecCommand.argument('<command>');
|
|
21
21
|
commandSandboxExecCommand.action(async (identifier, command, options) => {
|
|
22
22
|
output_1.default.handleSignals();
|
|
23
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
24
23
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
25
24
|
const project = input_1.default.restApiProject(options.project);
|
|
26
|
-
const client = input_1.default.restApiTokenClient(
|
|
25
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
27
26
|
const runtime = input_1.default.restApiSandboxExecRuntime(options.runtime);
|
|
28
27
|
const result = await client.listSandboxes(workspace, project);
|
|
29
28
|
const sandboxes = result.sandboxes || [];
|
|
@@ -13,19 +13,23 @@ commandSandboxExecKill.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
|
13
13
|
commandSandboxExecKill.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
14
14
|
commandSandboxExecKill.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
15
15
|
commandSandboxExecKill.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
16
|
+
commandSandboxExecKill.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
16
17
|
commandSandboxExecKill.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
18
|
commandSandboxExecKill.argument('<command-id>', texts_1.OPTION_SANDBOX_COMMAND_ID);
|
|
18
19
|
commandSandboxExecKill.action(async (identifier, commandId, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
20
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
21
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
22
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
23
|
const result = await client.listSandboxes(workspace, project);
|
|
24
24
|
const sandboxes = result.sandboxes || [];
|
|
25
25
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
26
26
|
if (!found) {
|
|
27
27
|
output_1.default.exitError(texts_1.ERR_SANDBOX_NOT_FOUND);
|
|
28
28
|
}
|
|
29
|
+
const confirmed = options.force ||
|
|
30
|
+
(await output_1.default.confirm((0, texts_1.OPTION_SANDBOX_COMMAND_KILL_CONFIRM)(identifier, commandId)));
|
|
31
|
+
if (!confirmed)
|
|
32
|
+
output_1.default.exitNormal();
|
|
29
33
|
await client.terminateSandboxCommand(workspace, found.id, commandId);
|
|
30
34
|
output_1.default.exitSuccess((0, texts_1.TXT_SANDBOX_COMMAND_KILLED)(commandId));
|
|
31
35
|
});
|
|
@@ -16,10 +16,9 @@ commandSandboxExecList.option('-w, --workspace <domain>', texts_1.OPTION_REST_AP
|
|
|
16
16
|
commandSandboxExecList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
17
17
|
commandSandboxExecList.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
18
|
commandSandboxExecList.action(async (identifier, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
20
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
21
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
22
|
const result = await client.listSandboxes(workspace, project);
|
|
24
23
|
const sandboxes = result.sandboxes || [];
|
|
25
24
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -18,10 +18,9 @@ commandSandboxExecLogs.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIE
|
|
|
18
18
|
commandSandboxExecLogs.argument('<command-id>', texts_1.OPTION_SANDBOX_COMMAND_ID);
|
|
19
19
|
commandSandboxExecLogs.action(async (identifier, commandId, options) => {
|
|
20
20
|
output_1.default.handleSignals();
|
|
21
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
22
21
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
23
22
|
const project = input_1.default.restApiProject(options.project);
|
|
24
|
-
const client = input_1.default.restApiTokenClient(
|
|
23
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
25
24
|
const result = await client.listSandboxes(workspace, project);
|
|
26
25
|
const sandboxes = result.sandboxes || [];
|
|
27
26
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -16,10 +16,9 @@ commandSandboxExecStatus.option('-p, --project <name>', texts_1.OPTION_REST_API_
|
|
|
16
16
|
commandSandboxExecStatus.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
17
|
commandSandboxExecStatus.argument('<command-id>', texts_1.OPTION_SANDBOX_COMMAND_ID);
|
|
18
18
|
commandSandboxExecStatus.action(async (identifier, commandId, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
20
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
21
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
22
|
const result = await client.listSandboxes(workspace, project);
|
|
24
23
|
const sandboxes = result.sandboxes || [];
|
|
25
24
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -15,10 +15,9 @@ commandSandboxGet.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WOR
|
|
|
15
15
|
commandSandboxGet.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
16
16
|
commandSandboxGet.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
17
|
commandSandboxGet.action(async (identifier, options) => {
|
|
18
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
19
18
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
20
19
|
const project = input_1.default.restApiProject(options.project);
|
|
21
|
-
const client = input_1.default.restApiTokenClient(
|
|
20
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
22
21
|
const result = await client.listSandboxes(workspace, project);
|
|
23
22
|
const sandboxes = result.sandboxes || [];
|
|
24
23
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -27,7 +26,7 @@ commandSandboxGet.action(async (identifier, options) => {
|
|
|
27
26
|
}
|
|
28
27
|
const sandbox = await client.getSandbox(workspace, found.id);
|
|
29
28
|
const data = [
|
|
30
|
-
['
|
|
29
|
+
['Field', 'Value'],
|
|
31
30
|
['ID', sandbox.id || '-'],
|
|
32
31
|
['Identifier', sandbox.identifier || '-'],
|
|
33
32
|
['Name', sandbox.name || '-'],
|
|
@@ -15,10 +15,9 @@ commandSandboxList.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
|
15
15
|
commandSandboxList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
16
16
|
commandSandboxList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
17
17
|
commandSandboxList.action(async (options) => {
|
|
18
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
19
18
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
20
19
|
const project = input_1.default.restApiProject(options.project);
|
|
21
|
-
const client = input_1.default.restApiTokenClient(
|
|
20
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
22
21
|
const result = await client.listSandboxes(workspace, project);
|
|
23
22
|
const sandboxes = result.sandboxes || [];
|
|
24
23
|
if (sandboxes.length === 0) {
|
|
@@ -31,7 +30,7 @@ commandSandboxList.action(async (options) => {
|
|
|
31
30
|
sandbox.status || '-',
|
|
32
31
|
sandbox.id || '-',
|
|
33
32
|
sandbox.identifier || '-',
|
|
34
|
-
|
|
33
|
+
sandbox.html_url || '-',
|
|
35
34
|
]);
|
|
36
35
|
}
|
|
37
36
|
output_1.default.table(data);
|
|
@@ -16,10 +16,9 @@ commandSandboxRestart.option('-p, --project <name>', texts_1.OPTION_REST_API_PRO
|
|
|
16
16
|
commandSandboxRestart.option('--wait [seconds]', texts_1.OPTION_SANDBOX_WAIT);
|
|
17
17
|
commandSandboxRestart.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
18
|
commandSandboxRestart.action(async (identifier, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
20
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
21
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
22
|
const result = await client.listSandboxes(workspace, project);
|
|
24
23
|
const sandboxes = result.sandboxes || [];
|
|
25
24
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -9,6 +9,7 @@ const output_1 = __importDefault(require("../../../output"));
|
|
|
9
9
|
const input_1 = __importDefault(require("../../../input"));
|
|
10
10
|
const human_id_1 = __importDefault(require("human-id"));
|
|
11
11
|
const commandSandboxSnapshotCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT_CREATE);
|
|
12
|
+
commandSandboxSnapshotCreate.alias('add');
|
|
12
13
|
commandSandboxSnapshotCreate.option('--token <token>', texts_1.OPTION_REST_API_TOKEN);
|
|
13
14
|
commandSandboxSnapshotCreate.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
14
15
|
commandSandboxSnapshotCreate.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
@@ -18,10 +19,9 @@ commandSandboxSnapshotCreate.option('-n, --name <name>', texts_1.OPTION_SANDBOX_
|
|
|
18
19
|
commandSandboxSnapshotCreate.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
19
20
|
commandSandboxSnapshotCreate.option('--wait [seconds]', texts_1.OPTION_SANDBOX_WAIT);
|
|
20
21
|
commandSandboxSnapshotCreate.action(async (identifier, options) => {
|
|
21
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
22
22
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
23
23
|
const project = input_1.default.restApiProject(options.project);
|
|
24
|
-
const client = input_1.default.restApiTokenClient(
|
|
24
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
25
25
|
const result = await client.listSandboxes(workspace, project);
|
|
26
26
|
const sandboxes = result.sandboxes || [];
|
|
27
27
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -8,18 +8,19 @@ const texts_1 = require("../../../texts");
|
|
|
8
8
|
const output_1 = __importDefault(require("../../../output"));
|
|
9
9
|
const input_1 = __importDefault(require("../../../input"));
|
|
10
10
|
const commandSandboxSnapshotDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_SANDBOX_SNAPSHOT_DELETE);
|
|
11
|
+
commandSandboxSnapshotDelete.alias('rm');
|
|
11
12
|
commandSandboxSnapshotDelete.option('--token <token>', texts_1.OPTION_REST_API_TOKEN);
|
|
12
13
|
commandSandboxSnapshotDelete.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
13
14
|
commandSandboxSnapshotDelete.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
14
15
|
commandSandboxSnapshotDelete.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
15
16
|
commandSandboxSnapshotDelete.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
17
|
+
commandSandboxSnapshotDelete.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
16
18
|
commandSandboxSnapshotDelete.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
19
|
commandSandboxSnapshotDelete.argument('<snapshot-name>', texts_1.OPTION_SANDBOX_SNAPSHOT_NAME_ARG);
|
|
18
20
|
commandSandboxSnapshotDelete.action(async (identifier, snapshotName, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
21
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
22
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
23
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
24
|
const result = await client.listSandboxes(workspace, project);
|
|
24
25
|
const sandboxes = result.sandboxes || [];
|
|
25
26
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -32,6 +33,10 @@ commandSandboxSnapshotDelete.action(async (identifier, snapshotName, options) =>
|
|
|
32
33
|
if (!foundSnapshot) {
|
|
33
34
|
output_1.default.exitError(texts_1.ERR_SANDBOX_SNAPSHOT_NOT_FOUND);
|
|
34
35
|
}
|
|
36
|
+
const confirmed = options.force ||
|
|
37
|
+
(await output_1.default.confirm((0, texts_1.TXT_SANDBOX_SNAPSHOT_DELETE_CONFIRM)(identifier, snapshotName)));
|
|
38
|
+
if (!confirmed)
|
|
39
|
+
output_1.default.exitNormal();
|
|
35
40
|
await client.deleteSandboxSnapshot(workspace, found.id, foundSnapshot.id);
|
|
36
41
|
output_1.default.exitSuccess((0, texts_1.TXT_SANDBOX_SNAPSHOT_DELETED)(snapshotName));
|
|
37
42
|
});
|
|
@@ -16,10 +16,9 @@ commandSandboxSnapshotGet.option('-p, --project <name>', texts_1.OPTION_REST_API
|
|
|
16
16
|
commandSandboxSnapshotGet.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
17
|
commandSandboxSnapshotGet.argument('<snapshot-name>', texts_1.OPTION_SANDBOX_SNAPSHOT_NAME_ARG);
|
|
18
18
|
commandSandboxSnapshotGet.action(async (identifier, snapshotName, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
20
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
21
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
22
|
const result = await client.listSandboxes(workspace, project);
|
|
24
23
|
const sandboxes = result.sandboxes || [];
|
|
25
24
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -34,7 +33,7 @@ commandSandboxSnapshotGet.action(async (identifier, snapshotName, options) => {
|
|
|
34
33
|
}
|
|
35
34
|
const snapshot = await client.getSandboxSnapshot(workspace, found.id, foundSnapshot.id);
|
|
36
35
|
const data = [
|
|
37
|
-
['
|
|
36
|
+
['Field', 'Value'],
|
|
38
37
|
['Name', snapshot.name || '-'],
|
|
39
38
|
['Status', snapshot.status || '-'],
|
|
40
39
|
['Created', snapshot.create_date || '-'],
|
|
@@ -16,10 +16,9 @@ commandSandboxSnapshotList.option('-w, --workspace <domain>', texts_1.OPTION_RES
|
|
|
16
16
|
commandSandboxSnapshotList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
17
17
|
commandSandboxSnapshotList.argument('[identifier]', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
18
|
commandSandboxSnapshotList.action(async (identifier, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
20
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
21
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
22
|
let snapshots;
|
|
24
23
|
if (identifier) {
|
|
25
24
|
const result = await client.listSandboxes(workspace, project);
|
|
@@ -16,10 +16,9 @@ commandSandboxStart.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJE
|
|
|
16
16
|
commandSandboxStart.option('--wait [seconds]', texts_1.OPTION_SANDBOX_WAIT);
|
|
17
17
|
commandSandboxStart.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
18
|
commandSandboxStart.action(async (identifier, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
20
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
21
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
22
|
const result = await client.listSandboxes(workspace, project);
|
|
24
23
|
const sandboxes = result.sandboxes || [];
|
|
25
24
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -15,10 +15,9 @@ commandSandboxStatus.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_
|
|
|
15
15
|
commandSandboxStatus.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
16
16
|
commandSandboxStatus.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
17
17
|
commandSandboxStatus.action(async (identifier, options) => {
|
|
18
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
19
18
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
20
19
|
const project = input_1.default.restApiProject(options.project);
|
|
21
|
-
const client = input_1.default.restApiTokenClient(
|
|
20
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
22
21
|
const result = await client.listSandboxes(workspace, project);
|
|
23
22
|
const sandboxes = result.sandboxes || [];
|
|
24
23
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -16,10 +16,9 @@ commandSandboxStop.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJEC
|
|
|
16
16
|
commandSandboxStop.option('--wait [seconds]', texts_1.OPTION_SANDBOX_WAIT);
|
|
17
17
|
commandSandboxStop.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
18
18
|
commandSandboxStop.action(async (identifier, options) => {
|
|
19
|
-
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
20
19
|
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
21
20
|
const project = input_1.default.restApiProject(options.project);
|
|
22
|
-
const client = input_1.default.restApiTokenClient(
|
|
21
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
23
22
|
const result = await client.listSandboxes(workspace, project);
|
|
24
23
|
const sandboxes = result.sandboxes || [];
|
|
25
24
|
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
@@ -13,8 +13,7 @@ commandWorkspaceList.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
|
13
13
|
commandWorkspaceList.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
14
14
|
commandWorkspaceList.alias('ls');
|
|
15
15
|
commandWorkspaceList.action(async (options) => {
|
|
16
|
-
const
|
|
17
|
-
const client = input_1.default.restApiTokenClient(baseUrl, options.token);
|
|
16
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
18
17
|
const response = await client.getWorkspaces();
|
|
19
18
|
if (!response.workspaces || response.workspaces.length === 0) {
|
|
20
19
|
output_1.default.normal('No workspaces found.');
|
|
@@ -22,7 +21,7 @@ commandWorkspaceList.action(async (options) => {
|
|
|
22
21
|
}
|
|
23
22
|
const data = [['NAME', 'DOMAIN', 'URL']];
|
|
24
23
|
for (const ws of response.workspaces) {
|
|
25
|
-
data.push([ws.name, ws.domain,
|
|
24
|
+
data.push([ws.name, ws.domain, ws.html_url]);
|
|
26
25
|
}
|
|
27
26
|
output_1.default.table(data);
|
|
28
27
|
output_1.default.exitNormal();
|
|
@@ -15,8 +15,7 @@ commandWorkspaceSet.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
|
15
15
|
commandWorkspaceSet.argument('[workspace]', texts_1.ARG_COMMAND_WORKSPACE);
|
|
16
16
|
commandWorkspaceSet.action(async (workspaceDomain, options) => {
|
|
17
17
|
output_1.default.handleSignals();
|
|
18
|
-
const
|
|
19
|
-
const client = input_1.default.restApiTokenClient(baseUrl, options.token);
|
|
18
|
+
const client = input_1.default.restApiTokenClient(options.api, options.region, options.token);
|
|
20
19
|
const response = await client.getWorkspaces();
|
|
21
20
|
if (!response.workspaces || response.workspaces.length === 0) {
|
|
22
21
|
output_1.default.exitError(texts_1.ERR_LOGIN_NO_WORKSPACES);
|
package/distTs/src/input.js
CHANGED
|
@@ -327,10 +327,23 @@ class Input {
|
|
|
327
327
|
clientToken: ct,
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
|
-
static restApiTokenClient(
|
|
331
|
-
const
|
|
330
|
+
static restApiTokenClient(optionsApi, optionsRegion, optionsToken) {
|
|
331
|
+
const baseUrl = this.restApiBaseUrl(optionsApi, optionsRegion);
|
|
332
|
+
const { token: t, refreshToken, clientId, clientToken, clientSecret, } = this.restApiToken(optionsToken);
|
|
332
333
|
return new client_1.default(baseUrl, t, refreshToken, clientId, clientSecret, clientToken);
|
|
333
334
|
}
|
|
335
|
+
static packageType(type) {
|
|
336
|
+
if (!type)
|
|
337
|
+
return utils_1.PACKAGE_TYPE.FILE;
|
|
338
|
+
if (Object.values(utils_1.PACKAGE_TYPE).includes(type))
|
|
339
|
+
return type;
|
|
340
|
+
output_1.default.exitError(texts_1.ERR_COMMAND_PACKAGE_TYPE);
|
|
341
|
+
}
|
|
342
|
+
static packageScope(project) {
|
|
343
|
+
if (project)
|
|
344
|
+
return utils_1.PACKAGE_SCOPE.PROJECT;
|
|
345
|
+
return utils_1.PACKAGE_SCOPE.WORKSPACE;
|
|
346
|
+
}
|
|
334
347
|
static pipelineRunPriority(priority) {
|
|
335
348
|
if (!priority)
|
|
336
349
|
return null;
|
|
@@ -522,6 +535,18 @@ class Input {
|
|
|
522
535
|
}
|
|
523
536
|
return p;
|
|
524
537
|
}
|
|
538
|
+
static restApiPage(page) {
|
|
539
|
+
const p = parseInt(page, 10);
|
|
540
|
+
if (!p)
|
|
541
|
+
return 1;
|
|
542
|
+
return p;
|
|
543
|
+
}
|
|
544
|
+
static restApiPerPage(perPage) {
|
|
545
|
+
const p = parseInt(perPage, 10);
|
|
546
|
+
if (!p)
|
|
547
|
+
return 10;
|
|
548
|
+
return p;
|
|
549
|
+
}
|
|
525
550
|
static restApiSandboxExecRuntime(runtime) {
|
|
526
551
|
if (!runtime)
|
|
527
552
|
runtime = utils_1.SANDBOX_EXEC_RUNTIME.BASH;
|
package/distTs/src/output.js
CHANGED
|
@@ -135,10 +135,8 @@ class Output {
|
|
|
135
135
|
this.tunnelNonInteractive(tunnel);
|
|
136
136
|
}
|
|
137
137
|
static object(data) {
|
|
138
|
-
Object.
|
|
139
|
-
|
|
140
|
-
this.normal(data[key]);
|
|
141
|
-
});
|
|
138
|
+
const table = [['Field', 'Value'], ...Object.entries(data)];
|
|
139
|
+
this.table(table);
|
|
142
140
|
}
|
|
143
141
|
static table(data) {
|
|
144
142
|
// apply padding
|
|
@@ -177,6 +175,17 @@ class Output {
|
|
|
177
175
|
}
|
|
178
176
|
});
|
|
179
177
|
}
|
|
178
|
+
static async confirm(title = 'Are you sure?') {
|
|
179
|
+
return new Promise((resolve) => {
|
|
180
|
+
terminal(title);
|
|
181
|
+
terminal('\n');
|
|
182
|
+
terminal('(y/N)');
|
|
183
|
+
terminal.inputField((_, input) => {
|
|
184
|
+
terminal('\n');
|
|
185
|
+
resolve((input || '').trim().toLowerCase() === 'y');
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
180
189
|
static async inputString() {
|
|
181
190
|
return new Promise((resolve) => {
|
|
182
191
|
terminal.inputField((_, input) => {
|