@gatling.io/core 3.11.4-M2 → 3.11.5
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 +4 -4
- package/target/body.js +2 -1
- package/target/checks/index.js +5 -4
- package/target/gatlingJvm/byteArrays.d.ts +5 -0
- package/target/gatlingJvm/byteArrays.js +8 -0
- package/target/index.d.ts +2 -0
- package/target/index.js +7 -1
- package/target/parameters.d.ts +23 -0
- package/target/parameters.js +26 -0
- package/target/session.js +2 -1
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gatling.io/core",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "target/index.js",
|
|
6
6
|
"types": "target/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@gatling.io/jvm-types": "3.11.
|
|
8
|
+
"@gatling.io/jvm-types": "3.11.5"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@types/jest": "29.5.12",
|
|
12
12
|
"jest": "29.7.0",
|
|
13
|
-
"prettier": "3.2
|
|
13
|
+
"prettier": "3.3.2",
|
|
14
14
|
"rimraf": "5.0.7",
|
|
15
|
-
"ts-jest": "29.1.
|
|
15
|
+
"ts-jest": "29.1.5",
|
|
16
16
|
"ts-node": "10.9.2",
|
|
17
17
|
"typescript": "5.4.5"
|
|
18
18
|
},
|
package/target/body.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ByteArrayBody = exports.PebbleFileBody = exports.PebbleStringBody = exports.ElFileBody = exports.RawFileBody = exports.StringBody = void 0;
|
|
4
4
|
const jvm_types_1 = require("@gatling.io/jvm-types");
|
|
5
|
+
const byteArrays_1 = require("./gatlingJvm/byteArrays");
|
|
5
6
|
const session_1 = require("./session");
|
|
6
7
|
const wrapBodyWithBytes = (_underlying) => Object.assign((session) => _underlying.apply(session._underlying), { _underlying });
|
|
7
8
|
const wrapBodyWithString = (_underlying) => Object.assign((session) => _underlying.apply(session._underlying), { _underlying });
|
|
@@ -22,7 +23,7 @@ const PebbleFileBody = (filePath) => wrapBodyWithString(typeof filePath === "fun
|
|
|
22
23
|
: jvm_types_1.CoreDsl.PebbleFileBody(filePath));
|
|
23
24
|
exports.PebbleFileBody = PebbleFileBody;
|
|
24
25
|
const ByteArrayBody = (bytes) => wrapBodyWithBytes(typeof bytes === "function"
|
|
25
|
-
? jvm_types_1.CoreDsl.ByteArrayBody((0, session_1.underlyingSessionTo)(bytes))
|
|
26
|
+
? jvm_types_1.CoreDsl.ByteArrayBody((0, byteArrays_1.asByteArrayFunction)((0, session_1.underlyingSessionTo)(bytes)))
|
|
26
27
|
: typeof bytes === "string"
|
|
27
28
|
? jvm_types_1.CoreDsl.ByteArrayBody(bytes)
|
|
28
29
|
: jvm_types_1.CoreDsl.ByteArrayBody(bytes));
|
package/target/checks/index.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.responseTimeInMillis = exports.sha1 = exports.md5 = exports.regex = expo
|
|
|
18
18
|
const jvm_types_1 = require("@gatling.io/jvm-types");
|
|
19
19
|
const session_1 = require("../session");
|
|
20
20
|
const captureGroup_1 = require("./captureGroup");
|
|
21
|
+
const byteArrays_1 = require("../gatlingJvm/byteArrays");
|
|
21
22
|
const final_1 = require("./final");
|
|
22
23
|
const find_1 = require("./find");
|
|
23
24
|
const jsonOfTypeFind_1 = require("./jsonOfTypeFind");
|
|
@@ -57,11 +58,11 @@ exports.bodyString = bodyString;
|
|
|
57
58
|
const bodyBytes = () => ({
|
|
58
59
|
...(0, find_1.wrapCheckBuilderFind)(jvm_types_1.CoreDsl.bodyBytes()),
|
|
59
60
|
is: (expected) => (0, final_1.wrapCheckBuilderFinal)(typeof expected === "function"
|
|
60
|
-
? jvm_types_1.CoreDsl.bodyBytes().is((0, session_1.underlyingSessionTo)(expected))
|
|
61
|
-
: jvm_types_1.CoreDsl.bodyBytes().is(expected)),
|
|
61
|
+
? jvm_types_1.CoreDsl.bodyBytes().is((0, byteArrays_1.asByteArrayFunction)((0, session_1.underlyingSessionTo)(expected)))
|
|
62
|
+
: jvm_types_1.CoreDsl.bodyBytes().is((0, byteArrays_1.asByteArray)(expected))),
|
|
62
63
|
not: (expected) => (0, final_1.wrapCheckBuilderFinal)(typeof expected === "function"
|
|
63
|
-
? jvm_types_1.CoreDsl.bodyBytes().not((0, session_1.underlyingSessionTo)(expected))
|
|
64
|
-
: jvm_types_1.CoreDsl.bodyBytes().not(expected))
|
|
64
|
+
? jvm_types_1.CoreDsl.bodyBytes().not((0, byteArrays_1.asByteArrayFunction)((0, session_1.underlyingSessionTo)(expected)))
|
|
65
|
+
: jvm_types_1.CoreDsl.bodyBytes().not((0, byteArrays_1.asByteArray)(expected)))
|
|
65
66
|
});
|
|
66
67
|
exports.bodyBytes = bodyBytes;
|
|
67
68
|
/**
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import JvmSession = io.gatling.javaapi.core.Session;
|
|
2
|
+
type JvmExpression<T> = (arg: JvmSession) => T;
|
|
3
|
+
export declare const asByteArray: (v: number[]) => number[];
|
|
4
|
+
export declare const asByteArrayFunction: (f: JvmExpression<number[]>) => JvmExpression<number[]>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.asByteArrayFunction = exports.asByteArray = void 0;
|
|
4
|
+
const ByteArrays = Java.type("io.gatling.js.callbacks.ByteArrays");
|
|
5
|
+
const asByteArray = (v) => ByteArrays.asByteArray(v);
|
|
6
|
+
exports.asByteArray = asByteArray;
|
|
7
|
+
const asByteArrayFunction = (f) => ByteArrays.asByteArrayFunction(f);
|
|
8
|
+
exports.asByteArrayFunction = asByteArrayFunction;
|
package/target/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { Assertion } from "./assertions";
|
|
|
7
7
|
import { PopulationBuilder } from "./population";
|
|
8
8
|
import { ProtocolBuilder } from "./protocol";
|
|
9
9
|
import { ThrottleStep } from "./throttling";
|
|
10
|
+
export { asByteArray, asByteArrayFunction } from "./gatlingJvm/byteArrays";
|
|
10
11
|
export * from "./utils/duration";
|
|
11
12
|
export * from "./assertions";
|
|
12
13
|
export * from "./body";
|
|
@@ -18,6 +19,7 @@ export * from "./filters";
|
|
|
18
19
|
export { GlobalStore } from "./globalStore";
|
|
19
20
|
export * from "./openInjection";
|
|
20
21
|
export * from "./population";
|
|
22
|
+
export { getOption, getEnvironmentVariable, GetWithDefault } from "./parameters";
|
|
21
23
|
export * from "./protocol";
|
|
22
24
|
export * from "./scenario";
|
|
23
25
|
export * from "./session";
|
package/target/index.js
CHANGED
|
@@ -14,12 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.simulation = exports.GlobalStore = void 0;
|
|
17
|
+
exports.simulation = exports.getEnvironmentVariable = exports.getOption = exports.GlobalStore = exports.asByteArrayFunction = exports.asByteArray = void 0;
|
|
18
18
|
require("@gatling.io/jvm-types");
|
|
19
19
|
const pauses_1 = require("./structure/pauses");
|
|
20
20
|
const duration_1 = require("./utils/duration");
|
|
21
21
|
const session_1 = require("./session");
|
|
22
22
|
// FIXME no export *
|
|
23
|
+
var byteArrays_1 = require("./gatlingJvm/byteArrays");
|
|
24
|
+
Object.defineProperty(exports, "asByteArray", { enumerable: true, get: function () { return byteArrays_1.asByteArray; } });
|
|
25
|
+
Object.defineProperty(exports, "asByteArrayFunction", { enumerable: true, get: function () { return byteArrays_1.asByteArrayFunction; } });
|
|
23
26
|
__exportStar(require("./utils/duration"), exports);
|
|
24
27
|
__exportStar(require("./assertions"), exports);
|
|
25
28
|
__exportStar(require("./body"), exports);
|
|
@@ -32,6 +35,9 @@ var globalStore_1 = require("./globalStore");
|
|
|
32
35
|
Object.defineProperty(exports, "GlobalStore", { enumerable: true, get: function () { return globalStore_1.GlobalStore; } });
|
|
33
36
|
__exportStar(require("./openInjection"), exports);
|
|
34
37
|
__exportStar(require("./population"), exports);
|
|
38
|
+
var parameters_1 = require("./parameters");
|
|
39
|
+
Object.defineProperty(exports, "getOption", { enumerable: true, get: function () { return parameters_1.getOption; } });
|
|
40
|
+
Object.defineProperty(exports, "getEnvironmentVariable", { enumerable: true, get: function () { return parameters_1.getEnvironmentVariable; } });
|
|
35
41
|
__exportStar(require("./protocol"), exports);
|
|
36
42
|
__exportStar(require("./scenario"), exports);
|
|
37
43
|
__exportStar(require("./session"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface GetWithDefault {
|
|
2
|
+
(name: string): string | undefined;
|
|
3
|
+
(name: string, defaultValue: string): string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Gets the option indicated by the specified name.
|
|
7
|
+
*
|
|
8
|
+
* Options can be specified in the `gatling run` command by passing arguments with the format `key=value`, e.g.
|
|
9
|
+
* `gatling run option1=foo option2=bar`.
|
|
10
|
+
*
|
|
11
|
+
* @param key - the key of the option.
|
|
12
|
+
* @param defaultValue - a default value
|
|
13
|
+
* @returns the string value of the option if it is defined, or else `defaultValue` if provided, or else `undefined`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getOption: GetWithDefault;
|
|
16
|
+
/**
|
|
17
|
+
* Gets the environment variable indicated by the specified name.
|
|
18
|
+
*
|
|
19
|
+
* @param name - the name of the environment variable.
|
|
20
|
+
* @param defaultValue - a default value
|
|
21
|
+
* @returns the string value of the environment variable if it is defined, or else `defaultValue` if provided, or else `undefined`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getEnvironmentVariable: GetWithDefault;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnvironmentVariable = exports.getOption = void 0;
|
|
4
|
+
const jvm_types_1 = require("@gatling.io/jvm-types");
|
|
5
|
+
/**
|
|
6
|
+
* Gets the option indicated by the specified name.
|
|
7
|
+
*
|
|
8
|
+
* Options can be specified in the `gatling run` command by passing arguments with the format `key=value`, e.g.
|
|
9
|
+
* `gatling run option1=foo option2=bar`.
|
|
10
|
+
*
|
|
11
|
+
* @param key - the key of the option.
|
|
12
|
+
* @param defaultValue - a default value
|
|
13
|
+
* @returns the string value of the option if it is defined, or else `defaultValue` if provided, or else `undefined`.
|
|
14
|
+
*/
|
|
15
|
+
const getOption = (key, defaultValue) => getOrElse(jvm_types_1.System.getProperty(key), defaultValue);
|
|
16
|
+
exports.getOption = getOption;
|
|
17
|
+
/**
|
|
18
|
+
* Gets the environment variable indicated by the specified name.
|
|
19
|
+
*
|
|
20
|
+
* @param name - the name of the environment variable.
|
|
21
|
+
* @param defaultValue - a default value
|
|
22
|
+
* @returns the string value of the environment variable if it is defined, or else `defaultValue` if provided, or else `undefined`.
|
|
23
|
+
*/
|
|
24
|
+
const getEnvironmentVariable = (name, defaultValue) => getOrElse(jvm_types_1.System.getenv(name), defaultValue);
|
|
25
|
+
exports.getEnvironmentVariable = getEnvironmentVariable;
|
|
26
|
+
const getOrElse = (value, defaultValue) => typeof value === "string" ? value : defaultValue;
|
package/target/session.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.underlyingXWithSessionTo = exports.underlyingSessionToDuration = exports.underlyingSessionToJava = exports.underlyingSessionTo = exports.underlyingSessionTransform = exports.wrapSession = void 0;
|
|
4
|
+
const byteArrays_1 = require("./gatlingJvm/byteArrays");
|
|
4
5
|
const collections_1 = require("./gatlingJvm/collections");
|
|
5
6
|
const duration_1 = require("./utils/duration");
|
|
6
7
|
const wrapSession = (_underlying) => ({
|
|
@@ -9,7 +10,7 @@ const wrapSession = (_underlying) => ({
|
|
|
9
10
|
set: (key, value) => {
|
|
10
11
|
return (0, exports.wrapSession)(_underlying.set(key, (0, collections_1.asJava)(value)));
|
|
11
12
|
},
|
|
12
|
-
setByteArray: (key, value) => (0, exports.wrapSession)(_underlying.set(key, value)),
|
|
13
|
+
setByteArray: (key, value) => (0, exports.wrapSession)(_underlying.set(key, (0, byteArrays_1.asByteArray)(value))),
|
|
13
14
|
setAll: (newAttributes) => {
|
|
14
15
|
let session = _underlying;
|
|
15
16
|
for (const key in newAttributes) {
|