bdy 1.25.39-dev-pr → 1.25.40-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 -2
- package/distTs/src/api/client.js +1 -191
- package/distTs/src/cliError.js +0 -5
- package/distTs/src/cliIndex.js +0 -3
- package/distTs/src/command/login.js +1 -1
- package/distTs/src/command/variable/inject.js +218 -0
- package/distTs/src/command/variable/injection.js +182 -0
- package/distTs/src/command/variable/secretMask.js +100 -0
- package/distTs/src/command/variable.js +2 -0
- package/distTs/src/output/pipeline.js +56 -54
- package/distTs/src/output.js +22 -85
- package/distTs/src/texts.js +83 -522
- package/distTs/src/tunnel/output/interactive/tunnel.js +10 -14
- package/distTs/src/tunnel/output/noninteractive/tunnel.js +1 -3
- package/distTs/src/utils.js +18 -142
- package/package.json +1 -2
- package/distTs/src/autocomplete.js +0 -90
- package/distTs/src/command/artifact/downloadDir.js +0 -110
- package/distTs/src/command/autocomplete/install.js +0 -16
- package/distTs/src/command/autocomplete/uninstall.js +0 -16
- package/distTs/src/command/autocomplete.js +0 -14
- package/distTs/src/command/environment/resolve.js +0 -39
- package/distTs/src/command/package/create.js +0 -64
- package/distTs/src/command/package/delete.js +0 -38
- package/distTs/src/command/package/docker/login.js +0 -26
- package/distTs/src/command/package/docker.js +0 -11
- package/distTs/src/command/package/download.js +0 -138
- package/distTs/src/command/package/get.js +0 -36
- package/distTs/src/command/package/list.js +0 -31
- package/distTs/src/command/package/publish.js +0 -241
- package/distTs/src/command/package/version/delete.js +0 -39
- package/distTs/src/command/package/version/get.js +0 -45
- package/distTs/src/command/package/version/list.js +0 -47
- package/distTs/src/command/package/version.js +0 -16
- package/distTs/src/command/package.js +0 -26
- package/distTs/src/command/pipeline/run/apply.js +0 -62
- package/distTs/src/command/pr/comment/add.js +0 -66
- package/distTs/src/command/pr/comment/list.js +0 -167
- package/distTs/src/command/pr/comment/status.js +0 -50
- package/distTs/src/command/pr/comment.js +0 -19
- package/distTs/src/command/pr/create.js +0 -44
- package/distTs/src/command/pr/diff.js +0 -337
- package/distTs/src/command/pr/file/list.js +0 -139
- package/distTs/src/command/pr/file/mark.js +0 -45
- package/distTs/src/command/pr/file.js +0 -16
- package/distTs/src/command/pr/get.js +0 -29
- package/distTs/src/command/pr/list.js +0 -79
- package/distTs/src/command/pr/merge.js +0 -67
- package/distTs/src/command/pr/review/request.js +0 -30
- package/distTs/src/command/pr/review/start.js +0 -29
- package/distTs/src/command/pr/review/verdict.js +0 -81
- package/distTs/src/command/pr/review.js +0 -18
- package/distTs/src/command/pr/shared.js +0 -704
- package/distTs/src/command/pr/state.js +0 -38
- package/distTs/src/command/pr/summary.js +0 -341
- package/distTs/src/command/pr/update.js +0 -56
- package/distTs/src/command/pr/updateBranch.js +0 -22
- package/distTs/src/command/pr/versions.js +0 -42
- package/distTs/src/command/pr.js +0 -39
- package/distTs/src/command/scrape/validation.js +0 -154
- package/distTs/src/command/scrape.js +0 -144
- package/distTs/src/command/suiteLink.js +0 -14
- package/distTs/src/command/tests/visual/result/download.js +0 -31
- package/distTs/src/command/tests/visual/result/get.js +0 -68
- package/distTs/src/command/tests/visual/result/list.js +0 -49
- package/distTs/src/command/tests/visual/result.js +0 -23
- package/distTs/src/command/tests/visual/session/get.js +0 -70
- package/distTs/src/command/tests/visual/session/list.js +0 -69
- package/distTs/src/command/tests/visual/session/open.js +0 -22
- package/distTs/src/command/tests/visual/session/reviewUrl.js +0 -37
- package/distTs/src/command/tests/visual/session/update.js +0 -26
- package/distTs/src/command/tests/visual/shared/context.js +0 -144
- package/distTs/src/command/tests/visual/shared/diffRegions.js +0 -172
- package/distTs/src/command/tests/visual/shared/format.js +0 -21
- package/distTs/src/command/tests/visual/shared/lookup.js +0 -107
- package/distTs/src/command/tests/visual/shared/options.js +0 -90
- package/distTs/src/command/tests/visual/shared/review.js +0 -146
- package/distTs/src/command/tests/visual/shared/reviewUrl.js +0 -62
- package/distTs/src/command/tests/visual/shared/session.js +0 -217
- package/distTs/src/command/tests/visual/snapshot/get.js +0 -46
- package/distTs/src/command/tests/visual/snapshot/list.js +0 -68
- package/distTs/src/command/tests/visual/snapshot/open.js +0 -26
- package/distTs/src/command/tests/visual/snapshot/reviewUrl.js +0 -48
- package/distTs/src/command/tests/visual/snapshot.js +0 -28
- package/distTs/src/command/tests/visual/suite/create.js +0 -38
- package/distTs/src/command/tests/visual/suite/delete.js +0 -29
- package/distTs/src/command/tests/visual/suite/get.js +0 -43
- package/distTs/src/command/tests/visual/suite/list.js +0 -35
- package/distTs/src/command/tests/visual/suite/open.js +0 -20
- package/distTs/src/command/tests/visual/suite/update.js +0 -47
- package/distTs/src/command/tests/visual/suite.js +0 -30
- package/distTs/src/command/ut/upload.js +0 -86
- package/distTs/src/command/ut.js +0 -12
- package/distTs/src/command/vt/close.js +0 -27
- package/distTs/src/command/vt/compare/validation.js +0 -46
- package/distTs/src/command/vt/compare.js +0 -100
- package/distTs/src/command/vt/exec.js +0 -82
- package/distTs/src/command/vt/installBrowser.js +0 -20
- package/distTs/src/command/vt/shared/validation.js +0 -145
- package/distTs/src/command/vt/storybook.js +0 -138
- package/distTs/src/command/vt.js +0 -20
- package/distTs/src/command/yaml/agents.js +0 -88
- package/distTs/src/command/yaml/init.js +0 -110
- package/distTs/src/main.js +0 -190
- package/distTs/src/types/options.js +0 -2
- package/distTs/src/types/scrape.js +0 -2
- package/distTs/src/types/visualTests.js +0 -2
|
@@ -0,0 +1,182 @@
|
|
|
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
|
+
exports.buildInjection = exports.parseVarFile = void 0;
|
|
7
|
+
const node_os_1 = require("node:os");
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const texts_1 = require("../../texts");
|
|
11
|
+
const cliError_1 = __importDefault(require("../../cliError"));
|
|
12
|
+
// The API keeps these as base64 (they may be binary); the keys are text.
|
|
13
|
+
const BASE64_TYPES = [
|
|
14
|
+
utils_1.VARIABLE_TYPE.FILE,
|
|
15
|
+
utils_1.VARIABLE_TYPE.P12,
|
|
16
|
+
utils_1.VARIABLE_TYPE.IOS_KEYCHAIN,
|
|
17
|
+
utils_1.VARIABLE_TYPE.IOS_PROVISION_PROFILES,
|
|
18
|
+
];
|
|
19
|
+
const MASKED = '!encrypted';
|
|
20
|
+
const MIN_MASKED_LINE = 8;
|
|
21
|
+
const MIN_MASKED_VALUE = 6;
|
|
22
|
+
// KEY:PATH, split on the first colon: a key has none, a Windows path may.
|
|
23
|
+
// `~` is expanded here - the shell leaves it alone in the middle of a word.
|
|
24
|
+
const parseVarFile = (spec) => {
|
|
25
|
+
const at = spec.indexOf(':');
|
|
26
|
+
const key = at < 0 ? '' : spec.slice(0, at);
|
|
27
|
+
let path = at < 0 ? '' : spec.slice(at + 1);
|
|
28
|
+
if (!key || !path) {
|
|
29
|
+
throw new cliError_1.default('usage_error', (0, texts_1.ERR_VARIABLE_INJECT_VAR_FILE_FORMAT)(spec));
|
|
30
|
+
}
|
|
31
|
+
if (path === '~' || path.startsWith('~/'))
|
|
32
|
+
path = (0, node_os_1.homedir)() + path.slice(1);
|
|
33
|
+
return { key, path: (0, node_path_1.resolve)(path) };
|
|
34
|
+
};
|
|
35
|
+
exports.parseVarFile = parseVarFile;
|
|
36
|
+
/**
|
|
37
|
+
* What goes into the command, from GET /variables?environment_id=: the
|
|
38
|
+
* environment's own variables first, then its bases nearest first, so the
|
|
39
|
+
* first variable of a key is the one that applies.
|
|
40
|
+
*
|
|
41
|
+
* VAR variables go into the process environment - all of them, or only the
|
|
42
|
+
* ones named by --var. File variables go only where --var-file puts them,
|
|
43
|
+
* with their password/passphrase as KEY_PASSWORD/KEY_PASSPHRASE.
|
|
44
|
+
*
|
|
45
|
+
* An encrypted value the API did not decrypt fails the whole run: injecting
|
|
46
|
+
* the masked form would hand the command a wrong secret without a word. The
|
|
47
|
+
* API does not say why it was not decrypted, so the reason is read from the
|
|
48
|
+
* response, in the order the API checks it: a bare marker is the missing
|
|
49
|
+
* manage permission, a marker with the ciphertext is the environment flag or,
|
|
50
|
+
* with the flag on, the token's scope.
|
|
51
|
+
*/
|
|
52
|
+
const buildInjection = (variables, environment, vars, varFiles) => {
|
|
53
|
+
const byKey = new Map();
|
|
54
|
+
for (const variable of variables) {
|
|
55
|
+
if (!byKey.has(variable.key))
|
|
56
|
+
byKey.set(variable.key, variable);
|
|
57
|
+
}
|
|
58
|
+
const find = (key) => {
|
|
59
|
+
const variable = byKey.get(key);
|
|
60
|
+
if (!variable) {
|
|
61
|
+
throw new cliError_1.default('not_found', (0, texts_1.ERR_VARIABLE_INJECT_NOT_FOUND)(key), (0, texts_1.HINT_VARIABLE_INJECT_LIST)(environment.identifier ?? '<environment>'));
|
|
62
|
+
}
|
|
63
|
+
if (variable.disabled) {
|
|
64
|
+
throw new cliError_1.default('usage_error', (0, texts_1.ERR_VARIABLE_INJECT_DISABLED)(key));
|
|
65
|
+
}
|
|
66
|
+
return variable;
|
|
67
|
+
};
|
|
68
|
+
let plain;
|
|
69
|
+
if (vars.length) {
|
|
70
|
+
plain = [...new Set(vars)].map((key) => {
|
|
71
|
+
const variable = find(key);
|
|
72
|
+
const type = variable.type ?? utils_1.VARIABLE_TYPE.VAR;
|
|
73
|
+
if (type !== utils_1.VARIABLE_TYPE.VAR) {
|
|
74
|
+
throw new cliError_1.default('usage_error', (0, texts_1.ERR_VARIABLE_INJECT_NOT_VAR)(key, type));
|
|
75
|
+
}
|
|
76
|
+
return variable;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
plain = [...byKey.values()].filter((v) => (v.type ?? utils_1.VARIABLE_TYPE.VAR) === utils_1.VARIABLE_TYPE.VAR && !v.disabled);
|
|
81
|
+
}
|
|
82
|
+
const keys = new Set();
|
|
83
|
+
const paths = new Set();
|
|
84
|
+
const fileVars = varFiles.map(({ key, path }) => {
|
|
85
|
+
if (keys.has(key)) {
|
|
86
|
+
throw new cliError_1.default('usage_error', (0, texts_1.ERR_VARIABLE_INJECT_VAR_FILE_DUPLICATE_KEY)(key));
|
|
87
|
+
}
|
|
88
|
+
if (paths.has(path)) {
|
|
89
|
+
throw new cliError_1.default('usage_error', (0, texts_1.ERR_VARIABLE_INJECT_VAR_FILE_DUPLICATE_PATH)(path));
|
|
90
|
+
}
|
|
91
|
+
keys.add(key);
|
|
92
|
+
paths.add(path);
|
|
93
|
+
const variable = find(key);
|
|
94
|
+
if ((variable.type ?? utils_1.VARIABLE_TYPE.VAR) === utils_1.VARIABLE_TYPE.VAR) {
|
|
95
|
+
throw new cliError_1.default('usage_error', (0, texts_1.ERR_VARIABLE_INJECT_NOT_FILE)(key));
|
|
96
|
+
}
|
|
97
|
+
return { variable, path };
|
|
98
|
+
});
|
|
99
|
+
// every secret field that reaches the command, checked before anything runs
|
|
100
|
+
const masked = [];
|
|
101
|
+
const check = (key, value, secret) => {
|
|
102
|
+
if (secret && typeof value === 'string' && value.startsWith(MASKED)) {
|
|
103
|
+
masked.push({ key, value });
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
for (const v of plain)
|
|
107
|
+
check(v.key, v.value, !!v.encrypted);
|
|
108
|
+
for (const { variable: v } of fileVars) {
|
|
109
|
+
check(v.key, v.value, !!v.encrypted);
|
|
110
|
+
check(v.key, v.password, true);
|
|
111
|
+
check(v.key, v.passphrase, true);
|
|
112
|
+
}
|
|
113
|
+
if (masked.length) {
|
|
114
|
+
const failing = [...new Set(masked.map((m) => m.key))];
|
|
115
|
+
if (masked.some((m) => m.value === MASKED)) {
|
|
116
|
+
const noAccess = [
|
|
117
|
+
...new Set(masked.filter((m) => m.value === MASKED).map((m) => m.key)),
|
|
118
|
+
];
|
|
119
|
+
throw new cliError_1.default('forbidden', (0, texts_1.ERR_VARIABLE_INJECT_NO_ACCESS)(noAccess), texts_1.HINT_VARIABLE_INJECT_NO_ACCESS);
|
|
120
|
+
}
|
|
121
|
+
if (!environment.allow_decrypted_values) {
|
|
122
|
+
throw new cliError_1.default('forbidden', (0, texts_1.ERR_VARIABLE_INJECT_NOT_ALLOWED)(failing), texts_1.HINT_VARIABLE_INJECT_NOT_ALLOWED);
|
|
123
|
+
}
|
|
124
|
+
throw new cliError_1.default('forbidden', (0, texts_1.ERR_VARIABLE_INJECT_NO_SCOPE)(failing), texts_1.HINT_VARIABLE_INJECT_NO_SCOPE);
|
|
125
|
+
}
|
|
126
|
+
const injection = { env: {}, files: [], secrets: [], unmasked: [] };
|
|
127
|
+
// without the line ending a key or a file ends with, so printing one does
|
|
128
|
+
// not swallow the newline after it
|
|
129
|
+
const addSecret = (key, value) => {
|
|
130
|
+
let bytes = Buffer.isBuffer(value) ? value : Buffer.from(value);
|
|
131
|
+
let end = bytes.length;
|
|
132
|
+
while (end && (bytes[end - 1] === 0x0a || bytes[end - 1] === 0x0d))
|
|
133
|
+
end--;
|
|
134
|
+
bytes = bytes.subarray(0, end);
|
|
135
|
+
if (!bytes.length)
|
|
136
|
+
return;
|
|
137
|
+
if (bytes.length < MIN_MASKED_VALUE) {
|
|
138
|
+
if (!injection.unmasked.includes(key))
|
|
139
|
+
injection.unmasked.push(key);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
injection.secrets.push(bytes);
|
|
143
|
+
// a key or a file printed in part (`head -1`, a tool quoting one line of
|
|
144
|
+
// it) is masked line by line too; a short line is no secret on its own
|
|
145
|
+
// and masking it would garble unrelated output
|
|
146
|
+
if (bytes.includes(0x0a)) {
|
|
147
|
+
for (const line of bytes.toString('latin1').split(/\r?\n/)) {
|
|
148
|
+
if (line.length >= MIN_MASKED_LINE)
|
|
149
|
+
injection.secrets.push(Buffer.from(line, 'latin1'));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
for (const v of plain) {
|
|
154
|
+
const value = v.value ?? '';
|
|
155
|
+
injection.env[v.key] = value;
|
|
156
|
+
if (v.encrypted)
|
|
157
|
+
addSecret(v.key, value);
|
|
158
|
+
}
|
|
159
|
+
const extras = [];
|
|
160
|
+
for (const { variable: v, path } of fileVars) {
|
|
161
|
+
const value = v.value ?? '';
|
|
162
|
+
const content = BASE64_TYPES.includes(v.type)
|
|
163
|
+
? Buffer.from(value, 'base64')
|
|
164
|
+
: Buffer.from(value);
|
|
165
|
+
injection.files.push({ path, content });
|
|
166
|
+
if (v.encrypted)
|
|
167
|
+
addSecret(v.key, content);
|
|
168
|
+
if (v.password)
|
|
169
|
+
extras.push({ name: `${v.key}_PASSWORD`, key: v.key, value: v.password });
|
|
170
|
+
if (v.passphrase)
|
|
171
|
+
extras.push({ name: `${v.key}_PASSPHRASE`, key: v.key, value: v.passphrase });
|
|
172
|
+
}
|
|
173
|
+
for (const { name, key, value } of extras) {
|
|
174
|
+
if (name in injection.env) {
|
|
175
|
+
throw new cliError_1.default('usage_error', (0, texts_1.ERR_VARIABLE_INJECT_NAME_CONFLICT)(name, key));
|
|
176
|
+
}
|
|
177
|
+
injection.env[name] = value;
|
|
178
|
+
addSecret(name, value);
|
|
179
|
+
}
|
|
180
|
+
return injection;
|
|
181
|
+
};
|
|
182
|
+
exports.buildInjection = buildInjection;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_stream_1 = require("node:stream");
|
|
4
|
+
const MASK = Buffer.from('***');
|
|
5
|
+
/**
|
|
6
|
+
* Replaces the secrets in a byte stream with ***. Works on bytes, not text,
|
|
7
|
+
* so binary output passes through intact and a multi-byte character split
|
|
8
|
+
* between chunks is not a concern.
|
|
9
|
+
*
|
|
10
|
+
* A secret can arrive split between two writes, so a tail of a chunk that is
|
|
11
|
+
* the start of a secret is held back until the next chunk shows whether it
|
|
12
|
+
* is one. Only such a tail is held - anything else goes out at once - and
|
|
13
|
+
* only for flushDelay: a prompt that happens to end like the start of a
|
|
14
|
+
* secret must not hang. A secret written in two parts further apart than
|
|
15
|
+
* that is not masked; programs print a value in one write.
|
|
16
|
+
*/
|
|
17
|
+
class SecretMask extends node_stream_1.Transform {
|
|
18
|
+
flushDelay;
|
|
19
|
+
secrets;
|
|
20
|
+
longest;
|
|
21
|
+
pending = Buffer.alloc(0);
|
|
22
|
+
timer = null;
|
|
23
|
+
// bytes taken in so far, for telling a stream that still flows from one
|
|
24
|
+
// that went quiet
|
|
25
|
+
bytesIn = 0;
|
|
26
|
+
constructor(secrets, flushDelay = 50) {
|
|
27
|
+
super();
|
|
28
|
+
this.flushDelay = flushDelay;
|
|
29
|
+
// longest first, so a secret containing another is masked whole
|
|
30
|
+
this.secrets = secrets
|
|
31
|
+
.filter((s) => s.length)
|
|
32
|
+
.sort((a, b) => b.length - a.length);
|
|
33
|
+
this.longest = this.secrets[0]?.length ?? 0;
|
|
34
|
+
}
|
|
35
|
+
_transform(chunk, _encoding, callback) {
|
|
36
|
+
this.clearTimer();
|
|
37
|
+
this.bytesIn += chunk.length;
|
|
38
|
+
const data = this.pending.length ? Buffer.concat([this.pending, chunk]) : chunk;
|
|
39
|
+
const out = [];
|
|
40
|
+
let i = 0;
|
|
41
|
+
for (;;) {
|
|
42
|
+
let at = -1;
|
|
43
|
+
let match = null;
|
|
44
|
+
for (const secret of this.secrets) {
|
|
45
|
+
const index = data.indexOf(secret, i);
|
|
46
|
+
if (index >= 0 && (at < 0 || index < at)) {
|
|
47
|
+
at = index;
|
|
48
|
+
match = secret;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (!match)
|
|
52
|
+
break;
|
|
53
|
+
out.push(data.subarray(i, at), MASK);
|
|
54
|
+
i = at + match.length;
|
|
55
|
+
}
|
|
56
|
+
const hold = this.heldTail(data, i);
|
|
57
|
+
out.push(data.subarray(i, hold));
|
|
58
|
+
this.pending = Buffer.from(data.subarray(hold));
|
|
59
|
+
const ready = Buffer.concat(out);
|
|
60
|
+
if (ready.length)
|
|
61
|
+
this.push(ready);
|
|
62
|
+
if (this.pending.length) {
|
|
63
|
+
this.timer = setTimeout(() => this.release(), this.flushDelay);
|
|
64
|
+
}
|
|
65
|
+
callback();
|
|
66
|
+
}
|
|
67
|
+
_flush(callback) {
|
|
68
|
+
this.release();
|
|
69
|
+
callback();
|
|
70
|
+
}
|
|
71
|
+
_destroy(err, callback) {
|
|
72
|
+
this.clearTimer();
|
|
73
|
+
callback(err);
|
|
74
|
+
}
|
|
75
|
+
// Earliest position from which the rest of data starts some secret.
|
|
76
|
+
heldTail(data, from) {
|
|
77
|
+
const start = Math.max(from, data.length - this.longest + 1);
|
|
78
|
+
for (let p = start; p < data.length; p++) {
|
|
79
|
+
const rest = data.subarray(p);
|
|
80
|
+
if (this.secrets.some((s) => s.length > rest.length && s.subarray(0, rest.length).equals(rest))) {
|
|
81
|
+
return p;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return data.length;
|
|
85
|
+
}
|
|
86
|
+
release() {
|
|
87
|
+
this.clearTimer();
|
|
88
|
+
if (this.pending.length) {
|
|
89
|
+
const pending = this.pending;
|
|
90
|
+
this.pending = Buffer.alloc(0);
|
|
91
|
+
this.push(pending);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
clearTimer() {
|
|
95
|
+
if (this.timer)
|
|
96
|
+
clearTimeout(this.timer);
|
|
97
|
+
this.timer = null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.default = SecretMask;
|
|
@@ -10,6 +10,7 @@ const get_1 = __importDefault(require("./variable/get"));
|
|
|
10
10
|
const create_1 = __importDefault(require("./variable/create"));
|
|
11
11
|
const update_1 = __importDefault(require("./variable/update"));
|
|
12
12
|
const delete_1 = __importDefault(require("./variable/delete"));
|
|
13
|
+
const inject_1 = __importDefault(require("./variable/inject"));
|
|
13
14
|
const commandVariable = (0, utils_1.newCommand)('variable', texts_1.DESC_COMMAND_VARIABLE);
|
|
14
15
|
commandVariable.alias('var');
|
|
15
16
|
commandVariable.addCommand(list_1.default);
|
|
@@ -17,4 +18,5 @@ commandVariable.addCommand(get_1.default);
|
|
|
17
18
|
commandVariable.addCommand(create_1.default);
|
|
18
19
|
commandVariable.addCommand(update_1.default);
|
|
19
20
|
commandVariable.addCommand(delete_1.default);
|
|
21
|
+
commandVariable.addCommand(inject_1.default);
|
|
20
22
|
exports.default = commandVariable;
|
|
@@ -579,7 +579,7 @@ class OutputPipeline {
|
|
|
579
579
|
return;
|
|
580
580
|
}
|
|
581
581
|
commands.forEach((command) => {
|
|
582
|
-
output_1.default.
|
|
582
|
+
output_1.default.normal(`${output_1.default.getTermKitDimColor(` ${texts_1.TXT_PIPELINE_RUN_NEXT}`)}${output_1.default.getTermKitMutedColor(command)}`);
|
|
583
583
|
});
|
|
584
584
|
}
|
|
585
585
|
static _jsonActionsLogsHelp(identifier, runId, flags, actionRunId) {
|
|
@@ -1295,28 +1295,28 @@ class OutputPipeline {
|
|
|
1295
1295
|
this.jsonAction(identifier, runId, action, flags);
|
|
1296
1296
|
}
|
|
1297
1297
|
else {
|
|
1298
|
-
output_1.default.
|
|
1299
|
-
output_1.default.
|
|
1300
|
-
output_1.default.
|
|
1301
|
-
output_1.default.
|
|
1298
|
+
output_1.default.normal(this._runDetailsHeader());
|
|
1299
|
+
output_1.default.normal(this._runDetailsId(action.runId, tabs));
|
|
1300
|
+
output_1.default.normal(this._runHtmlUrl(action.url, tabs));
|
|
1301
|
+
output_1.default.normal(this._runDetailsStatus(action.status, action.started, action.finished, tabs));
|
|
1302
1302
|
const target = this._runActionTarget(action, tabs);
|
|
1303
1303
|
if (target) {
|
|
1304
|
-
output_1.default.
|
|
1304
|
+
output_1.default.normal(target);
|
|
1305
1305
|
}
|
|
1306
1306
|
const loop = this._runLoopVariables(action.loop, action.loopValues, tabs);
|
|
1307
1307
|
if (loop) {
|
|
1308
|
-
output_1.default.
|
|
1308
|
+
output_1.default.normal(loop);
|
|
1309
1309
|
}
|
|
1310
1310
|
const started = this._runDetailsStarted(action.status, action.started, null, tabs);
|
|
1311
1311
|
if (started) {
|
|
1312
|
-
output_1.default.
|
|
1312
|
+
output_1.default.normal(started);
|
|
1313
1313
|
}
|
|
1314
1314
|
const finished = this._runDetailsFinished(action.status, action.finished, tabs);
|
|
1315
1315
|
if (finished) {
|
|
1316
|
-
output_1.default.
|
|
1316
|
+
output_1.default.normal(finished);
|
|
1317
1317
|
}
|
|
1318
|
-
output_1.default.
|
|
1319
|
-
output_1.default.
|
|
1318
|
+
output_1.default.normal('');
|
|
1319
|
+
output_1.default.normal(this._runLogsHeader());
|
|
1320
1320
|
}
|
|
1321
1321
|
drawnStart = true;
|
|
1322
1322
|
}
|
|
@@ -1326,7 +1326,9 @@ class OutputPipeline {
|
|
|
1326
1326
|
this.jsonLog(logs[actionLogsStart]);
|
|
1327
1327
|
}
|
|
1328
1328
|
else {
|
|
1329
|
-
|
|
1329
|
+
// log lines are payload inside markup - escape so % and ^
|
|
1330
|
+
// sequences in build output render verbatim
|
|
1331
|
+
output_1.default.normal(output_1.default.getTermKitDimColor(` ${output_1.default.escapeTermKit(logs[actionLogsStart])}`));
|
|
1330
1332
|
}
|
|
1331
1333
|
}
|
|
1332
1334
|
if (action &&
|
|
@@ -1349,39 +1351,39 @@ class OutputPipeline {
|
|
|
1349
1351
|
}
|
|
1350
1352
|
else {
|
|
1351
1353
|
if (logsEnd && action?.outputtedVariables.length) {
|
|
1352
|
-
output_1.default.
|
|
1353
|
-
output_1.default.
|
|
1354
|
-
output_1.default.
|
|
1354
|
+
output_1.default.normal('');
|
|
1355
|
+
output_1.default.normal(this._runOutputHeader());
|
|
1356
|
+
output_1.default.normal(output_1.default.getTermKitDimColor(' Variables '), false);
|
|
1355
1357
|
action.outputtedVariables.forEach((v, i) => {
|
|
1356
1358
|
let line = '';
|
|
1357
1359
|
if (i > 0)
|
|
1358
1360
|
line += ' ';
|
|
1359
|
-
line += output_1.default.getTermKitMutedColor(v.key);
|
|
1361
|
+
line += output_1.default.getTermKitMutedColor(output_1.default.escapeTermKit(v.key));
|
|
1360
1362
|
line += output_1.default.getTermKitDimColor(` = "`);
|
|
1361
|
-
line += output_1.default.getTermKitBlueColor(v.value);
|
|
1363
|
+
line += output_1.default.getTermKitBlueColor(output_1.default.escapeTermKit(v.value));
|
|
1362
1364
|
line += output_1.default.getTermKitDimColor('"');
|
|
1363
|
-
output_1.default.
|
|
1365
|
+
output_1.default.normal(line);
|
|
1364
1366
|
});
|
|
1365
1367
|
}
|
|
1366
1368
|
if (logsEnd && action && totalFetchesCount > 1) {
|
|
1367
|
-
output_1.default.
|
|
1368
|
-
output_1.default.
|
|
1369
|
-
output_1.default.
|
|
1369
|
+
output_1.default.normal('');
|
|
1370
|
+
output_1.default.normal(this._runDetailsHeader());
|
|
1371
|
+
output_1.default.normal(this._runDetailsStatus(action.status, action.started, action.finished, tabs));
|
|
1370
1372
|
const target = this._runActionTarget(action, tabs);
|
|
1371
1373
|
if (target) {
|
|
1372
|
-
output_1.default.
|
|
1374
|
+
output_1.default.normal(target);
|
|
1373
1375
|
}
|
|
1374
1376
|
const loop = this._runLoopVariables(action.loop, action.loopValues, tabs);
|
|
1375
1377
|
if (loop) {
|
|
1376
|
-
output_1.default.
|
|
1378
|
+
output_1.default.normal(loop);
|
|
1377
1379
|
}
|
|
1378
1380
|
const started = this._runDetailsStarted(action.status, action.started, null, tabs);
|
|
1379
1381
|
if (started) {
|
|
1380
|
-
output_1.default.
|
|
1382
|
+
output_1.default.normal(started);
|
|
1381
1383
|
}
|
|
1382
1384
|
const finished = this._runDetailsFinished(action.status, action.finished, tabs);
|
|
1383
1385
|
if (finished) {
|
|
1384
|
-
output_1.default.
|
|
1386
|
+
output_1.default.normal(finished);
|
|
1385
1387
|
}
|
|
1386
1388
|
}
|
|
1387
1389
|
}
|
|
@@ -1447,32 +1449,32 @@ class OutputPipeline {
|
|
|
1447
1449
|
}
|
|
1448
1450
|
const draw = (r) => {
|
|
1449
1451
|
if (!run) {
|
|
1450
|
-
output_1.default.
|
|
1451
|
-
output_1.default.
|
|
1452
|
-
output_1.default.
|
|
1453
|
-
output_1.default.
|
|
1454
|
-
output_1.default.
|
|
1452
|
+
output_1.default.normal(this._runDetailsHeader());
|
|
1453
|
+
output_1.default.normal(this._runDetailsId(r.runId, tabs));
|
|
1454
|
+
output_1.default.normal(this._runHtmlUrl(r.url, tabs));
|
|
1455
|
+
output_1.default.normal(this._runDetailsStatus(r.status, r.started, r.finished, tabs));
|
|
1456
|
+
output_1.default.normal(this._runDetailsTriggerer(r, tabs));
|
|
1455
1457
|
if (r?.description)
|
|
1456
|
-
output_1.default.
|
|
1458
|
+
output_1.default.normal(this._runDetailsDescription(r, tabs));
|
|
1457
1459
|
const started = this._runDetailsStarted(r.status, r.started, r.delayed, tabs);
|
|
1458
1460
|
if (started)
|
|
1459
|
-
output_1.default.
|
|
1461
|
+
output_1.default.normal(started);
|
|
1460
1462
|
const finished = this._runDetailsFinished(r.status, r.finished, tabs);
|
|
1461
1463
|
if (finished)
|
|
1462
|
-
output_1.default.
|
|
1464
|
+
output_1.default.normal(finished);
|
|
1463
1465
|
const context = this._runContext(r, tabs);
|
|
1464
1466
|
if (context.length > 0) {
|
|
1465
|
-
output_1.default.
|
|
1467
|
+
output_1.default.normal('');
|
|
1466
1468
|
context.forEach((str) => {
|
|
1467
|
-
output_1.default.
|
|
1469
|
+
output_1.default.normal(str);
|
|
1468
1470
|
});
|
|
1469
1471
|
}
|
|
1470
|
-
output_1.default.
|
|
1471
|
-
output_1.default.
|
|
1472
|
+
output_1.default.normal('');
|
|
1473
|
+
output_1.default.normal(this._runActionsHeader(tabs));
|
|
1472
1474
|
}
|
|
1473
1475
|
const actions = this._runActions(r, true, 0, -1, tabs);
|
|
1474
1476
|
actions.forEach((str) => {
|
|
1475
|
-
output_1.default.
|
|
1477
|
+
output_1.default.normal(str);
|
|
1476
1478
|
});
|
|
1477
1479
|
run = r;
|
|
1478
1480
|
};
|
|
@@ -1513,42 +1515,42 @@ class OutputPipeline {
|
|
|
1513
1515
|
else {
|
|
1514
1516
|
if (totalFetchesCount > 1 || noFollow) {
|
|
1515
1517
|
if (!noFollow)
|
|
1516
|
-
output_1.default.
|
|
1517
|
-
output_1.default.
|
|
1518
|
+
output_1.default.normal('');
|
|
1519
|
+
output_1.default.normal(this._runDetailsHeader());
|
|
1518
1520
|
if (noFollow) {
|
|
1519
|
-
output_1.default.
|
|
1520
|
-
output_1.default.
|
|
1521
|
+
output_1.default.normal(this._runDetailsId(run.runId, tabs));
|
|
1522
|
+
output_1.default.normal(this._runHtmlUrl(run.url, tabs));
|
|
1521
1523
|
}
|
|
1522
|
-
output_1.default.
|
|
1524
|
+
output_1.default.normal(this._runDetailsStatus(run.status, run.started, run.finished, tabs));
|
|
1523
1525
|
if (noFollow) {
|
|
1524
|
-
output_1.default.
|
|
1526
|
+
output_1.default.normal(this._runDetailsTriggerer(run, tabs));
|
|
1525
1527
|
if (run?.description)
|
|
1526
|
-
output_1.default.
|
|
1528
|
+
output_1.default.normal(this._runDetailsDescription(run, tabs));
|
|
1527
1529
|
}
|
|
1528
1530
|
const started = this._runDetailsStarted(run.status, run.started, run.delayed, tabs);
|
|
1529
1531
|
if (started)
|
|
1530
|
-
output_1.default.
|
|
1532
|
+
output_1.default.normal(started);
|
|
1531
1533
|
const finished = this._runDetailsFinished(run.status, run.finished, tabs);
|
|
1532
1534
|
if (finished)
|
|
1533
|
-
output_1.default.
|
|
1535
|
+
output_1.default.normal(finished);
|
|
1534
1536
|
if (noFollow) {
|
|
1535
1537
|
const context = this._runContext(run, tabs);
|
|
1536
1538
|
if (context.length > 0) {
|
|
1537
|
-
output_1.default.
|
|
1539
|
+
output_1.default.normal('');
|
|
1538
1540
|
context.forEach((str) => {
|
|
1539
|
-
output_1.default.
|
|
1541
|
+
output_1.default.normal(str);
|
|
1540
1542
|
});
|
|
1541
1543
|
}
|
|
1542
|
-
output_1.default.
|
|
1543
|
-
output_1.default.
|
|
1544
|
+
output_1.default.normal('');
|
|
1545
|
+
output_1.default.normal(this._runActionsHeader(tabs));
|
|
1544
1546
|
const actions = this._runActions(run, true, 0, -1, tabs);
|
|
1545
1547
|
actions.forEach((str) => {
|
|
1546
|
-
output_1.default.
|
|
1548
|
+
output_1.default.normal(str);
|
|
1547
1549
|
});
|
|
1548
1550
|
}
|
|
1549
1551
|
}
|
|
1550
|
-
output_1.default.
|
|
1551
|
-
output_1.default.
|
|
1552
|
+
output_1.default.normal(this._dimLine());
|
|
1553
|
+
output_1.default.normal(this._runActionsLogsHelp(identifier, runId, flags));
|
|
1552
1554
|
}
|
|
1553
1555
|
await finishRun(run);
|
|
1554
1556
|
}
|