@gatling.io/http 3.13.103 → 3.13.104-M10
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 +5 -5
- package/jest.config.js +0 -5
- package/src/bodyPart.ts +0 -590
- package/src/checks.ts +0 -142
- package/src/cookies.ts +0 -227
- package/src/feeders.ts +0 -13
- package/src/headers.ts +0 -32
- package/src/index.test.ts +0 -425
- package/src/index.ts +0 -242
- package/src/method.ts +0 -65
- package/src/polling.ts +0 -59
- package/src/protocol.ts +0 -1011
- package/src/proxy.ts +0 -61
- package/src/request/body.ts +0 -12
- package/src/request/index.ts +0 -838
- package/src/request/request.ts +0 -37
- package/src/response/body.ts +0 -19
- package/src/response/index.ts +0 -61
- package/src/response/status.ts +0 -428
- package/tsconfig.json +0 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gatling.io/http",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.104-M10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://gatling.io",
|
|
6
6
|
"repository": "github:gatling/gatling-js",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"main": "target/index.js",
|
|
21
21
|
"types": "target/index.d.ts",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@gatling.io/jvm-types": "3.13.
|
|
24
|
-
"@gatling.io/core": "3.13.
|
|
23
|
+
"@gatling.io/jvm-types": "3.13.104-M10",
|
|
24
|
+
"@gatling.io/core": "3.13.104-M10"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/jest": "29.5.14",
|
|
28
28
|
"jest": "29.7.0",
|
|
29
|
-
"prettier": "3.
|
|
29
|
+
"prettier": "3.4.1",
|
|
30
30
|
"rimraf": "6.0.1",
|
|
31
31
|
"ts-jest": "29.2.5",
|
|
32
32
|
"ts-node": "10.9.2",
|
|
33
|
-
"typescript": "5.
|
|
33
|
+
"typescript": "5.7.2"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"clean": "rimraf target",
|
package/jest.config.js
DELETED
package/src/bodyPart.ts
DELETED
|
@@ -1,590 +0,0 @@
|
|
|
1
|
-
import { Expression, Session, Wrapper, underlyingSessionTo, asByteArray, asByteArrayFunction } from "@gatling.io/core";
|
|
2
|
-
import { HttpDsl as JvmHttpDsl } from "@gatling.io/jvm-types";
|
|
3
|
-
|
|
4
|
-
import JvmSession = io.gatling.javaapi.core.Session;
|
|
5
|
-
import JvmBodyPart = io.gatling.javaapi.http.BodyPart;
|
|
6
|
-
|
|
7
|
-
export interface BodyPart extends Wrapper<JvmBodyPart> {
|
|
8
|
-
/**
|
|
9
|
-
* Define the contentType attribute
|
|
10
|
-
*
|
|
11
|
-
* @param contentType - the contentType attribute, expressed as a Gatling Expression Language String
|
|
12
|
-
* @returns a new BodyPart instance
|
|
13
|
-
*/
|
|
14
|
-
contentType(contentType: string): BodyPart;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Define the contentType attribute
|
|
18
|
-
*
|
|
19
|
-
* @param contentType - the contentType attribute, expressed as a function
|
|
20
|
-
* @returns a new BodyPart instance
|
|
21
|
-
*/
|
|
22
|
-
contentType(contentType: (session: Session) => string): BodyPart;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Define the charset attribute
|
|
26
|
-
*
|
|
27
|
-
* @param charset - the static charset attribute
|
|
28
|
-
* @returns a new BodyPart instance
|
|
29
|
-
*/
|
|
30
|
-
charset(charset: string): BodyPart;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Define the dispositionType attribute
|
|
34
|
-
*
|
|
35
|
-
* @param dispositionType - the dispositionType attribute, expressed as a Gatling Expression
|
|
36
|
-
* Language String
|
|
37
|
-
* @returns a new BodyPart instance
|
|
38
|
-
*/
|
|
39
|
-
dispositionType(dispositionType: string): BodyPart;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Define the dispositionType attribute
|
|
43
|
-
*
|
|
44
|
-
* @param dispositionType - the dispositionType attribute, expressed as a function
|
|
45
|
-
* @returns a new BodyPart instance
|
|
46
|
-
*/
|
|
47
|
-
dispositionType(dispositionType: (session: Session) => string): BodyPart;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Define the fileName attribute
|
|
51
|
-
*
|
|
52
|
-
* @param fileName - the fileName attribute, expressed as a Gatling Expression Language String
|
|
53
|
-
* @returns a new BodyPart instance
|
|
54
|
-
*/
|
|
55
|
-
fileName(fileName: string): BodyPart;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Define the fileName attribute
|
|
59
|
-
*
|
|
60
|
-
* @param fileName - the fileName attribute, expressed as a function
|
|
61
|
-
* @returns a new BodyPart instance
|
|
62
|
-
*/
|
|
63
|
-
fileName(fileName: (session: Session) => string): BodyPart;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Define the contentId attribute
|
|
67
|
-
*
|
|
68
|
-
* @param contentId - the contentId attribute, expressed as a Gatling Expression Language String
|
|
69
|
-
* @returns a new BodyPart instance
|
|
70
|
-
*/
|
|
71
|
-
contentId(contentId: string): BodyPart;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Define the contentId attribute
|
|
75
|
-
*
|
|
76
|
-
* @param contentId - the contentId attribute, expressed as a function
|
|
77
|
-
* @returns a new BodyPart instance
|
|
78
|
-
*/
|
|
79
|
-
contentId(contentId: (session: Session) => string): BodyPart;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Define the transferEncoding attribute
|
|
83
|
-
*
|
|
84
|
-
* @param transferEncoding - the static transferEncoding attribute
|
|
85
|
-
* @returns a new BodyPart instance
|
|
86
|
-
*/
|
|
87
|
-
transferEncoding(transferEncoding: string): BodyPart;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Define a header
|
|
91
|
-
*
|
|
92
|
-
* @param name - the header name, expressed as a Gatling Expression Language String
|
|
93
|
-
* @param value - the header value, expressed as a Gatling Expression Language String
|
|
94
|
-
* @returns a new BodyPart instance
|
|
95
|
-
*/
|
|
96
|
-
header(name: string, value: string): BodyPart;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Define a header
|
|
100
|
-
*
|
|
101
|
-
* @param name - the header name, expressed as a Gatling Expression Language String
|
|
102
|
-
* @param value - the header value, expressed as a function
|
|
103
|
-
* @returns a new BodyPart instance
|
|
104
|
-
*/
|
|
105
|
-
header(name: string, value: (session: Session) => string): BodyPart;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Define a header
|
|
109
|
-
*
|
|
110
|
-
* @param name - the header name, expressed as a function
|
|
111
|
-
* @param value - the header value, expressed as a Gatling Expression Language String
|
|
112
|
-
* @returns a new BodyPart instance
|
|
113
|
-
*/
|
|
114
|
-
header(name: (session: Session) => string, value: string): BodyPart;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Define a header
|
|
118
|
-
*
|
|
119
|
-
* @param name - the header name, expressed as a function
|
|
120
|
-
* @param value - the header value, expressed as a function
|
|
121
|
-
* @returns a new BodyPart instance
|
|
122
|
-
*/
|
|
123
|
-
header(name: (session: Session) => string, value: (session: Session) => string): BodyPart;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export const wrapBodyPart = (_underlying: JvmBodyPart): BodyPart => ({
|
|
127
|
-
_underlying,
|
|
128
|
-
contentType: (contentType: Expression<string>): BodyPart =>
|
|
129
|
-
wrapBodyPart(
|
|
130
|
-
typeof contentType === "function"
|
|
131
|
-
? _underlying.contentType(underlyingSessionTo(contentType))
|
|
132
|
-
: _underlying.contentType(contentType)
|
|
133
|
-
),
|
|
134
|
-
charset: (charset: string): BodyPart => wrapBodyPart(_underlying.charset(charset)),
|
|
135
|
-
dispositionType: (dispositionType: Expression<string>): BodyPart =>
|
|
136
|
-
wrapBodyPart(
|
|
137
|
-
typeof dispositionType === "function"
|
|
138
|
-
? _underlying.dispositionType(underlyingSessionTo(dispositionType))
|
|
139
|
-
: _underlying.dispositionType(dispositionType)
|
|
140
|
-
),
|
|
141
|
-
fileName: (fileName: Expression<string>): BodyPart =>
|
|
142
|
-
wrapBodyPart(
|
|
143
|
-
typeof fileName === "function"
|
|
144
|
-
? _underlying.fileName(underlyingSessionTo(fileName))
|
|
145
|
-
: _underlying.fileName(fileName)
|
|
146
|
-
),
|
|
147
|
-
contentId: (contentId: Expression<string>): BodyPart =>
|
|
148
|
-
wrapBodyPart(
|
|
149
|
-
typeof contentId == "function"
|
|
150
|
-
? _underlying.contentId(underlyingSessionTo(contentId))
|
|
151
|
-
: _underlying.contentId(contentId)
|
|
152
|
-
),
|
|
153
|
-
transferEncoding: (transferEncoding: string): BodyPart =>
|
|
154
|
-
wrapBodyPart(_underlying.transferEncoding(transferEncoding)),
|
|
155
|
-
header: (name: Expression<string>, value: Expression<string>): BodyPart =>
|
|
156
|
-
wrapBodyPart(
|
|
157
|
-
typeof name === "function"
|
|
158
|
-
? typeof value === "function"
|
|
159
|
-
? _underlying.header(underlyingSessionTo(name), underlyingSessionTo(value))
|
|
160
|
-
: _underlying.header(underlyingSessionTo(name), value)
|
|
161
|
-
: typeof value === "function"
|
|
162
|
-
? _underlying.header(name, underlyingSessionTo(value))
|
|
163
|
-
: _underlying.header(name, value)
|
|
164
|
-
)
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
interface JvmBodyPartFunction {
|
|
168
|
-
(arg0: string): JvmBodyPart;
|
|
169
|
-
(arg0: (jvmSession: JvmSession) => string): JvmBodyPart;
|
|
170
|
-
(arg0: string, arg1: string): JvmBodyPart;
|
|
171
|
-
(arg0: string, arg1: (jvmSession: JvmSession) => string): JvmBodyPart;
|
|
172
|
-
(arg0: (jvmSession: JvmSession) => string, arg1: string): JvmBodyPart;
|
|
173
|
-
(arg0: (jvmSession: JvmSession) => string, arg1: (jvmSession: JvmSession) => string): JvmBodyPart;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const bodyPartImpl =
|
|
177
|
-
(jvmBodyPart: JvmBodyPartFunction) =>
|
|
178
|
-
(arg0: Expression<string>, arg1?: Expression<string>): BodyPart => {
|
|
179
|
-
if (arg1 === undefined) {
|
|
180
|
-
if (typeof arg0 === "function") {
|
|
181
|
-
return wrapBodyPart(jvmBodyPart(underlyingSessionTo(arg0)));
|
|
182
|
-
} else {
|
|
183
|
-
return wrapBodyPart(jvmBodyPart(arg0));
|
|
184
|
-
}
|
|
185
|
-
} else {
|
|
186
|
-
if (typeof arg0 === "function") {
|
|
187
|
-
if (typeof arg1 === "function") {
|
|
188
|
-
return wrapBodyPart(jvmBodyPart(underlyingSessionTo(arg0), underlyingSessionTo(arg1)));
|
|
189
|
-
} else {
|
|
190
|
-
return wrapBodyPart(jvmBodyPart(underlyingSessionTo(arg0), arg1));
|
|
191
|
-
}
|
|
192
|
-
} else {
|
|
193
|
-
if (typeof arg1 === "function") {
|
|
194
|
-
return wrapBodyPart(jvmBodyPart(arg0, underlyingSessionTo(arg1)));
|
|
195
|
-
} else {
|
|
196
|
-
return wrapBodyPart(jvmBodyPart(arg0, arg1));
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
export interface ElFileBodyPartFunction {
|
|
203
|
-
/**
|
|
204
|
-
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
205
|
-
* Gatling Expression Language String. The name of the part is equal to the file name.
|
|
206
|
-
*
|
|
207
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
208
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
209
|
-
* @returns the next DSL step
|
|
210
|
-
*/
|
|
211
|
-
(filePath: string): BodyPart;
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
215
|
-
* Gatling Expression Language String The name of the part is equal to the file name.
|
|
216
|
-
*
|
|
217
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
218
|
-
* absolute, expressed as a function
|
|
219
|
-
* @returns the next DSL step
|
|
220
|
-
*/
|
|
221
|
-
(filePath: (session: Session) => string): BodyPart;
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
225
|
-
* Gatling Expression Language String.
|
|
226
|
-
*
|
|
227
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
228
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
229
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
230
|
-
* @returns the next DSL step
|
|
231
|
-
*/
|
|
232
|
-
(name: string, filePath: string): BodyPart;
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
236
|
-
* Gatling Expression Language String.
|
|
237
|
-
*
|
|
238
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
239
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
240
|
-
* absolute, expressed as a function
|
|
241
|
-
* @returns the next DSL step
|
|
242
|
-
*/
|
|
243
|
-
(name: string, filePath: (session: Session) => string): BodyPart;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
247
|
-
* Gatling Expression Language String.
|
|
248
|
-
*
|
|
249
|
-
* @param name - the name of the part, expressed as a function
|
|
250
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
251
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
252
|
-
* @returns the next DSL step
|
|
253
|
-
*/
|
|
254
|
-
(name: (session: Session) => string, filePath: string): BodyPart;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
258
|
-
* Gatling Expression Language String.
|
|
259
|
-
*
|
|
260
|
-
* @param name - the name of the part, expressed as a function
|
|
261
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
262
|
-
* absolute, expressed as a function
|
|
263
|
-
* @returns the next DSL step
|
|
264
|
-
*/
|
|
265
|
-
(name: (session: Session) => string, filePath: (session: Session) => string): BodyPart;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export const ElFileBodyPart: ElFileBodyPartFunction = (arg0: Expression<string>, arg1?: Expression<string>) =>
|
|
269
|
-
bodyPartImpl(JvmHttpDsl.ElFileBodyPart)(arg0, arg1);
|
|
270
|
-
|
|
271
|
-
export interface StringBodyPartFunction {
|
|
272
|
-
/**
|
|
273
|
-
* Bootstrap a {@link BodyPart} backed by a String
|
|
274
|
-
*
|
|
275
|
-
* @param string - the string, interpreted as a Gatling Expression Language String
|
|
276
|
-
* @returns the next DSL step
|
|
277
|
-
*/
|
|
278
|
-
(string: string): BodyPart;
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Bootstrap a {@link BodyPart} backed by a String
|
|
282
|
-
*
|
|
283
|
-
* @param string - the string, expressed as a function
|
|
284
|
-
* @returns the next DSL step
|
|
285
|
-
*/
|
|
286
|
-
(string: (session: Session) => string): BodyPart;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Bootstrap a {@link BodyPart} backed by a String
|
|
290
|
-
*
|
|
291
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
292
|
-
* @param string - the string, interpreted as a Gatling Expression Language String
|
|
293
|
-
* @returns the next DSL step
|
|
294
|
-
*/
|
|
295
|
-
(name: string, string: string): BodyPart;
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Bootstrap a {@link BodyPart} backed by a String
|
|
299
|
-
*
|
|
300
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
301
|
-
* @param string - the string, interpreted as a function
|
|
302
|
-
* @returns the next DSL step
|
|
303
|
-
*/
|
|
304
|
-
(name: string, string: (session: Session) => string): BodyPart;
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Bootstrap a {@link BodyPart} backed by a String
|
|
308
|
-
*
|
|
309
|
-
* @param name - the name of the part, expressed as a function
|
|
310
|
-
* @param string - the string, interpreted as a Gatling Expression Language String
|
|
311
|
-
* @returns the next DSL step
|
|
312
|
-
*/
|
|
313
|
-
(name: (session: Session) => string, string: string): BodyPart;
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Bootstrap a {@link BodyPart} backed by a String
|
|
317
|
-
*
|
|
318
|
-
* @param name - the name of the part, expressed as a function
|
|
319
|
-
* @param string - the string, interpreted as a function
|
|
320
|
-
* @returns the next DSL step
|
|
321
|
-
*/
|
|
322
|
-
(name: (session: Session) => string, string: (session: Session) => string): BodyPart;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
export const StringBodyPart: StringBodyPartFunction = (arg0: Expression<string>, arg1?: Expression<string>) =>
|
|
326
|
-
bodyPartImpl(JvmHttpDsl.StringBodyPart)(arg0, arg1);
|
|
327
|
-
|
|
328
|
-
export interface RawFileBodyPartFunction {
|
|
329
|
-
/**
|
|
330
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is. The name of the
|
|
331
|
-
* part is equal to the name of the file.
|
|
332
|
-
*
|
|
333
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
334
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
335
|
-
* @returns the next DSL step
|
|
336
|
-
*/
|
|
337
|
-
(filePath: string): BodyPart;
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is. The name of the
|
|
341
|
-
* part is equal to the name of the file.
|
|
342
|
-
*
|
|
343
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
344
|
-
* absolute, expressed as a function
|
|
345
|
-
* @returns the next DSL step
|
|
346
|
-
*/
|
|
347
|
-
(filePath: (session: Session) => string): BodyPart;
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is.
|
|
351
|
-
*
|
|
352
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
353
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
354
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
355
|
-
* @returns the next DSL step
|
|
356
|
-
*/
|
|
357
|
-
(name: string, filePath: string): BodyPart;
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is.
|
|
361
|
-
*
|
|
362
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
363
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
364
|
-
* absolute, expressed as a function
|
|
365
|
-
* @returns the next DSL step
|
|
366
|
-
*/
|
|
367
|
-
(name: string, filePath: (session: Session) => string): BodyPart;
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is.
|
|
371
|
-
*
|
|
372
|
-
* @param name - the name of the part, expressed as a function
|
|
373
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
374
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
375
|
-
* @returns the next DSL step
|
|
376
|
-
*/
|
|
377
|
-
(name: (session: Session) => string, filePath: string): BodyPart;
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is.
|
|
381
|
-
*
|
|
382
|
-
* @param name - the name of the part, expressed as a function
|
|
383
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
384
|
-
* absolute, expressed as a function
|
|
385
|
-
* @returns the next DSL step
|
|
386
|
-
*/
|
|
387
|
-
(name: (session: Session) => string, filePath: (session: Session) => string): BodyPart;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
export const RawFileBodyPart: RawFileBodyPartFunction = (arg0: Expression<string>, arg1?: Expression<string>) =>
|
|
391
|
-
bodyPartImpl(JvmHttpDsl.RawFileBodyPart)(arg0, arg1);
|
|
392
|
-
|
|
393
|
-
export interface PebbleFileBodyPartFunction {
|
|
394
|
-
/**
|
|
395
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
396
|
-
* href="https://pebbletemplates.io/">Pebble</a> template. The name of the part is equal to the
|
|
397
|
-
* name of the file.
|
|
398
|
-
*
|
|
399
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
400
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
401
|
-
* @returns the next DSL step
|
|
402
|
-
*/
|
|
403
|
-
(filePath: string): BodyPart;
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
407
|
-
* href="https://pebbletemplates.io/">Pebble</a> template. The name of the part is equal to the
|
|
408
|
-
* name of the file.
|
|
409
|
-
*
|
|
410
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
411
|
-
* absolute, expressed as a function
|
|
412
|
-
* @returns the next DSL step
|
|
413
|
-
*/
|
|
414
|
-
(filePath: (session: Session) => string): BodyPart;
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
418
|
-
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
419
|
-
*
|
|
420
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
421
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
422
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
423
|
-
* @returns the next DSL step
|
|
424
|
-
*/
|
|
425
|
-
(name: string, filePath: string): BodyPart;
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
429
|
-
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
430
|
-
*
|
|
431
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
432
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
433
|
-
* absolute, expressed as a function
|
|
434
|
-
* @returns the next DSL step
|
|
435
|
-
*/
|
|
436
|
-
(name: string, filePath: (session: Session) => string): BodyPart;
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
440
|
-
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
441
|
-
*
|
|
442
|
-
* @param name - the name of the part, expressed as a function
|
|
443
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
444
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
445
|
-
* @returns the next DSL step
|
|
446
|
-
*/
|
|
447
|
-
(name: (session: Session) => string, filePath: string): BodyPart;
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
451
|
-
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
452
|
-
*
|
|
453
|
-
* @param name - the name of the part, expressed as a function
|
|
454
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
455
|
-
* absolute, expressed as a function
|
|
456
|
-
* @returns the next DSL step
|
|
457
|
-
*/
|
|
458
|
-
(name: (session: Session) => string, filePath: (session: Session) => string): BodyPart;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
export const PebbleFileBodyPart: PebbleFileBodyPartFunction = (arg0: Expression<string>, arg1?: Expression<string>) =>
|
|
462
|
-
bodyPartImpl(JvmHttpDsl.PebbleFileBodyPart)(arg0, arg1);
|
|
463
|
-
|
|
464
|
-
export interface PebbleStringBodyPartFunction {
|
|
465
|
-
/**
|
|
466
|
-
* Bootstrap a {@link BodyPart} backed by a String, whose content is interpreted as a <a
|
|
467
|
-
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
468
|
-
*
|
|
469
|
-
* @param string - the Pebble String template
|
|
470
|
-
* @returns the next DSL step
|
|
471
|
-
*/
|
|
472
|
-
(string: string): BodyPart;
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* Bootstrap a {@link BodyPart} backed by a String, whose content is interpreted as a <a
|
|
476
|
-
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
477
|
-
*
|
|
478
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
479
|
-
* @param string - the Pebble String template
|
|
480
|
-
* @returns the next DSL step
|
|
481
|
-
*/
|
|
482
|
-
(name: string, string: string): BodyPart;
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Bootstrap a {@link BodyPart} backed by a String, whose content is interpreted as a <a
|
|
486
|
-
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
487
|
-
*
|
|
488
|
-
* @param name - the name of the part, expressed as a function
|
|
489
|
-
* @param string - the Pebble String template
|
|
490
|
-
* @returns the next DSL step
|
|
491
|
-
*/
|
|
492
|
-
(name: (session: Session) => string, string: string): BodyPart;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
export const PebbleStringBodyPart: PebbleStringBodyPartFunction = (arg0: Expression<string>, arg1?: string) => {
|
|
496
|
-
if (arg1 === undefined) {
|
|
497
|
-
if (typeof arg0 === "function") {
|
|
498
|
-
throw Error(`PebbleStringBodyPart() called with invalid arguments ${arg0}, ${arg1}`);
|
|
499
|
-
} else {
|
|
500
|
-
return wrapBodyPart(JvmHttpDsl.PebbleStringBodyPart(arg0));
|
|
501
|
-
}
|
|
502
|
-
} else {
|
|
503
|
-
if (typeof arg0 === "function") {
|
|
504
|
-
return wrapBodyPart(JvmHttpDsl.PebbleStringBodyPart(underlyingSessionTo(arg0), arg1));
|
|
505
|
-
} else {
|
|
506
|
-
return wrapBodyPart(JvmHttpDsl.PebbleStringBodyPart(arg0, arg1));
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
};
|
|
510
|
-
|
|
511
|
-
export interface ByteArrayBodyPartFunction {
|
|
512
|
-
/**
|
|
513
|
-
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
514
|
-
*
|
|
515
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
516
|
-
* @param bytes - the static bytes
|
|
517
|
-
* @returns the next DSL step
|
|
518
|
-
*/
|
|
519
|
-
(name: string, bytes: string): BodyPart;
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
523
|
-
*
|
|
524
|
-
* @param name - the name of the part, expressed as a function
|
|
525
|
-
* @param bytes - the static bytes
|
|
526
|
-
* @returns the next DSL step
|
|
527
|
-
*/
|
|
528
|
-
(name: (session: Session) => string, bytes: string): BodyPart;
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
532
|
-
*
|
|
533
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
534
|
-
* @param bytes - the bytes, expressed as a Gatling Expression Language String
|
|
535
|
-
* @returns the next DSL step
|
|
536
|
-
*/
|
|
537
|
-
(name: string, bytes: number[]): BodyPart;
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
541
|
-
*
|
|
542
|
-
* @param name - the name of the part, expressed as a function
|
|
543
|
-
* @param bytes - the bytes, expressed as a Gatling Expression Language String
|
|
544
|
-
* @returns the next DSL step
|
|
545
|
-
*/
|
|
546
|
-
(name: (session: Session) => string, bytes: number[]): BodyPart;
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
550
|
-
*
|
|
551
|
-
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
552
|
-
* @param bytes - the bytes, expressed as a function
|
|
553
|
-
* @returns the next DSL step
|
|
554
|
-
*/
|
|
555
|
-
(name: string, bytes: (session: Session) => number[]): BodyPart;
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
559
|
-
*
|
|
560
|
-
* @param name - the name of the part, expressed as a function
|
|
561
|
-
* @param bytes - the bytes, expressed as a function
|
|
562
|
-
* @returns the next DSL step
|
|
563
|
-
*/
|
|
564
|
-
(name: (session: Session) => string, bytes: (session: Session) => number[]): BodyPart;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
export const ByteArrayBodyPart: ByteArrayBodyPartFunction = (
|
|
568
|
-
arg0: Expression<string>,
|
|
569
|
-
arg1: string | Expression<number[]>
|
|
570
|
-
): BodyPart => {
|
|
571
|
-
if (typeof arg0 === "function") {
|
|
572
|
-
if (typeof arg1 === "function") {
|
|
573
|
-
return wrapBodyPart(
|
|
574
|
-
JvmHttpDsl.ByteArrayBodyPart(underlyingSessionTo(arg0), asByteArrayFunction(underlyingSessionTo(arg1)))
|
|
575
|
-
);
|
|
576
|
-
} else if (typeof arg1 === "string") {
|
|
577
|
-
return wrapBodyPart(JvmHttpDsl.ByteArrayBodyPart(underlyingSessionTo(arg0), arg1));
|
|
578
|
-
} else {
|
|
579
|
-
return wrapBodyPart(JvmHttpDsl.ByteArrayBodyPart(underlyingSessionTo(arg0), asByteArray(arg1)));
|
|
580
|
-
}
|
|
581
|
-
} else {
|
|
582
|
-
if (typeof arg1 === "function") {
|
|
583
|
-
return wrapBodyPart(JvmHttpDsl.ByteArrayBodyPart(arg0, asByteArrayFunction(underlyingSessionTo(arg1))));
|
|
584
|
-
} else if (typeof arg1 === "string") {
|
|
585
|
-
return wrapBodyPart(JvmHttpDsl.ByteArrayBodyPart(arg0, arg1));
|
|
586
|
-
} else {
|
|
587
|
-
return wrapBodyPart(JvmHttpDsl.ByteArrayBodyPart(arg0, asByteArray(arg1)));
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
};
|