bdy 1.18.17-dev → 1.18.17-master

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.18.17-dev",
4
+ "version": "1.18.17-master",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const utils_1 = require("../../../utils");
7
+ const texts_1 = require("../../../texts");
8
+ const input_1 = __importDefault(require("../../../input"));
9
+ const output_1 = __importDefault(require("../../../output"));
10
+ const commandSandboxAppAdd = (0, utils_1.newCommand)('add', texts_1.DESC_COMMAND_SANDBOX_APP_ADD);
11
+ commandSandboxAppAdd.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
12
+ commandSandboxAppAdd.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
13
+ commandSandboxAppAdd.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
14
+ commandSandboxAppAdd.argument('<app-command>', texts_1.OPTION_SANDBOX_APP_COMMAND);
15
+ commandSandboxAppAdd.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_APP_ADD}`);
16
+ commandSandboxAppAdd.action(async (identifier, app, options) => {
17
+ const workspace = input_1.default.restApiWorkspace(options.workspace);
18
+ const project = input_1.default.restApiProject(options.project);
19
+ const client = input_1.default.restApiTokenClient();
20
+ const { sandbox_id } = await client.getSandboxByIdentifier(workspace, project, identifier);
21
+ if (!sandbox_id) {
22
+ output_1.default.exitError(texts_1.ERR_SANDBOX_NOT_FOUND);
23
+ }
24
+ const sandbox = await client.getSandbox(workspace, sandbox_id);
25
+ const apps = sandbox.apps || [];
26
+ apps.push(app);
27
+ await client.updateSandbox(workspace, sandbox_id, {
28
+ apps,
29
+ });
30
+ output_1.default.exitSuccess(texts_1.TXT_SANDBOX_APP_ADDED);
31
+ });
32
+ exports.default = commandSandboxAppAdd;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const utils_1 = require("../../../utils");
7
+ const texts_1 = require("../../../texts");
8
+ const input_1 = __importDefault(require("../../../input"));
9
+ const output_1 = __importDefault(require("../../../output"));
10
+ const commandSandboxAppRemove = (0, utils_1.newCommand)('remove', texts_1.DESC_COMMAND_SANDBOX_APP_REMOVE);
11
+ commandSandboxAppRemove.alias('rm');
12
+ commandSandboxAppRemove.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
13
+ commandSandboxAppRemove.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
14
+ commandSandboxAppRemove.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
15
+ commandSandboxAppRemove.argument('<app-id>', texts_1.OPTION_SANDBOX_APP_ID);
16
+ commandSandboxAppRemove.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_APP_REMOVE}`);
17
+ commandSandboxAppRemove.action(async (identifier, appId, options) => {
18
+ const workspace = input_1.default.restApiWorkspace(options.workspace);
19
+ const project = input_1.default.restApiProject(options.project);
20
+ const client = input_1.default.restApiTokenClient();
21
+ const { sandbox_id } = await client.getSandboxByIdentifier(workspace, project, identifier);
22
+ if (!sandbox_id) {
23
+ output_1.default.exitError(texts_1.ERR_SANDBOX_NOT_FOUND);
24
+ }
25
+ const sandbox = await client.getSandbox(workspace, sandbox_id);
26
+ const apps = (sandbox.apps || []).filter((app) => app.id !== appId);
27
+ await client.updateSandbox(workspace, sandbox_id, {
28
+ apps,
29
+ });
30
+ output_1.default.exitSuccess(texts_1.TXT_SANDBOX_APP_REMOVED);
31
+ });
32
+ exports.default = commandSandboxAppRemove;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.18.17-dev",
4
+ "version": "1.18.17-master",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {