bdy 1.16.16-dev → 1.16.17-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 +73 -8
- package/distTs/src/command/login.js +11 -3
- package/distTs/src/command/package/download.js +259 -0
- package/distTs/src/command/package/list.js +35 -0
- package/distTs/src/command/package/publish.js +231 -0
- package/distTs/src/command/package.js +16 -0
- package/distTs/src/command/pipeline/run.js +3 -3
- package/distTs/src/command/project/set.js +1 -1
- package/distTs/src/index.js +2 -0
- package/distTs/src/input.js +24 -2
- package/distTs/src/texts.js +65 -20
- package/package.json +1 -1
package/distTs/package.json
CHANGED
package/distTs/src/api/client.js
CHANGED
|
@@ -51,7 +51,7 @@ class ApiClient {
|
|
|
51
51
|
let responseBody;
|
|
52
52
|
logger_1.default.debug(`API CLIENT: ${method} ${this.baseUrl.protocol}//${this.baseUrl.host}${path}`);
|
|
53
53
|
logger_1.default.debug(headers);
|
|
54
|
-
logger_1.default.debug(
|
|
54
|
+
logger_1.default.debug(bodyParsed);
|
|
55
55
|
try {
|
|
56
56
|
const r = await this.client.request(opts);
|
|
57
57
|
status = r.statusCode;
|
|
@@ -107,7 +107,7 @@ class ApiClient {
|
|
|
107
107
|
else
|
|
108
108
|
throw new Error(texts_1.ERR_REST_API_GENERAL_ERROR);
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
110
|
+
if ([200, 201].includes(status)) {
|
|
111
111
|
if (parseResponseBody) {
|
|
112
112
|
try {
|
|
113
113
|
const b = await responseBody.json();
|
|
@@ -138,9 +138,6 @@ class ApiClient {
|
|
|
138
138
|
throw new Error(texts_1.ERR_REST_API_GENERAL_ERROR);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
async getPipelineByIdentifier(workspace, project, identifier) {
|
|
142
|
-
return await this.request('GET', `/workspaces/${encodeURIComponent(workspace)}/identifiers?project=${encodeURIComponent(project)}&pipeline=${encodeURIComponent(identifier)}`, null, true);
|
|
143
|
-
}
|
|
144
141
|
async getPipelineRun(workspace, project, pipelineId, executionId) {
|
|
145
142
|
return await this.request('GET', `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines/${encodeURIComponent(pipelineId)}/executions/${encodeURIComponent(executionId)}`, null, true);
|
|
146
143
|
}
|
|
@@ -212,9 +209,6 @@ class ApiClient {
|
|
|
212
209
|
async listSandboxCommands(workspace, sandboxId) {
|
|
213
210
|
return await this.request('GET', `/workspaces/${encodeURIComponent(workspace)}/sandboxes/${encodeURIComponent(sandboxId)}/commands`, null, true);
|
|
214
211
|
}
|
|
215
|
-
async getSandboxCommandLogsUrl(workspace, sandboxId, commandId) {
|
|
216
|
-
return `${this.baseUrl.origin}/workspaces/${encodeURIComponent(workspace)}/sandboxes/${encodeURIComponent(sandboxId)}/commands/${encodeURIComponent(commandId)}/logs`;
|
|
217
|
-
}
|
|
218
212
|
async streamSandboxCommandLogs(workspace, sandboxId, commandId, follow = true) {
|
|
219
213
|
let q = '';
|
|
220
214
|
if (follow)
|
|
@@ -308,8 +302,79 @@ class ApiClient {
|
|
|
308
302
|
async getWorkspaces() {
|
|
309
303
|
return await this.request('GET', '/workspaces', null, true);
|
|
310
304
|
}
|
|
305
|
+
async getPackages(workspace, project) {
|
|
306
|
+
let query = '';
|
|
307
|
+
if (project)
|
|
308
|
+
query += `?project_name=${encodeURIComponent(project)}`;
|
|
309
|
+
return await this.request('GET', `/workspaces/${encodeURIComponent(workspace)}/packages${query}`, null, true);
|
|
310
|
+
}
|
|
311
311
|
async getProjects(workspace) {
|
|
312
312
|
return await this.request('GET', `/workspaces/${encodeURIComponent(workspace)}/projects`, null, true);
|
|
313
313
|
}
|
|
314
|
+
async getResourceByIdentifier(workspace, params) {
|
|
315
|
+
let query = '';
|
|
316
|
+
Object.keys(params).forEach((key) => {
|
|
317
|
+
if (!query)
|
|
318
|
+
query += '?';
|
|
319
|
+
else
|
|
320
|
+
query += '&';
|
|
321
|
+
query += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);
|
|
322
|
+
});
|
|
323
|
+
return await this.request('GET', `/workspaces/${encodeURIComponent(workspace)}/identifiers${query}`, null, true);
|
|
324
|
+
}
|
|
325
|
+
async getPipelineByIdentifier(workspace, project, identifier) {
|
|
326
|
+
return await this.getResourceByIdentifier(workspace, { project, pipeline: identifier });
|
|
327
|
+
}
|
|
328
|
+
async getPackageVersionByIdentifier(workspace, project, pkg, version) {
|
|
329
|
+
const opts = {
|
|
330
|
+
package: pkg,
|
|
331
|
+
};
|
|
332
|
+
if (project)
|
|
333
|
+
opts.project = project;
|
|
334
|
+
if (version)
|
|
335
|
+
opts.package_version = version;
|
|
336
|
+
return await this.getResourceByIdentifier(workspace, opts);
|
|
337
|
+
}
|
|
338
|
+
async getPackageVersion(workspace, pkgId, versionId) {
|
|
339
|
+
return await this.request('GET', `/workspaces/${encodeURIComponent(workspace)}/packages/${encodeURIComponent(pkgId)}/versions/${encodeURIComponent(versionId)}`, null, true);
|
|
340
|
+
}
|
|
341
|
+
async getPackageLatest(workspace, pkgId) {
|
|
342
|
+
const res = await this.request('GET', `/workspaces/${encodeURIComponent(workspace)}/packages/${encodeURIComponent(pkgId)}/versions?page=1&per_page=1`, null, true);
|
|
343
|
+
if (res && res.versions && res.versions.length > 0) {
|
|
344
|
+
return res.versions[0];
|
|
345
|
+
}
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
async downloadPackageVersion(workspace, pkgId, versionId) {
|
|
349
|
+
return await this.request('GET', `/workspaces/${encodeURIComponent(workspace)}/packages/${encodeURIComponent(pkgId)}/versions/${encodeURIComponent(versionId)}/download`, null, false, true);
|
|
350
|
+
}
|
|
351
|
+
async postPackageVersion(workspace, pkgId, version) {
|
|
352
|
+
return await this.request('POST', `/workspaces/${encodeURIComponent(workspace)}/packages/${encodeURIComponent(pkgId)}/versions`, {
|
|
353
|
+
version
|
|
354
|
+
}, true);
|
|
355
|
+
}
|
|
356
|
+
async postPackageVersionZip(workspace, pkgId, versionId, file) {
|
|
357
|
+
const form = new undici_1.FormData();
|
|
358
|
+
form.append('file', file);
|
|
359
|
+
return await this.request('POST', `/workspaces/${encodeURIComponent(workspace)}/packages/${encodeURIComponent(pkgId)}/versions/${versionId}/upload`, form, true);
|
|
360
|
+
}
|
|
361
|
+
async postPackage(workspace, project, identifier) {
|
|
362
|
+
const body = {
|
|
363
|
+
name: identifier,
|
|
364
|
+
identifier,
|
|
365
|
+
type: 'FILE',
|
|
366
|
+
scope: 'WORKSPACE',
|
|
367
|
+
authorization: {
|
|
368
|
+
type: 'BUDDY'
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
if (project) {
|
|
372
|
+
body.project = {
|
|
373
|
+
name: project
|
|
374
|
+
};
|
|
375
|
+
body.scope = 'PROJECT';
|
|
376
|
+
}
|
|
377
|
+
return await this.request('POST', `/workspaces/${encodeURIComponent(workspace)}/packages`, body, true);
|
|
378
|
+
}
|
|
314
379
|
}
|
|
315
380
|
exports.default = ApiClient;
|
|
@@ -14,7 +14,7 @@ const input_1 = __importDefault(require("../input"));
|
|
|
14
14
|
const OAUTH_CLIENT_APP_PORT = 7596;
|
|
15
15
|
const OAUTH_CLIENT_APP_HOST = 'localhost';
|
|
16
16
|
const OAUTH_CLIENT_APP_REDIRECT_URL = `http://localhost:${OAUTH_CLIENT_APP_PORT}`;
|
|
17
|
-
const OAUTH_CLIENT_APP_SCOPES = 'WORKSPACE USER_INFO EXECUTION_MANAGE SANDBOX_MANAGE';
|
|
17
|
+
const OAUTH_CLIENT_APP_SCOPES = 'WORKSPACE USER_INFO EXECUTION_MANAGE SANDBOX_MANAGE PACKAGE_MANAGE';
|
|
18
18
|
function normalizeBaseUrl(url) {
|
|
19
19
|
let normalized = url.trim();
|
|
20
20
|
normalized = normalized.replace(/^https?:\/\//i, '');
|
|
@@ -76,7 +76,8 @@ async function oauthServer(api, clientId, clientSecret) {
|
|
|
76
76
|
reject(texts_1.ERR_LOGIN_HTTP_SERVER_PORT_TAKEN);
|
|
77
77
|
});
|
|
78
78
|
s.listen(OAUTH_CLIENT_APP_PORT, OAUTH_CLIENT_APP_HOST);
|
|
79
|
-
|
|
79
|
+
const url = `https://${api}/oauth2/authorize?type=web_server&client_id=${encodeURIComponent(clientId)}&redirect_uri=${encodeURIComponent(OAUTH_CLIENT_APP_REDIRECT_URL)}&response_type=code&scope=${encodeURIComponent(OAUTH_CLIENT_APP_SCOPES)}`;
|
|
80
|
+
(0, open_1.default)(url);
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
async function getOrCreateApp(api) {
|
|
@@ -84,10 +85,17 @@ async function getOrCreateApp(api) {
|
|
|
84
85
|
let clientId = cfg_1.default.getApiClientId();
|
|
85
86
|
let clientSecret = cfg_1.default.getApiClientSecret();
|
|
86
87
|
if (clientId && clientSecret) {
|
|
88
|
+
let clear = false;
|
|
87
89
|
try {
|
|
88
|
-
await client.getApp(clientId);
|
|
90
|
+
const app = await client.getApp(clientId);
|
|
91
|
+
if (!app || !app.redirect_uris || !app.redirect_uris.includes(OAUTH_CLIENT_APP_REDIRECT_URL)) {
|
|
92
|
+
clear = true;
|
|
93
|
+
}
|
|
89
94
|
}
|
|
90
95
|
catch {
|
|
96
|
+
clear = true;
|
|
97
|
+
}
|
|
98
|
+
if (clear) {
|
|
91
99
|
clientId = null;
|
|
92
100
|
clientSecret = null;
|
|
93
101
|
}
|
|
@@ -0,0 +1,259 @@
|
|
|
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 client_1 = __importDefault(require("../../api/client"));
|
|
10
|
+
const output_1 = __importDefault(require("../../output"));
|
|
11
|
+
const logger_1 = __importDefault(require("../../logger"));
|
|
12
|
+
const path_1 = require("path");
|
|
13
|
+
const uuid_1 = require("uuid");
|
|
14
|
+
const fs_1 = __importDefault(require("fs"));
|
|
15
|
+
const promises_1 = __importDefault(require("stream/promises"));
|
|
16
|
+
const fflate_1 = require("fflate");
|
|
17
|
+
const commandPackageDownload = (0, utils_1.newCommand)('download', texts_1.DESC_COMMAND_PACKAGE_DOWNLOAD);
|
|
18
|
+
commandPackageDownload.alias('dd');
|
|
19
|
+
commandPackageDownload.option('-t, --token <token>', texts_1.OPTION_REST_API_TOKEN);
|
|
20
|
+
commandPackageDownload.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
21
|
+
commandPackageDownload.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
22
|
+
commandPackageDownload.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
23
|
+
commandPackageDownload.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
24
|
+
commandPackageDownload.option('-m, --merge', texts_1.OPTION_PACKAGE_DOWNLOAD_MERGE);
|
|
25
|
+
commandPackageDownload.option('-r, --replace', texts_1.OPTION_PACKAGE_DOWNLOAD_REPLACE);
|
|
26
|
+
commandPackageDownload.argument('<identifier>', texts_1.OPTION_PACKAGE_ID);
|
|
27
|
+
commandPackageDownload.argument('<directory>', texts_1.OPTION_PACKAGE_DOWNLOAD_PATH);
|
|
28
|
+
commandPackageDownload.action(async (id, path, options) => {
|
|
29
|
+
const token = input_1.default.restApiToken(options.token);
|
|
30
|
+
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
31
|
+
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
32
|
+
const project = input_1.default.restApiProject(options.project, true);
|
|
33
|
+
const client = new client_1.default(baseUrl, token);
|
|
34
|
+
// eslint-disable-next-line prefer-const
|
|
35
|
+
let { identifier, version } = input_1.default.packageSplitIdentifier(id);
|
|
36
|
+
const data = await client.getPackageVersionByIdentifier(workspace, project, identifier, version);
|
|
37
|
+
if (!data || !data.domain) {
|
|
38
|
+
output_1.default.exitError(texts_1.ERR_WORKSPACE_NOT_FOUND);
|
|
39
|
+
}
|
|
40
|
+
if (project && !data.project_identifier) {
|
|
41
|
+
output_1.default.exitError(texts_1.ERR_PROJECT_NOT_FOUND);
|
|
42
|
+
}
|
|
43
|
+
const packageId = data.pkg_id;
|
|
44
|
+
if (!packageId) {
|
|
45
|
+
output_1.default.exitError(texts_1.ERR_PACKAGE_DOWNLOAD_NOT_FOUND);
|
|
46
|
+
}
|
|
47
|
+
let versionId = data.pkg_version_id;
|
|
48
|
+
if (version && !versionId) {
|
|
49
|
+
output_1.default.exitError(texts_1.ERR_PACKAGE_VERSION_NOT_FOUND);
|
|
50
|
+
}
|
|
51
|
+
if (!version || !versionId) {
|
|
52
|
+
const v = await client.getPackageLatest(workspace, packageId);
|
|
53
|
+
if (!v) {
|
|
54
|
+
output_1.default.exitError(texts_1.ERR_PACKAGE_VERSION_NOT_FOUND);
|
|
55
|
+
}
|
|
56
|
+
version = v.version;
|
|
57
|
+
versionId = v.id;
|
|
58
|
+
}
|
|
59
|
+
const dirPath = (0, path_1.resolve)(path);
|
|
60
|
+
const exists = fs_1.default.existsSync(dirPath);
|
|
61
|
+
if (!exists) {
|
|
62
|
+
try {
|
|
63
|
+
fs_1.default.mkdirSync(dirPath, {
|
|
64
|
+
recursive: true,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
logger_1.default.error(err);
|
|
69
|
+
output_1.default.exitError((0, texts_1.ERR_PACKAGE_DOWNLOAD_MKDIR)(dirPath));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else if (options.replace) {
|
|
73
|
+
try {
|
|
74
|
+
fs_1.default.rmSync(dirPath, {
|
|
75
|
+
recursive: true,
|
|
76
|
+
force: true,
|
|
77
|
+
});
|
|
78
|
+
fs_1.default.mkdirSync(dirPath, {
|
|
79
|
+
recursive: true,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
logger_1.default.error(err);
|
|
84
|
+
output_1.default.exitError((0, texts_1.ERR_PACKAGE_DOWNLOAD_REPLACE)(dirPath));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
const stat = fs_1.default.statSync(dirPath);
|
|
89
|
+
if (!stat.isDirectory()) {
|
|
90
|
+
output_1.default.exitError((0, texts_1.ERR_PACKAGE_DOWNLOAD_IS_FILE)(dirPath));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
logger_1.default.error(err);
|
|
95
|
+
output_1.default.exitError(texts_1.ERR_SWW);
|
|
96
|
+
}
|
|
97
|
+
let empty = true;
|
|
98
|
+
try {
|
|
99
|
+
const entries = fs_1.default.readdirSync(dirPath);
|
|
100
|
+
empty = !entries.length;
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
logger_1.default.error(err);
|
|
104
|
+
output_1.default.exitError((0, texts_1.ERR_PACKAGE_DOWNLOAD_READDIR)(dirPath));
|
|
105
|
+
}
|
|
106
|
+
if (!empty && !options.merge) {
|
|
107
|
+
output_1.default.exitError((0, texts_1.ERR_PACKAGE_DOWNLOAD_NOT_EMPTY_DIR)(dirPath));
|
|
108
|
+
}
|
|
109
|
+
const zipPath = (0, path_1.join)((0, utils_1.getHomeDirectory)(), `${(0, uuid_1.v4)()}.zip`);
|
|
110
|
+
const clearZip = () => {
|
|
111
|
+
try {
|
|
112
|
+
fs_1.default.rmSync(zipPath);
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
// do nothing
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
output_1.default.normal(texts_1.TXT_PACKAGE_DOWNLOADING_ZIP);
|
|
119
|
+
const body = await client.downloadPackageVersion(workspace, packageId, versionId);
|
|
120
|
+
try {
|
|
121
|
+
await promises_1.default.pipeline(body, fs_1.default.createWriteStream(zipPath));
|
|
122
|
+
output_1.default.clearPreviousLine();
|
|
123
|
+
output_1.default.normal(texts_1.TXT_PACKAGE_DOWNLOADED_ZIP);
|
|
124
|
+
output_1.default.normal(texts_1.TXT_PACKAGE_UNZIPPING);
|
|
125
|
+
let count = 0;
|
|
126
|
+
await unzip(dirPath, zipPath, () => {
|
|
127
|
+
count += 1;
|
|
128
|
+
output_1.default.clearPreviousLine();
|
|
129
|
+
output_1.default.normal((0, texts_1.TXT_PACKAGE_UNZIPPING_COUNT)(count));
|
|
130
|
+
});
|
|
131
|
+
clearZip();
|
|
132
|
+
output_1.default.clearPreviousLine();
|
|
133
|
+
output_1.default.normal(texts_1.TXT_PACKAGE_UNZIPPED);
|
|
134
|
+
}
|
|
135
|
+
catch (err) {
|
|
136
|
+
logger_1.default.error(err);
|
|
137
|
+
clearZip();
|
|
138
|
+
output_1.default.exitError(texts_1.ERR_SWW);
|
|
139
|
+
}
|
|
140
|
+
output_1.default.exitSuccess((0, texts_1.TXT_PACKAGE_DOWNLOADED)(version, dirPath));
|
|
141
|
+
});
|
|
142
|
+
const unzip = (dirPath, zipPath, onFile) => {
|
|
143
|
+
return new Promise((resolve, reject) => {
|
|
144
|
+
let _startedFiles = 0;
|
|
145
|
+
let _finishedFiles = 0;
|
|
146
|
+
let _finishedStream = false;
|
|
147
|
+
let _finishedError = null;
|
|
148
|
+
let _calledResolve = false;
|
|
149
|
+
const rs = fs_1.default.createReadStream(zipPath);
|
|
150
|
+
const _finish = () => {
|
|
151
|
+
if (_finishedError || _finishedStream) {
|
|
152
|
+
try {
|
|
153
|
+
rs.removeAllListeners();
|
|
154
|
+
rs.close();
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
// do nothing
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (_calledResolve)
|
|
161
|
+
return;
|
|
162
|
+
if (_finishedError) {
|
|
163
|
+
_calledResolve = true;
|
|
164
|
+
reject(_finishedError);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (_finishedStream && _startedFiles === _finishedFiles) {
|
|
168
|
+
_calledResolve = true;
|
|
169
|
+
resolve();
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const finishFile = (err, fws) => {
|
|
173
|
+
if (!_finishedError && err)
|
|
174
|
+
_finishedError = err;
|
|
175
|
+
_finishedFiles += 1;
|
|
176
|
+
if (fws) {
|
|
177
|
+
try {
|
|
178
|
+
fws.removeAllListeners();
|
|
179
|
+
fws.close();
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
// do nothing
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
onFile();
|
|
186
|
+
_finish();
|
|
187
|
+
};
|
|
188
|
+
const finishStream = (err) => {
|
|
189
|
+
if (!_finishedError && err)
|
|
190
|
+
_finishedError = err;
|
|
191
|
+
_finishedStream = true;
|
|
192
|
+
_finish();
|
|
193
|
+
};
|
|
194
|
+
const unzip = new fflate_1.Unzip(async (file) => {
|
|
195
|
+
if (_finishedError)
|
|
196
|
+
return;
|
|
197
|
+
_startedFiles += 1;
|
|
198
|
+
const fullPath = (0, path_1.join)(dirPath, file.name);
|
|
199
|
+
const parentPath = (0, path_1.dirname)(fullPath);
|
|
200
|
+
let fws;
|
|
201
|
+
try {
|
|
202
|
+
await fs_1.default.promises.rm(fullPath, {
|
|
203
|
+
recursive: true,
|
|
204
|
+
force: true,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// do nothing
|
|
209
|
+
}
|
|
210
|
+
try {
|
|
211
|
+
if (fullPath.endsWith('/')) {
|
|
212
|
+
await fs_1.default.promises.mkdir(fullPath, {
|
|
213
|
+
recursive: true,
|
|
214
|
+
});
|
|
215
|
+
finishFile();
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
await fs_1.default.promises.mkdir(parentPath, {
|
|
219
|
+
recursive: true,
|
|
220
|
+
});
|
|
221
|
+
fws = fs_1.default.createWriteStream(fullPath, {
|
|
222
|
+
flags: 'w',
|
|
223
|
+
});
|
|
224
|
+
fws.on('error', (err) => {
|
|
225
|
+
finishFile(err, fws);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
catch (err) {
|
|
229
|
+
finishFile(err, fws);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
file.ondata = (err, data, final) => {
|
|
233
|
+
if (_finishedError)
|
|
234
|
+
return;
|
|
235
|
+
if (err)
|
|
236
|
+
finishFile(err, fws);
|
|
237
|
+
else {
|
|
238
|
+
if (fws)
|
|
239
|
+
fws.write(data);
|
|
240
|
+
if (final)
|
|
241
|
+
finishFile(null, fws);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
file.start();
|
|
245
|
+
});
|
|
246
|
+
unzip.register(fflate_1.AsyncUnzipInflate);
|
|
247
|
+
rs.on('data', (chunk) => {
|
|
248
|
+
unzip.push(chunk, false);
|
|
249
|
+
});
|
|
250
|
+
rs.on('error', (err) => {
|
|
251
|
+
finishStream(err);
|
|
252
|
+
});
|
|
253
|
+
rs.on('end', () => {
|
|
254
|
+
unzip.push(new Uint8Array(0), true);
|
|
255
|
+
finishStream();
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
exports.default = commandPackageDownload;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 output_1 = __importDefault(require("../../output"));
|
|
7
|
+
const client_1 = __importDefault(require("../../api/client"));
|
|
8
|
+
const texts_1 = require("../../texts");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const input_1 = __importDefault(require("../../input"));
|
|
11
|
+
const commandPackageList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_PACKAGE_LIST);
|
|
12
|
+
commandPackageList.option('--token <token>', texts_1.OPTION_REST_API_TOKEN);
|
|
13
|
+
commandPackageList.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
14
|
+
commandPackageList.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
15
|
+
commandPackageList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
16
|
+
commandPackageList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
17
|
+
commandPackageList.alias('ls');
|
|
18
|
+
commandPackageList.action(async (options) => {
|
|
19
|
+
const token = input_1.default.restApiToken(options.token);
|
|
20
|
+
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
21
|
+
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
22
|
+
const project = input_1.default.restApiProject(options.project, true);
|
|
23
|
+
const client = new client_1.default(baseUrl, token);
|
|
24
|
+
const response = await client.getPackages(workspace, project);
|
|
25
|
+
if (!response.packages || response.packages.length === 0) {
|
|
26
|
+
output_1.default.exitError(texts_1.ERR_COMMAND_PACKAGE_NO_PROJECTS);
|
|
27
|
+
}
|
|
28
|
+
const data = [['NAME', 'IDENTIFIER']];
|
|
29
|
+
for (const pkg of response.packages) {
|
|
30
|
+
data.push([pkg.name, pkg.identifier]);
|
|
31
|
+
}
|
|
32
|
+
output_1.default.table(data);
|
|
33
|
+
output_1.default.exitNormal();
|
|
34
|
+
});
|
|
35
|
+
exports.default = commandPackageList;
|
|
@@ -0,0 +1,231 @@
|
|
|
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 client_1 = __importDefault(require("../../api/client"));
|
|
10
|
+
const output_1 = __importDefault(require("../../output"));
|
|
11
|
+
const logger_1 = __importDefault(require("../../logger"));
|
|
12
|
+
const fflate_1 = __importDefault(require("fflate"));
|
|
13
|
+
const fs_1 = __importDefault(require("fs"));
|
|
14
|
+
const path_1 = require("path");
|
|
15
|
+
const uuid_1 = require("uuid");
|
|
16
|
+
const commandPackagePublish = (0, utils_1.newCommand)('publish', texts_1.DESC_COMMAND_PACKAGE_PUBLISH);
|
|
17
|
+
commandPackagePublish.alias('pub');
|
|
18
|
+
commandPackagePublish.option('-t, --token <token>', texts_1.OPTION_REST_API_TOKEN);
|
|
19
|
+
commandPackagePublish.option('--api <url>', texts_1.OPTION_REST_API_ENDPOINT);
|
|
20
|
+
commandPackagePublish.option('--region <region>', texts_1.OPTION_REST_API_REGION);
|
|
21
|
+
commandPackagePublish.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
22
|
+
commandPackagePublish.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
23
|
+
commandPackagePublish.option('-c, --create', texts_1.OPTION_PACKAGE_PUBLISH_CREATE);
|
|
24
|
+
commandPackagePublish.option('-f, --force', texts_1.OPTION_PACKAGE_PUBLISH_OVERWRITE_VERSION);
|
|
25
|
+
commandPackagePublish.argument('<identifier>', texts_1.OPTION_PACKAGE_ID);
|
|
26
|
+
commandPackagePublish.argument('<directory>', texts_1.OPTION_PACKAGE_PUBLISH_PATH);
|
|
27
|
+
commandPackagePublish.action(async (id, path, options) => {
|
|
28
|
+
let dirPath = input_1.default.resolvePath(path);
|
|
29
|
+
const token = input_1.default.restApiToken(options.token);
|
|
30
|
+
const baseUrl = input_1.default.restApiBaseUrl(options.api, options.region);
|
|
31
|
+
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
32
|
+
const project = input_1.default.restApiProject(options.project, true);
|
|
33
|
+
// eslint-disable-next-line prefer-const
|
|
34
|
+
let { identifier, version } = input_1.default.packageSplitIdentifier(id);
|
|
35
|
+
if (!version)
|
|
36
|
+
version = (0, uuid_1.v4)();
|
|
37
|
+
const client = new client_1.default(baseUrl, token);
|
|
38
|
+
const data = await client.getPackageVersionByIdentifier(workspace, project, identifier, version);
|
|
39
|
+
if (!data || !data.domain) {
|
|
40
|
+
output_1.default.exitError(texts_1.ERR_WORKSPACE_NOT_FOUND);
|
|
41
|
+
}
|
|
42
|
+
if (project && !data.project_identifier) {
|
|
43
|
+
output_1.default.exitError(texts_1.ERR_PROJECT_NOT_FOUND);
|
|
44
|
+
}
|
|
45
|
+
let packageId = data.pkg_id;
|
|
46
|
+
if (!packageId) {
|
|
47
|
+
if (options.create) {
|
|
48
|
+
const d = await client.postPackage(workspace, project, identifier);
|
|
49
|
+
packageId = d.id;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
output_1.default.exitError(texts_1.ERR_PACKAGE_PUBLISH_NOT_FOUND);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
let packageVersionId = data.pkg_version_id;
|
|
56
|
+
let url;
|
|
57
|
+
if (packageVersionId && !options.force) {
|
|
58
|
+
output_1.default.exitError(texts_1.ERR_PACKAGE_VERSION_EXISTS);
|
|
59
|
+
}
|
|
60
|
+
if (!packageVersionId) {
|
|
61
|
+
const d = await client.postPackageVersion(workspace, packageId, version);
|
|
62
|
+
url = d.version_url;
|
|
63
|
+
packageVersionId = d.id;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const d = await client.getPackageVersion(workspace, packageId, packageVersionId);
|
|
67
|
+
url = d.version_url;
|
|
68
|
+
}
|
|
69
|
+
output_1.default.normal(texts_1.TXT_PACKAGE_SCANNING_DIR, false);
|
|
70
|
+
const stat = fs_1.default.statSync(dirPath);
|
|
71
|
+
let entries;
|
|
72
|
+
if (stat.isDirectory()) {
|
|
73
|
+
entries = fs_1.default.readdirSync(dirPath, {
|
|
74
|
+
withFileTypes: true,
|
|
75
|
+
recursive: true,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
const parentPath = (0, path_1.dirname)(dirPath);
|
|
80
|
+
entries = [
|
|
81
|
+
{
|
|
82
|
+
isDirectory: () => stat.isDirectory(),
|
|
83
|
+
isFile: () => stat.isFile(),
|
|
84
|
+
isBlockDevice: () => stat.isBlockDevice(),
|
|
85
|
+
isCharacterDevice: () => stat.isCharacterDevice(),
|
|
86
|
+
isFIFO: () => stat.isFIFO(),
|
|
87
|
+
isSocket: () => stat.isSocket(),
|
|
88
|
+
isSymbolicLink: () => stat.isSymbolicLink(),
|
|
89
|
+
name: (0, path_1.basename)(dirPath),
|
|
90
|
+
parentPath,
|
|
91
|
+
path: parentPath,
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
dirPath = parentPath;
|
|
95
|
+
}
|
|
96
|
+
if (!entries.length) {
|
|
97
|
+
output_1.default.normal(texts_1.TXT_PACKAGE_NO_ENTRIES_FOUND);
|
|
98
|
+
output_1.default.exitSuccess((0, texts_1.TXT_PACKAGE_PUBLISHED)(url));
|
|
99
|
+
}
|
|
100
|
+
else if (entries.length === 1) {
|
|
101
|
+
output_1.default.normal(texts_1.TXT_PACKAGE_ONE_ENTRY_FOUND);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
output_1.default.normal((0, texts_1.TXT_PACKAGE_ENTRIES_FOUND)(entries.length));
|
|
105
|
+
}
|
|
106
|
+
output_1.default.normal((0, texts_1.TXT_PACKAGE_ZIP_ENTRIES)(0));
|
|
107
|
+
const zipPath = (0, path_1.join)((0, utils_1.getHomeDirectory)(), `${(0, uuid_1.v4)()}.zip`);
|
|
108
|
+
const clearZip = () => {
|
|
109
|
+
try {
|
|
110
|
+
fs_1.default.rmSync(zipPath);
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
// do nothing
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
let blob;
|
|
117
|
+
try {
|
|
118
|
+
let proc = 0;
|
|
119
|
+
await createZip(dirPath, zipPath, entries, () => {
|
|
120
|
+
proc += 1;
|
|
121
|
+
output_1.default.clearPreviousLine();
|
|
122
|
+
output_1.default.normal((0, texts_1.TXT_PACKAGE_ZIP_ENTRIES)(proc));
|
|
123
|
+
});
|
|
124
|
+
output_1.default.clearPreviousLine();
|
|
125
|
+
output_1.default.normal(texts_1.TXT_PACKAGE_ZIPPED);
|
|
126
|
+
blob = await fs_1.default.openAsBlob(zipPath);
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
logger_1.default.error(err);
|
|
130
|
+
clearZip();
|
|
131
|
+
output_1.default.exitError(texts_1.ERR_SWW);
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
output_1.default.normal(texts_1.TXT_PACKAGE_UPLOADING);
|
|
135
|
+
await client.postPackageVersionZip(workspace, packageId, packageVersionId, blob);
|
|
136
|
+
output_1.default.clearPreviousLine();
|
|
137
|
+
output_1.default.normal(texts_1.TXT_PACKAGE_UPLOADED);
|
|
138
|
+
clearZip();
|
|
139
|
+
output_1.default.exitSuccess((0, texts_1.TXT_PACKAGE_PUBLISHED)(url));
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
clearZip();
|
|
143
|
+
logger_1.default.error(err);
|
|
144
|
+
output_1.default.exitError(err);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
const addEntryToZip = (dirPath, zip, entry) => {
|
|
148
|
+
return new Promise((resolve, reject) => {
|
|
149
|
+
const isDir = entry.isDirectory();
|
|
150
|
+
let name = (0, path_1.join)(entry.parentPath.replace(dirPath, ''), entry.name);
|
|
151
|
+
if (isDir)
|
|
152
|
+
name += '/';
|
|
153
|
+
const file = new fflate_1.default.AsyncZipDeflate(name, {
|
|
154
|
+
level: 9,
|
|
155
|
+
});
|
|
156
|
+
zip.add(file);
|
|
157
|
+
if (isDir) {
|
|
158
|
+
file.push(new Uint8Array(0), true);
|
|
159
|
+
resolve();
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const fullPath = (0, path_1.join)(entry.parentPath, entry.name);
|
|
163
|
+
const rs = fs_1.default.createReadStream(fullPath);
|
|
164
|
+
const finish = (err) => {
|
|
165
|
+
try {
|
|
166
|
+
rs.removeAllListeners();
|
|
167
|
+
rs.close();
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
// do nothing
|
|
171
|
+
}
|
|
172
|
+
if (err)
|
|
173
|
+
reject(err);
|
|
174
|
+
else
|
|
175
|
+
resolve();
|
|
176
|
+
};
|
|
177
|
+
rs.on('data', (chunk) => {
|
|
178
|
+
file.push(chunk, false);
|
|
179
|
+
});
|
|
180
|
+
rs.on('error', (err) => {
|
|
181
|
+
finish(err);
|
|
182
|
+
});
|
|
183
|
+
rs.on('end', () => {
|
|
184
|
+
file.push(new Uint8Array(0), true);
|
|
185
|
+
finish();
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
const addEntriesToZip = async (dirPath, zip, entries, onEntry) => {
|
|
190
|
+
for (let i = 0; i < entries.length; i += 1) {
|
|
191
|
+
await addEntryToZip(dirPath, zip, entries[i]);
|
|
192
|
+
onEntry();
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
const createZip = (dirPath, zipPath, entries, onEntry) => {
|
|
196
|
+
return new Promise((resolve, reject) => {
|
|
197
|
+
const ws = fs_1.default.createWriteStream(zipPath);
|
|
198
|
+
let wasError = false;
|
|
199
|
+
const zip = new fflate_1.default.Zip((err, data, final) => {
|
|
200
|
+
if (wasError) {
|
|
201
|
+
// do nothing
|
|
202
|
+
}
|
|
203
|
+
else if (err) {
|
|
204
|
+
wasError = true;
|
|
205
|
+
ws.close();
|
|
206
|
+
reject(err);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
ws.write(data);
|
|
210
|
+
if (final) {
|
|
211
|
+
ws.close((err) => {
|
|
212
|
+
if (err)
|
|
213
|
+
reject(err);
|
|
214
|
+
else
|
|
215
|
+
resolve();
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
addEntriesToZip(dirPath, zip, entries, onEntry)
|
|
221
|
+
.then(() => {
|
|
222
|
+
zip.end();
|
|
223
|
+
})
|
|
224
|
+
.catch((err) => {
|
|
225
|
+
ws.close(() => {
|
|
226
|
+
reject(err);
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
exports.default = commandPackagePublish;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 publish_1 = __importDefault(require("./package/publish"));
|
|
9
|
+
const download_1 = __importDefault(require("./package/download"));
|
|
10
|
+
const list_1 = __importDefault(require("./package/list"));
|
|
11
|
+
const commandPackage = (0, utils_1.newCommand)('package', texts_1.DESC_COMMAND_PACKAGE);
|
|
12
|
+
commandPackage.alias('pkg');
|
|
13
|
+
commandPackage.addCommand(list_1.default);
|
|
14
|
+
commandPackage.addCommand(publish_1.default);
|
|
15
|
+
commandPackage.addCommand(download_1.default);
|
|
16
|
+
exports.default = commandPackage;
|
|
@@ -38,13 +38,13 @@ commandPipelineRun.action(async (identifier, options) => {
|
|
|
38
38
|
const client = new client_1.default(baseUrl, token);
|
|
39
39
|
const data = await client.getPipelineByIdentifier(workspace, project, identifier);
|
|
40
40
|
if (!data || !data.domain) {
|
|
41
|
-
output_1.default.exitError(texts_1.
|
|
41
|
+
output_1.default.exitError(texts_1.ERR_WORKSPACE_NOT_FOUND);
|
|
42
42
|
}
|
|
43
43
|
if (!data.project_identifier) {
|
|
44
|
-
output_1.default.exitError(texts_1.
|
|
44
|
+
output_1.default.exitError(texts_1.ERR_PROJECT_NOT_FOUND);
|
|
45
45
|
}
|
|
46
46
|
if (!data.pipeline_id) {
|
|
47
|
-
output_1.default.exitError(texts_1.
|
|
47
|
+
output_1.default.exitError(texts_1.ERR_PIPELINE_NOT_FOUND);
|
|
48
48
|
}
|
|
49
49
|
const body = {};
|
|
50
50
|
if (options.branch) {
|
|
@@ -29,7 +29,7 @@ commandProjectSet.action(async (projectName, options) => {
|
|
|
29
29
|
if (projectName) {
|
|
30
30
|
const found = response.projects.find((p) => p.name === projectName);
|
|
31
31
|
if (!found) {
|
|
32
|
-
output_1.default.exitError(
|
|
32
|
+
output_1.default.exitError(texts_1.ERR_PROJECT_NOT_FOUND);
|
|
33
33
|
}
|
|
34
34
|
project = found.name;
|
|
35
35
|
}
|
package/distTs/src/index.js
CHANGED
|
@@ -21,6 +21,7 @@ const logout_1 = __importDefault(require("./command/logout"));
|
|
|
21
21
|
const workspace_1 = __importDefault(require("./command/workspace"));
|
|
22
22
|
const project_1 = __importDefault(require("./command/project"));
|
|
23
23
|
const whoami_1 = __importDefault(require("./command/whoami"));
|
|
24
|
+
const package_1 = __importDefault(require("./command/package"));
|
|
24
25
|
stream_1.default.setDefaultHighWaterMark(false, 67108864);
|
|
25
26
|
process.title = 'bdy';
|
|
26
27
|
process.on('uncaughtException', (err) => {
|
|
@@ -39,6 +40,7 @@ program.addCommand(version_1.default);
|
|
|
39
40
|
program.addCommand(vt_1.default);
|
|
40
41
|
program.addCommand(ut_1.default);
|
|
41
42
|
program.addCommand(pipeline_1.default);
|
|
43
|
+
program.addCommand(package_1.default);
|
|
42
44
|
program.addCommand(sandbox_1.default);
|
|
43
45
|
program.addCommand(login_1.default);
|
|
44
46
|
program.addCommand(whoami_1.default);
|
package/distTs/src/input.js
CHANGED
|
@@ -42,10 +42,10 @@ const punycode_1 = __importDefault(require("punycode/"));
|
|
|
42
42
|
const node_fs_1 = __importStar(require("node:fs"));
|
|
43
43
|
const tls_1 = __importDefault(require("tls"));
|
|
44
44
|
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
45
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
46
45
|
const utils_1 = require("./utils");
|
|
47
46
|
const texts_1 = require("./texts");
|
|
48
47
|
const tunnel_1 = require("./types/tunnel");
|
|
48
|
+
const node_path_1 = __importStar(require("node:path"));
|
|
49
49
|
const cfg_1 = __importDefault(require("./tunnel/cfg"));
|
|
50
50
|
class Input {
|
|
51
51
|
static timeout(timeout) {
|
|
@@ -427,6 +427,14 @@ class Input {
|
|
|
427
427
|
t = 1440;
|
|
428
428
|
return t;
|
|
429
429
|
}
|
|
430
|
+
static resolvePath(path) {
|
|
431
|
+
const p = (0, node_path_1.resolve)(path);
|
|
432
|
+
const exists = node_fs_1.default.existsSync(p);
|
|
433
|
+
if (!exists) {
|
|
434
|
+
output_1.default.exitError(texts_1.ERR_PATH_NOT_EXISTS);
|
|
435
|
+
}
|
|
436
|
+
return p;
|
|
437
|
+
}
|
|
430
438
|
static restApiWorkspace(workspace) {
|
|
431
439
|
let w = process.env.BUDDY_WORKSPACE;
|
|
432
440
|
if (workspace)
|
|
@@ -438,6 +446,18 @@ class Input {
|
|
|
438
446
|
}
|
|
439
447
|
return w;
|
|
440
448
|
}
|
|
449
|
+
static packageSplitIdentifier(identifier) {
|
|
450
|
+
const s = (identifier || '').split('@');
|
|
451
|
+
if (s.length >= 2) {
|
|
452
|
+
return {
|
|
453
|
+
identifier: s[0],
|
|
454
|
+
version: s[1],
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
return {
|
|
458
|
+
identifier: s[0],
|
|
459
|
+
};
|
|
460
|
+
}
|
|
441
461
|
static restApiSandboxDestinationPath(destPath) {
|
|
442
462
|
const s = (destPath || '').split(':');
|
|
443
463
|
if (s.length !== 2) {
|
|
@@ -467,13 +487,15 @@ class Input {
|
|
|
467
487
|
}
|
|
468
488
|
return { sourceStats, sourcePath: s };
|
|
469
489
|
}
|
|
470
|
-
static restApiProject(project) {
|
|
490
|
+
static restApiProject(project, allowNull) {
|
|
471
491
|
let p = process.env.BUDDY_PROJECT;
|
|
472
492
|
if (project)
|
|
473
493
|
p = project;
|
|
474
494
|
if (!p)
|
|
475
495
|
p = cfg_1.default.getProject();
|
|
476
496
|
if (!p) {
|
|
497
|
+
if (allowNull)
|
|
498
|
+
return null;
|
|
477
499
|
output_1.default.exitError(texts_1.ERR_REST_API_PROJECT);
|
|
478
500
|
}
|
|
479
501
|
return p;
|
package/distTs/src/texts.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
3
|
+
exports.ERR_TUNNEL_NOT_FOUND = exports.ERR_WHITELIST_IS_NOT_VALID = exports.ERR_USER_AGENT_IS_NOT_VALID = exports.ERR_BA_IS_NOT_VALID = exports.ERR_BA_LOGIN_NOT_PROVIDED = exports.ERR_BA_PASSWORD_NOT_PROVIDED = exports.ERR_CB_THRESHOLD_IS_NOT_VALID = exports.ERR_CERT_PATH_IS_NOT_VALID = exports.ERR_KEY_PATH_IS_NOT_VALID = exports.ERR_CA_PATH_IS_NOT_VALID = exports.ERR_WRONG_CA = exports.ERR_WRONG_KEY_CERT = exports.ERR_NAME_WITHOUT_ASTERISK = exports.ERR_PORT_IS_NOT_VALID = exports.ERR_REGION_IS_NOT_VALID = exports.ERR_PATH_IS_NOT_DIRECTORY = exports.ERR_DIRECTORY_DOES_NOT_EXISTS = exports.ERR_TERMINATE_IS_NOT_VALID = exports.ERR_TIMEOUT_IS_NOT_VALID = exports.ERR_TYPE_IS_NOT_VALID = exports.ERR_TARGET_IS_NOT_VALID = exports.ERR_SAVING_AGENT_CONFIG = exports.ERR_AGENT_NOT_REGISTERED = exports.ERR_RUN_PIPELINE_WRONG_VARIABLE = exports.ERR_RUN_PIPELINE_WRONG_ACTION = exports.ERR_RUN_PIPELINE_WRONG_DELAY = exports.ERR_RUN_PIPELINE_WRONG_PRIORITY = exports.ERR_RUN_PIPELINE_WAIT_TIMEOUT = exports.ERR_SANDBOX_EXEC_RUNTIME_NOT_FOUND = exports.ERR_PACKAGE_VERSION_NOT_FOUND = exports.ERR_PACKAGE_VERSION_EXISTS = exports.ERR_PACKAGE_PUBLISH_NOT_FOUND = exports.ERR_PACKAGE_DOWNLOAD_NOT_FOUND = exports.ERR_PIPELINE_NOT_FOUND = exports.ERR_PROJECT_NOT_FOUND = exports.ERR_WORKSPACE_NOT_FOUND = exports.ERR_RUN_PIPELINE_NOT_FOUND = exports.ERR_RUN_PIPELINE_PROJECT_NOT_FOUND = exports.ERR_RUN_PIPELINE_WORKSPACE_NOT_FOUND = exports.ERR_REST_API_PROJECT = exports.ERR_REST_API_WORKSPACE = exports.ERR_PATH_NOT_EXISTS = exports.ERR_REST_API_REGION = exports.ERR_REST_API_URL = exports.ERR_REST_API_TOKEN = exports.ERR_REST_API_RATE_LIMIT = exports.ERR_REST_API_RESOURCE_NOT_FOUND = exports.ERR_REST_API_WRONG_TOKEN = exports.ERR_REST_API_CONNECT_ERROR = exports.ERR_REST_API_GENERAL_ERROR = void 0;
|
|
4
|
+
exports.ERR_INVALID_COMPARE_LINKS_RESPONSE = exports.ERR_INVALID_STORYBOOK_RESPONSE = exports.ERR_INVALID_DEFAULT_SETTINGS_RESPONSE = exports.ERR_INVALID_CLOSE_SESSION_RESPONSE = exports.ERR_INVALID_SNAPSHOTS_RESPONSE = exports.ERR_INVALID_SNAPSHOT_RESPONSE = exports.ERR_MISSING_URLS = exports.ERR_RESOURCE_NOT_FOUND = exports.ERR_MISSING_EXEC_COMMAND = exports.ERR_PARSING_STORIES = exports.ERR_UNSUPPORTED_STORYBOOK = exports.ERR_MISSING_STORYBOOK_INDEX_FILE = exports.ERR_WRONG_STORYBOOK_DIRECTORY = exports.ERR_MISSING_BUILD_ID = exports.ERR_MISSING_UT_TOKEN = exports.ERR_MISSING_VT_TOKEN = exports.ERR_CONFIG_CORRUPTED = exports.ERR_WRONG_TOKEN = exports.ERR_TOKEN_NOT_PROVIDED = exports.ERR_CANT_CREATE_DIR_IN_HOME = exports.ERR_CONNECTION_ERROR = exports.ERR_CONNECTION_TIMEOUT = exports.ERR_WRONG_STREAM = exports.ERR_WRONG_HANDSHAKE = exports.ERR_FETCH_VERSION = exports.ERR_PACKAGE_DOWNLOAD_REPLACE = exports.ERR_PACKAGE_DOWNLOAD_NOT_EMPTY_DIR = exports.ERR_PACKAGE_DOWNLOAD_IS_FILE = exports.ERR_PACKAGE_DOWNLOAD_READDIR = exports.ERR_PACKAGE_DOWNLOAD_MKDIR = exports.ERR_SWW = exports.ERR_NOT_FOUND = exports.ERR_FAILED_TO_CONNECT_TO_AGENT = exports.ERR_TUNNEL_REMOVED = exports.ERR_TUNNELS_DISABLED = exports.ERR_AGENT_LIMIT_REACHED = exports.ERR_TUNNEL_TARGET_INVALID = exports.ERR_WORKSPACE_FLAGGED = exports.ERR_TUNNEL_LIMIT_REACHED = exports.ERR_DOMAIN_RESTRICTED = exports.ERR_AGENT_REMOVED = exports.ERR_FAILED_TO_CONNECT = exports.ERR_TUNNEL_ALREADY_EXISTS = exports.ERR_AGENT_NOT_SUPPORTED = exports.ERR_AGENT_ADMIN_RIGHTS = exports.ERR_SWW_AGENT_UPDATING = exports.ERR_SWW_AGENT_ENABLING = exports.ERR_AGENT_NOT_FOUND = exports.ERR_AGENT_NOT_RUNNING = exports.ERR_AGENT_NOT_INSTALLED = void 0;
|
|
5
|
+
exports.DESC_COMMAND_CONFIG_SET_TIMEOUT = exports.DESC_COMMAND_CONFIG_SET_REGION = exports.DESC_COMMAND_CONFIG_REMOVE_TUNNEL = exports.DESC_COMMAND_CONFIG_GET_WHITELIST = exports.DESC_COMMAND_CONFIG_GET_TUNNELS = exports.DESC_COMMAND_CONFIG_GET_TUNNEL = exports.DESC_COMMAND_CONFIG_GET_TOKEN = exports.DESC_COMMAND_CONFIG_GET_TIMEOUT = exports.DESC_COMMAND_CONFIG_GET_REGION = exports.DESC_COMMAND_CONFIG_ADD_TLS = exports.DESC_COMMAND_CONFIG_ADD_TCP = exports.DESC_COMMAND_CONFIG_ADD_HTTP = exports.AGENT_FETCH_RETRY = exports.NO_TUNNELS_STARTED = exports.TXT_AGENT_STANDALONE_EXITING = exports.TXT_AGENT_STANDALONE_STARTED = exports.TXT_AGENT_STANDALONE_AGENT_REGISTER_ERROR = exports.TXT_AGENT_STANDALONE_AGENT_REGISTERED = exports.TXT_AGENT_STANDALONE_AGENT_REGISTERING = exports.TXT_AGENT_STANDALONE_AGENT_FETCH_ERROR = exports.TXT_AGENT_STANDALONE_AGENT_FETCHED = exports.TXT_AGENT_STANDALONE_AGENT_FETCHING = exports.TXT_TUNNEL_ADDED = exports.TXT_TUNNEL_REMOVED = exports.TXT_REGION_SAVED = exports.TXT_TIMEOUT_SAVED = exports.TXT_TOKEN_REMOVED = exports.TXT_TOKEN_SAVED = exports.TXT_WHITELIST_SAVED = exports.TXT_TUNNEL_STOPPED = exports.TXT_TUNNEL_STARTED = exports.TXT_AGENT_DISABLED = exports.TXT_AGENT_ALREADY_INSTALLED = exports.TXT_AGENT_UPDATED = exports.TXT_AGENT_INSTALLED = exports.TXT_AGENT_TARGET_DISABLED = exports.TXT_AGENT_TARGET_ENABLED = exports.TXT_AGENT_RESTARTED = exports.TXT_AGENT_DEBUG_OFF = exports.TXT_AGENT_DEBUG_ON = exports.TXT_AGENT_STARTED = exports.TXT_AGENT_STOPPED = exports.WARN_BROWSER_VERSION = exports.ERR_RESOURCE_DISCOVERY = exports.ERR_NO_SNAPSHOTS_TO_SEND = exports.ERR_INVALID_SNAPSHOT = exports.ERR_TEST_EXECUTION = exports.ERR_INVALID_JSON = exports.ERR_INVALID_DOWNLOAD_RESPONSE = exports.ERR_INVALID_SCRAPE_RESPONSE = void 0;
|
|
6
|
+
exports.OPTION_UPLOAD_DRY_RUN = exports.OPTION_UPLOAD_REPORT_FORMAT = exports.OPTION_UPLOAD_REPORT_GLOB = exports.DESC_COMMAND_UT_UPLOAD = exports.DESC_COMMAND_UT = exports.DESC_COMMAND_VT_INSTALL_BROWSER = exports.DESC_COMMAND_VT_EXEC = exports.DESC_COMMAND_VT_SCRAPE = exports.DESC_COMMAND_VT_COMPARE = exports.DESC_COMMAND_VT_STORYBOOK = exports.DESC_COMMAND_VT_CLOSE = exports.DESC_COMMAND_VT = exports.DESC_COMMAND_PIPELINE_RUN = exports.DESC_COMMAND_PACKAGE_DOWNLOAD = exports.DESC_COMMAND_PACKAGE_PUBLISH = exports.DESC_COMMAND_PACKAGE = exports.DESC_COMMAND_PIPELINE = exports.DESC_PROGRAM = exports.DESC_COMMAND_TLS = exports.DESC_COMMAND_TCP = exports.DESC_COMMAND_START = exports.DESC_COMMAND_TUNNEL = exports.DESC_COMMAND_AGENT = exports.DESC_COMMAND_HTTP = exports.DESC_COMMAND_CONFIG = exports.DESC_COMMAND_AGENT_VERSION = exports.DESC_COMMAND_AGENT_UPDATE = exports.DESC_COMMAND_AGENT_TARGET = exports.DESC_COMMAND_AGENT_TUNNEL = exports.DESC_COMMAND_AGENT_STOP = exports.DESC_COMMAND_AGENT_TARGET_DISABLE = exports.DESC_COMMAND_AGENT_TARGET_ENABLE = exports.DESC_COMMAND_AGENT_TARGET_STATUS = exports.DESC_COMMAND_AGENT_STATUS = exports.DESC_COMMAND_AGENT_RESTART = exports.DESC_COMMAND_AGENT_ENABLE = exports.DESC_COMMAND_AGENT_DEBUG = exports.DESC_COMMAND_AGENT_DISABLE = exports.DESC_COMMAND_AGENT_START = exports.DESC_COMMAND_AGENT_INSTALL = exports.DESC_COMMAND_AGENT_UNINSTALL = exports.DESC_COMMAND_AGENT_TUNNEL_REMOVE = exports.DESC_COMMAND_AGENT_TUNNEL_STATUS = exports.DESC_COMMAND_AGENT_TUNNEL_LIST = exports.DESC_COMMAND_CONFIG_SET = exports.DESC_COMMAND_CONFIG_REMOVE = exports.DESC_COMMAND_CONFIG_GET = exports.DESC_COMMAND_CONFIG_ADD = exports.DESC_COMMAND_CONFIG_SET_WHITELIST = exports.DESC_COMMAND_CONFIG_SET_TOKEN = void 0;
|
|
7
|
+
exports.OPTION_PIPELINE_RUN_ACTION = exports.OPTION_REST_API_TOKEN = exports.OPTION_PACKAGE_DOWNLOAD_REPLACE = exports.OPTION_PACKAGE_DOWNLOAD_MERGE = exports.OPTION_PACKAGE_PUBLISH_OVERWRITE_VERSION = exports.OPTION_PACKAGE_PUBLISH_CREATE = exports.OPTION_PACKAGE_ID = exports.OPTION_PACKAGE_DOWNLOAD_PATH = exports.OPTION_PACKAGE_PUBLISH_PATH = exports.OPTION_PIPELINE_RUN_ARGUMENT = exports.OPTION_PIPELINE_RUN_DELAY = exports.OPTION_PIPELINE_RUN_VAR = exports.OPTION_PIPELINE_RUN_PRIORITY = exports.OPTION_PIPELINE_RUN_CLEAR_CACHE = exports.OPTION_PIPELINE_RUN_REFRESH = exports.OPTION_PIPELINE_RUN_COMMENT = exports.OPTION_PIPELINE_RUN_PULL_REQUEST = exports.OPTION_PIPELINE_RUN_REVISION = exports.OPTION_PIPELINE_RUN_TAG = exports.OPTION_PIPELINE_RUN_BRANCH = exports.OPTION_REST_API_REGION = exports.OPTION_REST_API_ENDPOINT = exports.OPTION_DEFAULT_REGION = exports.OPTION_REGION = exports.TXT_PACKAGE_UNZIPPING_COUNT = exports.TXT_PACKAGE_UNZIPPED = exports.TXT_PACKAGE_UNZIPPING = exports.TXT_PACKAGE_DOWNLOADED_ZIP = exports.TXT_PACKAGE_DOWNLOADING_ZIP = exports.TXT_PACKAGE_DOWNLOADED = exports.TXT_PACKAGE_PUBLISHED = exports.TXT_PACKAGE_ENTRIES_FOUND = exports.TXT_PACKAGE_UPLOADED = exports.TXT_PACKAGE_UPLOADING = exports.TXT_PACKAGE_ZIPPED = exports.TXT_PACKAGE_ZIP_ENTRIES = exports.TXT_PACKAGE_ONE_ENTRY_FOUND = exports.TXT_PACKAGE_NO_ENTRIES_FOUND = exports.TXT_PACKAGE_SCANNING_DIR = exports.TXT_PIPELINE_RUN_FINISH_FAILED = exports.TXT_PIPELINE_RUN_FINISH_SUCCESSFULLY = exports.TXT_STORIES_AMOUNT = exports.TXT_PIPELINE_RUN_STILL_WAITING = exports.TXT_PIPELINE_RUN_WAIT = exports.TXT_PIPELINE_RUN_SUCCESS = exports.TXT_OPENING_TUNNEL = exports.TXT_UPDATING_AGENT = exports.TXT_ENABLING_AGENT = exports.TXT_NEW_AGENT_VERSION = exports.TXT_NEW_CLI_DOCKER_VERSION = void 0;
|
|
8
|
+
exports.OPTION_COMPARE_COOKIE = exports.OPTION_COMPARE_IGNORE = exports.OPTION_COMPARE_IGNORE_URLS = exports.OPTION_COMPARE_DRY_RUN = 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_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_ENVIRONMENT = exports.OPTION_REST_API_PROJECT = exports.OPTION_REST_API_WORKSPACE = exports.OPTION_PIPELINE_RUN_WAIT = void 0;
|
|
9
|
+
exports.LOG_STARTING_TUNNEL = exports.LOG_ENABLING_AGENT_TARGET = exports.LOG_DISABLING_AGENT_TARGET = exports.LOG_REMOVING_TUNNEL = 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 = void 0;
|
|
10
|
+
exports.DESC_COMMAND_SANDBOX_STOP = exports.DESC_COMMAND_SANDBOX_START = exports.DESC_COMMAND_SANDBOX_DESTROY = exports.DESC_COMMAND_SANDBOX_GET = 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 = void 0;
|
|
11
|
+
exports.DESC_COMMAND_SANDBOX_SNAPSHOT_GET = 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_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_APP = 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_CREATED = exports.TXT_SANDBOX_CREATING = exports.OPTION_SANDBOX_WAIT_TIMEOUT = exports.OPTION_SANDBOX_WAIT = exports.OPTION_SANDBOX_WAIT_APP = 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_APP_TIMEOUT = exports.ERR_SANDBOX_SETUP_TIMEOUT = exports.ERR_SANDBOX_APP_FAILED = 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 = void 0;
|
|
12
|
+
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 = exports.TXT_SANDBOX_EXEC_SUCCESS = exports.TXT_SANDBOX_EXEC_BACKGROUND = exports.TXT_SANDBOX_EXEC_ID = exports.ERR_SANDBOX_CP_INVALID_DEST = exports.ERR_SANDBOX_CP_SOURCE_NOT_FOUND = exports.TXT_SANDBOX_CP_DONE = exports.TXT_SANDBOX_CP_PROGRESS = exports.OPTION_SANDBOX_CP_SILENT = 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_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_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 = void 0;
|
|
13
|
+
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.ERR_COMMAND_PACKAGE_NO_PROJECTS = exports.DESC_COMMAND_PACKAGE_LIST = 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 = void 0;
|
|
13
14
|
const utils_1 = require("./utils");
|
|
14
15
|
exports.ERR_REST_API_GENERAL_ERROR = 'Something went wrong';
|
|
15
16
|
exports.ERR_REST_API_CONNECT_ERROR = 'Connection refused. Check selected endpoint';
|
|
@@ -19,11 +20,19 @@ exports.ERR_REST_API_RATE_LIMIT = 'Rate limit exceeded';
|
|
|
19
20
|
exports.ERR_REST_API_TOKEN = 'Personal access token is required (--token)';
|
|
20
21
|
exports.ERR_REST_API_URL = 'Valid rest api endpoint is required (--api)';
|
|
21
22
|
exports.ERR_REST_API_REGION = 'Valid rest api region is required (eu, us, as, onprem)';
|
|
23
|
+
exports.ERR_PATH_NOT_EXISTS = 'path not exists';
|
|
22
24
|
exports.ERR_REST_API_WORKSPACE = 'Workspace domain is required (--workspace)';
|
|
23
25
|
exports.ERR_REST_API_PROJECT = 'Project name is required (--project)';
|
|
24
26
|
exports.ERR_RUN_PIPELINE_WORKSPACE_NOT_FOUND = 'Workspace not found';
|
|
25
27
|
exports.ERR_RUN_PIPELINE_PROJECT_NOT_FOUND = 'Project not found';
|
|
26
28
|
exports.ERR_RUN_PIPELINE_NOT_FOUND = 'Pipeline not found';
|
|
29
|
+
exports.ERR_WORKSPACE_NOT_FOUND = 'Workspace not found';
|
|
30
|
+
exports.ERR_PROJECT_NOT_FOUND = 'Project not found';
|
|
31
|
+
exports.ERR_PIPELINE_NOT_FOUND = 'Pipeline not found';
|
|
32
|
+
exports.ERR_PACKAGE_DOWNLOAD_NOT_FOUND = 'Package not found';
|
|
33
|
+
exports.ERR_PACKAGE_PUBLISH_NOT_FOUND = 'Package not found. Change package name or use --create to create one';
|
|
34
|
+
exports.ERR_PACKAGE_VERSION_EXISTS = 'Package version exists. Change version name or use --force flag';
|
|
35
|
+
exports.ERR_PACKAGE_VERSION_NOT_FOUND = 'Package version not found';
|
|
27
36
|
exports.ERR_SANDBOX_EXEC_RUNTIME_NOT_FOUND = 'Sandbox exec runtime not found';
|
|
28
37
|
exports.ERR_RUN_PIPELINE_WAIT_TIMEOUT = 'Timeout waiting for run to finish';
|
|
29
38
|
exports.ERR_RUN_PIPELINE_WRONG_PRIORITY = 'Priority has wrong value. Possible: LOW, NORMAL, HIGH';
|
|
@@ -93,6 +102,16 @@ exports.ERR_TUNNEL_REMOVED = 'Tunnel removed';
|
|
|
93
102
|
exports.ERR_FAILED_TO_CONNECT_TO_AGENT = 'Failed connecting to agent';
|
|
94
103
|
exports.ERR_NOT_FOUND = 'Not found';
|
|
95
104
|
exports.ERR_SWW = 'Something went wrong';
|
|
105
|
+
const ERR_PACKAGE_DOWNLOAD_MKDIR = (dirPath) => `Error while creating directory ${dirPath}`;
|
|
106
|
+
exports.ERR_PACKAGE_DOWNLOAD_MKDIR = ERR_PACKAGE_DOWNLOAD_MKDIR;
|
|
107
|
+
const ERR_PACKAGE_DOWNLOAD_READDIR = (dirPath) => `Error while reading directory ${dirPath}`;
|
|
108
|
+
exports.ERR_PACKAGE_DOWNLOAD_READDIR = ERR_PACKAGE_DOWNLOAD_READDIR;
|
|
109
|
+
const ERR_PACKAGE_DOWNLOAD_IS_FILE = (dirPath) => `Path ${dirPath} is not a directory. Change path or use --replace flag`;
|
|
110
|
+
exports.ERR_PACKAGE_DOWNLOAD_IS_FILE = ERR_PACKAGE_DOWNLOAD_IS_FILE;
|
|
111
|
+
const ERR_PACKAGE_DOWNLOAD_NOT_EMPTY_DIR = (dirPath) => `Directory ${dirPath} is not empty. Use --merge or --replace flags`;
|
|
112
|
+
exports.ERR_PACKAGE_DOWNLOAD_NOT_EMPTY_DIR = ERR_PACKAGE_DOWNLOAD_NOT_EMPTY_DIR;
|
|
113
|
+
const ERR_PACKAGE_DOWNLOAD_REPLACE = (dirPath) => `Error while replacing directory ${dirPath}`;
|
|
114
|
+
exports.ERR_PACKAGE_DOWNLOAD_REPLACE = ERR_PACKAGE_DOWNLOAD_REPLACE;
|
|
96
115
|
exports.ERR_FETCH_VERSION = 'Failed to fetch version';
|
|
97
116
|
exports.ERR_WRONG_HANDSHAKE = 'Wrong handshake data';
|
|
98
117
|
exports.ERR_WRONG_STREAM = 'Wrong stream type';
|
|
@@ -209,7 +228,10 @@ exports.DESC_COMMAND_TCP = 'Starts a tunnel which forwards all TCP traffic on a
|
|
|
209
228
|
exports.DESC_COMMAND_TLS = 'Starts a tunnel listening for TLS traffic on port 443 with a specific hostname.';
|
|
210
229
|
exports.DESC_PROGRAM = 'Work seamlessly with Buddy from the command line.';
|
|
211
230
|
exports.DESC_COMMAND_PIPELINE = 'Commands to interact with the pipeline service';
|
|
212
|
-
exports.
|
|
231
|
+
exports.DESC_COMMAND_PACKAGE = 'Commands to interact with the package service';
|
|
232
|
+
exports.DESC_COMMAND_PACKAGE_PUBLISH = 'Publish package. Required scopes: PACKAGE_READ, PACKAGE_WRITE, PACKAGE_MANAGE';
|
|
233
|
+
exports.DESC_COMMAND_PACKAGE_DOWNLOAD = 'Download package. Required scopes: PACKAGE_READ';
|
|
234
|
+
exports.DESC_COMMAND_PIPELINE_RUN = 'Run pipeline. Required scopes: EXECUTION_INFO, EXECUTION_RUN';
|
|
213
235
|
exports.DESC_COMMAND_VT = 'Commands to interact with the visual test service';
|
|
214
236
|
exports.DESC_COMMAND_VT_CLOSE = 'Close visual test session.';
|
|
215
237
|
exports.DESC_COMMAND_VT_STORYBOOK = 'Create visual test session from storybook';
|
|
@@ -240,6 +262,26 @@ const TXT_PIPELINE_RUN_FINISH_SUCCESSFULLY = (runUrl) => `Run finished successfu
|
|
|
240
262
|
exports.TXT_PIPELINE_RUN_FINISH_SUCCESSFULLY = TXT_PIPELINE_RUN_FINISH_SUCCESSFULLY;
|
|
241
263
|
const TXT_PIPELINE_RUN_FINISH_FAILED = (status, runUrl) => `Run finished with status ${status}: ${runUrl}`;
|
|
242
264
|
exports.TXT_PIPELINE_RUN_FINISH_FAILED = TXT_PIPELINE_RUN_FINISH_FAILED;
|
|
265
|
+
exports.TXT_PACKAGE_SCANNING_DIR = 'Scanning...';
|
|
266
|
+
exports.TXT_PACKAGE_NO_ENTRIES_FOUND = 'no entries found';
|
|
267
|
+
exports.TXT_PACKAGE_ONE_ENTRY_FOUND = '1 entry found';
|
|
268
|
+
const TXT_PACKAGE_ZIP_ENTRIES = (count) => `Archiving...${count}`;
|
|
269
|
+
exports.TXT_PACKAGE_ZIP_ENTRIES = TXT_PACKAGE_ZIP_ENTRIES;
|
|
270
|
+
exports.TXT_PACKAGE_ZIPPED = `Archiving...Done`;
|
|
271
|
+
exports.TXT_PACKAGE_UPLOADING = 'Uploading...';
|
|
272
|
+
exports.TXT_PACKAGE_UPLOADED = 'Uploading...Done';
|
|
273
|
+
const TXT_PACKAGE_ENTRIES_FOUND = (count) => `${count} entries found`;
|
|
274
|
+
exports.TXT_PACKAGE_ENTRIES_FOUND = TXT_PACKAGE_ENTRIES_FOUND;
|
|
275
|
+
const TXT_PACKAGE_PUBLISHED = (versionUrl) => `Package published: ${versionUrl}`;
|
|
276
|
+
exports.TXT_PACKAGE_PUBLISHED = TXT_PACKAGE_PUBLISHED;
|
|
277
|
+
const TXT_PACKAGE_DOWNLOADED = (version, dirPath) => `Package version '${version}' downloaded to ${dirPath}`;
|
|
278
|
+
exports.TXT_PACKAGE_DOWNLOADED = TXT_PACKAGE_DOWNLOADED;
|
|
279
|
+
exports.TXT_PACKAGE_DOWNLOADING_ZIP = 'Downloading...';
|
|
280
|
+
exports.TXT_PACKAGE_DOWNLOADED_ZIP = 'Downloading...Done';
|
|
281
|
+
exports.TXT_PACKAGE_UNZIPPING = 'Unzipping...';
|
|
282
|
+
exports.TXT_PACKAGE_UNZIPPED = 'Unzipping...Done';
|
|
283
|
+
const TXT_PACKAGE_UNZIPPING_COUNT = (count) => `Unzipping...${count}`;
|
|
284
|
+
exports.TXT_PACKAGE_UNZIPPING_COUNT = TXT_PACKAGE_UNZIPPING_COUNT;
|
|
243
285
|
exports.OPTION_REGION = 'override default region ("eu", "us", "as")';
|
|
244
286
|
exports.OPTION_DEFAULT_REGION = 'default region ("eu", "us", "as")';
|
|
245
287
|
exports.OPTION_REST_API_ENDPOINT = 'override default base url (api.buddy.works) and region. You can use env variable: BUDDY_API_ENDPOINT.';
|
|
@@ -254,12 +296,20 @@ exports.OPTION_PIPELINE_RUN_CLEAR_CACHE = 'clear cache before running the pipeli
|
|
|
254
296
|
exports.OPTION_PIPELINE_RUN_PRIORITY = 'run priority. Can be one of "LOW", "NORMAL" or "HIGH". Default is "NORMAL"';
|
|
255
297
|
exports.OPTION_PIPELINE_RUN_VAR = 'variable key:value. Can be passed multiple times to pass multiple variables';
|
|
256
298
|
exports.OPTION_PIPELINE_RUN_DELAY = 'the date when the execution should be run. Should be set in the format: 2016-11-18T12:38:16.000Z or 30s, 10m, 3h10m30s';
|
|
257
|
-
exports.OPTION_PIPELINE_RUN_ARGUMENT = 'human-readable ID of pipeline';
|
|
299
|
+
exports.OPTION_PIPELINE_RUN_ARGUMENT = 'human-readable ID of the pipeline';
|
|
300
|
+
exports.OPTION_PACKAGE_PUBLISH_PATH = 'path to the directory or file';
|
|
301
|
+
exports.OPTION_PACKAGE_DOWNLOAD_PATH = 'path to the directory or file';
|
|
302
|
+
exports.OPTION_PACKAGE_ID = 'human-readable ID of the package and optionally version: package@version';
|
|
303
|
+
exports.OPTION_PACKAGE_PUBLISH_CREATE = 'create package if not exists';
|
|
304
|
+
exports.OPTION_PACKAGE_PUBLISH_OVERWRITE_VERSION = 'allow overwriting existing version';
|
|
305
|
+
exports.OPTION_PACKAGE_DOWNLOAD_MERGE = 'merge contents of the directory with package';
|
|
306
|
+
exports.OPTION_PACKAGE_DOWNLOAD_REPLACE = 'replace contents of the directory with package';
|
|
258
307
|
exports.OPTION_REST_API_TOKEN = 'personal access token. You can use env variable: BUDDY_TOKEN';
|
|
259
308
|
exports.OPTION_PIPELINE_RUN_ACTION = "action ID to be run in this execution. If not sent, it will be run in accordance with the pipeline's definition. Can be passed multiple times to select multiple actions";
|
|
260
309
|
exports.OPTION_PIPELINE_RUN_WAIT = 'wait for run to finish';
|
|
261
310
|
exports.OPTION_REST_API_WORKSPACE = 'workspace domain. You can use env variable: BUDDY_WORKSPACE';
|
|
262
311
|
exports.OPTION_REST_API_PROJECT = 'project name (url handle). You can use env variable: BUDDY_PROJECT';
|
|
312
|
+
exports.OPTION_REST_API_ENVIRONMENT = 'environment id';
|
|
263
313
|
exports.OPTION_WHITELIST = 'whitelist provided IP CIDRs. Use "*" to allow all';
|
|
264
314
|
exports.OPTION_HEADER = 'header key:value to add to the request';
|
|
265
315
|
exports.OPTION_RESPONSE_HEADER = 'header key:value to add to the response';
|
|
@@ -454,14 +504,10 @@ exports.OPTION_SANDBOX_RUN_COMMAND = 'command to run on startup';
|
|
|
454
504
|
exports.OPTION_SANDBOX_APP_DIR = 'application directory of the sandbox';
|
|
455
505
|
exports.OPTION_SANDBOX_APP_TYPE = 'application type of the sandbox (CMD, SERVICE)';
|
|
456
506
|
exports.OPTION_SANDBOX_RUNTIME = 'command runtime: BASH, JAVASCRIPT, TYPESCRIPT, PYTHON (default: BASH)';
|
|
457
|
-
exports.OPTION_SANDBOX_DETACHED = 'run command in background';
|
|
458
|
-
exports.OPTION_SANDBOX_COMMAND = 'command to execute';
|
|
459
507
|
// Sandbox errors
|
|
460
508
|
exports.ERR_SANDBOX_NOT_FOUND = 'Sandbox not found';
|
|
461
509
|
const ERR_SANDBOX_INVALID_RESOURCES = (resources) => `Invalid resources: ${resources}. Use: 1x2, 2x4, 4x8, 8x16, 12x24`;
|
|
462
510
|
exports.ERR_SANDBOX_INVALID_RESOURCES = ERR_SANDBOX_INVALID_RESOURCES;
|
|
463
|
-
const ERR_SANDBOX_INVALID_RUNTIME = (runtime) => `Invalid runtime: ${runtime}. Use: BASH, JAVASCRIPT, TYPESCRIPT, PYTHON`;
|
|
464
|
-
exports.ERR_SANDBOX_INVALID_RUNTIME = ERR_SANDBOX_INVALID_RUNTIME;
|
|
465
511
|
exports.ERR_SANDBOX_SETUP_FAILED = 'Sandbox setup failed';
|
|
466
512
|
exports.ERR_SANDBOX_APP_FAILED = 'Sandbox app failed';
|
|
467
513
|
exports.ERR_SANDBOX_SETUP_TIMEOUT = 'Timeout waiting for sandbox setup';
|
|
@@ -477,7 +523,6 @@ exports.OPTION_SANDBOX_WAIT_CONFIGURED = 'wait until sandbox ran setup commands'
|
|
|
477
523
|
exports.OPTION_SANDBOX_WAIT_APP = 'wait until sandbox ran ran app commands';
|
|
478
524
|
exports.OPTION_SANDBOX_WAIT = 'wait until operation completes';
|
|
479
525
|
exports.OPTION_SANDBOX_WAIT_TIMEOUT = 'timeout in seconds (default: 300)';
|
|
480
|
-
exports.OPTION_SANDBOX_COMMAND_LAST = 'show logs for the most recent command';
|
|
481
526
|
// Sandbox success messages
|
|
482
527
|
const TXT_SANDBOX_CREATING = (name, identifier) => `Creating sandbox: ${name} (${identifier})`;
|
|
483
528
|
exports.TXT_SANDBOX_CREATING = TXT_SANDBOX_CREATING;
|
|
@@ -502,7 +547,6 @@ exports.DESC_COMMAND_SANDBOX_EXEC_STATUS = 'Get command status';
|
|
|
502
547
|
exports.DESC_COMMAND_SANDBOX_EXEC_LOGS = 'Get command logs';
|
|
503
548
|
exports.DESC_COMMAND_SANDBOX_EXEC_KILL = 'Kill a running command';
|
|
504
549
|
exports.OPTION_SANDBOX_COMMAND_ID = 'command ID';
|
|
505
|
-
exports.OPTION_SANDBOX_COMMAND_FOLLOW = 'follow log output (stream)';
|
|
506
550
|
const TXT_SANDBOX_COMMAND_KILLED = (commandId) => `Command killed: ${commandId}`;
|
|
507
551
|
exports.TXT_SANDBOX_COMMAND_KILLED = TXT_SANDBOX_COMMAND_KILLED;
|
|
508
552
|
// Sandbox snapshot subcommands
|
|
@@ -593,6 +637,9 @@ exports.ERR_LOGIN_NO_WORKSPACES = 'No workspaces found for this token';
|
|
|
593
637
|
exports.ERR_LOGIN_NO_WORKSPACE_FOUND = 'Provided workspace has been not found';
|
|
594
638
|
exports.ERR_LOGIN_NO_PROJECT_FOUND = 'Provided project has been not found';
|
|
595
639
|
exports.ERR_LOGIN_INVALID_BASE_URL = 'Invalid URL format';
|
|
640
|
+
// package commands
|
|
641
|
+
exports.DESC_COMMAND_PACKAGE_LIST = 'List packages';
|
|
642
|
+
exports.ERR_COMMAND_PACKAGE_NO_PROJECTS = 'No packages found';
|
|
596
643
|
// Project commands
|
|
597
644
|
exports.DESC_COMMAND_PROJECT = 'Manage projects';
|
|
598
645
|
exports.DESC_COMMAND_PROJECT_LIST = 'List projects in current workspace';
|
|
@@ -603,7 +650,5 @@ const TXT_PROJECT_SET_SUCCESS = (project) => `Project set to: ${project}`;
|
|
|
603
650
|
exports.TXT_PROJECT_SET_SUCCESS = TXT_PROJECT_SET_SUCCESS;
|
|
604
651
|
exports.TXT_PROJECT_SET_CLEARED = 'Project cleared';
|
|
605
652
|
exports.TXT_LOGIN_SELECT_PROJECT = 'Select project (optional):';
|
|
606
|
-
const ERR_PROJECT_NOT_FOUND = (project) => `Project "${project}" not found`;
|
|
607
|
-
exports.ERR_PROJECT_NOT_FOUND = ERR_PROJECT_NOT_FOUND;
|
|
608
653
|
exports.ERR_PROJECT_NO_PROJECTS = 'No projects found in this workspace';
|
|
609
654
|
exports.TXT_PROJECT_NONE = 'No project configured. Run "bdy login" or "bdy project set" first.';
|