@mablhq/mabl-cli 1.50.4 → 1.51.6

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.
@@ -4,13 +4,11 @@ exports.DefaultBrowserEngine = exports.BrowserTypeToBrowserEngine = void 0;
4
4
  const browserTypes_1 = require("../commands/browserTypes");
5
5
  const chromiumBrowserEngine_1 = require("./chromiumBrowserEngine");
6
6
  const firefoxBrowserEngine_1 = require("./firefoxBrowserEngine");
7
- const unsupportedBrowserEngine_1 = require("./unsupportedBrowserEngine");
8
7
  const webkitBrowerEngine_1 = require("./webkitBrowerEngine");
9
8
  exports.BrowserTypeToBrowserEngine = {
10
9
  [browserTypes_1.BrowserType.Chrome]: new chromiumBrowserEngine_1.ChromiumBrowserEngine(),
11
10
  [browserTypes_1.BrowserType.Edge]: new chromiumBrowserEngine_1.ChromiumBrowserEngine(),
12
11
  [browserTypes_1.BrowserType.Firefox]: new firefoxBrowserEngine_1.FirefoxBrowserEngine(),
13
- [browserTypes_1.BrowserType.Safari]: new unsupportedBrowserEngine_1.UnsupportedBrowserEngine(),
14
12
  [browserTypes_1.BrowserType.Webkit]: new webkitBrowerEngine_1.WebkitBrowserEngine(),
15
13
  };
16
14
  exports.DefaultBrowserEngine = exports.BrowserTypeToBrowserEngine[browserTypes_1.BrowserType.Chrome];
@@ -6,18 +6,12 @@ var BrowserType;
6
6
  BrowserType["Chrome"] = "chrome";
7
7
  BrowserType["Edge"] = "edge";
8
8
  BrowserType["Firefox"] = "firefox";
9
- BrowserType["InternetExplorer"] = "internet_explorer";
10
- BrowserType["Safari"] = "safari";
11
9
  BrowserType["Webkit"] = "webkit";
12
10
  })(BrowserType = exports.BrowserType || (exports.BrowserType = {}));
13
11
  exports.SupportedBrowserTypeProperties = {
14
12
  chrome: { browserName: 'chrome', browserReleaseChannel: 'chrome' },
15
13
  edge: { browserName: 'edge', browserReleaseChannel: 'msedge' },
16
14
  firefox: { browserName: 'firefox', browserReleaseChannel: 'firefox' },
17
- safari: {
18
- browserName: 'safari',
19
- browserReleaseChannel: 'webkit',
20
- },
21
15
  webkit: {
22
16
  browserName: 'webkit',
23
17
  browserReleaseChannel: 'webkit',
@@ -115,8 +115,9 @@ exports.BrowserTypeSelections = [
115
115
  browserTypes_1.BrowserType.Chrome,
116
116
  browserTypes_1.BrowserType.Edge,
117
117
  browserTypes_1.BrowserType.Firefox,
118
- browserTypes_1.BrowserType.InternetExplorer,
119
- browserTypes_1.BrowserType.Safari,
118
+ 'internet_explorer',
119
+ 'safari',
120
+ browserTypes_1.BrowserType.Webkit,
120
121
  ].map((browser) => browser.toString());
121
122
  exports.ValidBrowserTypesForLocalRuns = [
122
123
  browserTypes_1.BrowserType.Chrome,
@@ -18,7 +18,7 @@ exports.builder = (yargs) => {
18
18
  })
19
19
  .option(constants_1.CommandArgFormat, {
20
20
  alias: 'fmt',
21
- default: constants_1.OutputFormats.Yaml,
21
+ default: constants_1.OutputFormats.Json,
22
22
  describe: `Specify a format for the DataTable export`,
23
23
  choices: [constants_1.OutputFormats.Json, constants_1.OutputFormats.Yaml, constants_1.OutputFormats.Csv],
24
24
  });
@@ -6,7 +6,7 @@ const util_1 = require("../../commandUtil/util");
6
6
  const constants_1 = require("../../constants");
7
7
  const pureUtil_1 = require("../../../util/pureUtil");
8
8
  const utils_1 = require("../utils");
9
- const mablscript_utils_1 = require("@mabl/mablscript-find/dist/dom-util/mablscript-utils");
9
+ const domUtil_1 = require("../../../domUtil");
10
10
  exports.command = `update <${constants_1.CommandArgId}> <${constants_1.CommandArgInput}>`;
11
11
  exports.describe = 'Update a mabl DataTable';
12
12
  exports.builder = (yargs) => {
@@ -70,7 +70,7 @@ function buildUpdateRequest(scenarios, dataTable) {
70
70
  throw Error('All scenarios must have the same number of variables.');
71
71
  }
72
72
  (_c = scenario.variables) === null || _c === void 0 ? void 0 : _c.forEach((variable, index) => {
73
- if (!(0, mablscript_utils_1.isValidUserVariableName)(variable.name)) {
73
+ if (!(0, domUtil_1.isValidUserVariableName)(variable.name)) {
74
74
  throw Error(`Invalid variable name: ${variable.name}. Variable names must start with a letter or underscore (_) followed by letters, numbers, and underscores and cannot be "user", "web", or "mail"`);
75
75
  }
76
76
  if (variable.name !== validationVariables[index].name) {
@@ -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.variableRowAsScenario = exports.scenarioAsVariableRow = exports.dataTableAsVariableTable = exports.isScenarioArray = exports.inferFileFormat = exports.jsonToScenarios = exports.parseJsonScenarios = exports.csvScenarioFormatToScenarios = exports.parseCsvScenarios = exports.sanitizeCsvCellInput = void 0;
6
+ exports.variableRowAsScenario = exports.scenarioAsVariableRow = exports.dataTableAsVariableTable = exports.isScenarioArray = exports.inferFileFormat = exports.jsonToScenarios = exports.parseJsonScenarios = exports.csvScenarioFormatToScenarios = exports.parseCsvScenarios = exports.desanitizeCsvCellOutput = exports.sanitizeCsvCellInput = void 0;
7
7
  const constants_1 = require("../constants");
8
8
  const path_1 = require("path");
9
9
  const fs_1 = __importDefault(require("fs"));
@@ -11,16 +11,23 @@ const csv_parser_1 = __importDefault(require("csv-parser"));
11
11
  const MALICIOUS_LINE_PREFIX_MATCHER = /^([+\-@=])/;
12
12
  const SANITIZED_LINE_PREFIX_MATCHER = /^(`[+\-@=])/;
13
13
  function sanitizeCsvCellInput(input) {
14
+ if (!input) {
15
+ return '';
16
+ }
14
17
  return MALICIOUS_LINE_PREFIX_MATCHER.test(input)
15
18
  ? `\`${input}`.trim()
16
19
  : input.trim();
17
20
  }
18
21
  exports.sanitizeCsvCellInput = sanitizeCsvCellInput;
19
22
  function desanitizeCsvCellOutput(input) {
23
+ if (!input) {
24
+ return '';
25
+ }
20
26
  return SANITIZED_LINE_PREFIX_MATCHER.test(input)
21
27
  ? input.slice(1).trim()
22
28
  : input.trim();
23
29
  }
30
+ exports.desanitizeCsvCellOutput = desanitizeCsvCellOutput;
24
31
  var AllowedInputExtensions;
25
32
  (function (AllowedInputExtensions) {
26
33
  AllowedInputExtensions["Csv"] = ".csv";
@@ -38,7 +38,8 @@ async function getDeployment(parsed) {
38
38
  break;
39
39
  default:
40
40
  if (deployment.run_result) {
41
- delete deployment.run_result.executions;
41
+ const { executions, ...rest } = deployment.run_result;
42
+ deployment.run_result = rest;
42
43
  }
43
44
  delete deployment.triggered_plan_run_summaries;
44
45
  const workspaceId = await (0, util_1.getWorkspaceIdFromAppOrEnv)(apiClient, deployment.application_id, deployment.environment_id);
@@ -104,12 +104,12 @@ function getDefaultLogMetadataForInfo(testId, testInvariantId) {
104
104
  exports.getDefaultLogMetadataForInfo = getDefaultLogMetadataForInfo;
105
105
  function createAssertFailureMessage(assertFailure) {
106
106
  if (assertFailure) {
107
- const { reason, expected, found, continueOnFailure } = assertFailure;
107
+ const { reason, expected, found, onFailure } = assertFailure;
108
108
  return {
109
109
  reason,
110
110
  expected: (0, pureUtil_1.stringifyIfPresent)(expected),
111
111
  found: (0, pureUtil_1.stringifyIfPresent)(found),
112
- continueOnFailure,
112
+ onFailure,
113
113
  };
114
114
  }
115
115
  return;