@mablhq/mabl-cli 1.29.0 → 1.29.11
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
CHANGED
package/api/types.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateValuePairInputs = exports.validateArrayInputs = exports.getWorkspaceIdFromAppOrEnv = exports.getJourneyFlowArray = exports.TEST_INFO_NOT_FOUND = exports.getWorkspaceId = exports.failWrapper = exports.getDescribeDescriptions = void 0;
|
|
6
|
+
exports.parseColinJoinedVariablePair = exports.validateValuePairInputs = exports.validateArrayInputs = exports.getWorkspaceIdFromAppOrEnv = exports.getJourneyFlowArray = exports.TEST_INFO_NOT_FOUND = exports.getWorkspaceId = exports.failWrapper = exports.getDescribeDescriptions = void 0;
|
|
7
7
|
const cliConfigProvider_1 = require("../../providers/cliConfigProvider");
|
|
8
8
|
const constants_1 = require("../constants");
|
|
9
9
|
const loggingProvider_1 = require("../../providers/logging/loggingProvider");
|
|
@@ -91,10 +91,10 @@ function validateValuePairInputs(inputName, inputs) {
|
|
|
91
91
|
}
|
|
92
92
|
const wrappingWhitespace = inputs.filter((header) => !/^([^\s:]{1,2}|[^\s:][^:]+[^\s:]):([^\s:]{1,2}|[^\s:][^:]+[^\s:])?$/m.test(header));
|
|
93
93
|
if (wrappingWhitespace.length > 0) {
|
|
94
|
-
const cleanFunction = (header) =>
|
|
95
|
-
|
|
96
|
-
.map((part) => part.trim())
|
|
97
|
-
|
|
94
|
+
const cleanFunction = (header) => {
|
|
95
|
+
const { name, value } = parseColinJoinedVariablePair(header);
|
|
96
|
+
return [name, value].map((part) => part.trim()).join(':');
|
|
97
|
+
};
|
|
98
98
|
const cleaned = inputs.map(cleanFunction);
|
|
99
99
|
const cleanedAffectedHeaders = wrappingWhitespace.map(cleanFunction);
|
|
100
100
|
loggingProvider_1.logger.info(chalk.yellow.bold(`${inputName} wrapping whitespace detected. Whitespace has been trimmed to [`) +
|
|
@@ -106,3 +106,9 @@ function validateValuePairInputs(inputName, inputs) {
|
|
|
106
106
|
return inputs;
|
|
107
107
|
}
|
|
108
108
|
exports.validateValuePairInputs = validateValuePairInputs;
|
|
109
|
+
function parseColinJoinedVariablePair(input) {
|
|
110
|
+
const name = input.substring(0, input.indexOf(':'));
|
|
111
|
+
const value = input.substring(input.indexOf(':') + 1);
|
|
112
|
+
return { name, value };
|
|
113
|
+
}
|
|
114
|
+
exports.parseColinJoinedVariablePair = parseColinJoinedVariablePair;
|
|
@@ -88,10 +88,10 @@ function addUpdateEnvCommands(argv) {
|
|
|
88
88
|
return undefined;
|
|
89
89
|
}
|
|
90
90
|
(0, util_1.validateArrayInputs)(variables, 'Variables must be SPACE delimited, e.g. --variables foo:bar baz:qux');
|
|
91
|
-
|
|
92
|
-
return
|
|
93
|
-
const
|
|
94
|
-
variablesObject[
|
|
91
|
+
const validVariables = (0, util_1.validateValuePairInputs)('Variable', variables);
|
|
92
|
+
return validVariables.reduce((variablesObject, item) => {
|
|
93
|
+
const { name, value } = (0, util_1.parseColinJoinedVariablePair)(item);
|
|
94
|
+
variablesObject[name] = value;
|
|
95
95
|
return variablesObject;
|
|
96
96
|
}, {});
|
|
97
97
|
});
|