@gatling.io/core 0.1.0

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 (109) hide show
  1. package/package.json +24 -0
  2. package/target/assertions.d.ts +214 -0
  3. package/target/assertions.js +63 -0
  4. package/target/body.d.ts +150 -0
  5. package/target/body.js +33 -0
  6. package/target/checks/builder.d.ts +10 -0
  7. package/target/checks/builder.js +7 -0
  8. package/target/checks/captureGroup.d.ts +15 -0
  9. package/target/checks/captureGroup.js +9 -0
  10. package/target/checks/condition.d.ts +19 -0
  11. package/target/checks/condition.js +7 -0
  12. package/target/checks/final.d.ts +23 -0
  13. package/target/checks/final.js +10 -0
  14. package/target/checks/find.d.ts +17 -0
  15. package/target/checks/find.js +9 -0
  16. package/target/checks/index.d.ts +408 -0
  17. package/target/checks/index.js +181 -0
  18. package/target/checks/jsonOfTypeFind.d.ts +56 -0
  19. package/target/checks/jsonOfTypeFind.js +16 -0
  20. package/target/checks/jsonOfTypeMultipleFind.d.ts +56 -0
  21. package/target/checks/jsonOfTypeMultipleFind.js +16 -0
  22. package/target/checks/multipleFind.d.ts +57 -0
  23. package/target/checks/multipleFind.js +26 -0
  24. package/target/checks/validate.d.ts +242 -0
  25. package/target/checks/validate.js +50 -0
  26. package/target/closedInjection.d.ts +33 -0
  27. package/target/closedInjection.js +38 -0
  28. package/target/common.d.ts +3 -0
  29. package/target/common.js +2 -0
  30. package/target/feeders.d.ts +203 -0
  31. package/target/feeders.js +74 -0
  32. package/target/filters.d.ts +31 -0
  33. package/target/filters.js +32 -0
  34. package/target/gatlingJvm/app.d.ts +4 -0
  35. package/target/gatlingJvm/app.js +2 -0
  36. package/target/gatlingJvm/callbacks.d.ts +9 -0
  37. package/target/gatlingJvm/callbacks.js +14 -0
  38. package/target/gatlingJvm/collections.d.ts +1 -0
  39. package/target/gatlingJvm/collections.js +31 -0
  40. package/target/index.d.ts +115 -0
  41. package/target/index.js +56 -0
  42. package/target/openInjection.d.ts +51 -0
  43. package/target/openInjection.js +62 -0
  44. package/target/population.d.ts +82 -0
  45. package/target/population.js +22 -0
  46. package/target/protocol.d.ts +5 -0
  47. package/target/protocol.js +3 -0
  48. package/target/scenario.d.ts +10 -0
  49. package/target/scenario.js +17 -0
  50. package/target/session.d.ts +28 -0
  51. package/target/session.js +42 -0
  52. package/target/structure/asLongAs.d.ts +74 -0
  53. package/target/structure/asLongAs.js +47 -0
  54. package/target/structure/asLongAsDuring.d.ts +221 -0
  55. package/target/structure/asLongAsDuring.js +92 -0
  56. package/target/structure/choices.d.ts +18 -0
  57. package/target/structure/choices.js +21 -0
  58. package/target/structure/doIf.d.ts +83 -0
  59. package/target/structure/doIf.js +39 -0
  60. package/target/structure/doIfOrElse.d.ts +86 -0
  61. package/target/structure/doIfOrElse.js +42 -0
  62. package/target/structure/doSwitch.d.ts +27 -0
  63. package/target/structure/doSwitch.js +13 -0
  64. package/target/structure/doSwitchOrElse.d.ts +34 -0
  65. package/target/structure/doSwitchOrElse.js +16 -0
  66. package/target/structure/doWhile.d.ts +28 -0
  67. package/target/structure/doWhile.js +28 -0
  68. package/target/structure/doWhileDuring.d.ts +225 -0
  69. package/target/structure/doWhileDuring.js +92 -0
  70. package/target/structure/during.d.ts +123 -0
  71. package/target/structure/during.js +60 -0
  72. package/target/structure/errors.d.ts +121 -0
  73. package/target/structure/errors.js +42 -0
  74. package/target/structure/execs.d.ts +46 -0
  75. package/target/structure/execs.js +15 -0
  76. package/target/structure/feeds.d.ts +42 -0
  77. package/target/structure/feeds.js +21 -0
  78. package/target/structure/forEach.d.ts +38 -0
  79. package/target/structure/forEach.js +34 -0
  80. package/target/structure/forever.d.ts +16 -0
  81. package/target/structure/forever.js +7 -0
  82. package/target/structure/groups.d.ts +17 -0
  83. package/target/structure/groups.js +9 -0
  84. package/target/structure/index.d.ts +64 -0
  85. package/target/structure/index.js +97 -0
  86. package/target/structure/jvmStructureBuilder.d.ts +28 -0
  87. package/target/structure/jvmStructureBuilder.js +3 -0
  88. package/target/structure/on.d.ts +12 -0
  89. package/target/structure/on.js +7 -0
  90. package/target/structure/paces.d.ts +101 -0
  91. package/target/structure/paces.js +58 -0
  92. package/target/structure/pauses.d.ts +127 -0
  93. package/target/structure/pauses.js +92 -0
  94. package/target/structure/randomSwitch.d.ts +19 -0
  95. package/target/structure/randomSwitch.js +9 -0
  96. package/target/structure/randomSwitchOrElse.d.ts +23 -0
  97. package/target/structure/randomSwitchOrElse.js +12 -0
  98. package/target/structure/rendezVous.d.ts +15 -0
  99. package/target/structure/rendezVous.js +6 -0
  100. package/target/structure/repeat.d.ts +34 -0
  101. package/target/structure/repeat.js +34 -0
  102. package/target/structure/roundRobinSwitch.d.ts +18 -0
  103. package/target/structure/roundRobinSwitch.js +9 -0
  104. package/target/structure/uniformRandomSwitch.d.ts +18 -0
  105. package/target/structure/uniformRandomSwitch.js +9 -0
  106. package/target/throttling.d.ts +43 -0
  107. package/target/throttling.js +36 -0
  108. package/target/utils/duration.d.ts +7 -0
  109. package/target/utils/duration.js +21 -0
@@ -0,0 +1,46 @@
1
+ import "@gatling.io/jvm-types";
2
+ import JvmActionBuilder = io.gatling.javaapi.core.ActionBuilder;
3
+ import JvmExecs = io.gatling.javaapi.core.exec.Execs;
4
+ import JvmExecutable = io.gatling.javaapi.core.exec.Executable;
5
+ import { Wrapper } from "../common";
6
+ import { SessionTransform } from "../session";
7
+ export interface Executable<T extends JvmExecutable> extends Wrapper<T> {
8
+ }
9
+ export interface ActionBuilder extends Executable<JvmActionBuilder> {
10
+ }
11
+ export declare const wrapActionBuilder: (_underlying: JvmActionBuilder) => ActionBuilder;
12
+ export interface ExecFunction<T extends Execs<T>> {
13
+ /**
14
+ * Attach some `Executable`s. Chains will be attached sequentially.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const chain1: ChainBuilder = ???
19
+ * const chain2: ChainBuilder = ???
20
+ * const chain1ThenChain2 = exec(chain1, chain2)
21
+ * ```
22
+ *
23
+ * @param executable - some `ChainBuilder` or `ActionBuilder`
24
+ * @param executables - other `ChainBuilder`s or `ActionBuilder`s
25
+ * @returns a new `StructureBuilder`
26
+ */
27
+ (executable: Executable<any>, ...executables: Array<Executable<any>>): T;
28
+ /**
29
+ * Attach a new action that will execute a function. Important: the function must only perform
30
+ * fast in-memory operations. In particular, it mustn't perform any long block I/O operation, or
31
+ * it will hurt Gatling performance badly.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * exec(session => session.set("foo", "bar"))
36
+ * ```
37
+ *
38
+ * @param executable - the function
39
+ * @returns a new `StructureBuilder`
40
+ */
41
+ (executable: SessionTransform): T;
42
+ }
43
+ export interface Execs<T extends Execs<T>> {
44
+ exec: ExecFunction<T>;
45
+ }
46
+ export declare const execImpl: <J2, J1 extends JvmExecs<J2, any>, T extends Execs<T>>(jvmExecs: J1, wrap: (wrapped: J2) => T) => ExecFunction<T>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execImpl = exports.wrapActionBuilder = void 0;
4
+ require("@gatling.io/jvm-types");
5
+ const session_1 = require("../session");
6
+ const callbacks_1 = require("../gatlingJvm/callbacks");
7
+ const wrapActionBuilder = (_underlying) => ({
8
+ _underlying
9
+ });
10
+ exports.wrapActionBuilder = wrapActionBuilder;
11
+ const execImpl = (jvmExecs, wrap) => (arg0, ...arg1) => wrap(typeof arg0 === "function"
12
+ ? jvmExecs.exec((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTransform)(arg0))) // arg0: SessionTransform
13
+ : jvmExecs.exec(arg0._underlying, ...arg1.map((e) => e._underlying)) // arg0: Executable, ...arg1: Executable[]
14
+ );
15
+ exports.execImpl = execImpl;
@@ -0,0 +1,42 @@
1
+ import "@gatling.io/jvm-types";
2
+ import JvmFeeds = io.gatling.javaapi.core.feed.Feeds;
3
+ import { FeederBuilder } from "../feeders";
4
+ import { SessionTo } from "../session";
5
+ export interface FeedFunction<T extends Feeds<T>> {
6
+ /**
7
+ * Attach a feed action.
8
+ *
9
+ * @param feederBuilder - a source of records
10
+ * @returns a new StructureBuilder
11
+ */
12
+ (feederBuilder: FeederBuilder<unknown>): T;
13
+ /**
14
+ * Attach a feed action.
15
+ *
16
+ * @param feederBuilder - a source of records
17
+ * @param numberOfRecords - the number of records to poll from the feeder at once
18
+ * @returns a new StructureBuilder
19
+ */
20
+ (feederBuilder: FeederBuilder<unknown>, numberOfRecords: number): T;
21
+ /**
22
+ * Attach a feed action.
23
+ *
24
+ * @param feederBuilder - a source of records
25
+ * @param numberOfRecords - the number of records to poll from the feeder at once, expressed as a Gatling Expression
26
+ * Language String
27
+ * @returns a new StructureBuilder
28
+ */
29
+ (feederBuilder: FeederBuilder<unknown>, numberOfRecords: string): T;
30
+ /**
31
+ * Attach a feed action.
32
+ *
33
+ * @param feederBuilder - a source of records
34
+ * @param numberOfRecords - the number of records to poll from the feeder at once, as a function
35
+ * @returns a new StructureBuilder
36
+ */
37
+ (feederBuilder: FeederBuilder<unknown>, numberOfRecords: SessionTo<number>): T;
38
+ }
39
+ export interface Feeds<T extends Feeds<T>> {
40
+ feed: FeedFunction<T>;
41
+ }
42
+ export declare const feedImpl: <J2, J1 extends JvmFeeds<J2, any>, T extends Feeds<T>>(jvmFeeds: J1, wrap: (wrapped: J2) => T) => FeedFunction<T>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.feedImpl = void 0;
4
+ require("@gatling.io/jvm-types");
5
+ const session_1 = require("../session");
6
+ const callbacks_1 = require("../gatlingJvm/callbacks");
7
+ const feedImpl = (jvmFeeds, wrap) => (feederBuilder, numberOfRecords) => {
8
+ if (typeof numberOfRecords === "number") {
9
+ return wrap(jvmFeeds.feed(feederBuilder._underlying, numberOfRecords));
10
+ }
11
+ else if (typeof numberOfRecords === "string") {
12
+ return wrap(jvmFeeds.feed(feederBuilder._underlying, numberOfRecords));
13
+ }
14
+ else if (typeof numberOfRecords === "function") {
15
+ return wrap(jvmFeeds.feed(feederBuilder._underlying, (0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(numberOfRecords))));
16
+ }
17
+ else {
18
+ return wrap(jvmFeeds.feed(feederBuilder._underlying));
19
+ }
20
+ };
21
+ exports.feedImpl = feedImpl;
@@ -0,0 +1,38 @@
1
+ import "@gatling.io/jvm-types";
2
+ import JvmForEach = io.gatling.javaapi.core.loop.ForEach;
3
+ import { SessionTo } from "../session";
4
+ import { On } from "./on";
5
+ export interface ForEachFunction<T extends ForEach<T>> {
6
+ /**
7
+ * Define a loop that will iterate over a list of values.
8
+ *
9
+ * @param seq - the static list of values to iterate over
10
+ * @param attributeName - the key to store the current element in the Session
11
+ * @param counterName - the name of the loop counter, as stored in the Session
12
+ * @returns a DSL component to define the loop content
13
+ */
14
+ (seq: unknown[], attributeName: string, counterName?: string): On<T>;
15
+ /**
16
+ * Define a loop that will iterate over a list of values.
17
+ *
18
+ * @param seq - the list of values to iterate over, expressed as a Gatling Expression Language String, must evaluate
19
+ * to an array
20
+ * @param attributeName - the key to store the current element in the Session
21
+ * @param counterName - the name of the loop counter, as stored in the Session
22
+ * @returns a DSL component to define the loop content
23
+ */
24
+ (seq: string, attributeName: string, counterName?: string): On<T>;
25
+ /**
26
+ * Define a loop that will iterate over a list of values.
27
+ *
28
+ * @param seq - the list of values to iterate over, expressed as a function
29
+ * @param attributeName - the key to store the current element in the Session
30
+ * @param counterName - the name of the loop counter, as stored in the Session
31
+ * @returns a DSL component to define the loop content
32
+ */
33
+ (seq: SessionTo<Array<unknown>>, attributeName: string, counterName?: string): On<T>;
34
+ }
35
+ export interface ForEach<T extends ForEach<T>> {
36
+ foreach: ForEachFunction<T>;
37
+ }
38
+ export declare const foreachImpl: <J2, J1 extends JvmForEach<J2, any>, T extends ForEach<T>>(jvmForEach: J1, wrap: (wrapped: J2) => T) => ForEachFunction<T>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.foreachImpl = void 0;
4
+ require("@gatling.io/jvm-types");
5
+ const session_1 = require("../session");
6
+ const callbacks_1 = require("../gatlingJvm/callbacks");
7
+ const on_1 = require("./on");
8
+ const foreachImpl = (jvmForEach, wrap) => (seq, attributeName, counterName) => {
9
+ if (typeof seq === "function") {
10
+ if (counterName !== undefined) {
11
+ return (0, on_1.wrapOn)(jvmForEach.foreach((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(seq)), attributeName, counterName), wrap);
12
+ }
13
+ else {
14
+ return (0, on_1.wrapOn)(jvmForEach.foreach((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(seq)), attributeName), wrap);
15
+ }
16
+ }
17
+ else if (typeof seq === "string") {
18
+ if (counterName !== undefined) {
19
+ return (0, on_1.wrapOn)(jvmForEach.foreach(seq, attributeName, counterName), wrap);
20
+ }
21
+ else {
22
+ return (0, on_1.wrapOn)(jvmForEach.foreach(seq, attributeName), wrap);
23
+ }
24
+ }
25
+ else {
26
+ if (counterName !== undefined) {
27
+ return (0, on_1.wrapOn)(jvmForEach.foreach(seq, attributeName, counterName), wrap);
28
+ }
29
+ else {
30
+ return (0, on_1.wrapOn)(jvmForEach.foreach(seq, attributeName), wrap);
31
+ }
32
+ }
33
+ };
34
+ exports.foreachImpl = foreachImpl;
@@ -0,0 +1,16 @@
1
+ import "@gatling.io/jvm-types";
2
+ import JvmForever = io.gatling.javaapi.core.loop.Forever;
3
+ import { On } from "./on";
4
+ export interface ForeverFunction<T extends Forever<T>> {
5
+ /**
6
+ * Define a loop that will iterate forever.
7
+ *
8
+ * @param counterName - the name of the loop counter, as stored in the Session
9
+ * @returns a DSL component for defining the loop content
10
+ */
11
+ (counterName?: string): On<T>;
12
+ }
13
+ export interface Forever<T extends Forever<T>> {
14
+ forever: ForeverFunction<T>;
15
+ }
16
+ export declare const foreverImpl: <J2, J1 extends JvmForever<J2, any>, T extends Forever<T>>(jvmForever: J1, wrap: (wrapped: J2) => T) => ForeverFunction<T>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.foreverImpl = void 0;
4
+ require("@gatling.io/jvm-types");
5
+ const on_1 = require("./on");
6
+ const foreverImpl = (jvmForever, wrap) => (counterName) => (0, on_1.wrapOn)(counterName !== undefined ? jvmForever.forever(counterName) : jvmForever.forever(), wrap);
7
+ exports.foreverImpl = foreverImpl;
@@ -0,0 +1,17 @@
1
+ import "@gatling.io/jvm-types";
2
+ import JvmGroups = io.gatling.javaapi.core.group.Groups;
3
+ import { SessionTo } from "../session";
4
+ import { On } from "./on";
5
+ export interface GroupFunction<T extends Groups<T>> {
6
+ /**
7
+ * Define a group
8
+ *
9
+ * @param name - the name of the group, expressed as a Gatling Expression Language String or a function
10
+ * @returns a DSL component for defining the wrapped block
11
+ */
12
+ (name: string | SessionTo<string>): On<T>;
13
+ }
14
+ export interface Groups<T extends Groups<T>> {
15
+ group: GroupFunction<T>;
16
+ }
17
+ export declare const groupImpl: <J2, J1 extends JvmGroups<J2, any>, T extends Groups<T>>(jvmGroups: J1, wrap: (wrapped: J2) => T) => GroupFunction<T>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.groupImpl = void 0;
4
+ require("@gatling.io/jvm-types");
5
+ const session_1 = require("../session");
6
+ const callbacks_1 = require("../gatlingJvm/callbacks");
7
+ const on_1 = require("./on");
8
+ const groupImpl = (jvmGroups, wrap) => (group) => (0, on_1.wrapOn)(typeof group === "function" ? jvmGroups.group((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(group))) : jvmGroups.group(group), wrap);
9
+ exports.groupImpl = groupImpl;
@@ -0,0 +1,64 @@
1
+ import "@gatling.io/jvm-types";
2
+ import JvmChainBuilder = io.gatling.javaapi.core.ChainBuilder;
3
+ import { JvmStructureBuilderLike } from "./jvmStructureBuilder";
4
+ import { ExecFunction, Execs, Executable } from "./execs";
5
+ import { GroupFunction, Groups } from "./groups";
6
+ import { FeedFunction, Feeds } from "./feeds";
7
+ import { PauseFunction, Pauses } from "./pauses";
8
+ import { Paces } from "./paces";
9
+ import { RendezVous } from "./rendezVous";
10
+ import { Repeat } from "./repeat";
11
+ import { ForEach } from "./forEach";
12
+ import { During } from "./during";
13
+ import { Forever } from "./forever";
14
+ import { AsLongAs } from "./asLongAs";
15
+ import { DoWhile } from "./doWhile";
16
+ import { AsLongAsDuring } from "./asLongAsDuring";
17
+ import { DoWhileDuring } from "./doWhileDuring";
18
+ import { DoIf, DoIfEquals } from "./doIf";
19
+ import { DoIfOrElse, DoIfEqualsOrElse } from "./doIfOrElse";
20
+ import { DoSwitch } from "./doSwitch";
21
+ import { DoSwitchOrElse } from "./doSwitchOrElse";
22
+ import { RandomSwitch } from "./randomSwitch";
23
+ import { RandomSwitchOrElse } from "./randomSwitchOrElse";
24
+ import { UniformRandomSwitch } from "./uniformRandomSwitch";
25
+ import { RoundRobinSwitch } from "./roundRobinSwitch";
26
+ import { Errors } from "./errors";
27
+ export interface StructureBuilder<T extends StructureBuilder<T>> extends Execs<T>, Groups<T>, Feeds<T>, Pauses<T>, Paces<T>, RendezVous<T>, Repeat<T>, ForEach<T>, During<T>, Forever<T>, AsLongAs<T>, DoWhile<T>, AsLongAsDuring<T>, DoWhileDuring<T>, DoIf<T>, DoIfOrElse<T>, DoIfEquals<T>, DoIfEqualsOrElse<T>, DoSwitch<T>, DoSwitchOrElse<T>, RandomSwitch<T>, RandomSwitchOrElse<T>, UniformRandomSwitch<T>, RoundRobinSwitch<T>, Errors<T> {
28
+ }
29
+ export declare const structureBuilderImpl: <J2, J1 extends JvmStructureBuilderLike<J2, any>, T extends StructureBuilder<T>>(jvm: J1, wrap: (wrapped: J2) => T) => StructureBuilder<T>;
30
+ export interface ChainBuilder extends StructureBuilder<ChainBuilder>, Executable<JvmChainBuilder> {
31
+ }
32
+ export { ActionBuilder, wrapActionBuilder } from "./execs";
33
+ export { onCase, percent } from "./choices";
34
+ export declare const exec: ExecFunction<ChainBuilder>;
35
+ export declare const group: GroupFunction<ChainBuilder>;
36
+ export declare const feed: FeedFunction<ChainBuilder>;
37
+ export declare const pause: PauseFunction<ChainBuilder>;
38
+ export declare const pace: import("./paces").PaceFunction<ChainBuilder>;
39
+ export declare const rendezVous: import("./rendezVous").RendezVousFunction<ChainBuilder>;
40
+ export declare const repeat: import("./repeat").RepeatFunction<ChainBuilder>;
41
+ export declare const foreach: import("./forEach").ForEachFunction<ChainBuilder>;
42
+ export declare const during: import("./during").DuringFunction<ChainBuilder>;
43
+ export declare const forever: import("./forever").ForeverFunction<ChainBuilder>;
44
+ export declare const asLongAs: import("./asLongAs").AsLongAsFunction<ChainBuilder>;
45
+ export declare const doWhile: import("./doWhile").DoWhileFunction<ChainBuilder>;
46
+ export declare const asLongAsDuring: import("./asLongAsDuring").AsLongAsDuringFunction<ChainBuilder>;
47
+ export declare const doWhileDuring: import("./doWhileDuring").DoWhileDuringFunction<ChainBuilder>;
48
+ export declare const doIf: import("./doIf").DoIfFunction<ChainBuilder>;
49
+ export declare const doIfOrElse: import("./doIfOrElse").DoIfOrElseFunction<ChainBuilder>;
50
+ export declare const doIfEquals: import("./doIf").DoIfEqualsFunction<ChainBuilder>;
51
+ export declare const doIfEqualsOrElse: import("./doIfOrElse").DoIfEqualsOrElseFunction<ChainBuilder>;
52
+ export declare const doSwitch: import("./doSwitch").DoSwitchFunction<ChainBuilder>;
53
+ export declare const doSwitchOrElse: import("./doSwitchOrElse").DoSwitchOrElseFunction<ChainBuilder>;
54
+ export declare const randomSwitch: import("./randomSwitch").RandomSwitchFunction<ChainBuilder>;
55
+ export declare const randomSwitchOrElse: import("./randomSwitchOrElse").RandomSwitchOrElseFunction<ChainBuilder>;
56
+ export declare const uniformRandomSwitch: import("./uniformRandomSwitch").UniformRandomSwitchFunction<ChainBuilder>;
57
+ export declare const roundRobinSwitch: import("./roundRobinSwitch").RoundRobinSwitchFunction<ChainBuilder>;
58
+ export declare const exitBlockOnFail: import("./errors").ExitBlockOnFailFunction<ChainBuilder>;
59
+ export declare const tryMax: import("./errors").TryMaxFunction<ChainBuilder>;
60
+ export declare const exitHereIf: import("./errors").ExitHereIfFunction<ChainBuilder>;
61
+ export declare const exitHere: import("./errors").ExitHereFunction<ChainBuilder>;
62
+ export declare const exitHereIfFailed: import("./errors").ExitHereIfFailedFunction<ChainBuilder>;
63
+ export declare const stopInjector: import("./errors").StopInjectorFunction<ChainBuilder>;
64
+ export declare const stopInjectorIf: import("./errors").StopInjectorIfFunction<ChainBuilder>;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stopInjectorIf = exports.stopInjector = exports.exitHereIfFailed = exports.exitHere = exports.exitHereIf = exports.tryMax = exports.exitBlockOnFail = exports.roundRobinSwitch = exports.uniformRandomSwitch = exports.randomSwitchOrElse = exports.randomSwitch = exports.doSwitchOrElse = exports.doSwitch = exports.doIfEqualsOrElse = exports.doIfEquals = exports.doIfOrElse = exports.doIf = exports.doWhileDuring = exports.asLongAsDuring = exports.doWhile = exports.asLongAs = exports.forever = exports.during = exports.foreach = exports.repeat = exports.rendezVous = exports.pace = exports.pause = exports.feed = exports.group = exports.exec = exports.percent = exports.onCase = exports.wrapActionBuilder = exports.structureBuilderImpl = void 0;
4
+ require("@gatling.io/jvm-types");
5
+ const jvm_types_1 = require("@gatling.io/jvm-types");
6
+ const execs_1 = require("./execs");
7
+ const groups_1 = require("./groups");
8
+ const feeds_1 = require("./feeds");
9
+ const pauses_1 = require("./pauses");
10
+ const paces_1 = require("./paces");
11
+ const rendezVous_1 = require("./rendezVous");
12
+ const repeat_1 = require("./repeat");
13
+ const forEach_1 = require("./forEach");
14
+ const during_1 = require("./during");
15
+ const forever_1 = require("./forever");
16
+ const asLongAs_1 = require("./asLongAs");
17
+ const doWhile_1 = require("./doWhile");
18
+ const asLongAsDuring_1 = require("./asLongAsDuring");
19
+ const doWhileDuring_1 = require("./doWhileDuring");
20
+ const doIf_1 = require("./doIf");
21
+ const doIfOrElse_1 = require("./doIfOrElse");
22
+ const doSwitch_1 = require("./doSwitch");
23
+ const doSwitchOrElse_1 = require("./doSwitchOrElse");
24
+ const randomSwitch_1 = require("./randomSwitch");
25
+ const randomSwitchOrElse_1 = require("./randomSwitchOrElse");
26
+ const uniformRandomSwitch_1 = require("./uniformRandomSwitch");
27
+ const roundRobinSwitch_1 = require("./roundRobinSwitch");
28
+ const errors_1 = require("./errors");
29
+ const structureBuilderImpl = (jvm, wrap) => ({
30
+ exec: (0, execs_1.execImpl)(jvm, wrap),
31
+ group: (0, groups_1.groupImpl)(jvm, wrap),
32
+ feed: (0, feeds_1.feedImpl)(jvm, wrap),
33
+ pause: (0, pauses_1.pauseImpl)(jvm, wrap),
34
+ pace: (0, paces_1.paceImpl)(jvm, wrap),
35
+ rendezVous: (0, rendezVous_1.rendezVousImpl)(jvm, wrap),
36
+ repeat: (0, repeat_1.repeatImpl)(jvm, wrap),
37
+ foreach: (0, forEach_1.foreachImpl)(jvm, wrap),
38
+ during: (0, during_1.duringImpl)(jvm, wrap),
39
+ forever: (0, forever_1.foreverImpl)(jvm, wrap),
40
+ asLongAs: (0, asLongAs_1.asLongAsImpl)(jvm, wrap),
41
+ doWhile: (0, doWhile_1.doWhileImpl)(jvm, wrap),
42
+ asLongAsDuring: (0, asLongAsDuring_1.asLongAsDuringImpl)(jvm, wrap),
43
+ doWhileDuring: (0, doWhileDuring_1.doWhileDuringImpl)(jvm, wrap),
44
+ doIf: (0, doIf_1.doIfImpl)(jvm, wrap),
45
+ doIfOrElse: (0, doIfOrElse_1.doIfOrElseImpl)(jvm, wrap),
46
+ doIfEquals: (0, doIf_1.doIfEqualsImpl)(jvm, wrap),
47
+ doIfEqualsOrElse: (0, doIfOrElse_1.doIfEqualsOrElseImpl)(jvm, wrap),
48
+ doSwitch: (0, doSwitch_1.doSwitchImpl)(jvm, wrap),
49
+ doSwitchOrElse: (0, doSwitchOrElse_1.doSwitchOrElseImpl)(jvm, wrap),
50
+ randomSwitch: (0, randomSwitch_1.randomSwitchImpl)(jvm, wrap),
51
+ randomSwitchOrElse: (0, randomSwitchOrElse_1.randomSwitchOrElseImpl)(jvm, wrap),
52
+ uniformRandomSwitch: (0, uniformRandomSwitch_1.uniformRandomSwitchImpl)(jvm, wrap),
53
+ roundRobinSwitch: (0, roundRobinSwitch_1.roundRobinSwitchImpl)(jvm, wrap),
54
+ ...(0, errors_1.errorsImpl)(jvm, wrap)
55
+ });
56
+ exports.structureBuilderImpl = structureBuilderImpl;
57
+ const wrapChainBuilder = (_underlying) => ({
58
+ _underlying,
59
+ ...(0, exports.structureBuilderImpl)(_underlying, wrapChainBuilder)
60
+ });
61
+ // CoreDsl elements
62
+ var execs_2 = require("./execs");
63
+ Object.defineProperty(exports, "wrapActionBuilder", { enumerable: true, get: function () { return execs_2.wrapActionBuilder; } });
64
+ var choices_1 = require("./choices");
65
+ Object.defineProperty(exports, "onCase", { enumerable: true, get: function () { return choices_1.onCase; } });
66
+ Object.defineProperty(exports, "percent", { enumerable: true, get: function () { return choices_1.percent; } });
67
+ exports.exec = (0, execs_1.execImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
68
+ exports.group = (0, groups_1.groupImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
69
+ exports.feed = (0, feeds_1.feedImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
70
+ exports.pause = (0, pauses_1.pauseImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
71
+ exports.pace = (0, paces_1.paceImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
72
+ exports.rendezVous = (0, rendezVous_1.rendezVousImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
73
+ exports.repeat = (0, repeat_1.repeatImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
74
+ exports.foreach = (0, forEach_1.foreachImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
75
+ exports.during = (0, during_1.duringImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
76
+ exports.forever = (0, forever_1.foreverImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
77
+ exports.asLongAs = (0, asLongAs_1.asLongAsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
78
+ exports.doWhile = (0, doWhile_1.doWhileImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
79
+ exports.asLongAsDuring = (0, asLongAsDuring_1.asLongAsDuringImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
80
+ exports.doWhileDuring = (0, doWhileDuring_1.doWhileDuringImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
81
+ exports.doIf = (0, doIf_1.doIfImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
82
+ exports.doIfOrElse = (0, doIfOrElse_1.doIfOrElseImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
83
+ exports.doIfEquals = (0, doIf_1.doIfEqualsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
84
+ exports.doIfEqualsOrElse = (0, doIfOrElse_1.doIfEqualsOrElseImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
85
+ exports.doSwitch = (0, doSwitch_1.doSwitchImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
86
+ exports.doSwitchOrElse = (0, doSwitchOrElse_1.doSwitchOrElseImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
87
+ exports.randomSwitch = (0, randomSwitch_1.randomSwitchImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
88
+ exports.randomSwitchOrElse = (0, randomSwitchOrElse_1.randomSwitchOrElseImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
89
+ exports.uniformRandomSwitch = (0, uniformRandomSwitch_1.uniformRandomSwitchImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
90
+ exports.roundRobinSwitch = (0, roundRobinSwitch_1.roundRobinSwitchImpl)(jvm_types_1.CoreDsl, wrapChainBuilder);
91
+ exports.exitBlockOnFail = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).exitBlockOnFail;
92
+ exports.tryMax = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).tryMax;
93
+ exports.exitHereIf = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).exitHereIf;
94
+ exports.exitHere = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).exitHere;
95
+ exports.exitHereIfFailed = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).exitHereIfFailed;
96
+ exports.stopInjector = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).stopInjector;
97
+ exports.stopInjectorIf = (0, errors_1.errorsImpl)(jvm_types_1.CoreDsl, wrapChainBuilder).stopInjectorIf;
@@ -0,0 +1,28 @@
1
+ import "@gatling.io/jvm-types";
2
+ import JvmExecs = io.gatling.javaapi.core.exec.Execs;
3
+ import JvmGroups = io.gatling.javaapi.core.group.Groups;
4
+ import JvmFeeds = io.gatling.javaapi.core.feed.Feeds;
5
+ import JvmPauses = io.gatling.javaapi.core.pause.Pauses;
6
+ import JvmPaces = io.gatling.javaapi.core.pause.Paces;
7
+ import JvmRendezVous = io.gatling.javaapi.core.pause.RendezVous;
8
+ import JvmRepeat = io.gatling.javaapi.core.loop.Repeat;
9
+ import JvmForEach = io.gatling.javaapi.core.loop.ForEach;
10
+ import JvmDuring = io.gatling.javaapi.core.loop.During;
11
+ import JvmForever = io.gatling.javaapi.core.loop.Forever;
12
+ import JvmAsLongAs = io.gatling.javaapi.core.loop.AsLongAs;
13
+ import JvmDoWhile = io.gatling.javaapi.core.loop.DoWhile;
14
+ import JvmAsLongAsDuring = io.gatling.javaapi.core.loop.AsLongAsDuring;
15
+ import JvmDoWhileDuring = io.gatling.javaapi.core.loop.DoWhileDuring;
16
+ import JvmDoIf = io.gatling.javaapi.core.condition.DoIf;
17
+ import JvmDoIfOrElse = io.gatling.javaapi.core.condition.DoIfOrElse;
18
+ import JvmDoIfEquals = io.gatling.javaapi.core.condition.DoIfEquals;
19
+ import JvmDoIfEqualsOrElse = io.gatling.javaapi.core.condition.DoIfEqualsOrElse;
20
+ import JvmDoSwitch = io.gatling.javaapi.core.condition.DoSwitch;
21
+ import JvmDoSwitchOrElse = io.gatling.javaapi.core.condition.DoSwitchOrElse;
22
+ import JvmRandomSwitch = io.gatling.javaapi.core.condition.RandomSwitch;
23
+ import JvmRandomSwitchOrElse = io.gatling.javaapi.core.condition.RandomSwitchOrElse;
24
+ import JvmUniformRandomSwitch = io.gatling.javaapi.core.condition.UniformRandomSwitch;
25
+ import JvmRoundRobinSwitch = io.gatling.javaapi.core.condition.RoundRobinSwitch;
26
+ import JvmErrors = io.gatling.javaapi.core.error.Errors;
27
+ export interface JvmStructureBuilderLike<T, W> extends JvmExecs<T, W>, JvmGroups<T, W>, JvmFeeds<T, W>, JvmPauses<T, W>, JvmPaces<T, W>, JvmRendezVous<T, W>, JvmRepeat<T, W>, JvmForEach<T, W>, JvmDuring<T, W>, JvmForever<T, W>, JvmAsLongAs<T, W>, JvmDoWhile<T, W>, JvmAsLongAsDuring<T, W>, JvmDoWhileDuring<T, W>, JvmDoIf<T, W>, JvmDoIfOrElse<T, W>, JvmDoIfEquals<T, W>, JvmDoIfEqualsOrElse<T, W>, JvmDoSwitch<T, W>, JvmDoSwitchOrElse<T, W>, JvmRandomSwitch<T, W>, JvmRandomSwitchOrElse<T, W>, JvmUniformRandomSwitch<T, W>, JvmRoundRobinSwitch<T, W>, JvmErrors<T, W> {
28
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("@gatling.io/jvm-types");
@@ -0,0 +1,12 @@
1
+ import JvmExecutable = io.gatling.javaapi.core.exec.Executable;
2
+ import { Executable } from "./execs";
3
+ interface JvmOn<T> {
4
+ on(arg0: JvmExecutable, ...arg1: JvmExecutable[]): T;
5
+ equals(arg0: any): boolean;
6
+ toString(): string;
7
+ }
8
+ export interface On<T> {
9
+ on(executable: Executable<any>, ...executables: Executable<any>[]): T;
10
+ }
11
+ export declare const wrapOn: <J, T>(jvmOn: JvmOn<J>, wrap: (underlying: J) => T) => On<T>;
12
+ export {};
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wrapOn = void 0;
4
+ const wrapOn = (jvmOn, wrap) => ({
5
+ on: (executable, ...executables) => wrap(jvmOn.on(executable._underlying, ...executables.map((e) => e._underlying)))
6
+ });
7
+ exports.wrapOn = wrapOn;
@@ -0,0 +1,101 @@
1
+ import "@gatling.io/jvm-types";
2
+ import JvmPaces = io.gatling.javaapi.core.pause.Paces;
3
+ import { Duration } from "../utils/duration";
4
+ import { SessionTo } from "../session";
5
+ export interface PaceFunction<T extends Paces<T>> {
6
+ /**
7
+ * Attach a pace action
8
+ *
9
+ * @param duration - the duration of the pace, in seconds or with an explicit time unit
10
+ * @returns a new StructureBuilder
11
+ */
12
+ (duration: Duration): T;
13
+ /**
14
+ * Attach a pace action where the duration is defined as a Gatling Expression Language string. This expression must
15
+ * resolve to either a number, then the unit will be seconds, or an object with an explicit time unit.
16
+ *
17
+ * @param duration - the duration of the pace
18
+ * @returns a new StructureBuilder
19
+ */
20
+ (duration: string): T;
21
+ /**
22
+ * Attach a pace action
23
+ *
24
+ * @param duration - the duration of the pace as a function
25
+ * @returns a new StructureBuilder
26
+ */
27
+ (duration: SessionTo<Duration>): T;
28
+ /**
29
+ * Attach a pace action
30
+ *
31
+ * @param duration - the duration of the pace, in seconds or with an explicit time unit
32
+ * @param counterName - the name of the loop counter, as stored in the Session
33
+ * @returns a new StructureBuilder
34
+ */
35
+ (duration: Duration, counterName: string): T;
36
+ /**
37
+ * Attach a pace action where the duration is defined as a Gatling Expression Language string. This expression must
38
+ * resolve to either a number, then the unit will be seconds, or an object with an explicit time unit.
39
+ *
40
+ * @param duration - the duration of the pace
41
+ * @param counterName - the name of the loop counter, as stored in the Session
42
+ * @returns a new StructureBuilder
43
+ */
44
+ (duration: string, counterName: string): T;
45
+ /**
46
+ * Attach a pace action
47
+ *
48
+ * @param duration - the duration of the pace as a function
49
+ * @param counterName - the name of the loop counter, as stored in the Session
50
+ * @returns a new StructureBuilder
51
+ */
52
+ (duration: SessionTo<Duration>, counterName: string): T;
53
+ /**
54
+ * Attach a pace action where the duration is random between 2 bounds
55
+ *
56
+ * @param min - the duration of the pace, in seconds or with an explicit time unit
57
+ * @param max - the duration of the pace, in seconds or with an explicit time unit
58
+ * @returns a new StructureBuilder
59
+ */
60
+ (min: Duration, max: Duration): T;
61
+ /**
62
+ * Attach a pace action where the duration is random between 2 bounds
63
+ *
64
+ * @param min - the duration of the pace as a function
65
+ * @param max - the duration of the pace as a function
66
+ * @returns a new StructureBuilder
67
+ */
68
+ (min: SessionTo<Duration>, max: SessionTo<Duration>): T;
69
+ /**
70
+ * Attach a pace action where the duration is random between 2 bounds
71
+ *
72
+ * @param min - the duration of the pace, in seconds or with an explicit time unit
73
+ * @param max - the duration of the pace, in seconds or with an explicit time unit
74
+ * @param counterName - the name of the loop counter, as stored in the Session
75
+ * @returns a new StructureBuilder
76
+ */
77
+ (min: Duration, max: Duration, counterName: string): T;
78
+ /**
79
+ * Attach a pace action where the duration is random between 2 bounds as Gatling Expression Language strings. These
80
+ * expressions must resolve to either a number, then the unit will be seconds, or an object with an explicit time unit.
81
+ *
82
+ * @param min - the duration of the pace
83
+ * @param max - the duration of the pace
84
+ * @param counterName - the name of the loop counter, as stored in the Session
85
+ * @returns a new StructureBuilder
86
+ */
87
+ (min: string, max: string, counterName: string): T;
88
+ /**
89
+ * Attach a pace action where the duration is random between 2 bounds
90
+ *
91
+ * @param min - the duration of the pace as a function
92
+ * @param max - the duration of the pace as a function
93
+ * @param counterName - the name of the loop counter, as stored in the Session
94
+ * @returns a new StructureBuilder
95
+ */
96
+ (min: SessionTo<Duration>, max: SessionTo<Duration>, counterName: string): T;
97
+ }
98
+ export interface Paces<T extends Paces<T>> {
99
+ pace: PaceFunction<T>;
100
+ }
101
+ export declare const paceImpl: <J2, J1 extends JvmPaces<J2, any>, T extends Paces<T>>(jvmGroups: J1, wrap: (wrapped: J2) => T) => PaceFunction<T>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paceImpl = void 0;
4
+ require("@gatling.io/jvm-types");
5
+ const duration_1 = require("../utils/duration");
6
+ const session_1 = require("../session");
7
+ const callbacks_1 = require("../gatlingJvm/callbacks");
8
+ const paceImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => {
9
+ if (arg2 !== undefined) {
10
+ // pace(min, max, counterName)
11
+ if (typeof arg0 === "string" && typeof arg1 === "string") {
12
+ return wrap(jvmGroups.pace(arg0, arg1, arg2));
13
+ }
14
+ else if (typeof arg0 === "function" && typeof arg1 === "function") {
15
+ return wrap(jvmGroups.pace((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionToDuration)(arg0)), (0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionToDuration)(arg1)), arg2));
16
+ }
17
+ else if ((0, duration_1.isDuration)(arg0) && (0, duration_1.isDuration)(arg1)) {
18
+ return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0), (0, duration_1.toJvmDuration)(arg1), arg2));
19
+ }
20
+ }
21
+ else if (arg1 !== undefined) {
22
+ if (typeof arg1 === "string") {
23
+ // pace(duration, counterName)
24
+ if (typeof arg0 === "string") {
25
+ return wrap(jvmGroups.pace(arg0, arg1));
26
+ }
27
+ else if (typeof arg0 === "function") {
28
+ return wrap(jvmGroups.pace((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionToDuration)(arg0)), arg1));
29
+ }
30
+ else if ((0, duration_1.isDuration)(arg0)) {
31
+ return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0), arg1));
32
+ }
33
+ }
34
+ else {
35
+ // pace(min, max)
36
+ if (typeof arg0 === "function" && typeof arg1 === "function") {
37
+ return wrap(jvmGroups.pace((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionToDuration)(arg0)), (0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionToDuration)(arg1))));
38
+ }
39
+ else if ((0, duration_1.isDuration)(arg0) && (0, duration_1.isDuration)(arg1)) {
40
+ return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0), (0, duration_1.toJvmDuration)(arg1)));
41
+ }
42
+ }
43
+ }
44
+ else {
45
+ // pace(duration)
46
+ if (typeof arg0 === "string") {
47
+ return wrap(jvmGroups.pace(arg0));
48
+ }
49
+ else if (typeof arg0 === "function") {
50
+ return wrap(jvmGroups.pace((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionToDuration)(arg0))));
51
+ }
52
+ else if ((0, duration_1.isDuration)(arg0)) {
53
+ return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0)));
54
+ }
55
+ }
56
+ throw Error(`pace() called with invalid arguments ${arg0}, ${arg1}, ${arg2}`);
57
+ };
58
+ exports.paceImpl = paceImpl;