@adonisjs/http-server 6.8.2-0 → 6.8.2-10

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