@gatling.io/http 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.
- package/package.json +25 -0
- package/target/bodyPart.d.ts +418 -0
- package/target/bodyPart.js +110 -0
- package/target/checks.d.ts +97 -0
- package/target/checks.js +35 -0
- package/target/cookies.d.ts +100 -0
- package/target/cookies.js +70 -0
- package/target/feeders.d.ts +9 -0
- package/target/feeders.js +14 -0
- package/target/headers.d.ts +26 -0
- package/target/headers.js +8 -0
- package/target/index.d.ts +163 -0
- package/target/index.js +59 -0
- package/target/method.d.ts +56 -0
- package/target/method.js +2 -0
- package/target/polling.d.ts +39 -0
- package/target/polling.js +16 -0
- package/target/protocol.d.ts +575 -0
- package/target/protocol.js +119 -0
- package/target/proxy.d.ts +44 -0
- package/target/proxy.js +21 -0
- package/target/request/body.d.ts +6 -0
- package/target/request/body.js +8 -0
- package/target/request/index.d.ts +521 -0
- package/target/request/index.js +207 -0
- package/target/request/request.d.ts +9 -0
- package/target/request/request.js +11 -0
- package/target/response/body.d.ts +9 -0
- package/target/response/body.js +11 -0
- package/target/response/index.d.ts +15 -0
- package/target/response/index.js +46 -0
- package/target/response/status.d.ts +236 -0
- package/target/response/status.js +361 -0
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gatling.io/http",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"main": "target/index.js",
|
|
5
|
+
"types": "target/index.d.ts",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@gatling.io/jvm-types": "0.1.0",
|
|
8
|
+
"@gatling.io/core": "0.1.0"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@types/jest": "29.5.12",
|
|
12
|
+
"jest": "29.7.0",
|
|
13
|
+
"prettier": "3.2.5",
|
|
14
|
+
"rimraf": "5.0.5",
|
|
15
|
+
"ts-jest": "29.1.2",
|
|
16
|
+
"ts-node": "10.9.2",
|
|
17
|
+
"typescript": "5.4.5"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"clean": "rimraf target",
|
|
21
|
+
"format": "prettier --write '**/*.ts'",
|
|
22
|
+
"test": "jest",
|
|
23
|
+
"build": "tsc -p ."
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { Session, Wrapper } from "@gatling.io/core";
|
|
2
|
+
import JvmBodyPart = io.gatling.javaapi.http.BodyPart;
|
|
3
|
+
export interface BodyPart extends Wrapper<JvmBodyPart> {
|
|
4
|
+
/**
|
|
5
|
+
* Define the contentType attribute
|
|
6
|
+
*
|
|
7
|
+
* @param contentType - the contentType attribute, expressed as a Gatling Expression Language String
|
|
8
|
+
* @returns a new BodyPart instance
|
|
9
|
+
*/
|
|
10
|
+
contentType(contentType: string): BodyPart;
|
|
11
|
+
/**
|
|
12
|
+
* Define the contentType attribute
|
|
13
|
+
*
|
|
14
|
+
* @param contentType - the contentType attribute, expressed as a function
|
|
15
|
+
* @returns a new BodyPart instance
|
|
16
|
+
*/
|
|
17
|
+
contentType(contentType: (session: Session) => string): BodyPart;
|
|
18
|
+
/**
|
|
19
|
+
* Define the charset attribute
|
|
20
|
+
*
|
|
21
|
+
* @param charset - the static charset attribute
|
|
22
|
+
* @returns a new BodyPart instance
|
|
23
|
+
*/
|
|
24
|
+
charset(charset: string): BodyPart;
|
|
25
|
+
/**
|
|
26
|
+
* Define the dispositionType attribute
|
|
27
|
+
*
|
|
28
|
+
* @param dispositionType - the dispositionType attribute, expressed as a Gatling Expression
|
|
29
|
+
* Language String
|
|
30
|
+
* @returns a new BodyPart instance
|
|
31
|
+
*/
|
|
32
|
+
dispositionType(dispositionType: string): BodyPart;
|
|
33
|
+
/**
|
|
34
|
+
* Define the dispositionType attribute
|
|
35
|
+
*
|
|
36
|
+
* @param dispositionType - the dispositionType attribute, expressed as a function
|
|
37
|
+
* @returns a new BodyPart instance
|
|
38
|
+
*/
|
|
39
|
+
dispositionType(dispositionType: (session: Session) => string): BodyPart;
|
|
40
|
+
/**
|
|
41
|
+
* Define the fileName attribute
|
|
42
|
+
*
|
|
43
|
+
* @param fileName - the fileName attribute, expressed as a Gatling Expression Language String
|
|
44
|
+
* @returns a new BodyPart instance
|
|
45
|
+
*/
|
|
46
|
+
fileName(fileName: string): BodyPart;
|
|
47
|
+
/**
|
|
48
|
+
* Define the fileName attribute
|
|
49
|
+
*
|
|
50
|
+
* @param fileName - the fileName attribute, expressed as a function
|
|
51
|
+
* @returns a new BodyPart instance
|
|
52
|
+
*/
|
|
53
|
+
fileName(fileName: (session: Session) => string): BodyPart;
|
|
54
|
+
/**
|
|
55
|
+
* Define the contentId attribute
|
|
56
|
+
*
|
|
57
|
+
* @param contentId - the contentId attribute, expressed as a Gatling Expression Language String
|
|
58
|
+
* @returns a new BodyPart instance
|
|
59
|
+
*/
|
|
60
|
+
contentId(contentId: string): BodyPart;
|
|
61
|
+
/**
|
|
62
|
+
* Define the contentId attribute
|
|
63
|
+
*
|
|
64
|
+
* @param contentId - the contentId attribute, expressed as a function
|
|
65
|
+
* @returns a new BodyPart instance
|
|
66
|
+
*/
|
|
67
|
+
contentId(contentId: (session: Session) => string): BodyPart;
|
|
68
|
+
/**
|
|
69
|
+
* Define the transferEncoding attribute
|
|
70
|
+
*
|
|
71
|
+
* @param transferEncoding - the static transferEncoding attribute
|
|
72
|
+
* @returns a new BodyPart instance
|
|
73
|
+
*/
|
|
74
|
+
transferEncoding(transferEncoding: string): BodyPart;
|
|
75
|
+
/**
|
|
76
|
+
* Define a header
|
|
77
|
+
*
|
|
78
|
+
* @param name - the header name, expressed as a Gatling Expression Language String
|
|
79
|
+
* @param value - the header value, expressed as a Gatling Expression Language String
|
|
80
|
+
* @returns a new BodyPart instance
|
|
81
|
+
*/
|
|
82
|
+
header(name: string, value: string): BodyPart;
|
|
83
|
+
/**
|
|
84
|
+
* Define a header
|
|
85
|
+
*
|
|
86
|
+
* @param name - the header name, expressed as a Gatling Expression Language String
|
|
87
|
+
* @param value - the header value, expressed as a function
|
|
88
|
+
* @returns a new BodyPart instance
|
|
89
|
+
*/
|
|
90
|
+
header(name: string, value: (session: Session) => string): BodyPart;
|
|
91
|
+
/**
|
|
92
|
+
* Define a header
|
|
93
|
+
*
|
|
94
|
+
* @param name - the header name, expressed as a function
|
|
95
|
+
* @param value - the header value, expressed as a Gatling Expression Language String
|
|
96
|
+
* @returns a new BodyPart instance
|
|
97
|
+
*/
|
|
98
|
+
header(name: (session: Session) => string, value: string): BodyPart;
|
|
99
|
+
/**
|
|
100
|
+
* Define a header
|
|
101
|
+
*
|
|
102
|
+
* @param name - the header name, expressed as a function
|
|
103
|
+
* @param value - the header value, expressed as a function
|
|
104
|
+
* @returns a new BodyPart instance
|
|
105
|
+
*/
|
|
106
|
+
header(name: (session: Session) => string, value: (session: Session) => string): BodyPart;
|
|
107
|
+
}
|
|
108
|
+
export declare const wrapBodyPart: (_underlying: JvmBodyPart) => BodyPart;
|
|
109
|
+
export interface ElFileBodyPartFunction {
|
|
110
|
+
/**
|
|
111
|
+
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
112
|
+
* Gatling Expression Language String. The name of the part is equal to the file name.
|
|
113
|
+
*
|
|
114
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
115
|
+
* absolute, expressed as a Gatling Expression Language String
|
|
116
|
+
* @returns the next DSL step
|
|
117
|
+
*/
|
|
118
|
+
(filePath: string): BodyPart;
|
|
119
|
+
/**
|
|
120
|
+
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
121
|
+
* Gatling Expression Language String The name of the part is equal to the file name.
|
|
122
|
+
*
|
|
123
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
124
|
+
* absolute, expressed as a function
|
|
125
|
+
* @returns the next DSL step
|
|
126
|
+
*/
|
|
127
|
+
(filePath: (session: Session) => string): BodyPart;
|
|
128
|
+
/**
|
|
129
|
+
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
130
|
+
* Gatling Expression Language String.
|
|
131
|
+
*
|
|
132
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
133
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
134
|
+
* absolute, expressed as a Gatling Expression Language String
|
|
135
|
+
* @returns the next DSL step
|
|
136
|
+
*/
|
|
137
|
+
(name: string, filePath: string): BodyPart;
|
|
138
|
+
/**
|
|
139
|
+
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
140
|
+
* Gatling Expression Language String.
|
|
141
|
+
*
|
|
142
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
143
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
144
|
+
* absolute, expressed as a function
|
|
145
|
+
* @returns the next DSL step
|
|
146
|
+
*/
|
|
147
|
+
(name: string, filePath: (session: Session) => string): BodyPart;
|
|
148
|
+
/**
|
|
149
|
+
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
150
|
+
* Gatling Expression Language String.
|
|
151
|
+
*
|
|
152
|
+
* @param name - the name of the part, expressed as a function
|
|
153
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
154
|
+
* absolute, expressed as a Gatling Expression Language String
|
|
155
|
+
* @returns the next DSL step
|
|
156
|
+
*/
|
|
157
|
+
(name: (session: Session) => string, filePath: string): BodyPart;
|
|
158
|
+
/**
|
|
159
|
+
* Bootstrap a {@link BodyPart} backed by a file whose text context will be interpreted as a
|
|
160
|
+
* Gatling Expression Language String.
|
|
161
|
+
*
|
|
162
|
+
* @param name - the name of the part, expressed as a function
|
|
163
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
164
|
+
* absolute, expressed as a function
|
|
165
|
+
* @returns the next DSL step
|
|
166
|
+
*/
|
|
167
|
+
(name: (session: Session) => string, filePath: (session: Session) => string): BodyPart;
|
|
168
|
+
}
|
|
169
|
+
export declare const ElFileBodyPart: ElFileBodyPartFunction;
|
|
170
|
+
export interface StringBodyPartFunction {
|
|
171
|
+
/**
|
|
172
|
+
* Bootstrap a {@link BodyPart} backed by a String
|
|
173
|
+
*
|
|
174
|
+
* @param string - the string, interpreted as a Gatling Expression Language String
|
|
175
|
+
* @returns the next DSL step
|
|
176
|
+
*/
|
|
177
|
+
(string: string): BodyPart;
|
|
178
|
+
/**
|
|
179
|
+
* Bootstrap a {@link BodyPart} backed by a String
|
|
180
|
+
*
|
|
181
|
+
* @param string - the string, expressed as a function
|
|
182
|
+
* @returns the next DSL step
|
|
183
|
+
*/
|
|
184
|
+
(string: (session: Session) => string): BodyPart;
|
|
185
|
+
/**
|
|
186
|
+
* Bootstrap a {@link BodyPart} backed by a String
|
|
187
|
+
*
|
|
188
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
189
|
+
* @param string - the string, interpreted as a Gatling Expression Language String
|
|
190
|
+
* @returns the next DSL step
|
|
191
|
+
*/
|
|
192
|
+
(name: string, string: string): BodyPart;
|
|
193
|
+
/**
|
|
194
|
+
* Bootstrap a {@link BodyPart} backed by a String
|
|
195
|
+
*
|
|
196
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
197
|
+
* @param string - the string, interpreted as a function
|
|
198
|
+
* @returns the next DSL step
|
|
199
|
+
*/
|
|
200
|
+
(name: string, string: (session: Session) => string): BodyPart;
|
|
201
|
+
/**
|
|
202
|
+
* Bootstrap a {@link BodyPart} backed by a String
|
|
203
|
+
*
|
|
204
|
+
* @param name - the name of the part, expressed as a function
|
|
205
|
+
* @param string - the string, interpreted as a Gatling Expression Language String
|
|
206
|
+
* @returns the next DSL step
|
|
207
|
+
*/
|
|
208
|
+
(name: (session: Session) => string, string: string): BodyPart;
|
|
209
|
+
/**
|
|
210
|
+
* Bootstrap a {@link BodyPart} backed by a String
|
|
211
|
+
*
|
|
212
|
+
* @param name - the name of the part, expressed as a function
|
|
213
|
+
* @param string - the string, interpreted as a function
|
|
214
|
+
* @returns the next DSL step
|
|
215
|
+
*/
|
|
216
|
+
(name: (session: Session) => string, string: (session: Session) => string): BodyPart;
|
|
217
|
+
}
|
|
218
|
+
export declare const StringBodyPart: StringBodyPartFunction;
|
|
219
|
+
export interface RawFileBodyPartFunction {
|
|
220
|
+
/**
|
|
221
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is. The name of the
|
|
222
|
+
* part is equal to the name of the file.
|
|
223
|
+
*
|
|
224
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
225
|
+
* absolute, expressed as a Gatling Expression Language String
|
|
226
|
+
* @returns the next DSL step
|
|
227
|
+
*/
|
|
228
|
+
(filePath: string): BodyPart;
|
|
229
|
+
/**
|
|
230
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is. The name of the
|
|
231
|
+
* part is equal to the name of the file.
|
|
232
|
+
*
|
|
233
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
234
|
+
* absolute, expressed as a function
|
|
235
|
+
* @returns the next DSL step
|
|
236
|
+
*/
|
|
237
|
+
(filePath: (session: Session) => string): BodyPart;
|
|
238
|
+
/**
|
|
239
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is.
|
|
240
|
+
*
|
|
241
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
242
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
243
|
+
* absolute, expressed as a Gatling Expression Language String
|
|
244
|
+
* @returns the next DSL step
|
|
245
|
+
*/
|
|
246
|
+
(name: string, filePath: string): BodyPart;
|
|
247
|
+
/**
|
|
248
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is.
|
|
249
|
+
*
|
|
250
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
251
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
252
|
+
* absolute, expressed as a function
|
|
253
|
+
* @returns the next DSL step
|
|
254
|
+
*/
|
|
255
|
+
(name: string, filePath: (session: Session) => string): BodyPart;
|
|
256
|
+
/**
|
|
257
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is.
|
|
258
|
+
*
|
|
259
|
+
* @param name - the name of the part, expressed as a function
|
|
260
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
261
|
+
* absolute, expressed as a Gatling Expression Language String
|
|
262
|
+
* @returns the next DSL step
|
|
263
|
+
*/
|
|
264
|
+
(name: (session: Session) => string, filePath: string): BodyPart;
|
|
265
|
+
/**
|
|
266
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose bytes will be sent as is.
|
|
267
|
+
*
|
|
268
|
+
* @param name - the name of the part, expressed as a function
|
|
269
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
270
|
+
* absolute, expressed as a function
|
|
271
|
+
* @returns the next DSL step
|
|
272
|
+
*/
|
|
273
|
+
(name: (session: Session) => string, filePath: (session: Session) => string): BodyPart;
|
|
274
|
+
}
|
|
275
|
+
export declare const RawFileBodyPart: RawFileBodyPartFunction;
|
|
276
|
+
export interface PebbleFileBodyPartFunction {
|
|
277
|
+
/**
|
|
278
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
279
|
+
* href="https://pebbletemplates.io/">Pebble</a> template. The name of the part is equal to the
|
|
280
|
+
* name of the file.
|
|
281
|
+
*
|
|
282
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
283
|
+
* absolute, expressed as a Gatling Expression Language String
|
|
284
|
+
* @returns the next DSL step
|
|
285
|
+
*/
|
|
286
|
+
(filePath: string): BodyPart;
|
|
287
|
+
/**
|
|
288
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
289
|
+
* href="https://pebbletemplates.io/">Pebble</a> template. The name of the part is equal to the
|
|
290
|
+
* name of the file.
|
|
291
|
+
*
|
|
292
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
293
|
+
* absolute, expressed as a function
|
|
294
|
+
* @returns the next DSL step
|
|
295
|
+
*/
|
|
296
|
+
(filePath: (session: Session) => string): BodyPart;
|
|
297
|
+
/**
|
|
298
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
299
|
+
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
300
|
+
*
|
|
301
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
302
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
303
|
+
* absolute, expressed as a Gatling Expression Language String
|
|
304
|
+
* @returns the next DSL step
|
|
305
|
+
*/
|
|
306
|
+
(name: string, filePath: string): BodyPart;
|
|
307
|
+
/**
|
|
308
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
309
|
+
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
310
|
+
*
|
|
311
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
312
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
313
|
+
* absolute, expressed as a function
|
|
314
|
+
* @returns the next DSL step
|
|
315
|
+
*/
|
|
316
|
+
(name: string, filePath: (session: Session) => string): BodyPart;
|
|
317
|
+
/**
|
|
318
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
319
|
+
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
320
|
+
*
|
|
321
|
+
* @param name - the name of the part, expressed as a function
|
|
322
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
323
|
+
* absolute, expressed as a Gatling Expression Language String
|
|
324
|
+
* @returns the next DSL step
|
|
325
|
+
*/
|
|
326
|
+
(name: (session: Session) => string, filePath: string): BodyPart;
|
|
327
|
+
/**
|
|
328
|
+
* Bootstrap a {@link BodyPart} backed by a file, whose content is interpreted as a <a
|
|
329
|
+
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
330
|
+
*
|
|
331
|
+
* @param name - the name of the part, expressed as a function
|
|
332
|
+
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
333
|
+
* absolute, expressed as a function
|
|
334
|
+
* @returns the next DSL step
|
|
335
|
+
*/
|
|
336
|
+
(name: (session: Session) => string, filePath: (session: Session) => string): BodyPart;
|
|
337
|
+
}
|
|
338
|
+
export declare const PebbleFileBodyPart: PebbleFileBodyPartFunction;
|
|
339
|
+
export interface PebbleStringBodyPartFunction {
|
|
340
|
+
/**
|
|
341
|
+
* Bootstrap a {@link BodyPart} backed by a String, whose content is interpreted as a <a
|
|
342
|
+
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
343
|
+
*
|
|
344
|
+
* @param string - the Pebble String template
|
|
345
|
+
* @returns the next DSL step
|
|
346
|
+
*/
|
|
347
|
+
(string: string): BodyPart;
|
|
348
|
+
/**
|
|
349
|
+
* Bootstrap a {@link BodyPart} backed by a String, whose content is interpreted as a <a
|
|
350
|
+
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
351
|
+
*
|
|
352
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
353
|
+
* @param string - the Pebble String template
|
|
354
|
+
* @returns the next DSL step
|
|
355
|
+
*/
|
|
356
|
+
(name: string, string: string): BodyPart;
|
|
357
|
+
/**
|
|
358
|
+
* Bootstrap a {@link BodyPart} backed by a String, whose content is interpreted as a <a
|
|
359
|
+
* href="https://pebbletemplates.io/">Pebble</a> template.
|
|
360
|
+
*
|
|
361
|
+
* @param name - the name of the part, expressed as a function
|
|
362
|
+
* @param string - the Pebble String template
|
|
363
|
+
* @returns the next DSL step
|
|
364
|
+
*/
|
|
365
|
+
(name: (session: Session) => string, string: string): BodyPart;
|
|
366
|
+
}
|
|
367
|
+
export declare const PebbleStringBodyPart: PebbleStringBodyPartFunction;
|
|
368
|
+
export interface ByteArrayBodyPartFunction {
|
|
369
|
+
/**
|
|
370
|
+
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
371
|
+
*
|
|
372
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
373
|
+
* @param bytes - the static bytes
|
|
374
|
+
* @returns the next DSL step
|
|
375
|
+
*/
|
|
376
|
+
(name: string, bytes: string): BodyPart;
|
|
377
|
+
/**
|
|
378
|
+
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
379
|
+
*
|
|
380
|
+
* @param name - the name of the part, expressed as a function
|
|
381
|
+
* @param bytes - the static bytes
|
|
382
|
+
* @returns the next DSL step
|
|
383
|
+
*/
|
|
384
|
+
(name: (session: Session) => string, bytes: string): BodyPart;
|
|
385
|
+
/**
|
|
386
|
+
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
387
|
+
*
|
|
388
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
389
|
+
* @param bytes - the bytes, expressed as a Gatling Expression Language String
|
|
390
|
+
* @returns the next DSL step
|
|
391
|
+
*/
|
|
392
|
+
(name: string, bytes: number[]): BodyPart;
|
|
393
|
+
/**
|
|
394
|
+
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
395
|
+
*
|
|
396
|
+
* @param name - the name of the part, expressed as a function
|
|
397
|
+
* @param bytes - the bytes, expressed as a Gatling Expression Language String
|
|
398
|
+
* @returns the next DSL step
|
|
399
|
+
*/
|
|
400
|
+
(name: (session: Session) => string, bytes: number[]): BodyPart;
|
|
401
|
+
/**
|
|
402
|
+
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
403
|
+
*
|
|
404
|
+
* @param name - the name of the part, expressed as a Gatling Expression Language String
|
|
405
|
+
* @param bytes - the bytes, expressed as a function
|
|
406
|
+
* @returns the next DSL step
|
|
407
|
+
*/
|
|
408
|
+
(name: string, bytes: (session: Session) => number[]): BodyPart;
|
|
409
|
+
/**
|
|
410
|
+
* Bootstrap a {@link BodyPart} backed by a byte array. Bytes are sent as is.
|
|
411
|
+
*
|
|
412
|
+
* @param name - the name of the part, expressed as a function
|
|
413
|
+
* @param bytes - the bytes, expressed as a function
|
|
414
|
+
* @returns the next DSL step
|
|
415
|
+
*/
|
|
416
|
+
(name: (session: Session) => string, bytes: (session: Session) => number[]): BodyPart;
|
|
417
|
+
}
|
|
418
|
+
export declare const ByteArrayBodyPart: ByteArrayBodyPartFunction;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ByteArrayBodyPart = exports.PebbleStringBodyPart = exports.PebbleFileBodyPart = exports.RawFileBodyPart = exports.StringBodyPart = exports.ElFileBodyPart = exports.wrapBodyPart = void 0;
|
|
4
|
+
const core_1 = require("@gatling.io/core");
|
|
5
|
+
const jvm_types_1 = require("@gatling.io/jvm-types");
|
|
6
|
+
const wrapBodyPart = (_underlying) => ({
|
|
7
|
+
_underlying,
|
|
8
|
+
contentType: (contentType) => (0, exports.wrapBodyPart)(typeof contentType === "function"
|
|
9
|
+
? _underlying.contentType((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(contentType)))
|
|
10
|
+
: _underlying.contentType(contentType)),
|
|
11
|
+
charset: (charset) => (0, exports.wrapBodyPart)(_underlying.charset(charset)),
|
|
12
|
+
dispositionType: (dispositionType) => (0, exports.wrapBodyPart)(typeof dispositionType === "function"
|
|
13
|
+
? _underlying.dispositionType((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(dispositionType)))
|
|
14
|
+
: _underlying.dispositionType(dispositionType)),
|
|
15
|
+
fileName: (fileName) => (0, exports.wrapBodyPart)(typeof fileName === "function"
|
|
16
|
+
? _underlying.fileName((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(fileName)))
|
|
17
|
+
: _underlying.fileName(fileName)),
|
|
18
|
+
contentId: (contentId) => (0, exports.wrapBodyPart)(typeof contentId == "function"
|
|
19
|
+
? _underlying.contentId((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(contentId)))
|
|
20
|
+
: _underlying.contentId(contentId)),
|
|
21
|
+
transferEncoding: (transferEncoding) => (0, exports.wrapBodyPart)(_underlying.transferEncoding(transferEncoding)),
|
|
22
|
+
header: (name, value) => (0, exports.wrapBodyPart)(typeof name === "function"
|
|
23
|
+
? typeof value === "function"
|
|
24
|
+
? _underlying.header((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(name)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(value)))
|
|
25
|
+
: _underlying.header((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(name)), value)
|
|
26
|
+
: typeof value === "function"
|
|
27
|
+
? _underlying.header(name, (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(value)))
|
|
28
|
+
: _underlying.header(name, value))
|
|
29
|
+
});
|
|
30
|
+
exports.wrapBodyPart = wrapBodyPart;
|
|
31
|
+
const bodyPartImpl = (jvmBodyPart) => (arg0, arg1) => {
|
|
32
|
+
if (arg1 === undefined) {
|
|
33
|
+
if (typeof arg0 === "function") {
|
|
34
|
+
return (0, exports.wrapBodyPart)(jvmBodyPart((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(arg0))));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return (0, exports.wrapBodyPart)(jvmBodyPart(arg0));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (typeof arg0 === "function") {
|
|
42
|
+
if (typeof arg1 === "function") {
|
|
43
|
+
return (0, exports.wrapBodyPart)(jvmBodyPart((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(arg0)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(arg1))));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return (0, exports.wrapBodyPart)(jvmBodyPart((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(arg0)), arg1));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
if (typeof arg1 === "function") {
|
|
51
|
+
return (0, exports.wrapBodyPart)(jvmBodyPart(arg0, (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(arg1))));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return (0, exports.wrapBodyPart)(jvmBodyPart(arg0, arg1));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const ElFileBodyPart = (arg0, arg1) => bodyPartImpl(jvm_types_1.HttpDsl.ElFileBodyPart)(arg0, arg1);
|
|
60
|
+
exports.ElFileBodyPart = ElFileBodyPart;
|
|
61
|
+
const StringBodyPart = (arg0, arg1) => bodyPartImpl(jvm_types_1.HttpDsl.StringBodyPart)(arg0, arg1);
|
|
62
|
+
exports.StringBodyPart = StringBodyPart;
|
|
63
|
+
const RawFileBodyPart = (arg0, arg1) => bodyPartImpl(jvm_types_1.HttpDsl.RawFileBodyPart)(arg0, arg1);
|
|
64
|
+
exports.RawFileBodyPart = RawFileBodyPart;
|
|
65
|
+
const PebbleFileBodyPart = (arg0, arg1) => bodyPartImpl(jvm_types_1.HttpDsl.PebbleFileBodyPart)(arg0, arg1);
|
|
66
|
+
exports.PebbleFileBodyPart = PebbleFileBodyPart;
|
|
67
|
+
const PebbleStringBodyPart = (arg0, arg1) => {
|
|
68
|
+
if (arg1 === undefined) {
|
|
69
|
+
if (typeof arg0 === "function") {
|
|
70
|
+
throw Error(`PebbleStringBodyPart() called with invalid arguments ${arg0}, ${arg1}`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return (0, exports.wrapBodyPart)(jvm_types_1.HttpDsl.PebbleStringBodyPart(arg0));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
if (typeof arg0 === "function") {
|
|
78
|
+
return (0, exports.wrapBodyPart)(jvm_types_1.HttpDsl.PebbleStringBodyPart((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(arg0)), arg1));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
return (0, exports.wrapBodyPart)(jvm_types_1.HttpDsl.PebbleStringBodyPart(arg0, arg1));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
exports.PebbleStringBodyPart = PebbleStringBodyPart;
|
|
86
|
+
const ByteArrayBodyPart = (arg0, arg1) => {
|
|
87
|
+
if (typeof arg0 === "function") {
|
|
88
|
+
if (typeof arg1 === "function") {
|
|
89
|
+
return (0, exports.wrapBodyPart)(jvm_types_1.HttpDsl.ByteArrayBodyPart((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(arg0)), (0, core_1.wrapByteArrayCallback)((0, core_1.underlyingSessionTo)(arg1))));
|
|
90
|
+
}
|
|
91
|
+
else if (typeof arg1 === "string") {
|
|
92
|
+
return (0, exports.wrapBodyPart)(jvm_types_1.HttpDsl.ByteArrayBodyPart((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(arg0)), arg1));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return (0, exports.wrapBodyPart)(jvm_types_1.HttpDsl.ByteArrayBodyPart((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(arg0)), (0, core_1.wrapByteArray)(arg1)));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
if (typeof arg1 === "function") {
|
|
100
|
+
return (0, exports.wrapBodyPart)(jvm_types_1.HttpDsl.ByteArrayBodyPart(arg0, (0, core_1.wrapByteArrayCallback)((0, core_1.underlyingSessionTo)(arg1))));
|
|
101
|
+
}
|
|
102
|
+
else if (typeof arg1 === "string") {
|
|
103
|
+
return (0, exports.wrapBodyPart)(jvm_types_1.HttpDsl.ByteArrayBodyPart(arg0, arg1));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return (0, exports.wrapBodyPart)(jvm_types_1.HttpDsl.ByteArrayBodyPart(arg0, (0, core_1.wrapByteArray)(arg1)));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
exports.ByteArrayBodyPart = ByteArrayBodyPart;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { CheckBuilderCaptureGroup, CheckBuilderFind, CheckBuilderMultipleFind, Session } from "@gatling.io/core";
|
|
2
|
+
/**
|
|
3
|
+
* Bootstrap a check that capture the response location, eg the landing url in a chain of
|
|
4
|
+
* redirects
|
|
5
|
+
*
|
|
6
|
+
* @returns the next step in the check DSL
|
|
7
|
+
*/
|
|
8
|
+
export declare const currentLocation: () => CheckBuilderFind<string>;
|
|
9
|
+
export interface CurrentLocationRegexFunction {
|
|
10
|
+
/**
|
|
11
|
+
* Bootstrap a check that capture some <a
|
|
12
|
+
* href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular
|
|
13
|
+
* Expression</a> capture groups on the response location, eg the landing url in a chain of
|
|
14
|
+
* redirects
|
|
15
|
+
*
|
|
16
|
+
* @param pattern - the regular expression, expressed as a Gatling Expression Language String
|
|
17
|
+
* @returns the next step in the check DSL
|
|
18
|
+
*/
|
|
19
|
+
(pattern: string): CheckBuilderCaptureGroup;
|
|
20
|
+
/**
|
|
21
|
+
* Bootstrap a check that capture some <a
|
|
22
|
+
* href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular
|
|
23
|
+
* Expression</a> capture groups on the response location, eg the landing url in a chain of
|
|
24
|
+
* redirects
|
|
25
|
+
*
|
|
26
|
+
* @param pattern - the regular expression, expressed as a function
|
|
27
|
+
* @returns the next step in the check DSL
|
|
28
|
+
*/
|
|
29
|
+
(pattern: (session: Session) => string): CheckBuilderCaptureGroup;
|
|
30
|
+
}
|
|
31
|
+
export declare const currentLocationRegex: CurrentLocationRegexFunction;
|
|
32
|
+
export interface HeaderFunction {
|
|
33
|
+
/**
|
|
34
|
+
* Bootstrap a check that capture the value of a HTTP header
|
|
35
|
+
*
|
|
36
|
+
* @param name the name of the HTTP header, expressed as a Gatling Expression Language String
|
|
37
|
+
* @return the next step in the check DSL
|
|
38
|
+
*/
|
|
39
|
+
(name: string): CheckBuilderMultipleFind<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Bootstrap a check that capture the value of a HTTP header
|
|
42
|
+
*
|
|
43
|
+
* @param name - the name of the HTTP header, expressed as a function
|
|
44
|
+
* @returns the next step in the check DSL
|
|
45
|
+
*/
|
|
46
|
+
(name: (session: Session) => string): CheckBuilderMultipleFind<string>;
|
|
47
|
+
}
|
|
48
|
+
export declare const header: HeaderFunction;
|
|
49
|
+
export interface HeaderRegexFunction {
|
|
50
|
+
/**
|
|
51
|
+
* Bootstrap a check that capture some <a
|
|
52
|
+
* href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular
|
|
53
|
+
* Expression</a> capture groups on a response header
|
|
54
|
+
*
|
|
55
|
+
* @param name - the name of the HTTP header, expressed as a Gatling Expression Language String
|
|
56
|
+
* @param pattern - the regular expression, expressed as a Gatling Expression Language String
|
|
57
|
+
* @returns the next step in the check DSL
|
|
58
|
+
*/
|
|
59
|
+
(name: string, pattern: string): CheckBuilderCaptureGroup;
|
|
60
|
+
/**
|
|
61
|
+
* Bootstrap a check that capture some <a
|
|
62
|
+
* href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular
|
|
63
|
+
* Expression</a> capture groups on a response header
|
|
64
|
+
*
|
|
65
|
+
* @param name - the name of the HTTP header, expressed as a function
|
|
66
|
+
* @param pattern - the regular expression, expressed as a Gatling Expression Language String
|
|
67
|
+
* @returns the next step in the check DSL
|
|
68
|
+
*/
|
|
69
|
+
(name: (session: Session) => string, pattern: string): CheckBuilderCaptureGroup;
|
|
70
|
+
/**
|
|
71
|
+
* Bootstrap a check that capture some <a
|
|
72
|
+
* href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular
|
|
73
|
+
* Expression</a> capture groups on a response header
|
|
74
|
+
*
|
|
75
|
+
* @param name - the name of the HTTP header, expressed as a Gatling Expression Language String
|
|
76
|
+
* @param pattern - the regular expression, expressed as a function
|
|
77
|
+
* @returns the next step in the check DSL
|
|
78
|
+
*/
|
|
79
|
+
(name: string, pattern: (session: Session) => string): CheckBuilderCaptureGroup;
|
|
80
|
+
/**
|
|
81
|
+
* Bootstrap a check that capture some <a
|
|
82
|
+
* href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html">Java Regular
|
|
83
|
+
* Expression</a> capture groups on a response header
|
|
84
|
+
*
|
|
85
|
+
* @param name the name of the HTTP header, expressed as a function
|
|
86
|
+
* @param pattern the regular expression, expressed as a function
|
|
87
|
+
* @return the next step in the check DSL
|
|
88
|
+
*/
|
|
89
|
+
(name: (session: Session) => string, pattern: (session: Session) => string): CheckBuilderCaptureGroup;
|
|
90
|
+
}
|
|
91
|
+
export declare const headerRegex: HeaderRegexFunction;
|
|
92
|
+
/**
|
|
93
|
+
* Bootstrap a check that capture the response HTTP status code
|
|
94
|
+
*
|
|
95
|
+
* @returns the next step in the check DSL
|
|
96
|
+
*/
|
|
97
|
+
export declare const status: () => CheckBuilderFind<number>;
|