@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
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.wrapHttpRequestActionBuilder = void 0;
|
|
18
|
+
const core_1 = require("@gatling.io/core");
|
|
19
|
+
__exportStar(require("./body"), exports);
|
|
20
|
+
__exportStar(require("./request"), exports);
|
|
21
|
+
const requestWithParamsActionBuilderImpl = (jvmBuilder, wrap) => ({
|
|
22
|
+
queryParam: (name, value) => {
|
|
23
|
+
if (typeof name === "function") {
|
|
24
|
+
if (typeof value === "function") {
|
|
25
|
+
return wrap(jvmBuilder.queryParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(name)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(value))));
|
|
26
|
+
}
|
|
27
|
+
else if (typeof value === "string") {
|
|
28
|
+
// FIXME it shows the value:any overload?
|
|
29
|
+
return wrap(jvmBuilder.queryParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(name)), value));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
// FIXME it shows the value:func overload?
|
|
33
|
+
return wrap(jvmBuilder.queryParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(name)), value));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
if (typeof value === "function") {
|
|
38
|
+
// FIXME it shows the value:any overload?
|
|
39
|
+
return wrap(jvmBuilder.queryParam(name, (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(value))));
|
|
40
|
+
}
|
|
41
|
+
else if (typeof value === "string") {
|
|
42
|
+
// FIXME it shows the value:any overload?
|
|
43
|
+
return wrap(jvmBuilder.queryParam(name, value));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return wrap(jvmBuilder.queryParam(name, value));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
multivaluedQueryParam: (name, values) => {
|
|
51
|
+
if (typeof name === "function") {
|
|
52
|
+
if (typeof values === "function") {
|
|
53
|
+
return wrap(jvmBuilder.multivaluedQueryParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(name)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionToJava)(values))));
|
|
54
|
+
}
|
|
55
|
+
else if (typeof values === "string") {
|
|
56
|
+
return wrap(jvmBuilder.multivaluedQueryParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(name)), values));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return wrap(jvmBuilder.multivaluedQueryParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(name)), values));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
if (typeof values === "function") {
|
|
64
|
+
return wrap(jvmBuilder.multivaluedQueryParam(name, (0, core_1.wrapCallback)((0, core_1.underlyingSessionToJava)(values))));
|
|
65
|
+
}
|
|
66
|
+
else if (typeof values === "string") {
|
|
67
|
+
return wrap(jvmBuilder.multivaluedQueryParam(name, values));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return wrap(jvmBuilder.multivaluedQueryParam(name, values));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
queryParamMap: (map) => {
|
|
75
|
+
if (typeof map === "function") {
|
|
76
|
+
return wrap(jvmBuilder.queryParamMap((0, core_1.wrapCallback)((0, core_1.underlyingSessionToJava)(map))));
|
|
77
|
+
}
|
|
78
|
+
else if (typeof map === "object") {
|
|
79
|
+
return wrap(jvmBuilder.queryParamMap(map));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
return wrap(jvmBuilder.queryParamMap(map));
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
header: (name, value) => wrap(typeof value === "function"
|
|
86
|
+
? jvmBuilder.header(name, (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(value)))
|
|
87
|
+
: jvmBuilder.header(name, value)),
|
|
88
|
+
headers: (headers) => wrap(jvmBuilder.headers(headers)),
|
|
89
|
+
ignoreProtocolHeaders: () => wrap(jvmBuilder.ignoreProtocolHeaders()),
|
|
90
|
+
basicAuth: (username, password) => wrap(typeof username === "function"
|
|
91
|
+
? typeof password === "function"
|
|
92
|
+
? jvmBuilder.basicAuth((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(username)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(password)))
|
|
93
|
+
: jvmBuilder.basicAuth((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(username)), password)
|
|
94
|
+
: typeof password === "function"
|
|
95
|
+
? jvmBuilder.basicAuth(username, (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(password)))
|
|
96
|
+
: jvmBuilder.basicAuth(username, password)),
|
|
97
|
+
digestAuth: (username, password) => wrap(typeof username === "function"
|
|
98
|
+
? typeof password === "function"
|
|
99
|
+
? jvmBuilder.digestAuth((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(username)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(password)))
|
|
100
|
+
: jvmBuilder.digestAuth((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(username)), password)
|
|
101
|
+
: typeof password === "function"
|
|
102
|
+
? jvmBuilder.digestAuth(username, (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(password)))
|
|
103
|
+
: jvmBuilder.digestAuth(username, password)),
|
|
104
|
+
disableUrlEncoding: () => wrap(jvmBuilder.disableUrlEncoding()),
|
|
105
|
+
proxy: (proxy) => wrap(jvmBuilder.proxy(proxy._underlying)),
|
|
106
|
+
signWithOAuth1: (consumerKey, clientSharedSecret, token, tokenSecret) => wrap(typeof consumerKey === "function" &&
|
|
107
|
+
typeof clientSharedSecret === "function" &&
|
|
108
|
+
typeof token === "function" &&
|
|
109
|
+
typeof tokenSecret === "function"
|
|
110
|
+
? jvmBuilder.signWithOAuth1((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(consumerKey)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(clientSharedSecret)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(token)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(tokenSecret)))
|
|
111
|
+
: jvmBuilder.signWithOAuth1(consumerKey, clientSharedSecret, token, tokenSecret))
|
|
112
|
+
});
|
|
113
|
+
const requestWithBodyActionBuilderImpl = (jvmBuilder, wrap) => ({
|
|
114
|
+
body: (body) => wrap(jvmBuilder.body(body._underlying)),
|
|
115
|
+
bodyPart: (part) => wrap(jvmBuilder.bodyPart(part._underlying)),
|
|
116
|
+
bodyParts: (...parts) => wrap(jvmBuilder.bodyParts(parts.map((part) => part._underlying))),
|
|
117
|
+
asMultipartForm: () => wrap(jvmBuilder.asMultipartForm()),
|
|
118
|
+
asFormUrlEncoded: () => wrap(jvmBuilder.asFormUrlEncoded()),
|
|
119
|
+
formParam: (key, value) => {
|
|
120
|
+
if (typeof key === "function") {
|
|
121
|
+
if (typeof value === "function") {
|
|
122
|
+
return wrap(jvmBuilder.formParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(key)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(value))));
|
|
123
|
+
}
|
|
124
|
+
else if (typeof value === "string") {
|
|
125
|
+
// FIXME it shows the value:any overload?
|
|
126
|
+
return wrap(jvmBuilder.formParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(key)), value));
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
// FIXME it shows the value:func overload?
|
|
130
|
+
return wrap(jvmBuilder.formParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(key)), value));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
if (typeof value === "function") {
|
|
135
|
+
// FIXME it shows the value:any overload?
|
|
136
|
+
return wrap(jvmBuilder.formParam(key, (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(value))));
|
|
137
|
+
}
|
|
138
|
+
else if (typeof value === "string") {
|
|
139
|
+
// FIXME it shows the value:any overload?
|
|
140
|
+
return wrap(jvmBuilder.formParam(key, value));
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
return wrap(jvmBuilder.formParam(key, value));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
multivaluedFormParam: (key, values) => {
|
|
148
|
+
if (typeof key === "function") {
|
|
149
|
+
if (typeof values === "function") {
|
|
150
|
+
return wrap(jvmBuilder.multivaluedFormParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(key)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionToJava)(values))));
|
|
151
|
+
}
|
|
152
|
+
else if (typeof values === "string") {
|
|
153
|
+
throw Error(`multivaluedFormParam() called with invalid arguments ${key}, ${values}`);
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
return wrap(jvmBuilder.multivaluedFormParam((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(key)), values));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
if (typeof values === "function") {
|
|
161
|
+
return wrap(jvmBuilder.multivaluedFormParam(key, (0, core_1.wrapCallback)((0, core_1.underlyingSessionToJava)(values))));
|
|
162
|
+
}
|
|
163
|
+
else if (typeof values === "string") {
|
|
164
|
+
return wrap(jvmBuilder.multivaluedFormParam(key, values));
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
return wrap(jvmBuilder.multivaluedFormParam(key, values));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
formParamMap: (map) => wrap(typeof map === "function"
|
|
172
|
+
? jvmBuilder.formParamMap((0, core_1.wrapCallback)((0, core_1.underlyingSessionToJava)(map)))
|
|
173
|
+
: jvmBuilder.formParamMap(map)),
|
|
174
|
+
form: (form) => wrap(typeof form === "function"
|
|
175
|
+
? jvmBuilder.form((0, core_1.wrapCallback)((0, core_1.underlyingSessionToJava)(form)))
|
|
176
|
+
: jvmBuilder.form(form)),
|
|
177
|
+
formUpload: (name, filePath) => wrap(typeof name === "function"
|
|
178
|
+
? typeof filePath === "function"
|
|
179
|
+
? jvmBuilder.formUpload((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(name)), (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(filePath)))
|
|
180
|
+
: jvmBuilder.formUpload((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(name)), filePath)
|
|
181
|
+
: typeof filePath === "function"
|
|
182
|
+
? jvmBuilder.formUpload(name, (0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(filePath)))
|
|
183
|
+
: jvmBuilder.formUpload(name, filePath)),
|
|
184
|
+
asJson: () => wrap(jvmBuilder.asJson()),
|
|
185
|
+
asXml: () => wrap(jvmBuilder.asXml())
|
|
186
|
+
});
|
|
187
|
+
const requestActionBuilderImpl = (jvmBuilder, wrap) => ({
|
|
188
|
+
check: (...checks) => wrap(jvmBuilder.check(checks.map((c) => c._underlying))),
|
|
189
|
+
checkIf: (condition) => (0, core_1.wrapCondition)(typeof condition === "string"
|
|
190
|
+
? jvmBuilder.checkIf(condition)
|
|
191
|
+
: jvmBuilder.checkIf((0, core_1.wrapCallback)((0, core_1.underlyingSessionTo)(condition))), wrap),
|
|
192
|
+
ignoreProtocolChecks: () => wrap(jvmBuilder.ignoreProtocolChecks()),
|
|
193
|
+
silent: () => wrap(jvmBuilder.silent()),
|
|
194
|
+
notSilent: () => wrap(jvmBuilder.notSilent()),
|
|
195
|
+
disableFollowRedirect: () => wrap(jvmBuilder.disableFollowRedirect()),
|
|
196
|
+
// TODO transformResponse: (f: (response: Response, session: Session) => Response): T =>
|
|
197
|
+
// wrap(jvmBuilder.transformResponse(wrapBiCallback(underlyingResponseTransform(f))))
|
|
198
|
+
resources: (...res) => wrap(jvmBuilder.resources(res.map((r) => r._underlying))),
|
|
199
|
+
requestTimeout: (duration) => wrap(jvmBuilder.requestTimeout((0, core_1.toJvmDuration)(duration)))
|
|
200
|
+
});
|
|
201
|
+
const wrapHttpRequestActionBuilder = (_underlying) => ({
|
|
202
|
+
_underlying,
|
|
203
|
+
...requestWithParamsActionBuilderImpl(_underlying, exports.wrapHttpRequestActionBuilder),
|
|
204
|
+
...requestWithBodyActionBuilderImpl(_underlying, exports.wrapHttpRequestActionBuilder),
|
|
205
|
+
...requestActionBuilderImpl(_underlying, exports.wrapHttpRequestActionBuilder)
|
|
206
|
+
});
|
|
207
|
+
exports.wrapHttpRequestActionBuilder = wrapHttpRequestActionBuilder;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Wrapper } from "@gatling.io/core";
|
|
2
|
+
import { HttpHeaders } from "../headers";
|
|
3
|
+
import { RequestBody } from "./body";
|
|
4
|
+
import JvmRequest = io.gatling.http.client.Request;
|
|
5
|
+
export interface Request extends Wrapper<JvmRequest> {
|
|
6
|
+
body(): RequestBody;
|
|
7
|
+
headers(): HttpHeaders;
|
|
8
|
+
}
|
|
9
|
+
export declare const wrapRequest: (_underlying: JvmRequest) => Request;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapRequest = void 0;
|
|
4
|
+
const headers_1 = require("../headers");
|
|
5
|
+
const body_1 = require("./body");
|
|
6
|
+
const wrapRequest = (_underlying) => ({
|
|
7
|
+
_underlying,
|
|
8
|
+
body: () => (0, body_1.wrapRequestBody)(_underlying.getBody()),
|
|
9
|
+
headers: () => (0, headers_1.wrapHttpHeaders)(_underlying.getHeaders())
|
|
10
|
+
});
|
|
11
|
+
exports.wrapRequest = wrapRequest;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Wrapper } from "@gatling.io/core";
|
|
2
|
+
import JvmResponseBody = io.gatling.http.response.ResponseBody;
|
|
3
|
+
export interface ResponseBody extends Wrapper<JvmResponseBody> {
|
|
4
|
+
bytes(): number[];
|
|
5
|
+
chars(): string[];
|
|
6
|
+
length(): number;
|
|
7
|
+
string(): string;
|
|
8
|
+
}
|
|
9
|
+
export declare const wrapResponseBody: (_underlying: JvmResponseBody) => ResponseBody;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapResponseBody = void 0;
|
|
4
|
+
const wrapResponseBody = (_underlying) => ({
|
|
5
|
+
_underlying,
|
|
6
|
+
bytes: () => _underlying.bytes(),
|
|
7
|
+
chars: () => _underlying.chars(),
|
|
8
|
+
length: () => _underlying.length(),
|
|
9
|
+
string: () => _underlying.string()
|
|
10
|
+
});
|
|
11
|
+
exports.wrapResponseBody = wrapResponseBody;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Wrapper } from "@gatling.io/core";
|
|
2
|
+
import { HttpHeaders } from "../headers";
|
|
3
|
+
import { ResponseBody } from "./body";
|
|
4
|
+
import { HttpResponseStatus } from "./status";
|
|
5
|
+
import JvmResponse = io.gatling.http.response.Response;
|
|
6
|
+
export * from "./body";
|
|
7
|
+
export * from "./status";
|
|
8
|
+
export interface Response extends Wrapper<JvmResponse> {
|
|
9
|
+
body(): ResponseBody;
|
|
10
|
+
headers(): HttpHeaders;
|
|
11
|
+
isHttp2(): boolean;
|
|
12
|
+
isRedirect(): boolean;
|
|
13
|
+
status(): HttpResponseStatus;
|
|
14
|
+
}
|
|
15
|
+
export declare const wrapResponse: (_underlying: JvmResponse) => Response;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.wrapResponse = void 0;
|
|
18
|
+
const headers_1 = require("../headers");
|
|
19
|
+
const body_1 = require("./body");
|
|
20
|
+
const status_1 = require("./status");
|
|
21
|
+
__exportStar(require("./body"), exports);
|
|
22
|
+
__exportStar(require("./status"), exports);
|
|
23
|
+
const wrapResponse = (_underlying) => ({
|
|
24
|
+
_underlying,
|
|
25
|
+
body: () => (0, body_1.wrapResponseBody)(_underlying.body()),
|
|
26
|
+
//copy: (
|
|
27
|
+
// request: Request = wrapRequest(_underlying.request()),
|
|
28
|
+
// startTimestamp: number = _underlying.startTimestamp(),
|
|
29
|
+
// endTimestamp: number = _underlying.endTimestamp(),
|
|
30
|
+
// //status: any /*io.netty.handler.codec.http.HttpResponseStatus*/,
|
|
31
|
+
// //headers: HttpHeaders,
|
|
32
|
+
// //body: any /*io.gatling.http.response.ResponseBody*/,
|
|
33
|
+
// //checksums: any /*scala.collection.immutable.Map*/,
|
|
34
|
+
// isHttp2: boolean = _underlying.isHttp2()
|
|
35
|
+
//): Response => wrapResponse(_underlying.copy(
|
|
36
|
+
// request = request._underlying,
|
|
37
|
+
// startTimestamp = startTimestamp,
|
|
38
|
+
// endTimestamp = endTimestamp,
|
|
39
|
+
// isHttp2
|
|
40
|
+
//)),
|
|
41
|
+
headers: () => (0, headers_1.wrapHttpHeaders)(_underlying.headers()),
|
|
42
|
+
isHttp2: () => _underlying.isHttp2(),
|
|
43
|
+
isRedirect: () => _underlying.isRedirect(),
|
|
44
|
+
status: () => (0, status_1.fromJvmHttpResponseStatus)(_underlying.status())
|
|
45
|
+
});
|
|
46
|
+
exports.wrapResponse = wrapResponse;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
export declare class HttpResponseStatus {
|
|
2
|
+
readonly code: number;
|
|
3
|
+
readonly reasonPhrase: string;
|
|
4
|
+
/**
|
|
5
|
+
* 100 Continue
|
|
6
|
+
*/
|
|
7
|
+
static readonly CONTINUE: HttpResponseStatus;
|
|
8
|
+
/**
|
|
9
|
+
* 101 Switching Protocols
|
|
10
|
+
*/
|
|
11
|
+
static readonly SWITCHING_PROTOCOLS: HttpResponseStatus;
|
|
12
|
+
/**
|
|
13
|
+
* 102 Processing (WebDAV, RFC2518)
|
|
14
|
+
*/
|
|
15
|
+
static readonly PROCESSING: HttpResponseStatus;
|
|
16
|
+
/**
|
|
17
|
+
* 103 Early Hints (RFC 8297)
|
|
18
|
+
*/
|
|
19
|
+
static readonly EARLY_HINTS: HttpResponseStatus;
|
|
20
|
+
/**
|
|
21
|
+
* 200 OK
|
|
22
|
+
*/
|
|
23
|
+
static readonly OK: HttpResponseStatus;
|
|
24
|
+
/**
|
|
25
|
+
* 201 Created
|
|
26
|
+
*/
|
|
27
|
+
static readonly CREATED: HttpResponseStatus;
|
|
28
|
+
/**
|
|
29
|
+
* 202 Accepted
|
|
30
|
+
*/
|
|
31
|
+
static readonly ACCEPTED: HttpResponseStatus;
|
|
32
|
+
/**
|
|
33
|
+
* 203 Non-Authoritative Information (since HTTP/1.1)
|
|
34
|
+
*/
|
|
35
|
+
static readonly NON_AUTHORITATIVE_INFORMATION: HttpResponseStatus;
|
|
36
|
+
/**
|
|
37
|
+
* 204 No Content
|
|
38
|
+
*/
|
|
39
|
+
static readonly NO_CONTENT: HttpResponseStatus;
|
|
40
|
+
/**
|
|
41
|
+
* 205 Reset Content
|
|
42
|
+
*/
|
|
43
|
+
static readonly RESET_CONTENT: HttpResponseStatus;
|
|
44
|
+
/**
|
|
45
|
+
* 206 Partial Content
|
|
46
|
+
*/
|
|
47
|
+
static readonly PARTIAL_CONTENT: HttpResponseStatus;
|
|
48
|
+
/**
|
|
49
|
+
* 207 Multi-Status (WebDAV, RFC2518)
|
|
50
|
+
*/
|
|
51
|
+
static readonly MULTI_STATUS: HttpResponseStatus;
|
|
52
|
+
/**
|
|
53
|
+
* 300 Multiple Choices
|
|
54
|
+
*/
|
|
55
|
+
static readonly MULTIPLE_CHOICES: HttpResponseStatus;
|
|
56
|
+
/**
|
|
57
|
+
* 301 Moved Permanently
|
|
58
|
+
*/
|
|
59
|
+
static readonly MOVED_PERMANENTLY: HttpResponseStatus;
|
|
60
|
+
/**
|
|
61
|
+
* 302 Found
|
|
62
|
+
*/
|
|
63
|
+
static readonly FOUND: HttpResponseStatus;
|
|
64
|
+
/**
|
|
65
|
+
* 303 See Other (since HTTP/1.1)
|
|
66
|
+
*/
|
|
67
|
+
static readonly SEE_OTHER: HttpResponseStatus;
|
|
68
|
+
/**
|
|
69
|
+
* 304 Not Modified
|
|
70
|
+
*/
|
|
71
|
+
static readonly NOT_MODIFIED: HttpResponseStatus;
|
|
72
|
+
/**
|
|
73
|
+
* 305 Use Proxy (since HTTP/1.1)
|
|
74
|
+
*/
|
|
75
|
+
static readonly USE_PROXY: HttpResponseStatus;
|
|
76
|
+
/**
|
|
77
|
+
* 307 Temporary Redirect (since HTTP/1.1)
|
|
78
|
+
*/
|
|
79
|
+
static readonly TEMPORARY_REDIRECT: HttpResponseStatus;
|
|
80
|
+
/**
|
|
81
|
+
* 308 Permanent Redirect (RFC7538)
|
|
82
|
+
*/
|
|
83
|
+
static readonly PERMANENT_REDIRECT: HttpResponseStatus;
|
|
84
|
+
/**
|
|
85
|
+
* 400 Bad Request
|
|
86
|
+
*/
|
|
87
|
+
static readonly BAD_REQUEST: HttpResponseStatus;
|
|
88
|
+
/**
|
|
89
|
+
* 401 Unauthorized
|
|
90
|
+
*/
|
|
91
|
+
static readonly UNAUTHORIZED: HttpResponseStatus;
|
|
92
|
+
/**
|
|
93
|
+
* 402 Payment Required
|
|
94
|
+
*/
|
|
95
|
+
static readonly PAYMENT_REQUIRED: HttpResponseStatus;
|
|
96
|
+
/**
|
|
97
|
+
* 403 Forbidden
|
|
98
|
+
*/
|
|
99
|
+
static readonly FORBIDDEN: HttpResponseStatus;
|
|
100
|
+
/**
|
|
101
|
+
* 404 Not Found
|
|
102
|
+
*/
|
|
103
|
+
static readonly NOT_FOUND: HttpResponseStatus;
|
|
104
|
+
/**
|
|
105
|
+
* 405 Method Not Allowed
|
|
106
|
+
*/
|
|
107
|
+
static readonly METHOD_NOT_ALLOWED: HttpResponseStatus;
|
|
108
|
+
/**
|
|
109
|
+
* 406 Not Acceptable
|
|
110
|
+
*/
|
|
111
|
+
static readonly NOT_ACCEPTABLE: HttpResponseStatus;
|
|
112
|
+
/**
|
|
113
|
+
* 407 Proxy Authentication Required
|
|
114
|
+
*/
|
|
115
|
+
static readonly PROXY_AUTHENTICATION_REQUIRED: HttpResponseStatus;
|
|
116
|
+
/**
|
|
117
|
+
* 408 Request Timeout
|
|
118
|
+
*/
|
|
119
|
+
static readonly REQUEST_TIMEOUT: HttpResponseStatus;
|
|
120
|
+
/**
|
|
121
|
+
* 409 Conflict
|
|
122
|
+
*/
|
|
123
|
+
static readonly CONFLICT: HttpResponseStatus;
|
|
124
|
+
/**
|
|
125
|
+
* 410 Gone
|
|
126
|
+
*/
|
|
127
|
+
static readonly GONE: HttpResponseStatus;
|
|
128
|
+
/**
|
|
129
|
+
* 411 Length Required
|
|
130
|
+
*/
|
|
131
|
+
static readonly LENGTH_REQUIRED: HttpResponseStatus;
|
|
132
|
+
/**
|
|
133
|
+
* 412 Precondition Failed
|
|
134
|
+
*/
|
|
135
|
+
static readonly PRECONDITION_FAILED: HttpResponseStatus;
|
|
136
|
+
/**
|
|
137
|
+
* 413 Request Entity Too Large
|
|
138
|
+
*/
|
|
139
|
+
static readonly REQUEST_ENTITY_TOO_LARGE: HttpResponseStatus;
|
|
140
|
+
/**
|
|
141
|
+
* 414 Request-URI Too Long
|
|
142
|
+
*/
|
|
143
|
+
static readonly REQUEST_URI_TOO_LONG: HttpResponseStatus;
|
|
144
|
+
/**
|
|
145
|
+
* 415 Unsupported Media Type
|
|
146
|
+
*/
|
|
147
|
+
static readonly UNSUPPORTED_MEDIA_TYPE: HttpResponseStatus;
|
|
148
|
+
/**
|
|
149
|
+
* 416 Requested Range Not Satisfiable
|
|
150
|
+
*/
|
|
151
|
+
static readonly REQUESTED_RANGE_NOT_SATISFIABLE: HttpResponseStatus;
|
|
152
|
+
/**
|
|
153
|
+
* 417 Expectation Failed
|
|
154
|
+
*/
|
|
155
|
+
static readonly EXPECTATION_FAILED: HttpResponseStatus;
|
|
156
|
+
/**
|
|
157
|
+
* 421 Misdirected Request
|
|
158
|
+
*
|
|
159
|
+
* @see <a href="https://tools.ietf.org/html/rfc7540#section-9.1.2">421 (Misdirected Request) Status Code</a>
|
|
160
|
+
*/
|
|
161
|
+
static readonly MISDIRECTED_REQUEST: HttpResponseStatus;
|
|
162
|
+
/**
|
|
163
|
+
* 422 Unprocessable Entity (WebDAV, RFC4918)
|
|
164
|
+
*/
|
|
165
|
+
static readonly UNPROCESSABLE_ENTITY: HttpResponseStatus;
|
|
166
|
+
/**
|
|
167
|
+
* 423 Locked (WebDAV, RFC4918)
|
|
168
|
+
*/
|
|
169
|
+
static readonly LOCKED: HttpResponseStatus;
|
|
170
|
+
/**
|
|
171
|
+
* 424 Failed Dependency (WebDAV, RFC4918)
|
|
172
|
+
*/
|
|
173
|
+
static readonly FAILED_DEPENDENCY: HttpResponseStatus;
|
|
174
|
+
/**
|
|
175
|
+
* 425 Unordered Collection (WebDAV, RFC3648)
|
|
176
|
+
*/
|
|
177
|
+
static readonly UNORDERED_COLLECTION: HttpResponseStatus;
|
|
178
|
+
/**
|
|
179
|
+
* 426 Upgrade Required (RFC2817)
|
|
180
|
+
*/
|
|
181
|
+
static readonly UPGRADE_REQUIRED: HttpResponseStatus;
|
|
182
|
+
/**
|
|
183
|
+
* 428 Precondition Required (RFC6585)
|
|
184
|
+
*/
|
|
185
|
+
static readonly PRECONDITION_REQUIRED: HttpResponseStatus;
|
|
186
|
+
/**
|
|
187
|
+
* 429 Too Many Requests (RFC6585)
|
|
188
|
+
*/
|
|
189
|
+
static readonly TOO_MANY_REQUESTS: HttpResponseStatus;
|
|
190
|
+
/**
|
|
191
|
+
* 431 Request Header Fields Too Large (RFC6585)
|
|
192
|
+
*/
|
|
193
|
+
static readonly REQUEST_HEADER_FIELDS_TOO_LARGE: HttpResponseStatus;
|
|
194
|
+
/**
|
|
195
|
+
* 500 Internal Server Error
|
|
196
|
+
*/
|
|
197
|
+
static readonly INTERNAL_SERVER_ERROR: HttpResponseStatus;
|
|
198
|
+
/**
|
|
199
|
+
* 501 Not Implemented
|
|
200
|
+
*/
|
|
201
|
+
static readonly NOT_IMPLEMENTED: HttpResponseStatus;
|
|
202
|
+
/**
|
|
203
|
+
* 502 Bad Gateway
|
|
204
|
+
*/
|
|
205
|
+
static readonly BAD_GATEWAY: HttpResponseStatus;
|
|
206
|
+
/**
|
|
207
|
+
* 503 Service Unavailable
|
|
208
|
+
*/
|
|
209
|
+
static readonly SERVICE_UNAVAILABLE: HttpResponseStatus;
|
|
210
|
+
/**
|
|
211
|
+
* 504 Gateway Timeout
|
|
212
|
+
*/
|
|
213
|
+
static readonly GATEWAY_TIMEOUT: HttpResponseStatus;
|
|
214
|
+
/**
|
|
215
|
+
* 505 HTTP Version Not Supported
|
|
216
|
+
*/
|
|
217
|
+
static readonly HTTP_VERSION_NOT_SUPPORTED: HttpResponseStatus;
|
|
218
|
+
/**
|
|
219
|
+
* 506 Variant Also Negotiates (RFC2295)
|
|
220
|
+
*/
|
|
221
|
+
static readonly VARIANT_ALSO_NEGOTIATES: HttpResponseStatus;
|
|
222
|
+
/**
|
|
223
|
+
* 507 Insufficient Storage (WebDAV, RFC4918)
|
|
224
|
+
*/
|
|
225
|
+
static readonly INSUFFICIENT_STORAGE: HttpResponseStatus;
|
|
226
|
+
/**
|
|
227
|
+
* 510 Not Extended (RFC2774)
|
|
228
|
+
*/
|
|
229
|
+
static readonly NOT_EXTENDED: HttpResponseStatus;
|
|
230
|
+
/**
|
|
231
|
+
* 511 Network Authentication Required (RFC6585)
|
|
232
|
+
*/
|
|
233
|
+
static readonly NETWORK_AUTHENTICATION_REQUIRED: HttpResponseStatus;
|
|
234
|
+
private constructor();
|
|
235
|
+
}
|
|
236
|
+
export declare const fromJvmHttpResponseStatus: (jvmStatus: io.netty.handler.codec.http.HttpResponseStatus) => HttpResponseStatus;
|