@mablhq/mabl-cli 1.13.21 → 1.16.16

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.
Files changed (38) hide show
  1. package/api/basicApiClient.js +56 -32
  2. package/api/featureSet.js +27 -0
  3. package/api/mablApiClient.js +22 -21
  4. package/api/mablApiClientFactory.js +0 -8
  5. package/browserLauncher/pageEvent.js +1 -0
  6. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +3 -0
  7. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +2 -0
  8. package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +12 -0
  9. package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +6 -0
  10. package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +10 -0
  11. package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +12 -0
  12. package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +6 -0
  13. package/commands/applications/applications_cmds/list.js +5 -2
  14. package/commands/branches/branches_cmds/list.js +5 -2
  15. package/commands/config/config_cmds/get.js +5 -2
  16. package/commands/config/config_cmds/list.js +5 -2
  17. package/commands/credentials/credentials_cmds/list.js +5 -2
  18. package/commands/deploy/deploy_cmds/executionResultPresenter.js +5 -2
  19. package/commands/deploy/deploy_cmds/list.js +5 -2
  20. package/commands/environments/environments_cmds/list.js +5 -2
  21. package/commands/flows/flows_cmds/list.js +5 -2
  22. package/commands/plans/plans_cmds/list.js +5 -2
  23. package/commands/tests/executionUtil.js +6 -1
  24. package/commands/tests/testsUtil.js +8 -23
  25. package/commands/tests/tests_cmds/list.js +5 -2
  26. package/commands/tests/tests_cmds/trainer_cmds/trainerUtil.js +2 -2
  27. package/commands/workspaces/workspace_cmds/list.js +5 -2
  28. package/domUtil/index.js +1 -1
  29. package/execution/index.js +1 -1
  30. package/execution/index.js.LICENSE.txt +0 -6
  31. package/mablApi/index.js +1 -1
  32. package/mablscript/MablStep.js +3 -0
  33. package/mablscript/steps/AccessibilityCheck.js +14 -2
  34. package/mablscriptFind/index.js +1 -1
  35. package/package.json +3 -3
  36. package/resources/mablFind.js +1 -1
  37. package/util/resourceUtil.js +39 -13
  38. package/api/entities/JourneyRunScheduledMessage.js +0 -2
@@ -22,15 +22,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.findNodeModulesDirectory = exports.findDirectory = exports.findResource = void 0;
23
23
  const path = __importStar(require("path"));
24
24
  const fs = __importStar(require("fs"));
25
- function findResource(pathInResource) {
26
- const unpackedPath = path.normalize(path.resolve(`${__dirname}/../../resources/${pathInResource}`));
27
- const packedPath = path.normalize(path.resolve(`${__dirname}/../resources/${pathInResource}`));
28
- if (fs.existsSync(unpackedPath)) {
29
- return unpackedPath;
25
+ function findResource(pathInResource, resourcesPathOverride) {
26
+ const pathsToCheck = [];
27
+ if (resourcesPathOverride) {
28
+ pathsToCheck.push(`${resourcesPathOverride}/${pathInResource}`);
30
29
  }
31
- return packedPath;
30
+ pathsToCheck.push(`${__dirname}/../../resources/${pathInResource}`);
31
+ pathsToCheck.push(`${__dirname}/../resources/${pathInResource}`);
32
+ const foundPath = pathsToCheck
33
+ .map((p) => path.normalize(path.resolve(p)))
34
+ .find(safeExistSync);
35
+ if (foundPath) {
36
+ return foundPath;
37
+ }
38
+ return path.normalize(pathsToCheck[0]);
32
39
  }
33
40
  exports.findResource = findResource;
41
+ function safeExistSync(path) {
42
+ try {
43
+ return fs.existsSync(path);
44
+ }
45
+ catch {
46
+ return false;
47
+ }
48
+ }
34
49
  function findDirectory(pathFromBase) {
35
50
  const unpackedPath = path.normalize(path.resolve(`${__dirname}/../../${pathFromBase}`));
36
51
  const packedPath = path.normalize(path.resolve(`${__dirname}/../${pathFromBase}`));
@@ -40,20 +55,31 @@ function findDirectory(pathFromBase) {
40
55
  return packedPath;
41
56
  }
42
57
  exports.findDirectory = findDirectory;
58
+ const CLI_NAMES = [
59
+ 'mabl-cli',
60
+ 'mabl-cli-dev',
61
+ 'mabl-cli-internal',
62
+ 'mabl-cli-internal-unpacked',
63
+ ];
43
64
  function findNodeModulesDirectory() {
44
65
  const unpackedPath = path.normalize(path.resolve(`${__dirname}/../../../node_modules`));
45
66
  if (fs.existsSync(unpackedPath)) {
46
67
  return unpackedPath;
47
68
  }
48
- const packedAsMabltronDependency = path.normalize(path.resolve(`${__dirname}/../../mabl-cli-internal/node_modules/`));
49
- if (fs.existsSync(packedAsMabltronDependency)) {
50
- return packedAsMabltronDependency;
51
- }
52
- const packedAsExecutionEngineDependency = path.normalize(path.resolve(`${__dirname}/../../mabl-cli-internal-unpacked/node_modules/`));
53
- if (fs.existsSync(packedAsExecutionEngineDependency)) {
54
- return packedAsExecutionEngineDependency;
69
+ for (const cliName of CLI_NAMES) {
70
+ const foundPath = checkForPackedPath(cliName);
71
+ if (foundPath) {
72
+ return foundPath;
73
+ }
55
74
  }
56
75
  const packedPath = path.normalize(path.resolve(`${__dirname}/../../node_modules`));
57
76
  return packedPath;
58
77
  }
59
78
  exports.findNodeModulesDirectory = findNodeModulesDirectory;
79
+ function checkForPackedPath(cliName) {
80
+ const packedCheckPath = path.normalize(path.resolve(`${__dirname}/../../${cliName}/node_modules/`));
81
+ if (fs.existsSync(packedCheckPath)) {
82
+ return packedCheckPath;
83
+ }
84
+ return;
85
+ }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });