@mablhq/mabl-cli 1.16.32 → 1.18.3
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/api/basicApiClient.js +9 -4
- package/api/featureSet.js +1 -4
- package/api/mablApiClient.js +16 -9
- package/browserLauncher/browserLauncherFactory.js +4 -4
- package/browserLauncher/elementHandle.js +2 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +8 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +11 -9
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +23 -29
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +28 -6
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +5 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +13 -9
- package/browserLauncher/runnerType.js +0 -1
- package/cli.js +12 -8
- package/commands/applications/applications_cmds/describe.js +4 -4
- package/commands/applications/applications_cmds/list.js +4 -4
- package/commands/auth/auth_cmds/activate-key.js +1 -1
- package/commands/branches/branches_cmds/create.js +4 -4
- package/commands/branches/branches_cmds/describe.js +3 -3
- package/commands/branches/branches_cmds/list.js +3 -3
- package/commands/branches/branches_cmds/merge.js +4 -4
- package/commands/commandUtil/codeInsights.js +4 -2
- package/commands/commandUtil/describe.js +1 -1
- package/commands/commandUtil/fileUtil.js +5 -1
- package/commands/commandUtil/util.js +2 -2
- package/commands/config/config_cmds/delete.js +1 -1
- package/commands/config/config_cmds/set.js +1 -1
- package/commands/constants.js +3 -1
- package/commands/credentials/credentials_cmds/list.js +4 -4
- package/commands/deploy/deploy_cmds/create.js +18 -13
- package/commands/deploy/deploy_cmds/describe.js +5 -5
- package/commands/deploy/deploy_cmds/executionResultPresenter.js +1 -1
- package/commands/deploy/deploy_cmds/list.js +4 -4
- package/commands/deploy/deploy_cmds/watch.js +2 -2
- package/commands/environments/environments_cmds/create.js +7 -7
- package/commands/environments/environments_cmds/delete.js +1 -1
- package/commands/environments/environments_cmds/describe.js +4 -4
- package/commands/environments/environments_cmds/list.js +4 -4
- package/commands/environments/environments_cmds/update.js +2 -2
- package/commands/environments/environments_cmds/urls_cmds/add.js +3 -3
- package/commands/environments/environments_cmds/urls_cmds/list.js +2 -2
- package/commands/flows/flows_cmds/export.js +5 -5
- package/commands/flows/flows_cmds/list.js +2 -2
- package/commands/link-agents/link-agents_cmds/delete.js +1 -1
- package/commands/plans/plans_cmds/describe.js +4 -4
- package/commands/plans/plans_cmds/list.js +2 -2
- package/commands/test-runs/test-runs_cmds/export.js +2 -2
- package/commands/tests/executionUtil.js +5 -5
- package/commands/tests/testsUtil.js +30 -18
- package/commands/tests/tests_cmds/create.js +3 -3
- package/commands/tests/tests_cmds/edit.js +3 -3
- package/commands/tests/tests_cmds/export.js +7 -7
- package/commands/tests/tests_cmds/import.js +35 -14
- package/commands/tests/tests_cmds/list.js +3 -3
- package/commands/tests/tests_cmds/run-alpha.js +3 -3
- package/commands/tests/tests_cmds/run-cloud.js +4 -4
- package/commands/tests/tests_cmds/run-legacy.js +8 -8
- package/commands/tests/tests_cmds/run.js +13 -8
- package/commands/tests/tests_cmds/trainer_cmds/trainerUtil.js +2 -2
- package/commands/tests/tests_cmds/trainer_cmds/update.js +1 -1
- package/commands/tests/tests_cmds/trainer_cmds/version.js +2 -2
- package/commands/workspaces/workspace_cmds/copy.js +2 -2
- package/commands/workspaces/workspace_cmds/describe.js +4 -4
- package/commands/workspaces/workspace_cmds/list.js +2 -2
- package/configGenerators/flowConfigGenerator.js +1 -1
- package/configGenerators/selIdeGenerator.js +6 -6
- package/core/messaging/actions/runnerActions.js +2 -2
- package/core/trainer/openUtils.js +2 -2
- package/core/trainer/trainingSessions.js +26 -26
- package/domUtil/index.js +1 -1
- package/domUtil/index.js.LICENSE.txt +5 -5
- package/env/env.js +5 -1
- package/execution/index.js +1 -1
- package/execution/index.js.LICENSE.txt +7 -5
- package/index.d.ts +0 -1
- package/mablApi/index.js +1 -1
- package/mablscript/AttributesConstants.js +2 -1
- package/mablscript/MablAction.js +1 -1
- package/mablscript/MablStep.js +26 -14
- package/mablscript/actions/AwaitPDFDownloadAction.js +2 -1
- package/mablscript/actions/ConditionAction.js +12 -4
- package/mablscript/actions/ExtractAction.js +16 -7
- package/mablscript/actions/FindAction.js +105 -80
- package/mablscript/actions/GenerateRandomStringAction.js +2 -1
- package/mablscript/actions/GetUrlAction.js +2 -2
- package/mablscript/actions/GetVariableValue.js +3 -3
- package/mablscript/actions/JavaScriptAction.js +16 -16
- package/mablscript/diffing/diffingUtil.js +146 -0
- package/mablscript/importer.js +26 -8
- package/mablscript/steps/AccessibilityCheck.js +9 -7
- package/mablscript/steps/AssertStep.js +60 -46
- package/mablscript/steps/AssertStepOld.js +41 -23
- package/mablscript/steps/AwaitTabStep.js +7 -6
- package/mablscript/steps/ClickAndHoldStep.js +6 -6
- package/mablscript/steps/ClickStep.js +6 -6
- package/mablscript/steps/CreateVariableStep.js +8 -8
- package/mablscript/steps/DoubleClickStep.js +7 -7
- package/mablscript/steps/DownloadStep.js +3 -2
- package/mablscript/steps/EchoStep.js +5 -3
- package/mablscript/steps/ElseIfConditionStep.js +5 -2
- package/mablscript/steps/EnterTextStep.js +13 -10
- package/mablscript/steps/EvaluateFlowStep.js +40 -0
- package/mablscript/steps/HoverStep.js +6 -6
- package/mablscript/steps/IfConditionStep.js +8 -7
- package/mablscript/steps/NavigateStep.js +1 -1
- package/mablscript/steps/ReleaseStep.js +7 -6
- package/mablscript/steps/RemoveCookieStep.js +2 -3
- package/mablscript/steps/SelectStep.js +5 -5
- package/mablscript/steps/SendHttpRequestStep.js +3 -3
- package/mablscript/steps/SendKeyStep.js +9 -9
- package/mablscript/steps/SetCookieStep.js +2 -4
- package/mablscript/steps/SetFilesStep.js +5 -5
- package/mablscript/steps/SetViewportStep.js +2 -2
- package/mablscript/steps/SwitchContextStep.js +12 -12
- package/mablscript/steps/VisitUrlStep.js +3 -2
- package/mablscript/steps/WaitStep.js +2 -5
- package/mablscript/steps/WaitUntilStep.js +3 -3
- package/{browserLauncher/puppeteerBrowserLauncher/internals.js → mablscript/types/EvaluateFlowStepDescriptor.js} +0 -0
- package/mablscript/types/GetCurrentLocationDescriptor.js +4 -3
- package/mablscript/types/OperatingSystemDescriptor.js +5 -1
- package/mablscript/types/VariableNamespace.js +1 -1
- package/mablscriptFind/index.js +1 -1
- package/mablscriptFind/index.js.LICENSE.txt +5 -5
- package/observers/mockObserver.js +4 -2
- package/package.json +55 -56
- package/popupDismissal/index.js +3 -3
- package/providers/authenticationProvider.js +3 -3
- package/providers/logging/loggingProvider.js +5 -1
- package/proxy/index.js +2 -1
- package/proxy/index.js.LICENSE.txt +5 -0
- package/reporters/mochAwesome/mochAwesomeReporter.js +11 -7
- package/reporters/reporter.js +1 -1
- package/resources/mablFind.js +1 -1
- package/resources/pdf-viewer/index.js +1 -1
- package/resources/pdf-viewer/libEmbeddedPdfHandler.js +11 -2
- package/resources/popupDismissal.js +1 -1
- package/util/RichPromise.js +1 -0
- package/util/actionabilityUtil.js +16 -35
- package/util/analytics.js +7 -3
- package/util/downloadUtil.js +6 -2
- package/util/httpUtil.js +6 -2
- package/util/markdownUtil.js +1 -1
- package/util/pureUtil.js +5 -1
- package/util/resourceUtil.js +5 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +0 -134
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowserLauncher.js +0 -45
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +0 -139
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerFrame.js +0 -115
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpRequest.js +0 -38
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +0 -27
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerJsHandle.js +0 -36
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +0 -331
- package/browserLauncher/puppeteerBrowserLauncher/wrappers.js +0 -25
|
@@ -13,12 +13,12 @@ const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
|
|
|
13
13
|
const constants_1 = require("../../constants");
|
|
14
14
|
exports.command = 'list';
|
|
15
15
|
exports.describe = 'List your applications';
|
|
16
|
-
exports.builder = list_1.getListBuilderOptions('applications');
|
|
17
|
-
exports.handler = util_1.failWrapper(listApplications);
|
|
16
|
+
exports.builder = (0, list_1.getListBuilderOptions)('applications');
|
|
17
|
+
exports.handler = (0, util_1.failWrapper)(listApplications);
|
|
18
18
|
async function listApplications(parsed) {
|
|
19
19
|
const output = parsed.output;
|
|
20
20
|
const limit = parsed.limit;
|
|
21
|
-
const workspaceId = util_1.getWorkspaceId(parsed);
|
|
21
|
+
const workspaceId = (0, util_1.getWorkspaceId)(parsed);
|
|
22
22
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
23
23
|
const applications = await apiClient.getApplications(workspaceId, limit);
|
|
24
24
|
printApplications(applications, output);
|
|
@@ -30,7 +30,7 @@ function printApplications(applications, output) {
|
|
|
30
30
|
loggingProvider_1.logger.info(JSON.stringify(applications, null, 2));
|
|
31
31
|
break;
|
|
32
32
|
case 'yaml':
|
|
33
|
-
loggingProvider_1.logger.info(js_yaml_1.dump(applications));
|
|
33
|
+
loggingProvider_1.logger.info((0, js_yaml_1.dump)(applications));
|
|
34
34
|
break;
|
|
35
35
|
default:
|
|
36
36
|
const table = new cli_table3_1.default({
|
|
@@ -16,7 +16,7 @@ exports.builder = (yargs) => {
|
|
|
16
16
|
demand: 'API key argument required',
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
exports.handler = util_1.failWrapper(activateApiKey);
|
|
19
|
+
exports.handler = (0, util_1.failWrapper)(activateApiKey);
|
|
20
20
|
async function activateApiKey(parsed) {
|
|
21
21
|
const auth = new authenticationProvider_1.AuthenticationProvider();
|
|
22
22
|
const apiKey = parsed['api-key'];
|
|
@@ -30,21 +30,21 @@ exports.builder = (yargs) => {
|
|
|
30
30
|
})
|
|
31
31
|
.check((argv) => {
|
|
32
32
|
const branchName = argv[constants_1.CommandArgName];
|
|
33
|
-
if (!branches_1.isValidMablBranchName(branchName)) {
|
|
33
|
+
if (!(0, branches_1.isValidMablBranchName)(branchName)) {
|
|
34
34
|
throw new Error(`[${branchName}] is not a valid mabl branch name. Please specify a valid name`);
|
|
35
35
|
}
|
|
36
36
|
return true;
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
|
-
exports.handler = util_1.failWrapper(createBranch);
|
|
39
|
+
exports.handler = (0, util_1.failWrapper)(createBranch);
|
|
40
40
|
async function createBranch(parsed) {
|
|
41
41
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
42
|
-
const workspaceId = util_1.getWorkspaceId(parsed);
|
|
42
|
+
const workspaceId = (0, util_1.getWorkspaceId)(parsed);
|
|
43
43
|
const branchName = parsed.name;
|
|
44
44
|
loggingProvider_1.logger.info(`Creating Branch [${branchName}]`);
|
|
45
45
|
try {
|
|
46
46
|
const branch = await apiClient.createBranch(workspaceId, branchName);
|
|
47
|
-
describe_1.outputEntity(branch, parsed.output);
|
|
47
|
+
(0, describe_1.outputEntity)(branch, parsed.output);
|
|
48
48
|
return branch.id;
|
|
49
49
|
}
|
|
50
50
|
catch (creationError) {
|
|
@@ -32,19 +32,19 @@ exports.builder = (yargs) => {
|
|
|
32
32
|
type: 'string',
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
|
-
exports.handler = util_1.failWrapper(getBranch);
|
|
35
|
+
exports.handler = (0, util_1.failWrapper)(getBranch);
|
|
36
36
|
async function getBranch(parsed) {
|
|
37
37
|
const branchIdentifier = parsed.identifier;
|
|
38
38
|
const lookupByName = parsed.name;
|
|
39
39
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
40
40
|
let branch;
|
|
41
41
|
if (lookupByName) {
|
|
42
|
-
const workspaceId = util_1.getWorkspaceId(parsed);
|
|
42
|
+
const workspaceId = (0, util_1.getWorkspaceId)(parsed);
|
|
43
43
|
branch = await apiClient.getBranchByName(workspaceId, branchIdentifier);
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
46
|
branch = await apiClient.getBranchById(branchIdentifier);
|
|
47
47
|
}
|
|
48
|
-
describe_1.outputEntity(branch, parsed.output);
|
|
48
|
+
(0, describe_1.outputEntity)(branch, parsed.output);
|
|
49
49
|
return branch.id;
|
|
50
50
|
}
|
|
@@ -38,12 +38,12 @@ exports.builder = {
|
|
|
38
38
|
nargs: 1,
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
|
-
exports.handler = util_1.failWrapper(listBranches);
|
|
41
|
+
exports.handler = (0, util_1.failWrapper)(listBranches);
|
|
42
42
|
async function listBranches(parsed) {
|
|
43
43
|
const output = parsed.output;
|
|
44
44
|
const limit = parsed.limit;
|
|
45
45
|
const statusFilter = parsed.status;
|
|
46
|
-
const workspaceId = util_1.getWorkspaceId(parsed);
|
|
46
|
+
const workspaceId = (0, util_1.getWorkspaceId)(parsed);
|
|
47
47
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
48
48
|
const branches = await apiClient.getBranches(workspaceId, limit, statusFilter);
|
|
49
49
|
printBranches(branches, output);
|
|
@@ -55,7 +55,7 @@ function printBranches(branches, output) {
|
|
|
55
55
|
loggingProvider_1.logger.info(JSON.stringify(branches, null, 2));
|
|
56
56
|
break;
|
|
57
57
|
case 'yaml':
|
|
58
|
-
loggingProvider_1.logger.info(js_yaml_1.dump(branches));
|
|
58
|
+
loggingProvider_1.logger.info((0, js_yaml_1.dump)(branches));
|
|
59
59
|
break;
|
|
60
60
|
default:
|
|
61
61
|
const table = new cli_table3_1.default({
|
|
@@ -38,19 +38,19 @@ exports.builder = (yargs) => {
|
|
|
38
38
|
})
|
|
39
39
|
.check((argv) => {
|
|
40
40
|
const fromBranchName = argv[CommandArgFrom];
|
|
41
|
-
if (!branches_1.isValidMablBranchName(fromBranchName)) {
|
|
41
|
+
if (!(0, branches_1.isValidMablBranchName)(fromBranchName)) {
|
|
42
42
|
throw new Error(`[${fromBranchName}] is not a valid mabl branch name. Please specify a valid name`);
|
|
43
43
|
}
|
|
44
44
|
return true;
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
exports.handler = util_1.failWrapper(mergeBranch);
|
|
47
|
+
exports.handler = (0, util_1.failWrapper)(mergeBranch);
|
|
48
48
|
async function mergeBranch(parsed) {
|
|
49
49
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
50
|
-
const workspaceId = util_1.getWorkspaceId(parsed);
|
|
50
|
+
const workspaceId = (0, util_1.getWorkspaceId)(parsed);
|
|
51
51
|
const fromBranchName = parsed.from;
|
|
52
52
|
const toBranchName = parsed.to;
|
|
53
53
|
const branch = await apiClient.mergeBranch(workspaceId, fromBranchName, toBranchName);
|
|
54
|
-
describe_1.outputEntity(branch, parsed.output);
|
|
54
|
+
(0, describe_1.outputEntity)(branch, parsed.output);
|
|
55
55
|
return branch.id;
|
|
56
56
|
}
|
|
@@ -16,7 +16,8 @@ function generateCodeReportForCommit(executionEventId, outputLink, executionResu
|
|
|
16
16
|
external_id: `${executionEventId}-cr`,
|
|
17
17
|
title: `mabl tests`,
|
|
18
18
|
details: `mabl tests for mabl deployment ${executionEventId}`,
|
|
19
|
-
result: ((_a = executionResult.event_status) === null || _a === void 0 ? void 0 : _a.succeeded)
|
|
19
|
+
result: ((_a = executionResult.event_status) === null || _a === void 0 ? void 0 : _a.succeeded)
|
|
20
|
+
? CodeReport_1.CodeInsightsResult.PASSED
|
|
20
21
|
: CodeReport_1.CodeInsightsResult.FAILED,
|
|
21
22
|
reporter: `mabl`,
|
|
22
23
|
link: outputLink,
|
|
@@ -149,7 +150,8 @@ async function maybeOutputToBitbucket(executionResult, deploymentId, outputLink)
|
|
|
149
150
|
const noProxy = process.env.CODE_INSIGHTS_PROXY_OFF === 'true';
|
|
150
151
|
if (repoSlug &&
|
|
151
152
|
workspace &&
|
|
152
|
-
node &&
|
|
153
|
+
node &&
|
|
154
|
+
((_d = executionResult === null || executionResult === void 0 ? void 0 : executionResult.executions) === null || _d === void 0 ? void 0 : _d.length) &&
|
|
153
155
|
executionResult.executions.length > 0) {
|
|
154
156
|
const codeReport = await putCodeReportAndAnnotations(executionResult, deploymentId, outputLink, workspace, repoSlug, node, isCustomBitBucketPipe, noProxy);
|
|
155
157
|
loggingProvider_1.logger.info(chalk.cyan(`Bitbucket Code Insights Report generated ${codeReport.uuid}`));
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -76,13 +76,13 @@ function validateValuePairInputs(inputName, inputs) {
|
|
|
76
76
|
.map((input) => input.trim())
|
|
77
77
|
.filter((input) => !/^([^:]+)?:(.+)?$/m.test(input));
|
|
78
78
|
if (missingColonInputs.length > 0) {
|
|
79
|
-
throw new Error(`${inputName} ${pluralize_1.default('value', missingColonInputs.length)} must separate kev/value with a colon ':', [${missingColonInputs.join(',')}]`);
|
|
79
|
+
throw new Error(`${inputName} ${(0, pluralize_1.default)('value', missingColonInputs.length)} must separate kev/value with a colon ':', [${missingColonInputs.join(',')}]`);
|
|
80
80
|
}
|
|
81
81
|
const missingNameInputs = inputs
|
|
82
82
|
.map((input) => input.replace(/^[ ]+/, ''))
|
|
83
83
|
.filter((input) => !/^([^:]+):(.+)?$/m.test(input));
|
|
84
84
|
if (missingNameInputs.length > 0) {
|
|
85
|
-
throw new Error(`${inputName} ${pluralize_1.default('name', missingNameInputs.length)} cannot be blank [${missingNameInputs.join(',')}]`);
|
|
85
|
+
throw new Error(`${inputName} ${(0, pluralize_1.default)('name', missingNameInputs.length)} cannot be blank [${missingNameInputs.join(',')}]`);
|
|
86
86
|
}
|
|
87
87
|
const illegalCharacterHeaders = inputs.filter((input) => /[\n\r]/m.test(input));
|
|
88
88
|
if (illegalCharacterHeaders.length > 0) {
|
|
@@ -60,7 +60,7 @@ async function setConfig(parsed) {
|
|
|
60
60
|
throw new Error(`<${exports.configKeyCommandArg}> value not one of supported types: ${JSON.stringify(exports.validConfigKeyChoices)}`);
|
|
61
61
|
}
|
|
62
62
|
loggingProvider_1.logger.info(`Configured [${key}] = [${value}]`);
|
|
63
|
-
list_1.listConfig();
|
|
63
|
+
(0, list_1.listConfig)();
|
|
64
64
|
return key;
|
|
65
65
|
}
|
|
66
66
|
function isValidUrl(value) {
|
package/commands/constants.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CommandArgUrlApi = exports.CommandArgUrlApp = exports.CommandArgUrl = exports.CommandArgTrainerVersion = exports.CommandArgTo = exports.CommandArgSilent = exports.CommandArgRevision = exports.CommandArgPlanId = exports.CommandArgContentTypes = exports.CommandArgPreview = exports.CommandArgOutputFilePath = exports.CommandArgOutput = exports.CommandArgNoPrompt = exports.CommandArgPrompt = exports.CommandArgPortNumber = exports.CommandArgName = exports.CommandArgMablBranchChangesOnly = exports.CommandArgMablBranch = exports.CommandArgMablAutoLogin = exports.CommandArgMablAutoBranch = exports.CommandArgLinkBypass = exports.CommandArgLinkLabel = exports.CommandArgLimitOutput = exports.CommandArgLabels = exports.CommandArgLabelsInclude = exports.CommandArgLabelsExclude = exports.CommandArgTestInteractionSpeed = exports.CommandArgTestRunId = exports.CommandArgTestFile = exports.CommandArgId = exports.CommandArgUserAgent = exports.CommandArgHttpHeaders = exports.CommandArgHelp = exports.CommandArgFromPlanId = exports.CommandArgFrom = exports.CommandArgFormat = exports.CommandArgFastFailure = exports.CommandArgOverrideEnvironmentId = exports.CommandArgEnvironmentId = exports.CommandArgEnableLink = exports.CommandArgDetailLevel = exports.CommandArgDescription = exports.CommandArgDeploymentId = exports.CommandArgDecrypt = exports.CommandArgDataTables = exports.CommandArgCredentials = exports.CommandArgBasicAuthCredentials = exports.CommandArgBrowsers = exports.CommandArgApplicationId = exports.CommandArgApiKey = void 0;
|
|
4
|
+
exports.BrowserTypeSelections = exports.DefaultBrowserType = exports.DefaultBranchName = exports.DefaultOutputFormatChoices = exports.DetailLevelFormats = exports.ReporterOptions = exports.OutputFormats = exports.CommandArgAliases = exports.CommandArgBrowserEnableExtensions = exports.CommandArgBrowserIgnoreCertificateErrors = exports.CommandArgBrowserDisableIsolation = exports.ListTimeFormat = exports.CommandArgReporterOptions = exports.CommandArgReporter = exports.CommandArgWorkspaceId = exports.CommandArgVersion = exports.CommandArgVariables = void 0;
|
|
4
5
|
const browserTypes_1 = require("./browserTypes");
|
|
5
6
|
exports.CommandArgApiKey = 'api-key';
|
|
6
7
|
exports.CommandArgApplicationId = 'application-id';
|
|
@@ -21,6 +22,7 @@ exports.CommandArgFrom = 'from';
|
|
|
21
22
|
exports.CommandArgFromPlanId = 'from-plan-id';
|
|
22
23
|
exports.CommandArgHelp = 'help';
|
|
23
24
|
exports.CommandArgHttpHeaders = 'http-headers';
|
|
25
|
+
exports.CommandArgUserAgent = 'user-agent';
|
|
24
26
|
exports.CommandArgId = 'id';
|
|
25
27
|
exports.CommandArgTestFile = 'test-file';
|
|
26
28
|
exports.CommandArgTestRunId = 'run-id';
|
|
@@ -13,12 +13,12 @@ const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
|
|
|
13
13
|
const constants_1 = require("../../constants");
|
|
14
14
|
exports.command = 'list';
|
|
15
15
|
exports.describe = 'List your credentials';
|
|
16
|
-
exports.builder = list_1.getListBuilderOptions('credentials');
|
|
17
|
-
exports.handler = util_1.failWrapper(listCredentials);
|
|
16
|
+
exports.builder = (0, list_1.getListBuilderOptions)('credentials');
|
|
17
|
+
exports.handler = (0, util_1.failWrapper)(listCredentials);
|
|
18
18
|
async function listCredentials(parsed) {
|
|
19
19
|
const output = parsed.output;
|
|
20
20
|
const limit = parsed.limit;
|
|
21
|
-
const workspaceId = util_1.getWorkspaceId(parsed);
|
|
21
|
+
const workspaceId = (0, util_1.getWorkspaceId)(parsed);
|
|
22
22
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
23
23
|
const credentials = await apiClient.getCredentials(workspaceId, limit);
|
|
24
24
|
printCredentials(credentials, output);
|
|
@@ -30,7 +30,7 @@ function printCredentials(credentials, output) {
|
|
|
30
30
|
loggingProvider_1.logger.info(JSON.stringify(credentials, null, 2));
|
|
31
31
|
break;
|
|
32
32
|
case 'yaml':
|
|
33
|
-
loggingProvider_1.logger.info(js_yaml_1.dump(credentials));
|
|
33
|
+
loggingProvider_1.logger.info((0, js_yaml_1.dump)(credentials));
|
|
34
34
|
break;
|
|
35
35
|
default:
|
|
36
36
|
const table = new cli_table3_1.default({
|
|
@@ -170,19 +170,19 @@ exports.builder = (yargs) => {
|
|
|
170
170
|
throw new Error(`At least one of ${constants_1.CommandArgApplicationId} or ${constants_1.CommandArgEnvironmentId} required`);
|
|
171
171
|
}
|
|
172
172
|
const branchName = argv[constants_1.CommandArgMablBranch];
|
|
173
|
-
if (branchName !== undefined && !branches_1.isValidMablBranchName(branchName)) {
|
|
173
|
+
if (branchName !== undefined && !(0, branches_1.isValidMablBranchName)(branchName)) {
|
|
174
174
|
throw new Error(`[${branchName}] is not a valid mabl branch name. Please specify a valid name`);
|
|
175
175
|
}
|
|
176
176
|
const snapshotFromBranch = argv[CommandArgSnapshotBranch];
|
|
177
177
|
if (snapshotFromBranch !== undefined &&
|
|
178
|
-
!branches_1.isValidMablBranchName(snapshotFromBranch)) {
|
|
178
|
+
!(0, branches_1.isValidMablBranchName)(snapshotFromBranch)) {
|
|
179
179
|
throw new Error(`[${snapshotFromBranch}] is not a valid mabl branch name to snapshot from. Please specify a valid name`);
|
|
180
180
|
}
|
|
181
|
-
util_1.validateArrayInputs(argv[constants_1.CommandArgBrowsers], 'browser names must be SPACE delimited, e.g. "--browsers=chrome firefox"');
|
|
182
|
-
util_1.validateArrayInputs(argv[constants_1.CommandArgLabelsInclude], 'label names must be SPACE delimited, e.g. "--labels=foo bar"');
|
|
183
|
-
util_1.validateArrayInputs(argv[constants_1.CommandArgHttpHeaders], 'HTTP headers must be SPACE delimited, e.g. "--http-headers="foo:bar" "baz:qux"');
|
|
181
|
+
(0, util_1.validateArrayInputs)(argv[constants_1.CommandArgBrowsers], 'browser names must be SPACE delimited, e.g. "--browsers=chrome firefox"');
|
|
182
|
+
(0, util_1.validateArrayInputs)(argv[constants_1.CommandArgLabelsInclude], 'label names must be SPACE delimited, e.g. "--labels=foo bar"');
|
|
183
|
+
(0, util_1.validateArrayInputs)(argv[constants_1.CommandArgHttpHeaders], 'HTTP headers must be SPACE delimited, e.g. "--http-headers="foo:bar" "baz:qux"');
|
|
184
184
|
const httpHeaders = argv[constants_1.CommandArgHttpHeaders];
|
|
185
|
-
argv[constants_1.CommandArgHttpHeaders] = util_1.validateValuePairInputs('HTTP header', httpHeaders);
|
|
185
|
+
argv[constants_1.CommandArgHttpHeaders] = (0, util_1.validateValuePairInputs)('HTTP header', httpHeaders);
|
|
186
186
|
const repositoryUrl = argv['repository-url'];
|
|
187
187
|
if (repositoryUrl !== undefined && repositoryUrl.trim() === '') {
|
|
188
188
|
throw new Error(`repository-url cannot be set to empty value`);
|
|
@@ -190,7 +190,7 @@ exports.builder = (yargs) => {
|
|
|
190
190
|
return true;
|
|
191
191
|
});
|
|
192
192
|
};
|
|
193
|
-
exports.handler = util_1.failWrapper(createDeployment);
|
|
193
|
+
exports.handler = (0, util_1.failWrapper)(createDeployment);
|
|
194
194
|
async function createDeployment(parsed) {
|
|
195
195
|
var _a, _b, _c;
|
|
196
196
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClientFromOptionalApiKey(parsed['api-key']);
|
|
@@ -203,7 +203,7 @@ async function createDeployment(parsed) {
|
|
|
203
203
|
const runnerType = parsed['runner-type'];
|
|
204
204
|
const applicationId = parsed['application-id'];
|
|
205
205
|
const environmentId = parsed['environment-id'];
|
|
206
|
-
const workspaceId = await util_1.getWorkspaceIdFromAppOrEnv(apiClient, applicationId, environmentId);
|
|
206
|
+
const workspaceId = await (0, util_1.getWorkspaceIdFromAppOrEnv)(apiClient, applicationId, environmentId);
|
|
207
207
|
const environmentOverride = parsed[constants_1.CommandArgOverrideEnvironmentId];
|
|
208
208
|
let deploymentIds;
|
|
209
209
|
if (environmentOverride) {
|
|
@@ -214,7 +214,7 @@ async function createDeployment(parsed) {
|
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
const mablBranch = parsed['mabl-branch'];
|
|
217
|
-
await branches_1.checkBranchNameAndAutoBranchMaybe(workspaceId, apiClient, mablBranch, parsed['auto-branch']);
|
|
217
|
+
await (0, branches_1.checkBranchNameAndAutoBranchMaybe)(workspaceId, apiClient, mablBranch, parsed['auto-branch']);
|
|
218
218
|
const snapshotFromBranch = parsed['snapshot-from'];
|
|
219
219
|
const httpHeaders = parsed['http-headers'];
|
|
220
220
|
const scmMetadata = await collectSourceControlMetadataIfEnabled(parsed);
|
|
@@ -247,7 +247,7 @@ async function createDeployment(parsed) {
|
|
|
247
247
|
const pollingResult = await waiter.awaitCompletion(deploymentEvent.id);
|
|
248
248
|
const isSuccess = ((_c = (_b = pollingResult === null || pollingResult === void 0 ? void 0 : pollingResult.newEntity) === null || _b === void 0 ? void 0 : _b.event_status) === null || _c === void 0 ? void 0 : _c.succeeded) || false;
|
|
249
249
|
try {
|
|
250
|
-
await codeInsights_1.maybeOutputToBitbucket(pollingResult.newEntity, deploymentEvent.id, outputWebappLink);
|
|
250
|
+
await (0, codeInsights_1.maybeOutputToBitbucket)(pollingResult.newEntity, deploymentEvent.id, outputWebappLink);
|
|
251
251
|
}
|
|
252
252
|
catch (error) {
|
|
253
253
|
loggingProvider_1.logger.info(chalk.yellow.bold('Unable to generate code insights due to BitBucket integration API error'));
|
|
@@ -268,7 +268,7 @@ function printDeploymentEventResultOutput(deploymentEventId, outputWebappLink, o
|
|
|
268
268
|
href: outputWebappLink,
|
|
269
269
|
execution_results: executionResult,
|
|
270
270
|
};
|
|
271
|
-
return describe_1.outputEntity(resultPayload, outputMode);
|
|
271
|
+
return (0, describe_1.outputEntity)(resultPayload, outputMode);
|
|
272
272
|
default:
|
|
273
273
|
return outputWebappLink;
|
|
274
274
|
}
|
|
@@ -281,9 +281,14 @@ async function collectSourceControlMetadataIfEnabled(parsed) {
|
|
|
281
281
|
const buildInfo = await new scmContextProvider_1.ScmContextProvider(process.env).extractScmAndBuildInfo();
|
|
282
282
|
const sourceControlBranch = ((_a = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.scmInfo) === null || _a === void 0 ? void 0 : _a.branchName) || ((_b = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.buildInfo) === null || _b === void 0 ? void 0 : _b.branchName);
|
|
283
283
|
const sourceControlTag = ((_c = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.scmInfo) === null || _c === void 0 ? void 0 : _c.tagName) || ((_d = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.buildInfo) === null || _d === void 0 ? void 0 : _d.tagName);
|
|
284
|
-
const sourceControlRepoUrl = userSuppliedRepositoryUrl ||
|
|
284
|
+
const sourceControlRepoUrl = userSuppliedRepositoryUrl ||
|
|
285
|
+
((_e = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.scmInfo) === null || _e === void 0 ? void 0 : _e.repoUrl) ||
|
|
286
|
+
((_f = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.buildInfo) === null || _f === void 0 ? void 0 : _f.repoUrl);
|
|
285
287
|
const sourceControlRepoName = ((_g = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.scmInfo) === null || _g === void 0 ? void 0 : _g.repoName) || ((_h = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.buildInfo) === null || _h === void 0 ? void 0 : _h.repoName);
|
|
286
|
-
const revision = parsed.revision ||
|
|
288
|
+
const revision = parsed.revision ||
|
|
289
|
+
((_j = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.scmInfo) === null || _j === void 0 ? void 0 : _j.commitSha) ||
|
|
290
|
+
((_k = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.buildInfo) === null || _k === void 0 ? void 0 : _k.commitSha) ||
|
|
291
|
+
((_l = buildInfo === null || buildInfo === void 0 ? void 0 : buildInfo.buildInfo) === null || _l === void 0 ? void 0 : _l.revision);
|
|
287
292
|
return {
|
|
288
293
|
branchName: sourceControlBranch,
|
|
289
294
|
tag: sourceControlTag,
|
|
@@ -17,7 +17,7 @@ exports.builder = {
|
|
|
17
17
|
choices: [...constants_1.DefaultOutputFormatChoices, constants_1.OutputFormats.Markdown],
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
|
-
exports.handler = util_1.failWrapper(getDeployment);
|
|
20
|
+
exports.handler = (0, util_1.failWrapper)(getDeployment);
|
|
21
21
|
async function getDeployment(parsed) {
|
|
22
22
|
const output = parsed.output;
|
|
23
23
|
const deploymentId = parsed.id;
|
|
@@ -27,22 +27,22 @@ async function getDeployment(parsed) {
|
|
|
27
27
|
case constants_1.OutputFormats.Markdown:
|
|
28
28
|
if (deployment.run_result) {
|
|
29
29
|
const executionResult = deployment.run_result;
|
|
30
|
-
loggingProvider_1.logger.info(markdownUtil_1.formatResultsAsGithubMarkdown(executionResult));
|
|
30
|
+
loggingProvider_1.logger.info((0, markdownUtil_1.formatResultsAsGithubMarkdown)(executionResult));
|
|
31
31
|
}
|
|
32
32
|
break;
|
|
33
33
|
case constants_1.OutputFormats.Json:
|
|
34
34
|
loggingProvider_1.logger.info(JSON.stringify(deployment, null, 2));
|
|
35
35
|
break;
|
|
36
36
|
case constants_1.OutputFormats.Yaml:
|
|
37
|
-
loggingProvider_1.logger.info(js_yaml_1.dump(deployment));
|
|
37
|
+
loggingProvider_1.logger.info((0, js_yaml_1.dump)(deployment));
|
|
38
38
|
break;
|
|
39
39
|
default:
|
|
40
40
|
if (deployment.run_result) {
|
|
41
41
|
delete deployment.run_result.executions;
|
|
42
42
|
}
|
|
43
43
|
delete deployment.triggered_plan_run_summaries;
|
|
44
|
-
const workspaceId = await util_1.getWorkspaceIdFromAppOrEnv(apiClient, deployment.application_id, deployment.environment_id);
|
|
45
|
-
loggingProvider_1.logger.info(js_yaml_1.dump(deployment));
|
|
44
|
+
const workspaceId = await (0, util_1.getWorkspaceIdFromAppOrEnv)(apiClient, deployment.application_id, deployment.environment_id);
|
|
45
|
+
loggingProvider_1.logger.info((0, js_yaml_1.dump)(deployment));
|
|
46
46
|
loggingProvider_1.logger.info(`VIEW RESULTS: ${chalk.cyan(getOutputLink(workspaceId, deployment.id))}`);
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
@@ -13,12 +13,12 @@ const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
|
|
|
13
13
|
const constants_1 = require("../../constants");
|
|
14
14
|
exports.command = 'list';
|
|
15
15
|
exports.describe = 'List recent mabl deployment events';
|
|
16
|
-
exports.builder = list_1.getListBuilderOptions('deployments');
|
|
17
|
-
exports.handler = util_1.failWrapper(listDeployments);
|
|
16
|
+
exports.builder = (0, list_1.getListBuilderOptions)('deployments');
|
|
17
|
+
exports.handler = (0, util_1.failWrapper)(listDeployments);
|
|
18
18
|
async function listDeployments(parsed) {
|
|
19
19
|
const output = parsed.output;
|
|
20
20
|
const limit = parsed.limit;
|
|
21
|
-
const workspaceId = util_1.getWorkspaceId(parsed);
|
|
21
|
+
const workspaceId = (0, util_1.getWorkspaceId)(parsed);
|
|
22
22
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
23
23
|
const deployments = await apiClient.getDeploymentEvents(workspaceId, limit);
|
|
24
24
|
printDeployments(deployments, output);
|
|
@@ -30,7 +30,7 @@ function printDeployments(deployments, output) {
|
|
|
30
30
|
loggingProvider_1.logger.info(JSON.stringify(deployments, null, 2));
|
|
31
31
|
break;
|
|
32
32
|
case 'yaml':
|
|
33
|
-
loggingProvider_1.logger.info(js_yaml_1.dump(deployments));
|
|
33
|
+
loggingProvider_1.logger.info((0, js_yaml_1.dump)(deployments));
|
|
34
34
|
break;
|
|
35
35
|
default:
|
|
36
36
|
const table = new cli_table3_1.default({
|
|
@@ -27,13 +27,13 @@ exports.builder = (yargs) => {
|
|
|
27
27
|
choices: constants_1.DefaultOutputFormatChoices,
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
exports.handler = util_1.failWrapper(getWatch);
|
|
30
|
+
exports.handler = (0, util_1.failWrapper)(getWatch);
|
|
31
31
|
async function getWatch(parsed) {
|
|
32
32
|
var _a, _b;
|
|
33
33
|
const deploymentId = parsed.id;
|
|
34
34
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
35
35
|
const deploymentEvent = await apiClient.getDeploymentEvent(deploymentId);
|
|
36
|
-
const outputWebappLink = create_1.getDeploymentEventWebappUrl(deploymentEvent);
|
|
36
|
+
const outputWebappLink = (0, create_1.getDeploymentEventWebappUrl)(deploymentEvent);
|
|
37
37
|
const waiter = new awaitDeploymentCompletion_1.AwaitDeploymentCompletion(apiClient, parsed['fast-failure'], parsed.silent);
|
|
38
38
|
const pollingResult = await waiter.awaitCompletion(deploymentEvent.id);
|
|
39
39
|
const isSuccess = ((_b = (_a = pollingResult === null || pollingResult === void 0 ? void 0 : pollingResult.newEntity) === null || _a === void 0 ? void 0 : _a.event_status) === null || _b === void 0 ? void 0 : _b.succeeded) || false;
|
|
@@ -16,7 +16,7 @@ const cliConfigProvider_1 = require("../../../providers/cliConfigProvider");
|
|
|
16
16
|
exports.command = 'create';
|
|
17
17
|
exports.describe = 'Create a new mabl environment';
|
|
18
18
|
exports.builder = (yargs) => {
|
|
19
|
-
addUpdateEnvCommands(add_1.addEnvironmentUrlOptions(yargs))
|
|
19
|
+
addUpdateEnvCommands((0, add_1.addEnvironmentUrlOptions)(yargs))
|
|
20
20
|
.option(constants_1.CommandArgWorkspaceId, {
|
|
21
21
|
alias: constants_1.CommandArgAliases.WorkspaceId,
|
|
22
22
|
describe: 'Workspace containing to create environment in',
|
|
@@ -37,7 +37,7 @@ exports.builder = (yargs) => {
|
|
|
37
37
|
type: 'array',
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
exports.handler = util_1.failWrapper(createEnvironment);
|
|
40
|
+
exports.handler = (0, util_1.failWrapper)(createEnvironment);
|
|
41
41
|
function addUpdateEnvCommands(argv) {
|
|
42
42
|
return argv
|
|
43
43
|
.option(constants_1.CommandArgName, {
|
|
@@ -79,14 +79,14 @@ function addUpdateEnvCommands(argv) {
|
|
|
79
79
|
})
|
|
80
80
|
.check((argv) => {
|
|
81
81
|
const branchName = argv[constants_1.CommandArgMablBranch];
|
|
82
|
-
if (branchName !== undefined && !branches_1.isValidMablBranchName(branchName)) {
|
|
82
|
+
if (branchName !== undefined && !(0, branches_1.isValidMablBranchName)(branchName)) {
|
|
83
83
|
throw new Error(`[${branchName}] is not a valid mabl branch name. Please specify a valid name`);
|
|
84
84
|
}
|
|
85
85
|
return true;
|
|
86
86
|
})
|
|
87
87
|
.coerce('variables', (variables) => {
|
|
88
|
-
util_1.validateArrayInputs(variables, 'Variables must be SPACE delimited, e.g. --variables foo:bar baz:qux');
|
|
89
|
-
variables = util_1.validateValuePairInputs('Variable', variables);
|
|
88
|
+
(0, util_1.validateArrayInputs)(variables, 'Variables must be SPACE delimited, e.g. --variables foo:bar baz:qux');
|
|
89
|
+
variables = (0, util_1.validateValuePairInputs)('Variable', variables);
|
|
90
90
|
return variables.reduce((variablesObject, item) => {
|
|
91
91
|
const parts = item.split(':', 2);
|
|
92
92
|
variablesObject[parts[0]] = parts[1];
|
|
@@ -119,8 +119,8 @@ async function createEnvironment(parsed) {
|
|
|
119
119
|
if (applicationId) {
|
|
120
120
|
loggingProvider_1.logger.info('Associating URLs with environment');
|
|
121
121
|
const createDeploymentsPromises = (parsed[constants_1.CommandArgUrlApp] || [])
|
|
122
|
-
.map((url) => add_1.createDeploymentForUrl(apiClient, environment, applicationId, url, mablApi_1.Deployment.DeploymentTypeEnum.WebApplication))
|
|
123
|
-
.concat((parsed[constants_1.CommandArgUrlApi] || []).map((url) => add_1.createDeploymentForUrl(apiClient, environment, applicationId, url, mablApi_1.Deployment.DeploymentTypeEnum.Api)));
|
|
122
|
+
.map((url) => (0, add_1.createDeploymentForUrl)(apiClient, environment, applicationId, url, mablApi_1.Deployment.DeploymentTypeEnum.WebApplication))
|
|
123
|
+
.concat((parsed[constants_1.CommandArgUrlApi] || []).map((url) => (0, add_1.createDeploymentForUrl)(apiClient, environment, applicationId, url, mablApi_1.Deployment.DeploymentTypeEnum.Api)));
|
|
124
124
|
await Promise.all(createDeploymentsPromises);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
@@ -16,7 +16,7 @@ exports.builder = (yargs) => {
|
|
|
16
16
|
type: 'string',
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
exports.handler = util_1.failWrapper(deleteEnvironment);
|
|
19
|
+
exports.handler = (0, util_1.failWrapper)(deleteEnvironment);
|
|
20
20
|
async function deleteEnvironment(parsed) {
|
|
21
21
|
var _a;
|
|
22
22
|
let environment;
|
|
@@ -5,21 +5,21 @@ const describe_1 = require("../../commandUtil/describe");
|
|
|
5
5
|
const util_1 = require("../../commandUtil/util");
|
|
6
6
|
const constants_1 = require("../../constants");
|
|
7
7
|
exports.command = 'describe <id>';
|
|
8
|
-
exports.describe = util_1.getDescribeDescriptions('environment');
|
|
8
|
+
exports.describe = (0, util_1.getDescribeDescriptions)('environment');
|
|
9
9
|
exports.builder = {
|
|
10
10
|
[constants_1.CommandArgDecrypt]: {
|
|
11
11
|
describe: `Set to decrypt and return environment variables as part of the payload`,
|
|
12
12
|
boolean: true,
|
|
13
13
|
},
|
|
14
|
-
...describe_1.getDescribeBuilderOptions(),
|
|
14
|
+
...(0, describe_1.getDescribeBuilderOptions)(),
|
|
15
15
|
};
|
|
16
|
-
exports.handler = util_1.failWrapper(getEnvironment);
|
|
16
|
+
exports.handler = (0, util_1.failWrapper)(getEnvironment);
|
|
17
17
|
async function getEnvironment(parsed) {
|
|
18
18
|
try {
|
|
19
19
|
const environmentId = parsed.id;
|
|
20
20
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
21
21
|
const environment = await apiClient.getEnvironment(environmentId, parsed.decrypt);
|
|
22
|
-
describe_1.outputEntity(environment, parsed.output);
|
|
22
|
+
(0, describe_1.outputEntity)(environment, parsed.output);
|
|
23
23
|
return environment.id;
|
|
24
24
|
}
|
|
25
25
|
catch (error) {
|
|
@@ -13,11 +13,11 @@ const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
|
|
|
13
13
|
const constants_1 = require("../../constants");
|
|
14
14
|
exports.command = 'list';
|
|
15
15
|
exports.describe = 'List your environments';
|
|
16
|
-
exports.builder = list_1.getListBuilderOptions('environments');
|
|
17
|
-
exports.handler = util_1.failWrapper(listEnvironments);
|
|
16
|
+
exports.builder = (0, list_1.getListBuilderOptions)('environments');
|
|
17
|
+
exports.handler = (0, util_1.failWrapper)(listEnvironments);
|
|
18
18
|
async function listEnvironments(parsed) {
|
|
19
19
|
const output = parsed.output;
|
|
20
|
-
const workspaceId = util_1.getWorkspaceId(parsed);
|
|
20
|
+
const workspaceId = (0, util_1.getWorkspaceId)(parsed);
|
|
21
21
|
const limit = parsed.limit;
|
|
22
22
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
23
23
|
const environments = await apiClient.getEnvironments(workspaceId, limit);
|
|
@@ -30,7 +30,7 @@ function printEnvironments(environments, output) {
|
|
|
30
30
|
loggingProvider_1.logger.info(JSON.stringify(environments, null, 2));
|
|
31
31
|
break;
|
|
32
32
|
case 'yaml':
|
|
33
|
-
loggingProvider_1.logger.info(js_yaml_1.dump(environments));
|
|
33
|
+
loggingProvider_1.logger.info((0, js_yaml_1.dump)(environments));
|
|
34
34
|
break;
|
|
35
35
|
default:
|
|
36
36
|
const table = new cli_table3_1.default({
|
|
@@ -13,14 +13,14 @@ const create_1 = require("./create");
|
|
|
13
13
|
exports.command = 'update <id>';
|
|
14
14
|
exports.describe = 'Update a mabl environment';
|
|
15
15
|
exports.builder = (yargs) => {
|
|
16
|
-
create_1.addUpdateEnvCommands(add_1.addEnvironmentUrlOptions(yargs)).positional(constants_1.CommandArgId, {
|
|
16
|
+
(0, create_1.addUpdateEnvCommands)((0, add_1.addEnvironmentUrlOptions)(yargs)).positional(constants_1.CommandArgId, {
|
|
17
17
|
describe: 'Id of environment to update',
|
|
18
18
|
type: 'string',
|
|
19
19
|
nargs: 1,
|
|
20
20
|
demand: 'id argument required',
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
exports.handler = util_1.failWrapper(updateEnvironment);
|
|
23
|
+
exports.handler = (0, util_1.failWrapper)(updateEnvironment);
|
|
24
24
|
async function updateEnvironment(parsed) {
|
|
25
25
|
var _a;
|
|
26
26
|
let environment;
|
|
@@ -20,7 +20,7 @@ exports.builder = (yargs) => {
|
|
|
20
20
|
})
|
|
21
21
|
.demandOption(constants_1.CommandArgApplicationId);
|
|
22
22
|
};
|
|
23
|
-
exports.handler = util_1.failWrapper(createDeployments);
|
|
23
|
+
exports.handler = (0, util_1.failWrapper)(createDeployments);
|
|
24
24
|
function addEnvironmentUrlOptions(yargs) {
|
|
25
25
|
return yargs
|
|
26
26
|
.option(constants_1.CommandArgApplicationId, {
|
|
@@ -46,10 +46,10 @@ function addEnvironmentUrlOptions(yargs) {
|
|
|
46
46
|
throw new Error(`Must specify at least one url if adding an application association to the environment`);
|
|
47
47
|
}
|
|
48
48
|
if (appUrls) {
|
|
49
|
-
util_1.validateArrayInputs(appUrls, 'Urls must be SPACE delimited, e.g. "--api-urls=http://mabl.com http://api.mabl.com');
|
|
49
|
+
(0, util_1.validateArrayInputs)(appUrls, 'Urls must be SPACE delimited, e.g. "--api-urls=http://mabl.com http://api.mabl.com');
|
|
50
50
|
}
|
|
51
51
|
if (apiUrls) {
|
|
52
|
-
util_1.validateArrayInputs(apiUrls, 'Urls must be SPACE delimited, e.g. "--api-urls=http://mabl.com http://api.mabl.com');
|
|
52
|
+
(0, util_1.validateArrayInputs)(apiUrls, 'Urls must be SPACE delimited, e.g. "--api-urls=http://mabl.com http://api.mabl.com');
|
|
53
53
|
}
|
|
54
54
|
return true;
|
|
55
55
|
});
|
|
@@ -33,14 +33,14 @@ exports.builder = (yargs) => {
|
|
|
33
33
|
nargs: 1,
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
exports.handler = util_1.failWrapper(queryDeployments);
|
|
36
|
+
exports.handler = (0, util_1.failWrapper)(queryDeployments);
|
|
37
37
|
async function queryDeployments(parsed) {
|
|
38
38
|
var _a;
|
|
39
39
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
40
40
|
try {
|
|
41
41
|
const environment = await apiClient.getEnvironment(parsed.id);
|
|
42
42
|
const deploymentEntities = await apiClient.queryDeploymentEntities((_a = environment.organization_id) !== null && _a !== void 0 ? _a : '', environment.id, parsed[constants_1.CommandArgApplicationId], parsed.limit);
|
|
43
|
-
describe_1.outputEntity(deploymentEntities.deployments, parsed.output);
|
|
43
|
+
(0, describe_1.outputEntity)(deploymentEntities.deployments, parsed.output);
|
|
44
44
|
}
|
|
45
45
|
catch (error) {
|
|
46
46
|
throw new Error(`Error listing urls for environment ${parsed.id}: ${error}`);
|