bdy 1.25.6-dev → 1.25.8-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/cliCommand.js +43 -0
- package/distTs/src/cliIndex.js +10 -0
- package/distTs/src/command/agent/uninstall.js +1 -1
- package/distTs/src/command/artifact/delete.js +1 -2
- package/distTs/src/command/artifact/version/delete.js +1 -2
- package/distTs/src/command/context/add.js +38 -0
- package/distTs/src/command/context/list.js +33 -0
- package/distTs/src/command/context/remove.js +35 -0
- package/distTs/src/command/context/show.js +35 -0
- package/distTs/src/command/context/use.js +25 -0
- package/distTs/src/command/context.js +22 -0
- package/distTs/src/command/distro/delete.js +1 -2
- package/distTs/src/command/distro/route/delete.js +1 -2
- package/distTs/src/command/environment/delete.js +1 -2
- package/distTs/src/command/login.js +1 -0
- package/distTs/src/command/logout.js +1 -0
- package/distTs/src/command/pipeline/delete.js +1 -2
- package/distTs/src/command/pipeline/run/approve.js +3 -2
- package/distTs/src/command/pipeline/run/cancel.js +3 -2
- package/distTs/src/command/pipeline/run/find.js +87 -0
- package/distTs/src/command/pipeline/run/findFilters.js +68 -0
- package/distTs/src/command/pipeline/run/retry.js +5 -2
- package/distTs/src/command/pipeline/run/start.js +3 -2
- package/distTs/src/command/pipeline/run/status.js +3 -2
- package/distTs/src/command/pipeline/run.js +3 -0
- package/distTs/src/command/project/link.js +1 -0
- package/distTs/src/command/register.js +1 -0
- package/distTs/src/command/sandbox/destroy.js +1 -2
- package/distTs/src/command/sandbox/endpoint/delete.js +1 -2
- package/distTs/src/command/sandbox/exec/kill.js +1 -2
- package/distTs/src/command/sandbox/snapshot/delete.js +1 -2
- package/distTs/src/command/target/delete.js +1 -1
- package/distTs/src/command/target/exec/kill.js +2 -3
- package/distTs/src/command/whoami.js +7 -10
- package/distTs/src/command/workspace/get.js +2 -2
- package/distTs/src/command/workspace/set.js +1 -0
- package/distTs/src/input.js +240 -26
- package/distTs/src/output/pipeline.js +84 -13
- package/distTs/src/output.js +24 -5
- package/distTs/src/project/context.js +97 -0
- package/distTs/src/texts.js +275 -29
- package/distTs/src/tunnel/cfg.js +43 -4
- package/distTs/src/types/context.js +2 -0
- package/distTs/src/types/pipelineRunFind.js +2 -0
- package/package.json +1 -1
package/distTs/src/tunnel/cfg.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const path_1 = require("path");
|
|
4
7
|
const fs_1 = require("fs");
|
|
5
8
|
const utils_1 = require("../utils");
|
|
9
|
+
const cliError_1 = __importDefault(require("../cliError"));
|
|
6
10
|
const texts_1 = require("../texts");
|
|
11
|
+
const texts_2 = require("../texts");
|
|
7
12
|
const tunnel_1 = require("../types/tunnel");
|
|
8
13
|
class Cfg {
|
|
9
14
|
dir;
|
|
@@ -22,7 +27,7 @@ class Cfg {
|
|
|
22
27
|
});
|
|
23
28
|
}
|
|
24
29
|
catch {
|
|
25
|
-
throw new Error((0,
|
|
30
|
+
throw new Error((0, texts_2.ERR_CANT_CREATE_DIR_IN_HOME)('.bdy'));
|
|
26
31
|
}
|
|
27
32
|
try {
|
|
28
33
|
(0, fs_1.chmodSync)(this.dir, 0o700);
|
|
@@ -36,7 +41,7 @@ class Cfg {
|
|
|
36
41
|
(0, fs_1.writeFileSync)(this.file, '{}', 'utf-8');
|
|
37
42
|
}
|
|
38
43
|
catch {
|
|
39
|
-
throw new Error((0,
|
|
44
|
+
throw new Error((0, texts_2.ERR_CANT_CREATE_DIR_IN_HOME)('.bdy/cfg.json'));
|
|
40
45
|
}
|
|
41
46
|
try {
|
|
42
47
|
(0, fs_1.chmodSync)(this.file, 0o600);
|
|
@@ -252,6 +257,40 @@ class Cfg {
|
|
|
252
257
|
getBaseUrl() {
|
|
253
258
|
return this.json.baseUrl || '';
|
|
254
259
|
}
|
|
260
|
+
getContexts() {
|
|
261
|
+
return { ...this.json.contexts };
|
|
262
|
+
}
|
|
263
|
+
getActiveContext() {
|
|
264
|
+
return this.json.activeContext || 'default';
|
|
265
|
+
}
|
|
266
|
+
getContext(name) {
|
|
267
|
+
if (name === 'default')
|
|
268
|
+
return null;
|
|
269
|
+
if (name === 'git')
|
|
270
|
+
return { source: 'git', remote: 'origin' };
|
|
271
|
+
if (name === 'link')
|
|
272
|
+
return { source: 'link' };
|
|
273
|
+
const contexts = this.getContexts();
|
|
274
|
+
if (!Object.hasOwn(contexts, name))
|
|
275
|
+
throw new cliError_1.default('context_not_found', (0, texts_1.ERR_CONTEXT_UNKNOWN)(name), texts_1.TXT_CONTEXT_HINT);
|
|
276
|
+
return contexts[name];
|
|
277
|
+
}
|
|
278
|
+
setContext(name, context) {
|
|
279
|
+
this.json.contexts = { ...this.getContexts(), [name]: context };
|
|
280
|
+
this.save();
|
|
281
|
+
}
|
|
282
|
+
setActiveContext(name) {
|
|
283
|
+
this.getContext(name);
|
|
284
|
+
this.json.activeContext = name;
|
|
285
|
+
this.save();
|
|
286
|
+
}
|
|
287
|
+
removeContext(name) {
|
|
288
|
+
this.getContext(name);
|
|
289
|
+
delete this.json.contexts[name];
|
|
290
|
+
if (this.getActiveContext() === name)
|
|
291
|
+
this.json.activeContext = 'default';
|
|
292
|
+
this.save();
|
|
293
|
+
}
|
|
255
294
|
clearLogin() {
|
|
256
295
|
delete this.json.apiToken;
|
|
257
296
|
delete this.json.apiRefreshToken;
|
|
@@ -282,7 +321,7 @@ class Cfg {
|
|
|
282
321
|
this.json = JSON.parse(txt);
|
|
283
322
|
}
|
|
284
323
|
catch {
|
|
285
|
-
throw new Error(
|
|
324
|
+
throw new Error(texts_2.ERR_CONFIG_CORRUPTED);
|
|
286
325
|
}
|
|
287
326
|
}
|
|
288
327
|
save() {
|
|
@@ -291,7 +330,7 @@ class Cfg {
|
|
|
291
330
|
(0, fs_1.writeFileSync)(this.file, JSON.stringify(this.json, null, 4), 'utf-8');
|
|
292
331
|
}
|
|
293
332
|
catch {
|
|
294
|
-
throw new Error((0,
|
|
333
|
+
throw new Error((0, texts_2.ERR_CANT_CREATE_DIR_IN_HOME)('.bdy/cfg.json'));
|
|
295
334
|
}
|
|
296
335
|
try {
|
|
297
336
|
(0, fs_1.chmodSync)(this.file, 0o600);
|