@mablhq/mabl-cli 2.51.28 → 2.51.32

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.
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isMablSymbolObject = exports.formatSymbol = exports.MablSymbol = exports.SINGLE_VARIABLE_PATTERN_REGEX = exports.VARIABLE_PATTERN_REGEX = void 0;
4
- exports.VARIABLE_PATTERN_REGEX = /{{@([_.a-zA-Z0-9]+)}}/g;
5
- exports.SINGLE_VARIABLE_PATTERN_REGEX = /^{{@([_.a-zA-Z0-9]+)}}$/;
4
+ exports.VARIABLE_PATTERN_REGEX = /{{@([_.a-zA-Z0-9\[\]]+)}}/g;
5
+ exports.SINGLE_VARIABLE_PATTERN_REGEX = /^{{@([_.a-zA-Z0-9\[\]]+)}}$/;
6
6
  class MablSymbol {
7
7
  constructor(fullyQualifiedName) {
8
8
  this.name = fullyQualifiedName;
@@ -12,6 +12,7 @@ const domUtil_1 = require("../../domUtil");
12
12
  const JavaScriptAction_1 = require("../actions/JavaScriptAction");
13
13
  const GetUrlAction_1 = require("../actions/GetUrlAction");
14
14
  const ConditionDescriptor_1 = require("../types/ConditionDescriptor");
15
+ const GetViewportAction_1 = require("../actions/GetViewportAction");
15
16
  class IfConditionStep extends MablStep_1.MablStep {
16
17
  constructor(name, args, actions) {
17
18
  super(name, args, actions, 'conditional_if');
@@ -22,12 +23,20 @@ class IfConditionStep extends MablStep_1.MablStep {
22
23
  if (candidatePrimaryActions.length > 1) {
23
24
  throw new Error(`Too many primary actions. Only one primary action is allowed of: Find, Get Url, Get Variable, or Javascript actions`);
24
25
  }
25
- if (candidatePrimaryActions[0] === undefined) {
26
- throw new Error(`At least one primary action is required: Find, Get Url, Get Variable, or Javascript action.`);
27
- }
28
- this.primaryAction = candidatePrimaryActions[0];
29
26
  this.conditionAction = actions.find((action) => action instanceof ConditionAction_1.ConditionAction);
30
27
  this.extractAction = actions.find((action) => action instanceof ExtractAction_1.ExtractAction);
28
+ if (candidatePrimaryActions[0] === undefined) {
29
+ if (this.conditionAction !== undefined &&
30
+ (0, ConditionDescriptor_1.isAIPromptCondition)(this.conditionAction.conditionDescriptor)) {
31
+ this.primaryAction = new GetViewportAction_1.GetViewportAction();
32
+ }
33
+ else {
34
+ throw new Error(`At least one primary action is required: Find, Get Url, Get Variable, or Javascript action.`);
35
+ }
36
+ }
37
+ else {
38
+ this.primaryAction = candidatePrimaryActions[0];
39
+ }
31
40
  }
32
41
  getStepName() {
33
42
  return 'If';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mablhq/mabl-cli",
3
- "version": "2.51.28",
3
+ "version": "2.51.32",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "The official mabl command line interface tool",
6
6
  "main": "index.js",
package/util/runUtil.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getExpectedDeploymentType = void 0;
3
+ exports.isDeploymentMatchByType = exports.getExpectedDeploymentType = void 0;
4
4
  const mablApi_1 = require("../mablApi");
5
5
  function getExpectedDeploymentType(testType) {
6
6
  switch (testType) {
@@ -13,3 +13,9 @@ function getExpectedDeploymentType(testType) {
13
13
  }
14
14
  }
15
15
  exports.getExpectedDeploymentType = getExpectedDeploymentType;
16
+ function isDeploymentMatchByType(deployment, expectedDeploymentType) {
17
+ return (deployment.deployment_type === expectedDeploymentType ||
18
+ (!deployment.deployment_type &&
19
+ expectedDeploymentType === mablApi_1.Deployment.DeploymentTypeEnum.WebApplication));
20
+ }
21
+ exports.isDeploymentMatchByType = isDeploymentMatchByType;