@adonisjs/http-server 6.8.2-1 → 6.8.2-11
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/LICENSE.md +1 -1
- package/README.md +3 -6
- package/build/factories/http_context.d.ts +10 -0
- package/build/factories/http_context.js +27 -0
- package/build/factories/http_server.d.ts +8 -0
- package/build/factories/http_server.js +26 -0
- package/build/factories/main.js +8 -0
- package/build/factories/qs_parser_factory.d.ts +10 -0
- package/build/factories/qs_parser_factory.js +18 -0
- package/build/factories/request.d.ts +10 -0
- package/build/factories/request.js +31 -0
- package/build/factories/response.d.ts +10 -0
- package/build/factories/response.js +34 -0
- package/build/factories/router.d.ts +10 -0
- package/build/factories/router.js +25 -0
- package/build/factories/server_factory.d.ts +10 -0
- package/build/factories/server_factory.js +34 -0
- package/build/index.js +8 -0
- package/build/src/cookies/client.d.ts +25 -0
- package/build/src/cookies/client.js +42 -0
- package/build/src/cookies/drivers/encrypted.d.ts +12 -0
- package/build/src/cookies/drivers/encrypted.js +20 -0
- package/build/src/cookies/drivers/plain.d.ts +12 -0
- package/build/src/cookies/drivers/plain.js +20 -0
- package/build/src/cookies/drivers/signed.d.ts +12 -0
- package/build/src/cookies/drivers/signed.js +20 -0
- package/build/src/cookies/parser.d.ts +28 -0
- package/build/src/cookies/parser.js +98 -0
- package/build/src/cookies/serializer.d.ts +22 -0
- package/build/src/cookies/serializer.js +40 -0
- package/build/src/debug.js +8 -0
- package/build/src/define_config.d.ts +3 -0
- package/build/src/define_config.js +11 -0
- package/build/src/define_middleware.d.ts +5 -0
- package/build/src/define_middleware.js +18 -0
- package/build/src/exception_handler.d.ts +93 -6
- package/build/src/exception_handler.js +203 -44
- package/build/src/exceptions.d.ts +6 -0
- package/build/src/exceptions.js +11 -0
- package/build/src/helpers.d.ts +14 -0
- package/build/src/helpers.js +43 -0
- package/build/src/http_context/local_storage.d.ts +3 -0
- package/build/src/http_context/local_storage.js +25 -0
- package/build/src/http_context/main.d.ts +36 -0
- package/build/src/http_context/main.js +54 -0
- package/build/src/qs.d.ts +4 -0
- package/build/src/qs.js +12 -0
- package/build/src/redirect.d.ts +24 -0
- package/build/src/redirect.js +60 -0
- package/build/src/request.d.ts +466 -0
- package/build/src/request.js +542 -0
- package/build/src/response.d.ts +427 -2
- package/build/src/response.js +611 -11
- package/build/src/router/brisk.d.ts +22 -0
- package/build/src/router/brisk.js +44 -2
- package/build/src/router/executor.d.ts +6 -1
- package/build/src/router/executor.js +14 -1
- package/build/src/router/factories/use_return_value.d.ts +4 -0
- package/build/src/router/factories/use_return_value.js +16 -3
- package/build/src/router/group.d.ts +47 -0
- package/build/src/router/group.js +88 -0
- package/build/src/router/lookup_store/main.d.ts +32 -0
- package/build/src/router/lookup_store/main.js +49 -0
- package/build/src/router/lookup_store/route_finder.d.ts +13 -0
- package/build/src/router/lookup_store/route_finder.js +21 -0
- package/build/src/router/lookup_store/url_builder.d.ts +36 -0
- package/build/src/router/lookup_store/url_builder.js +99 -2
- package/build/src/router/main.d.ts +92 -4
- package/build/src/router/main.js +146 -0
- package/build/src/router/matchers.d.ts +13 -0
- package/build/src/router/matchers.js +21 -0
- package/build/src/router/parser.d.ts +5 -0
- package/build/src/router/parser.js +17 -0
- package/build/src/router/resource.d.ts +30 -1
- package/build/src/router/resource.js +93 -1
- package/build/src/router/route.d.ts +65 -0
- package/build/src/router/route.js +151 -2
- package/build/src/router/store.d.ts +54 -0
- package/build/src/router/store.js +110 -2
- package/build/src/server/factories/final_handler.d.ts +7 -1
- package/build/src/server/factories/final_handler.js +15 -2
- package/build/src/server/factories/middleware_handler.d.ts +3 -0
- package/build/src/server/factories/middleware_handler.js +11 -0
- package/build/src/server/factories/write_response.d.ts +4 -0
- package/build/src/server/factories/write_response.js +12 -0
- package/build/src/server/main.d.ts +48 -0
- package/build/src/server/main.js +142 -5
- package/build/src/types/base.d.ts +12 -0
- package/build/src/types/base.js +8 -0
- package/build/src/types/main.js +8 -0
- package/build/src/types/middleware.d.ts +18 -0
- package/build/src/types/middleware.js +8 -0
- package/build/src/types/qs.d.ts +53 -0
- package/build/src/types/qs.js +8 -0
- package/build/src/types/request.d.ts +32 -0
- package/build/src/types/request.js +8 -0
- package/build/src/types/response.d.ts +29 -2
- package/build/src/types/response.js +8 -0
- package/build/src/types/route.d.ts +89 -1
- package/build/src/types/route.js +8 -0
- package/build/src/types/server.d.ts +36 -1
- package/build/src/types/server.js +8 -0
- package/package.json +52 -74
package/build/src/response.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
3
4
|
import Macroable from '@poppinss/macroable';
|
|
4
5
|
import type { Encryption } from '@adonisjs/encryption';
|
|
5
6
|
import { ServerResponse, IncomingMessage } from 'node:http';
|
|
@@ -8,109 +9,533 @@ import { Redirect } from './redirect.js';
|
|
|
8
9
|
import type { Router } from './router/main.js';
|
|
9
10
|
import type { HttpContext } from './http_context/main.js';
|
|
10
11
|
import type { CastableHeader, CookieOptions, ResponseConfig, ResponseStream } from './types/response.js';
|
|
12
|
+
/**
|
|
13
|
+
* The response is a wrapper over [ServerResponse](https://nodejs.org/api/http.html#http_class_http_serverresponse)
|
|
14
|
+
* streamlining the process of writing response body and automatically setting up appropriate headers.
|
|
15
|
+
*/
|
|
11
16
|
export declare class Response extends Macroable {
|
|
12
17
|
#private;
|
|
13
18
|
request: IncomingMessage;
|
|
14
19
|
response: ServerResponse;
|
|
20
|
+
/**
|
|
21
|
+
* Does response has body set that will written to the
|
|
22
|
+
* response socket at the end of the request
|
|
23
|
+
*/
|
|
15
24
|
get hasLazyBody(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Find if the response has non-stream content
|
|
27
|
+
*/
|
|
16
28
|
get hasContent(): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Returns true when response body is set using "response.stream"
|
|
31
|
+
* method
|
|
32
|
+
*/
|
|
17
33
|
get hasStream(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Returns true when response body is set using "response.download"
|
|
36
|
+
* or "response.attachment" methods
|
|
37
|
+
*/
|
|
18
38
|
get hasFileToStream(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the response content. Check if the response
|
|
41
|
+
* has content using the "hasContent" method
|
|
42
|
+
*/
|
|
19
43
|
get content(): [any, boolean, (string | undefined)?] | undefined;
|
|
20
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Returns reference to the stream set using "response.stream"
|
|
46
|
+
* method
|
|
47
|
+
*/
|
|
48
|
+
get outgoingStream(): import("stream").Readable | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Returns reference to the file path set using "response.stream"
|
|
51
|
+
* method.
|
|
52
|
+
*/
|
|
21
53
|
get fileToStream(): {
|
|
22
54
|
path: string;
|
|
23
55
|
generateEtag: boolean;
|
|
24
56
|
} | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Lazy body is used to set the response body. However, do not
|
|
59
|
+
* write it on the socket immediately unless `response.finish`
|
|
60
|
+
* is called.
|
|
61
|
+
*/
|
|
25
62
|
lazyBody: Partial<{
|
|
26
63
|
content: [any, boolean, string?];
|
|
27
64
|
stream: [ResponseStream, ((error: NodeJS.ErrnoException) => [string, number?])?];
|
|
28
65
|
fileToStream: [string, boolean, ((error: NodeJS.ErrnoException) => [string, number?])?];
|
|
29
66
|
}>;
|
|
67
|
+
/**
|
|
68
|
+
* The ctx will be set by the context itself. It creates a circular
|
|
69
|
+
* reference
|
|
70
|
+
*/
|
|
30
71
|
ctx?: HttpContext;
|
|
31
72
|
constructor(request: IncomingMessage, response: ServerResponse, encryption: Encryption, config: ResponseConfig, router: Router, qs: Qs);
|
|
73
|
+
/**
|
|
74
|
+
* Returns a boolean telling if response is finished or not.
|
|
75
|
+
* Any more attempts to update headers or body will result
|
|
76
|
+
* in raised exceptions.
|
|
77
|
+
*/
|
|
32
78
|
get finished(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Returns a boolean telling if response headers has been sent or not.
|
|
81
|
+
* Any more attempts to update headers will result in raised
|
|
82
|
+
* exceptions.
|
|
83
|
+
*/
|
|
33
84
|
get headersSent(): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Returns a boolean telling if response headers and body is written
|
|
87
|
+
* or not. When value is `true`, you can feel free to write headers
|
|
88
|
+
* and body.
|
|
89
|
+
*/
|
|
34
90
|
get isPending(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Writes the body with appropriate response headers. Etag header is set
|
|
93
|
+
* when `generateEtag` is set to `true`.
|
|
94
|
+
*
|
|
95
|
+
* Empty body results in `204`.
|
|
96
|
+
*/
|
|
35
97
|
protected writeBody(content: any, generateEtag: boolean, jsonpCallbackName?: string): void;
|
|
98
|
+
/**
|
|
99
|
+
* Stream the body to the response and handles cleaning up the stream
|
|
100
|
+
*/
|
|
36
101
|
protected streamBody(body: ResponseStream, errorCallback?: (error: NodeJS.ErrnoException) => [string, number?]): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Downloads a file by streaming it to the response
|
|
104
|
+
*/
|
|
37
105
|
protected streamFileForDownload(filePath: string, generateEtag: boolean, errorCallback?: (error: NodeJS.ErrnoException) => [string, number?]): Promise<void>;
|
|
38
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Writes headers with the Node.js res object using the
|
|
108
|
+
* response.setHeader method
|
|
109
|
+
*/
|
|
110
|
+
flushHeaders(): void;
|
|
111
|
+
/**
|
|
112
|
+
* Calls res.writeHead on the Node.js res object.
|
|
113
|
+
*/
|
|
114
|
+
writeHead(statusCode?: number): this;
|
|
115
|
+
/**
|
|
116
|
+
* Returns the existing value for a given HTTP response
|
|
117
|
+
* header.
|
|
118
|
+
*/
|
|
39
119
|
getHeader(key: string): import("http").OutgoingHttpHeader | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Get response headers
|
|
122
|
+
*/
|
|
40
123
|
getHeaders(): {
|
|
41
124
|
[x: string]: import("http").OutgoingHttpHeader | undefined;
|
|
42
125
|
};
|
|
126
|
+
/**
|
|
127
|
+
* Set header on the response. To `append` values to the existing header, we suggest
|
|
128
|
+
* using [[append]] method.
|
|
129
|
+
*
|
|
130
|
+
* If `value` is non existy, then header won't be set.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```js
|
|
134
|
+
* response.header('content-type', 'application/json')
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
43
137
|
header(key: string, value: CastableHeader): this;
|
|
138
|
+
/**
|
|
139
|
+
* Append value to an existing header. To replace the value, we suggest using
|
|
140
|
+
* [[header]] method.
|
|
141
|
+
*
|
|
142
|
+
* If `value` is not existy, then header won't be set.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```js
|
|
146
|
+
* response.append('set-cookie', 'username=virk')
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
44
149
|
append(key: string, value: CastableHeader): this;
|
|
150
|
+
/**
|
|
151
|
+
* Adds HTTP response header, when it doesn't exists already.
|
|
152
|
+
*/
|
|
45
153
|
safeHeader(key: string, value: CastableHeader): this;
|
|
154
|
+
/**
|
|
155
|
+
* Removes the existing response header from being sent.
|
|
156
|
+
*/
|
|
46
157
|
removeHeader(key: string): this;
|
|
158
|
+
/**
|
|
159
|
+
* Returns the status code for the response
|
|
160
|
+
*/
|
|
47
161
|
getStatus(): number;
|
|
162
|
+
/**
|
|
163
|
+
* Set HTTP status code
|
|
164
|
+
*/
|
|
48
165
|
status(code: number): this;
|
|
166
|
+
/**
|
|
167
|
+
* Set's status code only when it's not explictly
|
|
168
|
+
* set
|
|
169
|
+
*/
|
|
49
170
|
safeStatus(code: number): this;
|
|
171
|
+
/**
|
|
172
|
+
* Set response type by looking up for the mime-type using
|
|
173
|
+
* partial types like file extensions.
|
|
174
|
+
*
|
|
175
|
+
* Make sure to read [mime-types](https://www.npmjs.com/package/mime-types) docs
|
|
176
|
+
* too.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```js
|
|
180
|
+
* response.type('.json') // Content-type: application/json
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
50
183
|
type(type: string, charset?: string): this;
|
|
184
|
+
/**
|
|
185
|
+
* Set the Vary HTTP header
|
|
186
|
+
*/
|
|
51
187
|
vary(field: string | string[]): this;
|
|
188
|
+
/**
|
|
189
|
+
* Set etag by computing hash from the body. This class will set the etag automatically
|
|
190
|
+
* when `etag = true` in the defined config object.
|
|
191
|
+
*
|
|
192
|
+
* Use this function, when you want to compute etag manually for some other resons.
|
|
193
|
+
*/
|
|
52
194
|
setEtag(body: any, weak?: boolean): this;
|
|
195
|
+
/**
|
|
196
|
+
* Returns a boolean telling if the new response etag evaluates same
|
|
197
|
+
* as the request header `if-none-match`. In case of `true`, the
|
|
198
|
+
* server must return `304` response, telling the browser to
|
|
199
|
+
* use the client cache.
|
|
200
|
+
*
|
|
201
|
+
* You won't have to deal with this method directly, since AdonisJs will
|
|
202
|
+
* handle this for you when `http.etag = true` inside `config/app.js` file.
|
|
203
|
+
*
|
|
204
|
+
* However, this is how you can use it manually.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```js
|
|
208
|
+
* const responseBody = view.render('some-view')
|
|
209
|
+
*
|
|
210
|
+
* // sets the HTTP etag header for response
|
|
211
|
+
* response.setEtag(responseBody)
|
|
212
|
+
*
|
|
213
|
+
* if (response.fresh()) {
|
|
214
|
+
* response.sendStatus(304)
|
|
215
|
+
* } else {
|
|
216
|
+
* response.send(responseBody)
|
|
217
|
+
* }
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
53
220
|
fresh(): boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Returns the response body. Returns null when response
|
|
223
|
+
* body is a stream
|
|
224
|
+
*/
|
|
54
225
|
getBody(): any;
|
|
226
|
+
/**
|
|
227
|
+
* Send the body as response and optionally generate etag. The default value
|
|
228
|
+
* is read from `config/app.js` file, using `http.etag` property.
|
|
229
|
+
*
|
|
230
|
+
* This method buffers the body if `explicitEnd = true`, which is the default
|
|
231
|
+
* behavior and do not change, unless you know what you are doing.
|
|
232
|
+
*/
|
|
55
233
|
send(body: any, generateEtag?: boolean): void;
|
|
234
|
+
/**
|
|
235
|
+
* Alias of [[send]]
|
|
236
|
+
*/
|
|
56
237
|
json(body: any, generateEtag?: boolean): void;
|
|
238
|
+
/**
|
|
239
|
+
* Writes response as JSONP. The callback name is resolved as follows, with priority
|
|
240
|
+
* from top to bottom.
|
|
241
|
+
*
|
|
242
|
+
* 1. Explicitly defined as 2nd Param.
|
|
243
|
+
* 2. Fetch from request query string.
|
|
244
|
+
* 3. Use the config value `http.jsonpCallbackName` from `config/app.js`.
|
|
245
|
+
* 4. Fallback to `callback`.
|
|
246
|
+
*
|
|
247
|
+
* This method buffers the body if `explicitEnd = true`, which is the default
|
|
248
|
+
* behavior and do not change, unless you know what you are doing.
|
|
249
|
+
*/
|
|
57
250
|
jsonp(body: any, callbackName?: string, generateEtag?: boolean): void;
|
|
251
|
+
/**
|
|
252
|
+
* Pipe stream to the response. This method will gracefully destroy
|
|
253
|
+
* the stream, avoiding memory leaks.
|
|
254
|
+
*
|
|
255
|
+
* If `raiseErrors=false`, then this method will self handle all the exceptions by
|
|
256
|
+
* writing a generic HTTP response. To have more control over the error, it is
|
|
257
|
+
* recommended to set `raiseErrors=true` and wrap this function inside a
|
|
258
|
+
* `try/catch` statement.
|
|
259
|
+
*
|
|
260
|
+
* Streaming a file from the disk and showing 404 when file is missing.
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```js
|
|
264
|
+
* // Errors handled automatically with generic HTTP response
|
|
265
|
+
* response.stream(fs.createReadStream('file.txt'))
|
|
266
|
+
*
|
|
267
|
+
* // Manually handle (note the await call)
|
|
268
|
+
* try {
|
|
269
|
+
* await response.stream(fs.createReadStream('file.txt'))
|
|
270
|
+
* } catch () {
|
|
271
|
+
* response.status(404).send('File not found')
|
|
272
|
+
* }
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
58
275
|
stream(body: ResponseStream, errorCallback?: (error: NodeJS.ErrnoException) => [string, number?]): void;
|
|
276
|
+
/**
|
|
277
|
+
* Download file by streaming it from the file path. This method will setup
|
|
278
|
+
* appropriate `Content-type`, `Content-type` and `Last-modified` headers.
|
|
279
|
+
*
|
|
280
|
+
* Unexpected stream errors are handled gracefully to avoid memory leaks.
|
|
281
|
+
*
|
|
282
|
+
* If `raiseErrors=false`, then this method will self handle all the exceptions by
|
|
283
|
+
* writing a generic HTTP response. To have more control over the error, it is
|
|
284
|
+
* recommended to set `raiseErrors=true` and wrap this function inside a
|
|
285
|
+
* `try/catch` statement.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```js
|
|
289
|
+
* // Errors handled automatically with generic HTTP response
|
|
290
|
+
* response.download('somefile.jpg')
|
|
291
|
+
*
|
|
292
|
+
* // Manually handle (note the await call)
|
|
293
|
+
* try {
|
|
294
|
+
* await response.download('somefile.jpg')
|
|
295
|
+
* } catch (error) {
|
|
296
|
+
* response.status(error.code === 'ENOENT' ? 404 : 500)
|
|
297
|
+
* response.send('Cannot process file')
|
|
298
|
+
* }
|
|
299
|
+
* ```
|
|
300
|
+
*/
|
|
59
301
|
download(filePath: string, generateEtag?: boolean, errorCallback?: (error: NodeJS.ErrnoException) => [string, number?]): void;
|
|
302
|
+
/**
|
|
303
|
+
* Download the file by forcing the user to save the file vs displaying it
|
|
304
|
+
* within the browser.
|
|
305
|
+
*
|
|
306
|
+
* Internally calls [[download]]
|
|
307
|
+
*/
|
|
60
308
|
attachment(filePath: string, name?: string, disposition?: string, generateEtag?: boolean, errorCallback?: (error: NodeJS.ErrnoException) => [string, number?]): void;
|
|
309
|
+
/**
|
|
310
|
+
* Set the location header.
|
|
311
|
+
*
|
|
312
|
+
* @example
|
|
313
|
+
* ```js
|
|
314
|
+
* response.location('/login')
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
61
317
|
location(url: string): this;
|
|
318
|
+
/**
|
|
319
|
+
* Redirect the request.
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* ```js
|
|
323
|
+
* response.redirect('/foo')
|
|
324
|
+
* response.redirect().toRoute('foo.bar')
|
|
325
|
+
* response.redirect().back()
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
62
328
|
redirect(): Redirect;
|
|
63
329
|
redirect(path: string, forwardQueryString?: boolean, statusCode?: number): void;
|
|
330
|
+
/**
|
|
331
|
+
* Abort the request with custom body and a status code. 400 is
|
|
332
|
+
* used when status is not defined
|
|
333
|
+
*/
|
|
64
334
|
abort(body: any, status?: number): never;
|
|
335
|
+
/**
|
|
336
|
+
* Abort the request with custom body and a status code when
|
|
337
|
+
* passed condition returns `true`
|
|
338
|
+
*/
|
|
65
339
|
abortIf(condition: unknown, body: any, status?: number): asserts condition is undefined | null | false;
|
|
340
|
+
/**
|
|
341
|
+
* Abort the request with custom body and a status code when
|
|
342
|
+
* passed condition returns `false`
|
|
343
|
+
*/
|
|
66
344
|
abortUnless<T>(condition: T, body: any, status?: number): asserts condition is Exclude<T, undefined | null | false>;
|
|
345
|
+
/**
|
|
346
|
+
* Set signed cookie as the response header. The inline options overrides
|
|
347
|
+
* all options from the config.
|
|
348
|
+
*/
|
|
67
349
|
cookie(key: string, value: any, options?: Partial<CookieOptions>): this;
|
|
350
|
+
/**
|
|
351
|
+
* Set encrypted cookie as the response header. The inline options overrides
|
|
352
|
+
* all options from the config.
|
|
353
|
+
*/
|
|
68
354
|
encryptedCookie(key: string, value: any, options?: Partial<CookieOptions>): this;
|
|
355
|
+
/**
|
|
356
|
+
* Set unsigned cookie as the response header. The inline options overrides
|
|
357
|
+
* all options from the config.
|
|
358
|
+
*/
|
|
69
359
|
plainCookie(key: string, value: any, options?: Partial<CookieOptions & {
|
|
70
360
|
encode: boolean;
|
|
71
361
|
}>): this;
|
|
362
|
+
/**
|
|
363
|
+
* Clear existing cookie.
|
|
364
|
+
*/
|
|
72
365
|
clearCookie(key: string, options?: Partial<CookieOptions>): this;
|
|
366
|
+
/**
|
|
367
|
+
* Finishes the response by writing the lazy body, when `explicitEnd = true`
|
|
368
|
+
* and response is already pending.
|
|
369
|
+
*
|
|
370
|
+
* Calling this method twice or when `explicitEnd = false` is noop.
|
|
371
|
+
*/
|
|
73
372
|
finish(): void;
|
|
373
|
+
/**
|
|
374
|
+
* Shorthand method to finish request with "100" status code
|
|
375
|
+
*/
|
|
74
376
|
continue(): void;
|
|
377
|
+
/**
|
|
378
|
+
* Shorthand method to finish request with "101" status code
|
|
379
|
+
*/
|
|
75
380
|
switchingProtocols(): void;
|
|
381
|
+
/**
|
|
382
|
+
* Shorthand method to finish request with "200" status code
|
|
383
|
+
*/
|
|
76
384
|
ok(body: any, generateEtag?: boolean): void;
|
|
385
|
+
/**
|
|
386
|
+
* Shorthand method to finish request with "201" status code
|
|
387
|
+
*/
|
|
77
388
|
created(body?: any, generateEtag?: boolean): void;
|
|
389
|
+
/**
|
|
390
|
+
* Shorthand method to finish request with "202" status code
|
|
391
|
+
*/
|
|
78
392
|
accepted(body: any, generateEtag?: boolean): void;
|
|
393
|
+
/**
|
|
394
|
+
* Shorthand method to finish request with "203" status code
|
|
395
|
+
*/
|
|
79
396
|
nonAuthoritativeInformation(body: any, generateEtag?: boolean): void;
|
|
397
|
+
/**
|
|
398
|
+
* Shorthand method to finish request with "204" status code
|
|
399
|
+
*/
|
|
80
400
|
noContent(): void;
|
|
401
|
+
/**
|
|
402
|
+
* Shorthand method to finish request with "205" status code
|
|
403
|
+
*/
|
|
81
404
|
resetContent(): void;
|
|
405
|
+
/**
|
|
406
|
+
* Shorthand method to finish request with "206" status code
|
|
407
|
+
*/
|
|
82
408
|
partialContent(body: any, generateEtag?: boolean): void;
|
|
409
|
+
/**
|
|
410
|
+
* Shorthand method to finish request with "300" status code
|
|
411
|
+
*/
|
|
83
412
|
multipleChoices(body?: any, generateEtag?: boolean): void;
|
|
413
|
+
/**
|
|
414
|
+
* Shorthand method to finish request with "301" status code
|
|
415
|
+
*/
|
|
84
416
|
movedPermanently(body?: any, generateEtag?: boolean): void;
|
|
417
|
+
/**
|
|
418
|
+
* Shorthand method to finish request with "302" status code
|
|
419
|
+
*/
|
|
85
420
|
movedTemporarily(body?: any, generateEtag?: boolean): void;
|
|
421
|
+
/**
|
|
422
|
+
* Shorthand method to finish request with "303" status code
|
|
423
|
+
*/
|
|
86
424
|
seeOther(body?: any, generateEtag?: boolean): void;
|
|
425
|
+
/**
|
|
426
|
+
* Shorthand method to finish request with "304" status code
|
|
427
|
+
*/
|
|
87
428
|
notModified(body?: any, generateEtag?: boolean): void;
|
|
429
|
+
/**
|
|
430
|
+
* Shorthand method to finish request with "305" status code
|
|
431
|
+
*/
|
|
88
432
|
useProxy(body?: any, generateEtag?: boolean): void;
|
|
433
|
+
/**
|
|
434
|
+
* Shorthand method to finish request with "307" status code
|
|
435
|
+
*/
|
|
89
436
|
temporaryRedirect(body?: any, generateEtag?: boolean): void;
|
|
437
|
+
/**
|
|
438
|
+
* Shorthand method to finish request with "400" status code
|
|
439
|
+
*/
|
|
90
440
|
badRequest(body?: any, generateEtag?: boolean): void;
|
|
441
|
+
/**
|
|
442
|
+
* Shorthand method to finish request with "401" status code
|
|
443
|
+
*/
|
|
91
444
|
unauthorized(body?: any, generateEtag?: boolean): void;
|
|
445
|
+
/**
|
|
446
|
+
* Shorthand method to finish request with "402" status code
|
|
447
|
+
*/
|
|
92
448
|
paymentRequired(body?: any, generateEtag?: boolean): void;
|
|
449
|
+
/**
|
|
450
|
+
* Shorthand method to finish request with "403" status code
|
|
451
|
+
*/
|
|
93
452
|
forbidden(body?: any, generateEtag?: boolean): void;
|
|
453
|
+
/**
|
|
454
|
+
* Shorthand method to finish request with "404" status code
|
|
455
|
+
*/
|
|
94
456
|
notFound(body?: any, generateEtag?: boolean): void;
|
|
457
|
+
/**
|
|
458
|
+
* Shorthand method to finish request with "405" status code
|
|
459
|
+
*/
|
|
95
460
|
methodNotAllowed(body?: any, generateEtag?: boolean): void;
|
|
461
|
+
/**
|
|
462
|
+
* Shorthand method to finish request with "406" status code
|
|
463
|
+
*/
|
|
96
464
|
notAcceptable(body?: any, generateEtag?: boolean): void;
|
|
465
|
+
/**
|
|
466
|
+
* Shorthand method to finish request with "407" status code
|
|
467
|
+
*/
|
|
97
468
|
proxyAuthenticationRequired(body?: any, generateEtag?: boolean): void;
|
|
469
|
+
/**
|
|
470
|
+
* Shorthand method to finish request with "408" status code
|
|
471
|
+
*/
|
|
98
472
|
requestTimeout(body?: any, generateEtag?: boolean): void;
|
|
473
|
+
/**
|
|
474
|
+
* Shorthand method to finish request with "409" status code
|
|
475
|
+
*/
|
|
99
476
|
conflict(body?: any, generateEtag?: boolean): void;
|
|
477
|
+
/**
|
|
478
|
+
* Shorthand method to finish request with "401" status code
|
|
479
|
+
*/
|
|
100
480
|
gone(body?: any, generateEtag?: boolean): void;
|
|
481
|
+
/**
|
|
482
|
+
* Shorthand method to finish request with "411" status code
|
|
483
|
+
*/
|
|
101
484
|
lengthRequired(body?: any, generateEtag?: boolean): void;
|
|
485
|
+
/**
|
|
486
|
+
* Shorthand method to finish request with "412" status code
|
|
487
|
+
*/
|
|
102
488
|
preconditionFailed(body?: any, generateEtag?: boolean): void;
|
|
489
|
+
/**
|
|
490
|
+
* Shorthand method to finish request with "413" status code
|
|
491
|
+
*/
|
|
103
492
|
requestEntityTooLarge(body?: any, generateEtag?: boolean): void;
|
|
493
|
+
/**
|
|
494
|
+
* Shorthand method to finish request with "414" status code
|
|
495
|
+
*/
|
|
104
496
|
requestUriTooLong(body?: any, generateEtag?: boolean): void;
|
|
497
|
+
/**
|
|
498
|
+
* Shorthand method to finish request with "415" status code
|
|
499
|
+
*/
|
|
105
500
|
unsupportedMediaType(body?: any, generateEtag?: boolean): void;
|
|
501
|
+
/**
|
|
502
|
+
* Shorthand method to finish request with "416" status code
|
|
503
|
+
*/
|
|
106
504
|
requestedRangeNotSatisfiable(body?: any, generateEtag?: boolean): void;
|
|
505
|
+
/**
|
|
506
|
+
* Shorthand method to finish request with "417" status code
|
|
507
|
+
*/
|
|
107
508
|
expectationFailed(body?: any, generateEtag?: boolean): void;
|
|
509
|
+
/**
|
|
510
|
+
* Shorthand method to finish request with "422" status code
|
|
511
|
+
*/
|
|
108
512
|
unprocessableEntity(body?: any, generateEtag?: boolean): void;
|
|
513
|
+
/**
|
|
514
|
+
* Shorthand method to finish request with "429" status code
|
|
515
|
+
*/
|
|
109
516
|
tooManyRequests(body?: any, generateEtag?: boolean): void;
|
|
517
|
+
/**
|
|
518
|
+
* Shorthand method to finish request with "500" status code
|
|
519
|
+
*/
|
|
110
520
|
internalServerError(body?: any, generateEtag?: boolean): void;
|
|
521
|
+
/**
|
|
522
|
+
* Shorthand method to finish request with "501" status code
|
|
523
|
+
*/
|
|
111
524
|
notImplemented(body?: any, generateEtag?: boolean): void;
|
|
525
|
+
/**
|
|
526
|
+
* Shorthand method to finish request with "502" status code
|
|
527
|
+
*/
|
|
112
528
|
badGateway(body?: any, generateEtag?: boolean): void;
|
|
529
|
+
/**
|
|
530
|
+
* Shorthand method to finish request with "503" status code
|
|
531
|
+
*/
|
|
113
532
|
serviceUnavailable(body?: any, generateEtag?: boolean): void;
|
|
533
|
+
/**
|
|
534
|
+
* Shorthand method to finish request with "504" status code
|
|
535
|
+
*/
|
|
114
536
|
gatewayTimeout(body?: any, generateEtag?: boolean): void;
|
|
537
|
+
/**
|
|
538
|
+
* Shorthand method to finish request with "505" status code
|
|
539
|
+
*/
|
|
115
540
|
httpVersionNotSupported(body?: any, generateEtag?: boolean): void;
|
|
116
541
|
}
|