@mablhq/mabl-cli 1.21.7 → 1.22.1

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 (34) hide show
  1. package/api/mablApiClient.js +72 -53
  2. package/api/mablApiClientFactory.js +3 -3
  3. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +1 -0
  4. package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +77 -39
  5. package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +4 -0
  6. package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +1 -1
  7. package/cli.js +2 -0
  8. package/commands/config/config_cmds/configKeys.js +12 -1
  9. package/commands/config/config_cmds/set.js +6 -0
  10. package/commands/constants.js +3 -2
  11. package/commands/flows/flows_cmds/export.js +1 -1
  12. package/commands/internal/internal.js +6 -0
  13. package/commands/link-agents/link-agents_cmds/list.js +131 -0
  14. package/commands/link-agents/link-agents_cmds/terminate.js +31 -0
  15. package/commands/tests/testsUtil.js +18 -2
  16. package/commands/tests/tests_cmds/export.js +1 -1
  17. package/core/messaging/messaging.js +11 -1
  18. package/domUtil/index.js +1 -1
  19. package/domUtil/index.js.LICENSE.txt +2 -2
  20. package/env/defaultEnv.js +2 -1
  21. package/env/dev.js +2 -1
  22. package/env/env.js +3 -1
  23. package/env/local.js +2 -1
  24. package/env/prod.js +2 -1
  25. package/execution/index.js +1 -1
  26. package/execution/index.js.LICENSE.txt +2 -2
  27. package/mablscript/steps/SyntheticStep.js +20 -0
  28. package/mablscriptFind/index.js +1 -1
  29. package/mablscriptFind/index.js.LICENSE.txt +2 -2
  30. package/package.json +1 -1
  31. package/providers/authenticationProvider.js +1 -1
  32. package/providers/cliConfigProvider.js +20 -8
  33. package/resources/mablFind.js +1 -1
  34. package/util/httpUtil.js +3 -2
@@ -8,14 +8,14 @@
8
8
  */
9
9
 
10
10
  /**
11
- * @license Complex.js v2.0.15 12/05/2020
11
+ * @license Complex.js v2.1.1 12/05/2020
12
12
  *
13
13
  * Copyright (c) 2020, Robert Eisele (robert@xarg.org)
14
14
  * Dual licensed under the MIT or GPL Version 2 licenses.
15
15
  **/
16
16
 
17
17
  /**
18
- * @license Fraction.js v4.1.3 23/05/2021
18
+ * @license Fraction.js v4.2.0 05/03/2022
19
19
  * https://www.xarg.org/2014/03/rational-numbers-in-javascript/
20
20
  *
21
21
  * Copyright (c) 2021, Robert Eisele (robert@xarg.org)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mablhq/mabl-cli",
3
- "version": "1.21.7",
3
+ "version": "1.22.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "The official mabl command line interface tool",
6
6
  "main": "index.js",
@@ -40,7 +40,7 @@ class AuthenticationProvider {
40
40
  return authConfig;
41
41
  }
42
42
  async maybeRenewAuthentication(authConfig) {
43
- if (!authConfig.refreshToken) {
43
+ if (!authConfig.refreshToken || authConfig.authType === types_1.AuthType.ApiKey) {
44
44
  if (this.verbose) {
45
45
  loggingProvider_1.logger.info(`Authentication refresh token ${chalk.red.bold('Not Found')}`);
46
46
  }
@@ -136,6 +136,10 @@ class CliConfigProvider {
136
136
  static async getWorkspace() {
137
137
  return (await getAuthConfigFile()).get(WORKSPACE);
138
138
  }
139
+ static async getProxyMode() {
140
+ const proxyMode = await this.getConfigProperty(configKeys_1.configKeys.proxyMode);
141
+ return (0, configKeys_1.isValidProxyMode)(proxyMode) ? proxyMode : 'mabl';
142
+ }
139
143
  static getConfigProperty(key) {
140
144
  return getValue(propertyKeyToStoredKey(key));
141
145
  }
@@ -166,13 +170,6 @@ class CliConfigProvider {
166
170
  const httpConfig = {
167
171
  sslVerify: httpUtil_1.EXECUTION_ENGINE_SSL_VERIFY,
168
172
  };
169
- const proxyHostValue = await this.getConfigProperty(configKeys_1.configKeys.proxy);
170
- if (proxyHostValue) {
171
- if (typeof proxyHostValue !== 'string') {
172
- throw new Error('Invalid proxy host value');
173
- }
174
- httpConfig.proxyHost = new URL(proxyHostValue);
175
- }
176
173
  const sslVerifyValue = await this.getConfigProperty(configKeys_1.configKeys.sslVerify);
177
174
  if (sslVerifyValue !== undefined) {
178
175
  if (typeof sslVerifyValue !== 'boolean') {
@@ -180,13 +177,28 @@ class CliConfigProvider {
180
177
  }
181
178
  httpConfig.sslVerify = sslVerifyValue;
182
179
  }
180
+ const mablHttpConfig = { ...httpConfig };
181
+ const testHttpConfig = { ...httpConfig };
182
+ const proxyHostValue = await this.getConfigProperty(configKeys_1.configKeys.proxy);
183
+ const proxyMode = await this.getProxyMode();
184
+ if (proxyHostValue) {
185
+ if (typeof proxyHostValue !== 'string') {
186
+ throw new Error('Invalid proxy host value');
187
+ }
188
+ if (proxyMode === 'mabl' || proxyMode === 'all') {
189
+ mablHttpConfig.proxyHost = new URL(proxyHostValue);
190
+ }
191
+ if (proxyMode === 'test' || proxyMode === 'all') {
192
+ testHttpConfig.proxyHost = new URL(proxyHostValue);
193
+ }
194
+ }
183
195
  return {
184
196
  authentication,
185
197
  userId: config.get(USER_ID_NAME),
186
198
  email: config.get(EMAIL_NAME),
187
199
  userFullName: config.get(USER_FULL_NAME_NAME),
188
200
  workspace: config.get(WORKSPACE),
189
- http: httpConfig,
201
+ http: { mabl: mablHttpConfig, test: testHttpConfig },
190
202
  };
191
203
  }
192
204
  static clearAuthConfig() {