@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.
@@ -75,6 +75,8 @@ class BasicApiClient {
75
75
  case types_1.AuthType.Bearer:
76
76
  config.headers.authorization = `Bearer ${options.token}`;
77
77
  break;
78
+ case types_1.AuthType.None:
79
+ break;
78
80
  default:
79
81
  throw new Error(`Unhandled auth type [${options.authType}`);
80
82
  }
package/api/types.js CHANGED
@@ -5,4 +5,5 @@ var AuthType;
5
5
  (function (AuthType) {
6
6
  AuthType[AuthType["Bearer"] = 0] = "Bearer";
7
7
  AuthType[AuthType["ApiKey"] = 1] = "ApiKey";
8
+ AuthType[AuthType["None"] = 2] = "None";
8
9
  })(AuthType = exports.AuthType || (exports.AuthType = {}));
@@ -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) => header
95
- .split(':', 2)
96
- .map((part) => part.trim())
97
- .join(':');
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
- variables = (0, util_1.validateValuePairInputs)('Variable', variables);
92
- return variables.reduce((variablesObject, item) => {
93
- const parts = item.split(':', 2);
94
- variablesObject[parts[0]] = parts[1];
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
  });