@gatling.io/core 3.13.105 → 3.13.300

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/core",
3
- "version": "3.13.105",
3
+ "version": "3.13.300",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://gatling.io",
6
6
  "repository": "github:gatling/gatling-js",
@@ -20,7 +20,7 @@
20
20
  "main": "target/index.js",
21
21
  "types": "target/index.d.ts",
22
22
  "dependencies": {
23
- "@gatling.io/jvm-types": "3.13.105"
23
+ "@gatling.io/jvm-types": "3.13.300"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/jest": "29.5.14",
@@ -29,7 +29,7 @@
29
29
  "rimraf": "6.0.1",
30
30
  "ts-jest": "29.2.5",
31
31
  "ts-node": "10.9.2",
32
- "typescript": "5.7.2"
32
+ "typescript": "5.7.3"
33
33
  },
34
34
  "scripts": {
35
35
  "clean": "rimraf target",
@@ -0,0 +1,83 @@
1
+ import { SessionTo, SessionTransform } from "./session";
2
+ import { ActionBuilder } from "./structure";
3
+ export interface DummyBuilder extends ActionBuilder {
4
+ /**
5
+ * Set the successful outcome of the dummy action. If undefined, the outcome is a success.
6
+ *
7
+ * @param newSuccess - if the outcome of the dummy action must be a success
8
+ * @return a new DummyBuilder with the success outcome defined
9
+ */
10
+ withSuccess(newSuccess: boolean): DummyBuilder;
11
+ /**
12
+ * Set the successful outcome of the dummy action. If undefined, the outcome is a success.
13
+ *
14
+ * @param newSuccess - if the outcome of the dummy action must be a success, as a Gatling EL String
15
+ * @return a new DummyBuilder with the success outcome defined
16
+ */
17
+ withSuccess(newSuccess: string): DummyBuilder;
18
+ /**
19
+ * Set the successful outcome of the dummy action. If undefined, the outcome is a success.
20
+ *
21
+ * @param newSuccess - if the outcome of the dummy action must be a success, as a function
22
+ * @return a new DummyBuilder with the success outcome defined
23
+ */
24
+ withSuccess(newSuccess: SessionTo<boolean>): DummyBuilder;
25
+ /**
26
+ * Modify the Session like an exec(f) block would, as part of this dummy action
27
+ *
28
+ * @param f - a function to return an updated Session
29
+ * @return a new DummyBuilder with the Session function defined
30
+ */
31
+ withSessionUpdate(f: SessionTransform): DummyBuilder;
32
+ }
33
+ export interface DummyFunction {
34
+ /**
35
+ * Bootstrap a builder for performing a dummy action that emulates a network remote call
36
+ *
37
+ * @param actionName - the name of the action, as a Gatling EL String
38
+ * @param responseTime - the response time of the action in milliseconds
39
+ * @return a DummyBuilder
40
+ */
41
+ (actionName: string, responseTime: number): DummyBuilder;
42
+ /**
43
+ * Bootstrap a builder for performing a dummy action that emulates a network remote call
44
+ *
45
+ * @param actionName - the name of the action, as a Gatling EL String
46
+ * @param responseTime - the response time of the action in milliseconds, as a Gatling EL String
47
+ * @return a DummyBuilder
48
+ */
49
+ (actionName: string, responseTime: string): DummyBuilder;
50
+ /**
51
+ * Bootstrap a builder for performing a dummy action that emulates a network remote call
52
+ *
53
+ * @param actionName - the name of the action, as a Gatling EL String
54
+ * @param responseTime - the response time of the action in milliseconds, as a function
55
+ * @return a DummyBuilder
56
+ */
57
+ (actionName: string, responseTime: SessionTo<number>): DummyBuilder;
58
+ /**
59
+ * Bootstrap a builder for performing a dummy action that emulates a network remote call
60
+ *
61
+ * @param actionName - the name of the action, as a function
62
+ * @param responseTime - the response time of the action in milliseconds
63
+ * @return a DummyBuilder
64
+ */
65
+ (actionName: SessionTo<string>, responseTime: number): DummyBuilder;
66
+ /**
67
+ * Bootstrap a builder for performing a dummy action that emulates a network remote call
68
+ *
69
+ * @param actionName - the name of the action, as a Gatling EL String
70
+ * @param responseTime - the response time of the action in milliseconds, as function
71
+ * @return a DummyBuilder
72
+ */
73
+ (actionName: SessionTo<string>, responseTime: string): DummyBuilder;
74
+ /**
75
+ * Bootstrap a builder for performing a dummy action that emulates a network remote call
76
+ *
77
+ * @param actionName - the name of the action, as a function
78
+ * @param responseTime - the response time of the action in milliseconds, as a function
79
+ * @return a DummyBuilder
80
+ */
81
+ (actionName: SessionTo<string>, responseTime: SessionTo<number>): DummyBuilder;
82
+ }
83
+ export declare const dummy: DummyFunction;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dummy = void 0;
4
+ const jvm_types_1 = require("@gatling.io/jvm-types");
5
+ const session_1 = require("./session");
6
+ const wrapDummyBuilder = (_underlying) => ({
7
+ _underlying,
8
+ withSuccess: (newSuccess) => wrapDummyBuilder(typeof newSuccess === "function"
9
+ ? _underlying.withSuccess((0, session_1.underlyingSessionTo)(newSuccess))
10
+ : typeof newSuccess === "string"
11
+ ? _underlying.withSuccess(newSuccess)
12
+ : _underlying.withSuccess(newSuccess)),
13
+ withSessionUpdate: (f) => wrapDummyBuilder(_underlying.withSessionUpdate((0, session_1.underlyingSessionTransform)(f)))
14
+ });
15
+ const dummy = (actionName, responseTime) => {
16
+ if (typeof actionName === "function") {
17
+ if (typeof responseTime === "function") {
18
+ return wrapDummyBuilder(jvm_types_1.CoreDsl.dummy((0, session_1.underlyingSessionTo)(actionName), (0, session_1.underlyingSessionTo)(responseTime)));
19
+ }
20
+ else if (typeof responseTime === "string") {
21
+ return wrapDummyBuilder(jvm_types_1.CoreDsl.dummy((0, session_1.underlyingSessionTo)(actionName), responseTime));
22
+ }
23
+ else {
24
+ return wrapDummyBuilder(jvm_types_1.CoreDsl.dummy((0, session_1.underlyingSessionTo)(actionName), responseTime));
25
+ }
26
+ }
27
+ else {
28
+ if (typeof responseTime === "function") {
29
+ return wrapDummyBuilder(jvm_types_1.CoreDsl.dummy(actionName, (0, session_1.underlyingSessionTo)(responseTime)));
30
+ }
31
+ else if (typeof responseTime === "string") {
32
+ return wrapDummyBuilder(jvm_types_1.CoreDsl.dummy(actionName, responseTime));
33
+ }
34
+ else {
35
+ return wrapDummyBuilder(jvm_types_1.CoreDsl.dummy(actionName, responseTime));
36
+ }
37
+ }
38
+ };
39
+ exports.dummy = dummy;
package/target/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export * from "./body";
16
16
  export * from "./checks";
17
17
  export * from "./closedInjection";
18
18
  export * from "./common";
19
+ export { dummy, DummyBuilder, DummyFunction } from "./dummy";
19
20
  export * from "./feeders";
20
21
  export * from "./filters";
21
22
  export { GlobalStore } from "./globalStore";
package/target/index.js CHANGED
@@ -14,7 +14,7 @@ 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.getEnvironmentVariable = exports.getOption = exports.getParameter = exports.GlobalStore = exports.readResourceAsString = exports.readResourceAsBytes = exports.asByteArrayFunction = exports.asByteArray = exports.asJava = void 0;
17
+ exports.simulation = exports.getEnvironmentVariable = exports.getOption = exports.getParameter = exports.GlobalStore = exports.dummy = exports.readResourceAsString = exports.readResourceAsBytes = exports.asByteArrayFunction = exports.asByteArray = exports.asJava = 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");
@@ -34,6 +34,8 @@ __exportStar(require("./body"), exports);
34
34
  __exportStar(require("./checks"), exports);
35
35
  __exportStar(require("./closedInjection"), exports);
36
36
  __exportStar(require("./common"), exports);
37
+ var dummy_1 = require("./dummy");
38
+ Object.defineProperty(exports, "dummy", { enumerable: true, get: function () { return dummy_1.dummy; } });
37
39
  __exportStar(require("./feeders"), exports);
38
40
  __exportStar(require("./filters"), exports);
39
41
  var globalStore_1 = require("./globalStore");