bdy 1.19.3-dev-pipeline → 1.19.3-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 +2 -2
- package/distTs/src/api/client.js +2 -103
- package/distTs/src/command/pipeline/run.js +125 -22
- package/distTs/src/command/pipeline.js +0 -23
- package/distTs/src/command/project/get.js +18 -0
- package/distTs/src/command/project/link.js +11 -11
- package/distTs/src/command/project/set.js +31 -0
- package/distTs/src/command/sandbox/get/yaml.js +30 -0
- package/distTs/src/command/vt/scrape.js +193 -0
- package/distTs/src/input.js +31 -14
- package/distTs/src/output.js +31 -149
- package/distTs/src/texts.js +35 -85
- package/distTs/src/tunnel/http.js +51 -14
- package/distTs/src/tunnel/output/interactive/tunnel.js +2 -2
- package/distTs/src/tunnel/tcp.js +7 -0
- package/package.json +2 -2
- package/distTs/src/command/crawl/link.js +0 -61
- package/distTs/src/command/crawl/run.js +0 -147
- package/distTs/src/command/crawl/validation.js +0 -154
- package/distTs/src/command/crawl.js +0 -13
- package/distTs/src/command/pipeline/create.js +0 -45
- package/distTs/src/command/pipeline/get.js +0 -42
- package/distTs/src/command/pipeline/list.js +0 -43
- package/distTs/src/command/pipeline/run/apply.js +0 -62
- package/distTs/src/command/pipeline/run/approve.js +0 -62
- package/distTs/src/command/pipeline/run/cancel.js +0 -36
- package/distTs/src/command/pipeline/run/list.js +0 -52
- package/distTs/src/command/pipeline/run/logs.js +0 -37
- package/distTs/src/command/pipeline/run/retry.js +0 -36
- package/distTs/src/command/pipeline/run/start.js +0 -96
- package/distTs/src/command/pipeline/run/status.js +0 -35
- package/distTs/src/command/pipeline/update.js +0 -41
- package/distTs/src/command/pipeline/yaml.js +0 -38
- package/distTs/src/command/tests/capture/validation.js +0 -46
- package/distTs/src/command/tests/capture.js +0 -103
- package/distTs/src/command/tests/unit/link.js +0 -61
- package/distTs/src/command/tests/unit/upload.js +0 -91
- package/distTs/src/command/tests/unit.js +0 -13
- package/distTs/src/command/tests/visual/link.js +0 -61
- package/distTs/src/command/tests/visual/session/close.js +0 -32
- package/distTs/src/command/tests/visual/session/create.js +0 -86
- package/distTs/src/command/tests/visual/session.js +0 -13
- package/distTs/src/command/tests/visual/setup.js +0 -20
- package/distTs/src/command/tests/visual/shared/validation.js +0 -145
- package/distTs/src/command/tests/visual/upload.js +0 -141
- package/distTs/src/command/tests/visual.js +0 -17
- package/distTs/src/command/tests.js +0 -15
- package/distTs/src/crawl/requests.js +0 -141
- package/distTs/src/output/pipeline.js +0 -1547
- package/distTs/src/types/crawl.js +0 -2
- package/distTs/src/types/pipeline.js +0 -424
- package/distTs/src/unitTest/context.js +0 -26
package/distTs/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bdy",
|
|
3
3
|
"preferGlobal": false,
|
|
4
|
-
"version": "1.19.3-dev
|
|
4
|
+
"version": "1.19.3-dev",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {
|
|
@@ -108,6 +108,6 @@
|
|
|
108
108
|
"rollup-plugin-natives": "0.7.8",
|
|
109
109
|
"typescript": "5.9.3",
|
|
110
110
|
"typescript-eslint": "8.54.0",
|
|
111
|
-
"vitest": "
|
|
111
|
+
"vitest": "4.1.3"
|
|
112
112
|
}
|
|
113
113
|
}
|
package/distTs/src/api/client.js
CHANGED
|
@@ -216,79 +216,6 @@ class ApiClient {
|
|
|
216
216
|
throw new Error(texts_1.ERR_REST_API_GENERAL_ERROR);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
async getPipelineRunActionLogs(workspace, project, pipelineId, executionId, actionExecutionId, offset, limit) {
|
|
220
|
-
const query = {
|
|
221
|
-
offset: String(offset),
|
|
222
|
-
limit: String(limit),
|
|
223
|
-
};
|
|
224
|
-
return await this.request({
|
|
225
|
-
method: 'GET',
|
|
226
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines/${encodeURIComponent(pipelineId)}/executions/${encodeURIComponent(executionId)}/action_executions/${encodeURIComponent(actionExecutionId)}/logs`,
|
|
227
|
-
query,
|
|
228
|
-
parseResponseBody: true,
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
async getPipelineRunActionExecution(workspace, project, pipelineId, executionId, actionExecutionId) {
|
|
232
|
-
return await this.request({
|
|
233
|
-
method: 'GET',
|
|
234
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines/${encodeURIComponent(pipelineId)}/executions/${encodeURIComponent(executionId)}/action_executions/${encodeURIComponent(actionExecutionId)}`,
|
|
235
|
-
parseResponseBody: true,
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
async updatePipelineYml(workspace, project, pipelineId, body) {
|
|
239
|
-
return await this.request({
|
|
240
|
-
method: 'PATCH',
|
|
241
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines/${encodeURIComponent(pipelineId)}/yaml`,
|
|
242
|
-
body,
|
|
243
|
-
parseResponseBody: true
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
async createPipeline(workspace, project, body) {
|
|
247
|
-
return await this.request({
|
|
248
|
-
method: 'POST',
|
|
249
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines`,
|
|
250
|
-
body,
|
|
251
|
-
parseResponseBody: true
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
async getPipelines(workspace, project, page = 1, perPage = 10) {
|
|
255
|
-
const query = {
|
|
256
|
-
page: String(page),
|
|
257
|
-
per_page: String(perPage),
|
|
258
|
-
};
|
|
259
|
-
return await this.request({
|
|
260
|
-
method: 'GET',
|
|
261
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines`,
|
|
262
|
-
query,
|
|
263
|
-
parseResponseBody: true,
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
async getPipelineYml(workspace, project, pipelineId) {
|
|
267
|
-
return await this.request({
|
|
268
|
-
method: 'GET',
|
|
269
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines/${encodeURIComponent(pipelineId)}/yaml`,
|
|
270
|
-
parseResponseBody: true,
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
async getPipeline(workspace, project, pipelineId) {
|
|
274
|
-
return await this.request({
|
|
275
|
-
method: 'GET',
|
|
276
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines/${encodeURIComponent(pipelineId)}`,
|
|
277
|
-
parseResponseBody: true,
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
async getPipelineRuns(workspace, project, pipelineId, page = 1, perPage = 10) {
|
|
281
|
-
const query = {
|
|
282
|
-
page: String(page),
|
|
283
|
-
per_page: String(perPage),
|
|
284
|
-
};
|
|
285
|
-
return await this.request({
|
|
286
|
-
method: 'GET',
|
|
287
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines/${encodeURIComponent(pipelineId)}/executions`,
|
|
288
|
-
query,
|
|
289
|
-
parseResponseBody: true,
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
219
|
async getPipelineRun(workspace, project, pipelineId, executionId) {
|
|
293
220
|
return await this.request({
|
|
294
221
|
method: 'GET',
|
|
@@ -329,34 +256,6 @@ class ApiClient {
|
|
|
329
256
|
parseResponseBody: true,
|
|
330
257
|
});
|
|
331
258
|
}
|
|
332
|
-
async pipelineRunRetry(workspace, project, pipelineId, runId) {
|
|
333
|
-
return await this.request({
|
|
334
|
-
method: 'PATCH',
|
|
335
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines/${encodeURIComponent(pipelineId)}/executions/${encodeURIComponent(runId)}`,
|
|
336
|
-
body: {
|
|
337
|
-
operation: 'RETRY',
|
|
338
|
-
},
|
|
339
|
-
parseResponseBody: true,
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
async pipelineRunApply(workspace, project, pipelineId, runId, body) {
|
|
343
|
-
return await this.request({
|
|
344
|
-
method: 'PATCH',
|
|
345
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines/${encodeURIComponent(pipelineId)}/executions/${encodeURIComponent(runId)}`,
|
|
346
|
-
body,
|
|
347
|
-
parseResponseBody: true,
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
async pipelineRunCancel(workspace, project, pipelineId, runId) {
|
|
351
|
-
return await this.request({
|
|
352
|
-
method: 'PATCH',
|
|
353
|
-
path: `/workspaces/${encodeURIComponent(workspace)}/projects/${encodeURIComponent(project)}/pipelines/${encodeURIComponent(pipelineId)}/executions/${encodeURIComponent(runId)}`,
|
|
354
|
-
body: {
|
|
355
|
-
operation: 'CANCEL',
|
|
356
|
-
},
|
|
357
|
-
parseResponseBody: true,
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
259
|
async pipelineRun(workspace, project, pipelineId, body) {
|
|
361
260
|
return await this.request({
|
|
362
261
|
method: 'POST',
|
|
@@ -822,14 +721,14 @@ class ApiClient {
|
|
|
822
721
|
return await this.request({
|
|
823
722
|
method: 'POST',
|
|
824
723
|
path: `/workspaces/${encodeURIComponent(workspace)}/sandboxes/${encodeURIComponent(sandboxId)}/apps/${encodeURIComponent(appId)}/stop`,
|
|
825
|
-
parseResponseBody: true
|
|
724
|
+
parseResponseBody: true
|
|
826
725
|
});
|
|
827
726
|
}
|
|
828
727
|
async startSandboxApp(workspace, sandboxId, appId) {
|
|
829
728
|
return await this.request({
|
|
830
729
|
method: 'POST',
|
|
831
730
|
path: `/workspaces/${encodeURIComponent(workspace)}/sandboxes/${encodeURIComponent(sandboxId)}/apps/${encodeURIComponent(appId)}/start`,
|
|
832
|
-
parseResponseBody: true
|
|
731
|
+
parseResponseBody: true
|
|
833
732
|
});
|
|
834
733
|
}
|
|
835
734
|
async getSandboxAppLogs(workspace, sandboxId, appId, cursor) {
|
|
@@ -5,27 +5,130 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const texts_1 = require("../../texts");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const cancel_1 = __importDefault(require("./run/cancel"));
|
|
12
|
-
const retry_1 = __importDefault(require("./run/retry"));
|
|
13
|
-
const list_1 = __importDefault(require("./run/list"));
|
|
14
|
-
const approve_1 = __importDefault(require("./run/approve"));
|
|
8
|
+
const output_1 = __importDefault(require("../../output"));
|
|
9
|
+
const input_1 = __importDefault(require("../../input"));
|
|
10
|
+
const format_1 = __importDefault(require("../../format"));
|
|
15
11
|
const commandPipelineRun = (0, utils_1.newCommand)('run', texts_1.DESC_COMMAND_PIPELINE_RUN);
|
|
16
|
-
commandPipelineRun.
|
|
17
|
-
commandPipelineRun.
|
|
18
|
-
commandPipelineRun.
|
|
19
|
-
commandPipelineRun.
|
|
20
|
-
commandPipelineRun.
|
|
21
|
-
commandPipelineRun.
|
|
22
|
-
commandPipelineRun.
|
|
23
|
-
commandPipelineRun.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
commandPipelineRun.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
13
|
+
commandPipelineRun.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
14
|
+
commandPipelineRun.option('-b, --branch <branch>', texts_1.OPTION_PIPELINE_RUN_BRANCH);
|
|
15
|
+
commandPipelineRun.option('-t, --tag <tag>', texts_1.OPTION_PIPELINE_RUN_TAG);
|
|
16
|
+
commandPipelineRun.option('-pr, --pull-request <pull request>', texts_1.OPTION_PIPELINE_RUN_PULL_REQUEST);
|
|
17
|
+
commandPipelineRun.option('-r, --revision <revision>', texts_1.OPTION_PIPELINE_RUN_REVISION);
|
|
18
|
+
commandPipelineRun.option('--comment <comment>', texts_1.OPTION_PIPELINE_RUN_COMMENT);
|
|
19
|
+
commandPipelineRun.option('-f, --refresh', texts_1.OPTION_PIPELINE_RUN_REFRESH);
|
|
20
|
+
commandPipelineRun.option('-c, --clear-cache', texts_1.OPTION_PIPELINE_RUN_CLEAR_CACHE);
|
|
21
|
+
commandPipelineRun.option('--priority <priority>', texts_1.OPTION_PIPELINE_RUN_PRIORITY);
|
|
22
|
+
commandPipelineRun.option('-v, --variable <variables...>', texts_1.OPTION_PIPELINE_RUN_VAR);
|
|
23
|
+
commandPipelineRun.option('-vm, --variable-masked <variables...>', texts_1.OPTION_PIPELINE_RUN_VAR);
|
|
24
|
+
commandPipelineRun.option('--schedule <date>', texts_1.OPTION_PIPELINE_RUN_DELAY);
|
|
25
|
+
commandPipelineRun.option('--action <actions...>', texts_1.OPTION_PIPELINE_RUN_ACTION);
|
|
26
|
+
commandPipelineRun.option('--wait [minutes]', texts_1.OPTION_PIPELINE_RUN_WAIT);
|
|
27
|
+
commandPipelineRun.argument('<identifier>', texts_1.OPTION_PIPELINE_RUN_ARGUMENT);
|
|
28
|
+
commandPipelineRun.usage('<identifier> [options]');
|
|
29
|
+
commandPipelineRun.addHelpText('after', texts_1.EXAMPLE_PIPELINE_RUN);
|
|
30
|
+
commandPipelineRun.action(async (identifier, options) => {
|
|
31
|
+
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
32
|
+
const project = input_1.default.restApiProject(options.project);
|
|
33
|
+
const client = input_1.default.restApiTokenClient();
|
|
34
|
+
const data = await client.getPipelineByIdentifier(workspace, project, identifier);
|
|
35
|
+
if (!data || !data.domain) {
|
|
36
|
+
output_1.default.exitError(texts_1.ERR_WORKSPACE_NOT_FOUND);
|
|
37
|
+
}
|
|
38
|
+
if (!data.project_identifier) {
|
|
39
|
+
output_1.default.exitError(texts_1.ERR_PROJECT_NOT_FOUND);
|
|
40
|
+
}
|
|
41
|
+
if (!data.pipeline_id) {
|
|
42
|
+
output_1.default.exitError(texts_1.ERR_PIPELINE_NOT_FOUND);
|
|
43
|
+
}
|
|
44
|
+
const body = {};
|
|
45
|
+
if (options.branch) {
|
|
46
|
+
body.branch = {
|
|
47
|
+
name: options.branch,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
if (options.tag) {
|
|
51
|
+
body.tag = {
|
|
52
|
+
name: options.tag,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (options.pullRequest) {
|
|
56
|
+
body.pull_request = {
|
|
57
|
+
name: `pull/${options.pullRequest}`,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (options.revision) {
|
|
61
|
+
body.to_revision = {
|
|
62
|
+
revision: options.revision,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (options.comment) {
|
|
66
|
+
body.comment = options.comment;
|
|
67
|
+
}
|
|
68
|
+
if (options.refresh) {
|
|
69
|
+
body.refresh = true;
|
|
70
|
+
}
|
|
71
|
+
if (options.clearCache) {
|
|
72
|
+
body.clear_cache = true;
|
|
73
|
+
}
|
|
74
|
+
const priority = input_1.default.pipelineRunPriority(options.priority);
|
|
75
|
+
if (priority) {
|
|
76
|
+
body.priority = priority;
|
|
77
|
+
}
|
|
78
|
+
body.variables = [];
|
|
79
|
+
if (options.variable) {
|
|
80
|
+
body.variables = body.variables.concat(input_1.default.pipelineRunVariable(options.variable, false));
|
|
81
|
+
}
|
|
82
|
+
if (options.variableMasked) {
|
|
83
|
+
body.variables = body.variables.concat(input_1.default.pipelineRunVariable(options.variableMasked, true));
|
|
84
|
+
}
|
|
85
|
+
const delay = input_1.default.pipelineRunDelay(options.schedule);
|
|
86
|
+
if (delay) {
|
|
87
|
+
body.delay_until = delay;
|
|
88
|
+
}
|
|
89
|
+
const actions = input_1.default.pipelineRunAction(options.action);
|
|
90
|
+
if (actions) {
|
|
91
|
+
body.actions_to_run = actions;
|
|
92
|
+
}
|
|
93
|
+
const result = await client.pipelineRun(workspace, project, data.pipeline_id, body);
|
|
94
|
+
if (options.wait) {
|
|
95
|
+
const minutes = input_1.default.pipelineRunWaitTime(options.wait);
|
|
96
|
+
wait(minutes, workspace, project, data.pipeline_id, result.id, result.html_url, client);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
output_1.default.exitSuccess((0, texts_1.TXT_PIPELINE_RUN_SUCCESS)(result.html_url));
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const wait = (minutes, workspace, project, pipelineId, runId, htmlUrl, client) => {
|
|
103
|
+
const start = Date.now();
|
|
104
|
+
output_1.default.normal((0, texts_1.TXT_PIPELINE_RUN_WAIT)(minutes));
|
|
105
|
+
let fetchCounter = 1;
|
|
106
|
+
const ts1 = setTimeout(() => {
|
|
107
|
+
output_1.default.exitError(texts_1.ERR_RUN_PIPELINE_WAIT_TIMEOUT);
|
|
108
|
+
}, minutes * 60 * 1000);
|
|
109
|
+
const ts2 = setInterval(async () => {
|
|
110
|
+
output_1.default.clearPreviousLine();
|
|
111
|
+
output_1.default.normal((0, texts_1.TXT_PIPELINE_RUN_STILL_WAITING)(formatWaitTime(start)));
|
|
112
|
+
if (fetchCounter >= 3) {
|
|
113
|
+
const run = await client.getPipelineRun(workspace, project, pipelineId, runId);
|
|
114
|
+
if (!['INPROGRESS', 'ENQUEUED', 'TERMINATING'].includes(run.status)) {
|
|
115
|
+
clearTimeout(ts1);
|
|
116
|
+
clearInterval(ts2);
|
|
117
|
+
output_1.default.clearPreviousLine();
|
|
118
|
+
if (run.status === 'SUCCESSFUL') {
|
|
119
|
+
output_1.default.exitSuccess((0, texts_1.TXT_PIPELINE_RUN_FINISH_SUCCESSFULLY)(htmlUrl));
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
output_1.default.exitError((0, texts_1.TXT_PIPELINE_RUN_FINISH_FAILED)(run.status, htmlUrl));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
fetchCounter = 0;
|
|
126
|
+
}
|
|
127
|
+
fetchCounter += 1;
|
|
128
|
+
}, 1000);
|
|
129
|
+
};
|
|
130
|
+
const formatWaitTime = (start) => {
|
|
131
|
+
const elapsed = Math.floor((Date.now() - start) / 1000);
|
|
132
|
+
return format_1.default.pipelineRunWaitTime(elapsed);
|
|
133
|
+
};
|
|
31
134
|
exports.default = commandPipelineRun;
|
|
@@ -6,30 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const texts_1 = require("../texts");
|
|
8
8
|
const run_1 = __importDefault(require("./pipeline/run"));
|
|
9
|
-
const list_1 = __importDefault(require("./pipeline/list"));
|
|
10
|
-
const get_1 = __importDefault(require("./pipeline/get"));
|
|
11
|
-
const yaml_1 = __importDefault(require("./pipeline/yaml"));
|
|
12
|
-
const create_1 = __importDefault(require("./pipeline/create"));
|
|
13
|
-
const update_1 = __importDefault(require("./pipeline/update"));
|
|
14
9
|
const commandPipeline = (0, utils_1.newCommand)('pipeline', texts_1.DESC_COMMAND_PIPELINE);
|
|
15
10
|
commandPipeline.alias('pip');
|
|
16
11
|
commandPipeline.addCommand(run_1.default);
|
|
17
|
-
commandPipeline.addCommand(list_1.default);
|
|
18
|
-
commandPipeline.addCommand(get_1.default);
|
|
19
|
-
commandPipeline.addCommand(yaml_1.default);
|
|
20
|
-
commandPipeline.addCommand(create_1.default);
|
|
21
|
-
commandPipeline.addCommand(update_1.default);
|
|
22
|
-
commandPipeline.addHelpText('after', `
|
|
23
|
-
EXAMPLES:${texts_1.EXAMPLE_PIPELINE_RUN_START}
|
|
24
|
-
${texts_1.EXAMPLE_PIPELINE_RUN_STATUS}
|
|
25
|
-
${texts_1.EXAMPLE_PIPELINE_RUN_LOGS}
|
|
26
|
-
${texts_1.EXAMPLE_PIPELINE_RUN_CANCEL}
|
|
27
|
-
${texts_1.EXAMPLE_PIPELINE_RUN_RETRY}
|
|
28
|
-
${texts_1.EXAMPLE_PIPELINE_RUN_APPLY}
|
|
29
|
-
${texts_1.EXAMPLE_PIPELINE_RUN_LIST}
|
|
30
|
-
${texts_1.EXAMPLE_PIPELINE_LIST}
|
|
31
|
-
${texts_1.EXAMPLE_PIPELINE_GET}
|
|
32
|
-
${texts_1.EXAMPLE_PIPELINE_YML}
|
|
33
|
-
${texts_1.EXAMPLE_PIPELINE_CREATE}
|
|
34
|
-
${texts_1.EXAMPLE_PIPELINE_UPDATE}`);
|
|
35
12
|
exports.default = commandPipeline;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 cfg_1 = __importDefault(require("../../tunnel/cfg"));
|
|
7
|
+
const output_1 = __importDefault(require("../../output"));
|
|
8
|
+
const texts_1 = require("../../texts");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const commandProjectGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_PROJECT_GET);
|
|
11
|
+
commandProjectGet.action(async () => {
|
|
12
|
+
const project = cfg_1.default.getProject();
|
|
13
|
+
if (!project) {
|
|
14
|
+
output_1.default.exitError(texts_1.TXT_PROJECT_NONE);
|
|
15
|
+
}
|
|
16
|
+
output_1.default.exitNormal(project);
|
|
17
|
+
});
|
|
18
|
+
exports.default = commandProjectGet;
|
|
@@ -23,7 +23,7 @@ commandProjectLink.action(async (dir, options) => {
|
|
|
23
23
|
ProjectCfg.init(path, workspace, project);
|
|
24
24
|
output_1.default.okSign();
|
|
25
25
|
output_1.default.normal(texts_1.TXT_COMMAND_PROJECT_LINK_TO, false);
|
|
26
|
-
output_1.default.
|
|
26
|
+
output_1.default.light(` ${url}`);
|
|
27
27
|
await initRepo(workspace, project, path, git, options);
|
|
28
28
|
tryNow();
|
|
29
29
|
output_1.default.exitNormal();
|
|
@@ -54,13 +54,13 @@ const tryNow = () => {
|
|
|
54
54
|
output_1.default.arrowSign();
|
|
55
55
|
output_1.default.label(texts_1.OPT_COMMAND_PROJECT_LINK_TRY_NOW);
|
|
56
56
|
output_1.default.dim('$ ', false);
|
|
57
|
-
output_1.default.
|
|
57
|
+
output_1.default.light('bdy tunnel http 3000 ', false);
|
|
58
58
|
output_1.default.muted(' Expose localhost:3000 to the internet');
|
|
59
59
|
output_1.default.dim('$ ', false);
|
|
60
|
-
output_1.default.
|
|
60
|
+
output_1.default.light('bdy artifact publish . ', false);
|
|
61
61
|
output_1.default.muted(' Publish an artifact from the current project');
|
|
62
62
|
output_1.default.dim('$ ', false);
|
|
63
|
-
output_1.default.
|
|
63
|
+
output_1.default.light('bdy sandbox create --run "npm start" ', false);
|
|
64
64
|
output_1.default.muted(' Spin up a cloud sandbox and run your app');
|
|
65
65
|
};
|
|
66
66
|
const initRepo = async (workspace, project, path, git, options) => {
|
|
@@ -89,16 +89,16 @@ const initRepo = async (workspace, project, path, git, options) => {
|
|
|
89
89
|
});
|
|
90
90
|
output_1.default.okSign();
|
|
91
91
|
output_1.default.normal('Remote ', false);
|
|
92
|
-
output_1.default.
|
|
92
|
+
output_1.default.light('origin ', false);
|
|
93
93
|
output_1.default.normal('set to ', false);
|
|
94
|
-
output_1.default.
|
|
94
|
+
output_1.default.light(remote);
|
|
95
95
|
}
|
|
96
96
|
else if (remotes.origin !== remote) {
|
|
97
97
|
output_1.default.yellow(texts_1.OPT_COMMAND_PROJECT_LINK_HAS_REMOTE);
|
|
98
98
|
output_1.default.normal('Current origin: ', false);
|
|
99
|
-
output_1.default.
|
|
99
|
+
output_1.default.light(remotes.origin);
|
|
100
100
|
output_1.default.normal('Buddy project: ', false);
|
|
101
|
-
output_1.default.
|
|
101
|
+
output_1.default.light(remote);
|
|
102
102
|
const opt = await output_1.default.inputMenuAdv(texts_1.OPT_COMMAND_PROJECT_LINK_SET_GIT_REMOTE, [
|
|
103
103
|
{
|
|
104
104
|
name: 'Add buddy remote',
|
|
@@ -127,9 +127,9 @@ const initRepo = async (workspace, project, path, git, options) => {
|
|
|
127
127
|
});
|
|
128
128
|
output_1.default.okSign();
|
|
129
129
|
output_1.default.normal('Remote ', false);
|
|
130
|
-
output_1.default.
|
|
130
|
+
output_1.default.light('buddy ', false);
|
|
131
131
|
output_1.default.normal('set to ', false);
|
|
132
|
-
output_1.default.
|
|
132
|
+
output_1.default.light(remote);
|
|
133
133
|
}
|
|
134
134
|
else if (opt === 'origin') {
|
|
135
135
|
await (0, utils_1.execLocally)(`git remote rm origin`, {
|
|
@@ -140,7 +140,7 @@ const initRepo = async (workspace, project, path, git, options) => {
|
|
|
140
140
|
});
|
|
141
141
|
output_1.default.okSign();
|
|
142
142
|
output_1.default.normal('Origin replaced with ', false);
|
|
143
|
-
output_1.default.
|
|
143
|
+
output_1.default.light(remote);
|
|
144
144
|
}
|
|
145
145
|
else {
|
|
146
146
|
return;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 cfg_1 = __importDefault(require("../../tunnel/cfg"));
|
|
7
|
+
const output_1 = __importDefault(require("../../output"));
|
|
8
|
+
const texts_1 = require("../../texts");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const input_1 = __importDefault(require("../../input"));
|
|
11
|
+
const commandProjectSet = (0, utils_1.newCommand)('set', texts_1.DESC_COMMAND_PROJECT_SET);
|
|
12
|
+
commandProjectSet.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
13
|
+
commandProjectSet.argument('[project]', texts_1.ARG_COMMAND_PROJECT_NAME);
|
|
14
|
+
commandProjectSet.action(async (project, options) => {
|
|
15
|
+
output_1.default.handleSignals();
|
|
16
|
+
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
17
|
+
const client = input_1.default.restApiTokenClient();
|
|
18
|
+
if (project) {
|
|
19
|
+
await client.getProject(workspace, project);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const response = await client.getProjects(workspace);
|
|
23
|
+
project = await output_1.default.selectProject(response.projects);
|
|
24
|
+
}
|
|
25
|
+
cfg_1.default.setProject(project);
|
|
26
|
+
if (!project)
|
|
27
|
+
output_1.default.exitSuccess(texts_1.TXT_PROJECT_SET_CLEARED);
|
|
28
|
+
else
|
|
29
|
+
output_1.default.exitSuccess((0, texts_1.TXT_PROJECT_SET_SUCCESS)(project));
|
|
30
|
+
});
|
|
31
|
+
exports.default = commandProjectSet;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const utils_1 = require("../../../utils");
|
|
7
|
+
const texts_1 = require("../../../texts");
|
|
8
|
+
const input_1 = __importDefault(require("../../../input"));
|
|
9
|
+
const output_1 = __importDefault(require("../../../output"));
|
|
10
|
+
const commandSandboxGetYaml = (0, utils_1.newCommand)('yaml', texts_1.DESC_COMMAND_SANDBOX_GET_YAML);
|
|
11
|
+
commandSandboxGetYaml.hideVersionUpdate = true;
|
|
12
|
+
commandSandboxGetYaml.alias('yml');
|
|
13
|
+
commandSandboxGetYaml.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
|
|
14
|
+
commandSandboxGetYaml.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
|
|
15
|
+
commandSandboxGetYaml.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
|
|
16
|
+
commandSandboxGetYaml.action(async (identifier, options) => {
|
|
17
|
+
const workspace = input_1.default.restApiWorkspace(options.workspace);
|
|
18
|
+
const project = input_1.default.restApiProject(options.project);
|
|
19
|
+
const client = input_1.default.restApiTokenClient();
|
|
20
|
+
let result = await client.listSandboxes(workspace, project);
|
|
21
|
+
const sandboxes = result.sandboxes || [];
|
|
22
|
+
const found = sandboxes.find((s) => s.identifier === identifier);
|
|
23
|
+
if (!found) {
|
|
24
|
+
output_1.default.exitError(texts_1.ERR_SANDBOX_NOT_FOUND);
|
|
25
|
+
}
|
|
26
|
+
const sandboxId = found.id;
|
|
27
|
+
result = await client.getSandboxYaml(workspace, sandboxId);
|
|
28
|
+
output_1.default.exitNormal(Buffer.from(result.yaml, 'base64').toString('utf8'));
|
|
29
|
+
});
|
|
30
|
+
exports.default = commandSandboxGetYaml;
|