@gatling.io/cli 3.13.402 → 3.13.501

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gatling.io/cli",
3
- "version": "3.13.402",
3
+ "version": "3.13.501",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://gatling.io",
6
6
  "repository": "github:gatling/gatling-js",
@@ -27,8 +27,8 @@
27
27
  "archiver": "7.0.1",
28
28
  "node-stream-zip": "1.15.0",
29
29
  "commander": "13.1.0",
30
- "esbuild": "0.25.0",
31
- "esbuild-plugin-tsc": "0.4.0",
30
+ "esbuild": "0.25.1",
31
+ "esbuild-plugin-tsc": "0.5.0",
32
32
  "import-meta-resolve": "4.1.0",
33
33
  "make-fetch-happen": "14.0.3",
34
34
  "readline-sync": "1.4.10"
@@ -36,11 +36,11 @@
36
36
  "devDependencies": {
37
37
  "@types/archiver": "6.0.3",
38
38
  "@types/make-fetch-happen": "10.0.4",
39
- "@types/node": "18.19.76",
39
+ "@types/node": "18.19.80",
40
40
  "@types/readline-sync": "1.4.8",
41
- "prettier": "3.5.2",
41
+ "prettier": "3.5.3",
42
42
  "rimraf": "6.0.1",
43
- "typescript": "5.7.3"
43
+ "typescript": "5.8.2"
44
44
  },
45
45
  "scripts": {
46
46
  "clean": "rimraf target",
@@ -22,6 +22,8 @@ exports.default = (program) => {
22
22
  .addOption(options_1.apiTokenOption)
23
23
  // Plugin configuration
24
24
  .addOption(options_1.controlPlaneUrlOption)
25
+ .addOption(options_1.trustStoreOption)
26
+ .addOption(options_1.trustStorePasswordOption)
25
27
  .addOption(options_1.nonInteractiveOption)
26
28
  // Descriptor file
27
29
  .addOption(options_1.packageDescriptorFilenameOption)
@@ -40,6 +42,8 @@ exports.default = (program) => {
40
42
  const webAppUrl = (0, options_1.webAppUrlOptionValue)(options);
41
43
  const apiToken = (0, options_1.apiTokenOptionValue)(options);
42
44
  const controlPlaneUrl = (0, options_1.controlPlaneUrlOptionValue)(options);
45
+ const trustStore = (0, options_1.trustStoreOptionValue)(options);
46
+ const trustStorePassword = (0, options_1.trustStorePasswordOptionValue)(options);
43
47
  const nonInteractive = (0, options_1.nonInteractiveOptionValue)(options);
44
48
  const packageDescriptorFilename = (0, options_1.packageDescriptorFilenameOptionValue)(options);
45
49
  const packageFile = (0, options_1.packageFileOptionValue)(options);
@@ -56,6 +60,8 @@ exports.default = (program) => {
56
60
  webAppUrl,
57
61
  apiToken,
58
62
  controlPlaneUrl,
63
+ trustStore,
64
+ trustStorePassword,
59
65
  nonInteractive,
60
66
  packageDescriptorFilename,
61
67
  packageFile
@@ -22,6 +22,8 @@ exports.default = (program) => {
22
22
  .addOption(options_1.apiTokenOption)
23
23
  // Plugin configuration
24
24
  .addOption(options_1.controlPlaneUrlOption)
25
+ .addOption(options_1.trustStoreOption)
26
+ .addOption(options_1.trustStorePasswordOption)
25
27
  .addOption(options_1.nonInteractiveOption)
26
28
  // Descriptor file
27
29
  .addOption(options_1.packageDescriptorFilenameOption)
@@ -45,6 +47,8 @@ exports.default = (program) => {
45
47
  const webAppUrl = (0, options_1.webAppUrlOptionValue)(options);
46
48
  const apiToken = (0, options_1.apiTokenOptionValue)(options);
47
49
  const controlPlaneUrl = (0, options_1.controlPlaneUrlOptionValue)(options);
50
+ const trustStore = (0, options_1.trustStoreOptionValue)(options);
51
+ const trustStorePassword = (0, options_1.trustStorePasswordOptionValue)(options);
48
52
  const nonInteractive = (0, options_1.nonInteractiveOptionValue)(options);
49
53
  const packageDescriptorFilename = (0, options_1.packageDescriptorFilenameOptionValue)(options);
50
54
  const packageFile = (0, options_1.packageFileOptionValue)(options);
@@ -68,6 +72,8 @@ exports.default = (program) => {
68
72
  webAppUrl,
69
73
  apiToken,
70
74
  controlPlaneUrl,
75
+ trustStore,
76
+ trustStorePassword,
71
77
  nonInteractive,
72
78
  packageDescriptorFilename,
73
79
  packageFile,
@@ -39,6 +39,10 @@ export declare const apiTokenOption: Option;
39
39
  export declare const apiTokenOptionValue: (options: any) => string | undefined;
40
40
  export declare const controlPlaneUrlOption: Option;
41
41
  export declare const controlPlaneUrlOptionValue: (options: any) => string | undefined;
42
+ export declare const trustStoreOption: Option;
43
+ export declare const trustStoreOptionValue: (options: any) => string | undefined;
44
+ export declare const trustStorePasswordOption: Option;
45
+ export declare const trustStorePasswordOptionValue: (options: any) => string | undefined;
42
46
  export declare const packageDescriptorFilenameOption: Option;
43
47
  export declare const packageDescriptorFilenameOptionValue: (options: any) => string;
44
48
  export declare const enterpriseSimulationOption: Option;
@@ -3,7 +3,8 @@ 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.waitForRunEndOptionValue = exports.waitForRunEndOption = exports.runDescriptionOptionValue = exports.runDescriptionOption = exports.runTitleOptionValue = exports.runTitleOption = exports.enterpriseSimulationOptionValue = exports.enterpriseSimulationOption = exports.packageDescriptorFilenameOptionValue = exports.packageDescriptorFilenameOption = exports.controlPlaneUrlOptionValue = exports.controlPlaneUrlOption = exports.apiTokenOptionValue = exports.apiTokenOption = exports.webAppUrlOptionValue = exports.webAppUrlOption = exports.apiUrlOptionValue = exports.apiUrlOption = exports.bundleFileArgument = exports.parseRunParametersArgument = exports.runParametersArgument = exports.postmanOptionValueWithDefaults = exports.postmanOption = exports.nonInteractiveOptionValue = exports.nonInteractiveOption = exports.memoryOptionValue = exports.memoryOption = exports.jvmClasspathMandatoryOptionValue = exports.jvmClasspathMandatoryOption = exports.graalvmHomeMandatoryOptionValue = exports.graalvmHomeMandatoryOption = exports.typescriptOptionValueWithDefaults = exports.typescriptOption = exports.resultsFolderOptionValue = exports.resultsFolderOption = exports.resourcesFolderOptionValue = exports.resourcesFolderOption = exports.packageFileOptionValue = exports.packageFileOption = exports.bundleFileOptionValue = exports.bundleFileOption = exports.simulationMandatoryOptionValue = exports.simulationMandatoryOption = exports.simulationOptionValueWithDefaults = exports.simulationOption = exports.sourcesFolderOptionValue = exports.sourcesFolderOption = exports.gatlingHomeOptionValueWithDefaults = exports.gatlingHomeOption = void 0;
6
+ exports.runDescriptionOption = exports.runTitleOptionValue = exports.runTitleOption = exports.enterpriseSimulationOptionValue = exports.enterpriseSimulationOption = exports.packageDescriptorFilenameOptionValue = exports.packageDescriptorFilenameOption = exports.trustStorePasswordOptionValue = exports.trustStorePasswordOption = exports.trustStoreOptionValue = exports.trustStoreOption = exports.controlPlaneUrlOptionValue = exports.controlPlaneUrlOption = exports.apiTokenOptionValue = exports.apiTokenOption = exports.webAppUrlOptionValue = exports.webAppUrlOption = exports.apiUrlOptionValue = exports.apiUrlOption = exports.bundleFileArgument = exports.parseRunParametersArgument = exports.runParametersArgument = exports.postmanOptionValueWithDefaults = exports.postmanOption = exports.nonInteractiveOptionValue = exports.nonInteractiveOption = exports.memoryOptionValue = exports.memoryOption = exports.jvmClasspathMandatoryOptionValue = exports.jvmClasspathMandatoryOption = exports.graalvmHomeMandatoryOptionValue = exports.graalvmHomeMandatoryOption = exports.typescriptOptionValueWithDefaults = exports.typescriptOption = exports.resultsFolderOptionValue = exports.resultsFolderOption = exports.resourcesFolderOptionValue = exports.resourcesFolderOption = exports.packageFileOptionValue = exports.packageFileOption = exports.bundleFileOptionValue = exports.bundleFileOption = exports.simulationMandatoryOptionValue = exports.simulationMandatoryOption = exports.simulationOptionValueWithDefaults = exports.simulationOption = exports.sourcesFolderOptionValue = exports.sourcesFolderOption = exports.gatlingHomeOptionValueWithDefaults = exports.gatlingHomeOption = void 0;
7
+ exports.waitForRunEndOptionValue = exports.waitForRunEndOption = exports.runDescriptionOptionValue = void 0;
7
8
  const commander_1 = require("commander");
8
9
  const fs_1 = __importDefault(require("fs"));
9
10
  const os_1 = __importDefault(require("os"));
@@ -201,6 +202,10 @@ exports.apiTokenOptionValue = getStringValueOptional(exports.apiTokenOption);
201
202
  // Plugin configuration
202
203
  exports.controlPlaneUrlOption = new commander_1.Option("--control-plane-url <value>", "URL of a control plane for Gatling Enterprise providing a private repository. If this parameter is provided, packages will be registered as private packages and uploaded through this private control plane.");
203
204
  exports.controlPlaneUrlOptionValue = getStringValueOptional(exports.controlPlaneUrlOption);
205
+ exports.trustStoreOption = new commander_1.Option("--trust-store <value>", `Path to a trust store (in PKCS#12 or JKS format) used when calling remote APIs over HTTPS. Useful with the ${exports.controlPlaneUrlOption.long} option, if your control plane uses a certificate signed by an internal CA.`);
206
+ exports.trustStoreOptionValue = getStringValueOptional(exports.trustStoreOption);
207
+ exports.trustStorePasswordOption = new commander_1.Option("--trust-store-password <value>", `Use with the ${exports.trustStoreOption.long} option, if your trust store is protected by a password.`);
208
+ exports.trustStorePasswordOptionValue = getStringValueOptional(exports.trustStorePasswordOption);
204
209
  // Descriptor file
205
210
  exports.packageDescriptorFilenameOption = new commander_1.Option("--package-descriptor-filename <value>", "Path to a package descriptor inside the .gatling folder").default("package.conf");
206
211
  exports.packageDescriptorFilenameOptionValue = getStringValueMandatory(exports.packageDescriptorFilenameOption);
@@ -8,18 +8,12 @@ const make_fetch_happen_1 = __importDefault(require("make-fetch-happen"));
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const util_1 = __importDefault(require("util"));
10
10
  const stream_1 = __importDefault(require("stream"));
11
+ const proxy_1 = require("../proxy");
11
12
  const pipeline = util_1.default.promisify(stream_1.default.pipeline);
12
- const NPM_CONFIG_PROXY_KEY = "npm_config_proxy";
13
- const NPM_CONFIG_HTTPS_PROXY_KEY = "npm_config_https_proxy";
14
- const NPM_CONFIG_NOPROXY_KEY = "npm_config_noproxy";
15
- const fetchOptionsFromNpmConfiguration = () => {
16
- const proxy = process.env[NPM_CONFIG_HTTPS_PROXY_KEY] || process.env[NPM_CONFIG_PROXY_KEY] || undefined;
17
- const noProxy = process.env[NPM_CONFIG_NOPROXY_KEY] || undefined;
18
- return {
19
- proxy,
20
- noProxy
21
- };
22
- };
13
+ const fetchOptionsFromNpmConfiguration = () => ({
14
+ proxy: proxy_1.proxyConfiguration.httpsProxyUrl || proxy_1.proxyConfiguration.proxyUrl,
15
+ noProxy: proxy_1.proxyConfiguration.noProxyHosts
16
+ });
23
17
  const downloadFile = async (url, targetFile) => {
24
18
  const options = fetchOptionsFromNpmConfiguration();
25
19
  const response = await (0, make_fetch_happen_1.default)(url, options);
@@ -4,14 +4,14 @@ exports.versions = void 0;
4
4
  exports.versions = {
5
5
  graalvm: {
6
6
  jdk: "23.0.2",
7
- js: "24.1.2"
7
+ js: "24.2.0"
8
8
  },
9
9
  java: {
10
10
  compilerRelease: "21"
11
11
  },
12
12
  gatling: {
13
- core: "3.13.4",
14
- enterprisePluginCommons: "1.15.2",
15
- jsAdapter: "3.13.402"
13
+ core: "3.13.5",
14
+ enterprisePluginCommons: "1.16.0",
15
+ jsAdapter: "3.13.501"
16
16
  }
17
17
  };
@@ -16,6 +16,8 @@ export interface EnterprisePluginOptions extends RunJavaProcessOptions {
16
16
  webAppUrl: string;
17
17
  apiToken?: string;
18
18
  controlPlaneUrl?: string;
19
+ trustStore?: string;
20
+ trustStorePassword?: string;
19
21
  nonInteractive: boolean;
20
22
  }
21
23
  export interface EnterpriseDeployOptions extends EnterprisePluginOptions {
@@ -11,6 +11,7 @@ const zlib_1 = require("zlib");
11
11
  const dependencies_1 = require("./dependencies");
12
12
  const java_1 = require("./java");
13
13
  const log_1 = require("./log");
14
+ const proxy_1 = require("./proxy");
14
15
  const enterprisePackage = async (options) => {
15
16
  log_1.logger.info(`Packaging a Gatling simulation with options:
16
17
  - bundleFile: ${options.bundleFile}
@@ -123,6 +124,12 @@ const javaArgsFromPluginOptions = (options) => {
123
124
  if (options.controlPlaneUrl !== undefined) {
124
125
  javaArgs.push(`-Dgatling.enterprise.controlPlaneUrl=${options.controlPlaneUrl}`);
125
126
  }
127
+ if (options.trustStore !== undefined) {
128
+ javaArgs.push(`-Djavax.net.ssl.trustStore=${options.trustStore}`);
129
+ }
130
+ if (options.trustStore !== undefined && options.trustStorePassword !== undefined) {
131
+ javaArgs.push(`-Djavax.net.ssl.trustStorePassword=${options.trustStorePassword}`);
132
+ }
126
133
  javaArgs.push("-Dgatling.enterprise.buildTool=js-cli");
127
134
  javaArgs.push(`-Dgatling.enterprise.pluginVersion=${dependencies_1.versions.gatling.jsAdapter}`);
128
135
  if (options.nonInteractive) {
@@ -149,7 +156,7 @@ const enterpriseDeploy = async (options) => {
149
156
  log_1.logger.debug(" " + javaArgs[i]);
150
157
  }
151
158
  }
152
- return (0, java_1.runJavaProcess)(options, "io.gatling.plugin.cli.EnterpriseDeploy", additionalClasspathElements, javaArgs, []);
159
+ return (0, java_1.runJavaProcess)(options, "io.gatling.plugin.cli.EnterpriseDeploy", additionalClasspathElements, javaArgs, [], proxy_1.proxyConfiguration);
153
160
  };
154
161
  exports.enterpriseDeploy = enterpriseDeploy;
155
162
  const enterpriseStart = async (options) => {
@@ -174,6 +181,6 @@ const enterpriseStart = async (options) => {
174
181
  log_1.logger.debug(" " + javaArgs[i]);
175
182
  }
176
183
  }
177
- return (0, java_1.runJavaProcess)(options, "io.gatling.plugin.cli.EnterpriseStart", additionalClasspathElements, javaArgs, []);
184
+ return (0, java_1.runJavaProcess)(options, "io.gatling.plugin.cli.EnterpriseStart", additionalClasspathElements, javaArgs, [], proxy_1.proxyConfiguration);
178
185
  };
179
186
  exports.enterpriseStart = enterpriseStart;
package/target/java.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import { ProxyConfiguration } from "./proxy";
1
2
  export interface RunJavaProcessOptions {
2
3
  graalvmHome: string;
3
4
  jvmClasspath: string;
4
5
  }
5
- export declare const runJavaProcess: (options: RunJavaProcessOptions, mainClass: string, additionalClasspathElements: string[], javaArgs: string[], mainClassArgs: string[]) => Promise<void>;
6
+ export declare const runJavaProcess: (options: RunJavaProcessOptions, mainClass: string, additionalClasspathElements: string[], javaArgs: string[], mainClassArgs: string[], proxyConf?: ProxyConfiguration) => Promise<void>;
package/target/java.js CHANGED
@@ -4,10 +4,11 @@ exports.runJavaProcess = void 0;
4
4
  const child_process_1 = require("child_process");
5
5
  const os_1 = require("./dependencies/os");
6
6
  const log_1 = require("./log");
7
- const runJavaProcess = (options, mainClass, additionalClasspathElements, javaArgs, mainClassArgs) => {
7
+ const runJavaProcess = (options, mainClass, additionalClasspathElements, javaArgs, mainClassArgs, proxyConf) => {
8
8
  const command = `${options.graalvmHome}/bin/java`;
9
9
  const classpathSeparator = os_1.osType === "Windows_NT" ? ";" : ":";
10
10
  const classpath = [...additionalClasspathElements, options.jvmClasspath].join(classpathSeparator);
11
+ const proxyArgs = generateProxyArgs(proxyConf);
11
12
  const allArgs = [
12
13
  "-server",
13
14
  "-XX:+HeapDumpOnOutOfMemoryError",
@@ -16,6 +17,7 @@ const runJavaProcess = (options, mainClass, additionalClasspathElements, javaArg
16
17
  "-classpath",
17
18
  classpath,
18
19
  ...javaArgs,
20
+ ...proxyArgs,
19
21
  mainClass,
20
22
  ...mainClassArgs
21
23
  ];
@@ -36,3 +38,26 @@ const runJavaProcess = (options, mainClass, additionalClasspathElements, javaArg
36
38
  });
37
39
  };
38
40
  exports.runJavaProcess = runJavaProcess;
41
+ const generateProxyArgs = (proxyConf) => {
42
+ const proxyProps = (protocol, url) => {
43
+ const props = [];
44
+ if (url !== undefined) {
45
+ props.push(`-D${protocol}.proxyHost=${url.hostname}`);
46
+ props.push(`-D${protocol}.proxyPort=${url.port || "80"}`);
47
+ if (url.username) {
48
+ props.push(`-D${protocol}.proxyUser=${url.username}`);
49
+ }
50
+ if (url.password) {
51
+ props.push(`-D${protocol}.proxyPassword=${url.password}`);
52
+ }
53
+ }
54
+ return props;
55
+ };
56
+ const httpProps = proxyProps("http", proxyConf?.proxyUrl);
57
+ // For HTTPS, fallback on proxyUrl if httpsProxyUrl isn't set, following npm's own behavior
58
+ const httpsProps = proxyProps("https", proxyConf?.httpsProxyUrl || proxyConf?.proxyUrl);
59
+ const noProxyProps = proxyConf !== undefined && proxyConf.noProxyHosts.length > 0
60
+ ? [`-Dhttp.nonProxyHosts=${proxyConf.noProxyHosts.join("|")}`]
61
+ : [];
62
+ return [...httpProps, ...httpsProps, ...noProxyProps];
63
+ };
@@ -0,0 +1,6 @@
1
+ export interface ProxyConfiguration {
2
+ proxyUrl?: URL;
3
+ httpsProxyUrl?: URL;
4
+ noProxyHosts: string[];
5
+ }
6
+ export declare const proxyConfiguration: ProxyConfiguration;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.proxyConfiguration = void 0;
4
+ const NPM_CONFIG_PROXY_KEY = "npm_config_proxy";
5
+ const NPM_CONFIG_HTTPS_PROXY_KEY = "npm_config_https_proxy";
6
+ const NPM_CONFIG_NOPROXY_KEY = "npm_config_noproxy";
7
+ const httpProxy = process.env[NPM_CONFIG_PROXY_KEY] || undefined;
8
+ const proxyUrl = httpProxy !== undefined ? new URL(httpProxy) : undefined;
9
+ const httpsProxy = process.env[NPM_CONFIG_HTTPS_PROXY_KEY] || undefined;
10
+ const httpsProxyUrl = httpsProxy !== undefined ? new URL(httpsProxy) : undefined;
11
+ const noProxy = process.env[NPM_CONFIG_NOPROXY_KEY] || undefined;
12
+ const noProxyHosts = noProxy !== undefined ? noProxy.split(",") : [];
13
+ exports.proxyConfiguration = {
14
+ proxyUrl,
15
+ httpsProxyUrl,
16
+ noProxyHosts
17
+ };