@gatling.io/http 3.15.0 → 3.15.1
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 +3 -3
- package/target/index.d.ts +29 -1
- package/target/index.js +10 -4
- package/target/request/index.d.ts +6 -0
- package/target/request/index.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gatling.io/http",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://gatling.io",
|
|
6
6
|
"repository": "github:gatling/gatling-js",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"main": "target/index.js",
|
|
21
21
|
"types": "target/index.d.ts",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@gatling.io/core": "3.15.
|
|
24
|
-
"@gatling.io/jvm-types": "3.15.
|
|
23
|
+
"@gatling.io/core": "3.15.1",
|
|
24
|
+
"@gatling.io/jvm-types": "3.15.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/jest": "30.0.0",
|
package/target/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Session } from "@gatling.io/core";
|
|
1
|
+
import { ActionBuilder, Session } from "@gatling.io/core";
|
|
2
2
|
import { HttpProtocolBuilder } from "./protocol";
|
|
3
3
|
import { HttpRequestActionBuilder, Request } from "./request";
|
|
4
4
|
import { Response } from "./response";
|
|
@@ -142,6 +142,22 @@ export interface Http {
|
|
|
142
142
|
* @returns a new instance of HttpRequestActionBuilder
|
|
143
143
|
*/
|
|
144
144
|
httpRequest(method: string, url: (session: Session) => string): HttpRequestActionBuilder;
|
|
145
|
+
/**
|
|
146
|
+
* Define a HTTP request
|
|
147
|
+
*
|
|
148
|
+
* @param method - the HTTP method, expressed as a function
|
|
149
|
+
* @param url - the url, expressed as a Gatling Expression Language String
|
|
150
|
+
* @returns a new instance of HttpRequestActionBuilder
|
|
151
|
+
*/
|
|
152
|
+
httpRequest(method: (session: Session) => string, url: string): HttpRequestActionBuilder;
|
|
153
|
+
/**
|
|
154
|
+
* Define a HTTP request
|
|
155
|
+
*
|
|
156
|
+
* @param method - the HTTP method, expressed as a function
|
|
157
|
+
* @param url - the url, expressed as a function
|
|
158
|
+
* @returns a new instance of HttpRequestActionBuilder
|
|
159
|
+
*/
|
|
160
|
+
httpRequest(method: (session: Session) => string, url: (session: Session) => string): HttpRequestActionBuilder;
|
|
145
161
|
}
|
|
146
162
|
/**
|
|
147
163
|
* The entrypoint of the Gatling HTTP DSL
|
|
@@ -163,3 +179,15 @@ export interface HttpApply {
|
|
|
163
179
|
(name: (session: Session) => string): Http;
|
|
164
180
|
}
|
|
165
181
|
export declare const http: HttpApply & HttpProtocolBuilder;
|
|
182
|
+
interface HttpConcurrentRequestsFunction {
|
|
183
|
+
/**
|
|
184
|
+
* Execute HTTP requests concurrently. Works as resources in terms of concurrency level, meaning
|
|
185
|
+
* limited to maxConnectionsPerHost over HTTP/1.1.
|
|
186
|
+
*
|
|
187
|
+
* @param head - the first request of the list
|
|
188
|
+
* @param tail - the next requests of the list
|
|
189
|
+
* @returns an ActionBuilder
|
|
190
|
+
*/
|
|
191
|
+
(head: HttpRequestActionBuilder, ...tail: HttpRequestActionBuilder[]): ActionBuilder;
|
|
192
|
+
}
|
|
193
|
+
export declare const httpConcurrentRequests: HttpConcurrentRequestsFunction;
|
package/target/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.http = exports.underlyingResponseTransform = exports.underlyingRequestTransform = void 0;
|
|
17
|
+
exports.httpConcurrentRequests = exports.http = exports.underlyingResponseTransform = exports.underlyingRequestTransform = void 0;
|
|
18
18
|
const core_1 = require("@gatling.io/core");
|
|
19
19
|
const core_2 = require("@gatling.io/core");
|
|
20
20
|
const jvm_types_1 = require("@gatling.io/jvm-types");
|
|
@@ -49,9 +49,13 @@ const wrapHttp = (jvmHttp) => ({
|
|
|
49
49
|
head: (url) => (0, request_1.wrapHttpRequestActionBuilder)(typeof url === "function" ? jvmHttp.head((0, core_2.underlyingSessionTo)(url)) : jvmHttp.head(url)),
|
|
50
50
|
delete: (url) => (0, request_1.wrapHttpRequestActionBuilder)(typeof url === "function" ? jvmHttp.delete((0, core_2.underlyingSessionTo)(url)) : jvmHttp.delete(url)),
|
|
51
51
|
options: (url) => (0, request_1.wrapHttpRequestActionBuilder)(typeof url === "function" ? jvmHttp.options((0, core_2.underlyingSessionTo)(url)) : jvmHttp.options(url)),
|
|
52
|
-
httpRequest: (method, url) => (0, request_1.wrapHttpRequestActionBuilder)(typeof
|
|
53
|
-
?
|
|
54
|
-
|
|
52
|
+
httpRequest: (method, url) => (0, request_1.wrapHttpRequestActionBuilder)(typeof method === "function"
|
|
53
|
+
? typeof url === "function"
|
|
54
|
+
? jvmHttp.httpRequest((0, core_2.underlyingSessionTo)(method), (0, core_2.underlyingSessionTo)(url))
|
|
55
|
+
: jvmHttp.httpRequest((0, core_2.underlyingSessionTo)(method), url)
|
|
56
|
+
: typeof url === "function"
|
|
57
|
+
? jvmHttp.httpRequest(method, (0, core_2.underlyingSessionTo)(url))
|
|
58
|
+
: jvmHttp.httpRequest(method, url))
|
|
55
59
|
});
|
|
56
60
|
const httpApply = (name) => {
|
|
57
61
|
// Handle overloading
|
|
@@ -59,3 +63,5 @@ const httpApply = (name) => {
|
|
|
59
63
|
return wrapHttp(jvmHttp);
|
|
60
64
|
};
|
|
61
65
|
exports.http = Object.assign(httpApply, httpProtocolBuilder);
|
|
66
|
+
const httpConcurrentRequests = (head, ...tail) => (0, core_1.wrapActionBuilder)(jvm_types_1.HttpDsl.httpConcurrentRequests(head._underlying, ...tail.map((b) => b._underlying)));
|
|
67
|
+
exports.httpConcurrentRequests = httpConcurrentRequests;
|
|
@@ -156,6 +156,12 @@ export interface RequestActionBuilder<T> {
|
|
|
156
156
|
* @returns a new DSL instance
|
|
157
157
|
*/
|
|
158
158
|
ignoreProtocolHeaders(): T;
|
|
159
|
+
/**
|
|
160
|
+
* Ignore common signature calculators set in the Http protocol configuration
|
|
161
|
+
*
|
|
162
|
+
* @returns a new DSL instance
|
|
163
|
+
*/
|
|
164
|
+
ignoreProtocolSignatureCalculators(): T;
|
|
159
165
|
/**
|
|
160
166
|
* Set the authorization header for Basic Auth
|
|
161
167
|
*
|
package/target/request/index.js
CHANGED
|
@@ -85,6 +85,7 @@ const requestActionBuilderImpl = (jvmBuilder, wrap) => ({
|
|
|
85
85
|
header: (name, value) => wrap(typeof value === "function" ? jvmBuilder.header(name, (0, core_1.underlyingSessionTo)(value)) : jvmBuilder.header(name, value)),
|
|
86
86
|
headers: (headers) => wrap(jvmBuilder.headers((0, core_1.asJava)(headers))),
|
|
87
87
|
ignoreProtocolHeaders: () => wrap(jvmBuilder.ignoreProtocolHeaders()),
|
|
88
|
+
ignoreProtocolSignatureCalculators: () => wrap(jvmBuilder.ignoreProtocolSignatureCalculators()),
|
|
88
89
|
basicAuth: (username, password) => wrap(typeof username === "function"
|
|
89
90
|
? typeof password === "function"
|
|
90
91
|
? jvmBuilder.basicAuth((0, core_1.underlyingSessionTo)(username), (0, core_1.underlyingSessionTo)(password))
|