@johntalton/http-util 5.1.6 → 6.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.
Files changed (84) hide show
  1. package/README.md +54 -7
  2. package/package.json +26 -6
  3. package/src/body.js +8 -8
  4. package/src/{response/defs.js → defs.js} +35 -1
  5. package/src/{accept-encoding.js → headers/accept-encoding.js} +11 -14
  6. package/src/{accept-language.js → headers/accept-language.js} +14 -9
  7. package/src/headers/accept.js +86 -0
  8. package/src/{cache-control.js → headers/cache-control.js} +0 -6
  9. package/src/{clear-site-data.js → headers/clear-site-data.js} +4 -10
  10. package/src/headers/client-hints.js +88 -0
  11. package/src/{conditional.js → headers/conditional.js} +190 -117
  12. package/src/headers/content-disposition.js +44 -0
  13. package/src/{content-range.js → headers/content-range.js} +1 -18
  14. package/src/headers/content-type.js +101 -0
  15. package/src/{forwarded.js → headers/forwarded.js} +8 -56
  16. package/src/{index.js → headers/index.js} +4 -2
  17. package/src/headers/link.js +34 -0
  18. package/src/{multipart.js → headers/multipart.js} +22 -13
  19. package/src/{preference.js → headers/preference.js} +3 -58
  20. package/src/{range.js → headers/range.js} +4 -32
  21. package/src/{rate-limit.js → headers/rate-limit.js} +6 -1
  22. package/src/{server-timing.js → headers/server-timing.js} +3 -16
  23. package/src/headers/strict-transport-security.js +39 -0
  24. package/src/{accept-util.js → headers/util/accept-util.js} +8 -14
  25. package/src/headers/util/index.js +7 -0
  26. package/src/headers/util/kvp.js +79 -0
  27. package/src/headers/util/mime.js +77 -0
  28. package/src/headers/util/whitespace.js +8 -0
  29. package/src/{www-authenticate.js → headers/www-authenticate.js} +1 -1
  30. package/src/response/{accepted.js → 2xx/accepted.js} +2 -2
  31. package/src/response/2xx/bytes.js +62 -0
  32. package/src/response/2xx/created.js +49 -0
  33. package/src/response/2xx/json.js +60 -0
  34. package/src/response/2xx/no-content.js +45 -0
  35. package/src/response/2xx/partial-content.js +101 -0
  36. package/src/response/{preflight.js → 2xx/preflight.js} +29 -10
  37. package/src/response/{sse.js → 2xx/sse.js} +2 -2
  38. package/src/response/{trace.js → 2xx/trace.js} +3 -3
  39. package/src/response/3xx/found.js +23 -0
  40. package/src/response/{moved-permanently.js → 3xx/moved-permanently.js} +2 -2
  41. package/src/response/{multiple-choices.js → 3xx/multiple-choices.js} +2 -3
  42. package/src/response/3xx/not-modified.js +59 -0
  43. package/src/response/{permanent-redirect.js → 3xx/permanent-redirect.js} +2 -2
  44. package/src/response/{see-other.js → 3xx/see-other.js} +2 -2
  45. package/src/response/{temporary-redirect.js → 3xx/temporary-redirect.js} +2 -2
  46. package/src/response/4xx/bad-request.js +19 -0
  47. package/src/response/{conflict.js → 4xx/conflict.js} +2 -2
  48. package/src/response/{content-too-large.js → 4xx/content-too-large.js} +2 -2
  49. package/src/response/{forbidden.js → 4xx/forbidden.js} +3 -2
  50. package/src/response/{gone.js → 4xx/gone.js} +2 -2
  51. package/src/response/{im-a-teapot.js → 4xx/im-a-teapot.js} +2 -2
  52. package/src/response/{not-acceptable.js → 4xx/not-acceptable.js} +14 -3
  53. package/src/response/4xx/not-allowed.js +34 -0
  54. package/src/response/{not-found.js → 4xx/not-found.js} +3 -3
  55. package/src/response/4xx/payment-required.js +17 -0
  56. package/src/response/4xx/precondition-failed.js +45 -0
  57. package/src/response/{range-not-satisfiable.js → 4xx/range-not-satisfiable.js} +15 -4
  58. package/src/response/{timeout.js → 4xx/timeout.js} +2 -2
  59. package/src/response/{too-many-requests.js → 4xx/too-many-requests.js} +22 -5
  60. package/src/response/{unauthorized.js → 4xx/unauthorized.js} +5 -5
  61. package/src/response/{unprocessable.js → 4xx/unprocessable.js} +2 -2
  62. package/src/response/{unsupported-media.js → 4xx/unsupported-media.js} +21 -4
  63. package/src/response/{error.js → 5xx/error.js} +3 -3
  64. package/src/response/{insufficient-storage.js → 5xx/insufficient-storage.js} +2 -2
  65. package/src/response/{not-implemented.js → 5xx/not-implemented.js} +4 -4
  66. package/src/response/{unavailable.js → 5xx/unavailable.js} +16 -4
  67. package/src/response/header-util.js +2 -2
  68. package/src/response/index.js +39 -35
  69. package/src/response/response.js +40 -34
  70. package/src/response/send-util.js +32 -21
  71. package/src/accept.js +0 -122
  72. package/src/content-disposition.js +0 -57
  73. package/src/content-type.js +0 -148
  74. package/src/link.js +0 -35
  75. package/src/response/bytes.js +0 -27
  76. package/src/response/created.js +0 -28
  77. package/src/response/json.js +0 -28
  78. package/src/response/no-content.js +0 -25
  79. package/src/response/not-allowed.js +0 -23
  80. package/src/response/not-modified.js +0 -35
  81. package/src/response/partial-content.js +0 -71
  82. package/src/response/precondition-failed.js +0 -16
  83. /package/src/{fetch-metadata.js → headers/fetch-metadata.js} +0 -0
  84. /package/src/{quote.js → headers/util/quote.js} +0 -0
@@ -1,10 +1,10 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { CONTENT_TYPE_TEXT } from '../content-type.js'
4
- import { send } from './send-util.js'
3
+ import { CONTENT_TYPE_TEXT } from '../../headers/content-type.js'
4
+ import { send } from '../send-util.js'
5
5
 
6
6
  /** @import { ServerHttp2Stream } from 'node:http2' */
7
- /** @import { Metadata } from './defs.js' */
7
+ /** @import { Metadata } from '../../defs.js' */
8
8
 
9
9
  const { HTTP_STATUS_NOT_FOUND } = http2.constants
10
10
 
@@ -0,0 +1,17 @@
1
+ import http2 from 'node:http2'
2
+
3
+ import { send } from '../send-util.js'
4
+
5
+ /** @import { ServerHttp2Stream } from 'node:http2' */
6
+ /** @import { Metadata } from '../../defs.js' */
7
+
8
+ const { HTTP_STATUS_PAYMENT_REQUIRED } = http2.constants
9
+
10
+ /**
11
+ * @param {ServerHttp2Stream} stream
12
+ * @param {Metadata} meta
13
+ */
14
+ export function sendPaymentRequired(stream, meta) {
15
+ send(stream, HTTP_STATUS_PAYMENT_REQUIRED, {
16
+ }, [ ], undefined, undefined, meta)
17
+ }
@@ -0,0 +1,45 @@
1
+ import http2 from 'node:http2'
2
+
3
+ import { Conditional } from '../../headers/conditional.js'
4
+ import { send } from '../send-util.js'
5
+
6
+ /** @import { ServerHttp2Stream } from 'node:http2' */
7
+ /** @import { SendContent, Metadata } from '../../defs.js' */
8
+ /** @import { EtagItem ,IMFFixDateInput } from '../../headers/conditional.js' */
9
+
10
+ const {
11
+ HTTP2_HEADER_ETAG,
12
+ HTTP2_HEADER_LAST_MODIFIED
13
+ } = http2.constants
14
+
15
+ const { HTTP_STATUS_PRECONDITION_FAILED } = http2.constants
16
+
17
+ /**
18
+ * @param {ServerHttp2Stream} stream
19
+ * @param {EtagItem|undefined} etag
20
+ * @param {IMFFixDateInput|string|undefined} lastModified
21
+ * @param {Metadata} meta
22
+ */
23
+ export function sendPreconditionFailed(stream, etag, lastModified, meta) {
24
+ _sendPreconditionFailed(stream, {
25
+ etag,
26
+ lastModified
27
+ }, meta)
28
+ }
29
+
30
+ /**
31
+ * @param {ServerHttp2Stream} stream
32
+ * @param {Pick<SendContent, 'etag' | 'lastModified'>} content
33
+ * @param {Metadata} meta
34
+ */
35
+ export function _sendPreconditionFailed(stream, content, meta) {
36
+ const {
37
+ etag,
38
+ lastModified
39
+ } = content
40
+
41
+ send(stream, HTTP_STATUS_PRECONDITION_FAILED, {
42
+ [HTTP2_HEADER_ETAG]: Conditional.encodeEtag(etag),
43
+ [HTTP2_HEADER_LAST_MODIFIED]: Conditional.encodeFixDate(lastModified)
44
+ }, [], undefined, undefined, meta)
45
+ }
@@ -1,11 +1,11 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { CONTENT_RANGE_UNKNOWN, ContentRange } from '../content-range.js'
4
- import { send } from './send-util.js'
3
+ import { CONTENT_RANGE_UNKNOWN, ContentRange } from '../../headers/content-range.js'
4
+ import { send } from '../send-util.js'
5
5
 
6
6
  /** @import { ServerHttp2Stream } from 'node:http2' */
7
- /** @import { Metadata } from './defs.js' */
8
- /** @import { ContentRangeDirective} from '../content-range.js' */
7
+ /** @import { SendContent, Metadata } from '../../defs.js' */
8
+ /** @import { ContentRangeDirective} from '../../headers/content-range.js' */
9
9
 
10
10
  const {
11
11
  HTTP2_HEADER_CONTENT_RANGE
@@ -19,6 +19,17 @@ const { HTTP_STATUS_RANGE_NOT_SATISFIABLE } = http2.constants
19
19
  * @param {Metadata} meta
20
20
  */
21
21
  export function sendRangeNotSatisfiable(stream, rangeDirective, meta) {
22
+ _sendRangeNotSatisfiable(stream, { rangeDirective }, meta)
23
+ }
24
+
25
+ /**
26
+ * @param {ServerHttp2Stream} stream
27
+ * @param {Pick<SendContent, 'rangeDirective'>} content
28
+ * @param {Metadata} meta
29
+ */
30
+ export function _sendRangeNotSatisfiable(stream, content, meta) {
31
+ const { rangeDirective } = content
32
+
22
33
  /** @type {ContentRangeDirective} */
23
34
  const invalidRange = { size: rangeDirective.size, range: CONTENT_RANGE_UNKNOWN }
24
35
 
@@ -1,9 +1,9 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { send } from './send-util.js'
3
+ import { send } from '../send-util.js'
4
4
 
5
5
  /** @import { ServerHttp2Stream } from 'node:http2' */
6
- /** @import { Metadata } from './defs.js' */
6
+ /** @import { Metadata } from '../../defs.js' */
7
7
 
8
8
  const {
9
9
  HTTP_STATUS_REQUEST_TIMEOUT
@@ -1,17 +1,17 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { CONTENT_TYPE_TEXT } from '../content-type.js'
3
+ import { CONTENT_TYPE_TEXT } from '../../headers/content-type.js'
4
4
  import {
5
5
  HTTP_HEADER_RATE_LIMIT,
6
6
  HTTP_HEADER_RATE_LIMIT_POLICY,
7
7
  RateLimit,
8
8
  RateLimitPolicy
9
- } from '../rate-limit.js'
10
- import { send } from './send-util.js'
9
+ } from '../../headers/rate-limit.js'
10
+ import { send } from '../send-util.js'
11
11
 
12
12
  /** @import { ServerHttp2Stream } from 'node:http2' */
13
- /** @import { Metadata } from './defs.js' */
14
- /** @import { RateLimitInfo, RateLimitPolicyInfo } from '../rate-limit.js' */
13
+ /** @import { SendInfo, Metadata } from '../../defs.js' */
14
+ /** @import { RateLimitInfo, RateLimitPolicyInfo } from '../../headers/rate-limit.js' */
15
15
 
16
16
  const {
17
17
  HTTP2_HEADER_RETRY_AFTER
@@ -26,6 +26,23 @@ const { HTTP_STATUS_TOO_MANY_REQUESTS } = http2.constants
26
26
  * @param {Metadata} meta
27
27
  */
28
28
  export function sendTooManyRequests(stream, limitInfo, policies, meta) {
29
+ _sendTooManyRequests(stream, {
30
+ limitInfo,
31
+ policies
32
+ }, meta)
33
+ }
34
+
35
+ /**
36
+ * @param {ServerHttp2Stream} stream
37
+ * @param {Pick<SendInfo, 'limitInfo' | 'policies'>} info
38
+ * @param {Metadata} meta
39
+ */
40
+ export function _sendTooManyRequests(stream, info, meta) {
41
+ const {
42
+ limitInfo,
43
+ policies
44
+ } = info
45
+
29
46
  send(stream, HTTP_STATUS_TOO_MANY_REQUESTS, {
30
47
  [HTTP2_HEADER_RETRY_AFTER]: `${limitInfo.resetSeconds}`,
31
48
  [HTTP_HEADER_RATE_LIMIT]: RateLimit.from(limitInfo),
@@ -1,11 +1,11 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { Challenge } from '../www-authenticate.js'
4
- import { send } from './send-util.js'
3
+ import { Challenge } from '../../headers/www-authenticate.js'
4
+ import { send } from '../send-util.js'
5
5
 
6
6
  /** @import { ServerHttp2Stream } from 'node:http2' */
7
- /** @import { Metadata } from './defs.js' */
8
- /** @import { ChallengeItem } from '../www-authenticate.js' */
7
+ /** @import { Metadata } from '../../defs.js' */
8
+ /** @import { ChallengeItem } from '../../headers/www-authenticate.js' */
9
9
 
10
10
  const {
11
11
  HTTP2_HEADER_WWW_AUTHENTICATE
@@ -20,6 +20,6 @@ const { HTTP_STATUS_UNAUTHORIZED } = http2.constants
20
20
  */
21
21
  export function sendUnauthorized(stream, challenge, meta) {
22
22
  send(stream, HTTP_STATUS_UNAUTHORIZED, {
23
- [HTTP2_HEADER_WWW_AUTHENTICATE]: challenge?.map(Challenge.encode),
23
+ [HTTP2_HEADER_WWW_AUTHENTICATE]: challenge?.map(Challenge.encode), // todo stringify ?
24
24
  }, [ HTTP2_HEADER_WWW_AUTHENTICATE ], undefined, undefined, meta)
25
25
  }
@@ -1,9 +1,9 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { send } from './send-util.js'
3
+ import { send } from '../send-util.js'
4
4
 
5
5
  /** @import { ServerHttp2Stream } from 'node:http2' */
6
- /** @import { Metadata } from './defs.js' */
6
+ /** @import { Metadata } from '../../defs.js' */
7
7
 
8
8
  const { HTTP_STATUS_UNPROCESSABLE_ENTITY } = http2.constants
9
9
 
@@ -1,10 +1,10 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { HTTP_HEADER_ACCEPT_PATCH, HTTP_HEADER_ACCEPT_POST, HTTP_HEADER_ACCEPT_QUERY } from './defs.js'
4
- import { send } from './send-util.js'
3
+ import { HTTP_HEADER_ACCEPT_PATCH, HTTP_HEADER_ACCEPT_POST, HTTP_HEADER_ACCEPT_QUERY } from '../../defs.js'
4
+ import { send } from '../send-util.js'
5
5
 
6
6
  /** @import { ServerHttp2Stream } from 'node:http2' */
7
- /** @import { Metadata } from './defs.js' */
7
+ /** @import { SendInfo, Metadata } from '../../defs.js' */
8
8
 
9
9
  const { HTTP2_METHOD_POST, HTTP2_METHOD_PATCH } = http2.constants
10
10
 
@@ -17,11 +17,28 @@ const { HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE } = http2.constants
17
17
  * @param {Metadata} meta
18
18
  */
19
19
  export function sendUnsupportedMediaType(stream, acceptableMediaType, supportedQueryTypes, meta) {
20
+ _sendUnsupportedMediaType(stream, {
21
+ acceptableMediaType,
22
+ supportedQueryTypes
23
+ }, meta)
24
+ }
25
+
26
+ /**
27
+ * @param {ServerHttp2Stream} stream
28
+ * @param {Pick<SendInfo, 'acceptableMediaType' | 'supportedQueryTypes'>} info
29
+ * @param {Metadata} meta
30
+ */
31
+ export function _sendUnsupportedMediaType(stream, info, meta) {
32
+ const {
33
+ supportedQueryTypes,
34
+ acceptableMediaType
35
+ } = info
36
+
20
37
  const supportsQuery = supportedQueryTypes !== undefined && supportedQueryTypes.length > 0
21
38
  const exposedHeaders = supportsQuery ? [ HTTP_HEADER_ACCEPT_QUERY, HTTP_HEADER_ACCEPT_POST ] : [ HTTP_HEADER_ACCEPT_POST ]
22
39
 
23
40
  const method = HTTP2_METHOD_POST // todo pass in as parameter or split acceptable to post and patch types
24
- const acceptable = Array.isArray(acceptableMediaType) ? acceptableMediaType : [ acceptableMediaType ]
41
+ const acceptable = Array.isArray(acceptableMediaType) ? acceptableMediaType : [ acceptableMediaType ] // todo undefined creates array of one item
25
42
  const acceptHeader = (method === HTTP2_METHOD_POST) ? HTTP_HEADER_ACCEPT_POST : HTTP_HEADER_ACCEPT_PATCH
26
43
  const acceptValue = ((method === HTTP2_METHOD_POST) || (method === HTTP2_METHOD_PATCH)) ? acceptable.join(',') : undefined
27
44
 
@@ -1,10 +1,10 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { CONTENT_TYPE_TEXT } from '../content-type.js'
4
- import { send } from './send-util.js'
3
+ import { CONTENT_TYPE_TEXT } from '../../headers/content-type.js'
4
+ import { send } from '../send-util.js'
5
5
 
6
6
  /** @import { ServerHttp2Stream } from 'node:http2' */
7
- /** @import { Metadata } from './defs.js' */
7
+ /** @import { Metadata } from '../../defs.js' */
8
8
 
9
9
  const { HTTP_STATUS_INTERNAL_SERVER_ERROR } = http2.constants
10
10
 
@@ -1,9 +1,9 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { send } from './send-util.js'
3
+ import { send } from '../send-util.js'
4
4
 
5
5
  /** @import { ServerHttp2Stream } from 'node:http2' */
6
- /** @import { Metadata } from './defs.js' */
6
+ /** @import { Metadata } from '../../defs.js' */
7
7
 
8
8
  const { HTTP_STATUS_INSUFFICIENT_STORAGE } = http2.constants
9
9
 
@@ -1,10 +1,10 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { CONTENT_TYPE_TEXT } from '../content-type.js'
4
- import { send } from './send-util.js'
3
+ import { CONTENT_TYPE_TEXT } from '../../headers/content-type.js'
4
+ import { send } from '../send-util.js'
5
5
 
6
6
  /** @import { ServerHttp2Stream } from 'node:http2' */
7
- /** @import { Metadata } from './defs.js' */
7
+ /** @import { Metadata } from '../../defs.js' */
8
8
 
9
9
  const { HTTP_STATUS_NOT_IMPLEMENTED } = http2.constants
10
10
 
@@ -15,4 +15,4 @@ const { HTTP_STATUS_NOT_IMPLEMENTED } = http2.constants
15
15
  */
16
16
  export function sendNotImplemented(stream, message, meta) {
17
17
  send(stream, HTTP_STATUS_NOT_IMPLEMENTED, {}, [], CONTENT_TYPE_TEXT, message, meta)
18
- }
18
+ }
@@ -1,10 +1,10 @@
1
1
  import http2 from 'node:http2'
2
2
 
3
- import { CONTENT_TYPE_TEXT } from '../content-type.js'
4
- import { send } from './send-util.js'
3
+ import { CONTENT_TYPE_TEXT } from '../../headers/content-type.js'
4
+ import { send } from '../send-util.js'
5
5
 
6
6
  /** @import { ServerHttp2Stream } from 'node:http2' */
7
- /** @import { Metadata } from './defs.js' */
7
+ /** @import { SendInfo, Metadata } from '../../defs.js' */
8
8
 
9
9
  const {
10
10
  HTTP2_HEADER_RETRY_AFTER
@@ -19,7 +19,19 @@ const { HTTP_STATUS_SERVICE_UNAVAILABLE } = http2.constants
19
19
  * @param {Metadata} meta
20
20
  */
21
21
  export function sendUnavailable(stream, message, retryAfter, meta) {
22
+ _sendUnavailable(stream, message, { retryAfter }, meta)
23
+ }
24
+
25
+ /**
26
+ * @param {ServerHttp2Stream} stream
27
+ * @param {string|undefined} message
28
+ * @param {Pick<SendInfo, 'retryAfter'>} info
29
+ * @param {Metadata} meta
30
+ */
31
+ export function _sendUnavailable(stream, message, info, meta) {
32
+ const { retryAfter } = info
33
+
22
34
  send(stream, HTTP_STATUS_SERVICE_UNAVAILABLE, {
23
35
  [HTTP2_HEADER_RETRY_AFTER]: Number.isInteger(retryAfter) ? `${retryAfter}` : undefined
24
36
  }, [ HTTP2_HEADER_RETRY_AFTER ], CONTENT_TYPE_TEXT, message, meta)
25
- }
37
+ }
@@ -4,10 +4,10 @@ import {
4
4
  HTTP_HEADER_SERVER_TIMING,
5
5
  HTTP_HEADER_TIMING_ALLOW_ORIGIN,
6
6
  ServerTiming
7
- } from '../server-timing.js'
7
+ } from '../headers/server-timing.js'
8
8
 
9
9
  /** @import { OutgoingHttpHeaders } from 'node:http2' */
10
- /** @import { Metadata } from './defs.js' */
10
+ /** @import { Metadata } from '../defs.js' */
11
11
 
12
12
  const {
13
13
  HTTP2_HEADER_STATUS,
@@ -1,40 +1,44 @@
1
1
  /** biome-ignore-all lint/performance/noBarrelFile: entry point */
2
2
  /** biome-ignore-all lint/performance/noReExportAll: entry point */
3
- export * from './defs.js'
3
+ export * from '../defs.js'
4
+ export * from './header-util.js'
4
5
  export * from './send-util.js'
5
6
  // end common headers
6
7
 
7
- export * from './accepted.js'
8
- export * from './bytes.js'
9
- export * from './conflict.js'
10
- export * from './content-too-large.js'
11
- export * from './created.js'
12
- export * from './error.js'
13
- export * from './forbidden.js'
14
- export * from './gone.js'
15
- export * from './im-a-teapot.js'
16
- export * from './insufficient-storage.js'
17
- export * from './json.js'
18
- export * from './moved-permanently.js'
19
- export * from './multiple-choices.js'
20
- export * from './no-content.js'
21
- export * from './not-acceptable.js'
22
- export * from './not-allowed.js'
23
- export * from './not-found.js'
24
- export * from './not-implemented.js'
25
- export * from './not-modified.js'
26
- export * from './partial-content.js'
27
- export * from './permanent-redirect.js'
28
- export * from './precondition-failed.js'
29
- export * from './preflight.js'
30
- export * from './range-not-satisfiable.js'
31
- export * from './see-other.js'
32
- export * from './sse.js'
33
- export * from './temporary-redirect.js'
34
- export * from './timeout.js'
35
- export * from './too-many-requests.js'
36
- export * from './trace.js'
37
- export * from './unauthorized.js'
38
- export * from './unavailable.js'
39
- export * from './unprocessable.js'
40
- export * from './unsupported-media.js'
8
+ export * from './2xx/accepted.js'
9
+ export * from './2xx/bytes.js'
10
+ export * from './2xx/created.js'
11
+ export * from './2xx/json.js'
12
+ export * from './2xx/no-content.js'
13
+ export * from './2xx/partial-content.js'
14
+ export * from './2xx/preflight.js'
15
+ export * from './2xx/sse.js'
16
+ export * from './2xx/trace.js'
17
+ export * from './3xx/found.js'
18
+ export * from './3xx/moved-permanently.js'
19
+ export * from './3xx/multiple-choices.js'
20
+ export * from './3xx/not-modified.js'
21
+ export * from './3xx/permanent-redirect.js'
22
+ export * from './3xx/see-other.js'
23
+ export * from './3xx/temporary-redirect.js'
24
+ export * from './4xx/bad-request.js'
25
+ export * from './4xx/conflict.js'
26
+ export * from './4xx/content-too-large.js'
27
+ export * from './4xx/forbidden.js'
28
+ export * from './4xx/gone.js'
29
+ export * from './4xx/im-a-teapot.js'
30
+ export * from './4xx/not-acceptable.js'
31
+ export * from './4xx/not-allowed.js'
32
+ export * from './4xx/not-found.js'
33
+ export * from './4xx/payment-required.js'
34
+ export * from './4xx/precondition-failed.js'
35
+ export * from './4xx/range-not-satisfiable.js'
36
+ export * from './4xx/timeout.js'
37
+ export * from './4xx/too-many-requests.js'
38
+ export * from './4xx/unauthorized.js'
39
+ export * from './4xx/unprocessable.js'
40
+ export * from './4xx/unsupported-media.js'
41
+ export * from './5xx/error.js'
42
+ export * from './5xx/insufficient-storage.js'
43
+ export * from './5xx/not-implemented.js'
44
+ export * from './5xx/unavailable.js'
@@ -1,46 +1,51 @@
1
- import { sendAccepted } from './accepted.js'
2
- import { sendBytes } from './bytes.js'
3
- import { sendConflict } from './conflict.js'
4
- import { sendContentTooLarge } from './content-too-large.js'
5
- import { sendCreated } from './created.js'
6
- import { sendError } from './error.js'
7
- import { sendForbidden } from './forbidden.js'
8
- import { sendGone } from './gone.js'
9
- import { sendImATeapot } from './im-a-teapot.js'
10
- import { sendInsufficientStorage } from './insufficient-storage.js'
11
- import { sendJSON_Encoded } from './json.js'
12
- import { sendMovedPermanently } from './moved-permanently.js'
13
- import { sendMultipleChoices } from './multiple-choices.js'
14
- import { sendNoContent } from './no-content.js'
15
- import { sendNotAcceptable } from './not-acceptable.js'
16
- import { sendNotAllowed } from './not-allowed.js'
17
- import { sendNotFound } from './not-found.js'
18
- import { sendNotImplemented } from './not-implemented.js'
19
- import { sendNotModified } from './not-modified.js'
20
- import { sendPartialContent } from './partial-content.js'
21
- import { sendPermanentRedirect } from './permanent-redirect.js'
22
- import { sendPreconditionFailed } from './precondition-failed.js'
23
- import { sendPreflight } from './preflight.js'
24
- import { sendRangeNotSatisfiable } from './range-not-satisfiable.js'
25
- import { sendSeeOther } from './see-other.js'
26
- import { sendSSE } from './sse.js'
27
- import { sendTemporaryRedirect } from './temporary-redirect.js'
28
- import { sendTimeout } from './timeout.js'
29
- import { sendTooManyRequests } from './too-many-requests.js'
30
- import { sendTrace } from './trace.js'
31
- import { sendUnauthorized } from './unauthorized.js'
32
- import { sendUnavailable } from './unavailable.js'
33
- import { sendUnprocessable } from './unprocessable.js'
34
- import { sendUnsupportedMediaType } from './unsupported-media.js'
1
+ import { sendAccepted } from './2xx/accepted.js'
2
+ import { sendBytes } from './2xx/bytes.js'
3
+ import { sendCreated } from './2xx/created.js'
4
+ import { sendJSON_Encoded } from './2xx/json.js'
5
+ import { sendNoContent } from './2xx/no-content.js'
6
+ import { sendPartialContent } from './2xx/partial-content.js'
7
+ import { sendPreflight } from './2xx/preflight.js'
8
+ import { sendSSE } from './2xx/sse.js'
9
+ import { sendTrace } from './2xx/trace.js'
10
+ import { sendFound } from './3xx/found.js'
11
+ import { sendMovedPermanently } from './3xx/moved-permanently.js'
12
+ import { sendMultipleChoices } from './3xx/multiple-choices.js'
13
+ import { sendNotModified } from './3xx/not-modified.js'
14
+ import { sendPermanentRedirect } from './3xx/permanent-redirect.js'
15
+ import { sendSeeOther } from './3xx/see-other.js'
16
+ import { sendTemporaryRedirect } from './3xx/temporary-redirect.js'
17
+ import { sendBadRequest } from './4xx/bad-request.js'
18
+ import { sendConflict } from './4xx/conflict.js'
19
+ import { sendContentTooLarge } from './4xx/content-too-large.js'
20
+ import { sendForbidden } from './4xx/forbidden.js'
21
+ import { sendGone } from './4xx/gone.js'
22
+ import { sendImATeapot } from './4xx/im-a-teapot.js'
23
+ import { sendNotAcceptable } from './4xx/not-acceptable.js'
24
+ import { sendNotAllowed } from './4xx/not-allowed.js'
25
+ import { sendNotFound } from './4xx/not-found.js'
26
+ import { sendPaymentRequired } from './4xx/payment-required.js'
27
+ import { sendPreconditionFailed } from './4xx/precondition-failed.js'
28
+ import { sendRangeNotSatisfiable } from './4xx/range-not-satisfiable.js'
29
+ import { sendTimeout } from './4xx/timeout.js'
30
+ import { sendTooManyRequests } from './4xx/too-many-requests.js'
31
+ import { sendUnauthorized } from './4xx/unauthorized.js'
32
+ import { sendUnprocessable } from './4xx/unprocessable.js'
33
+ import { sendUnsupportedMediaType } from './4xx/unsupported-media.js'
34
+ import { sendError } from './5xx/error.js'
35
+ import { sendInsufficientStorage } from './5xx/insufficient-storage.js'
36
+ import { sendNotImplemented } from './5xx/not-implemented.js'
37
+ import { sendUnavailable } from './5xx/unavailable.js'
35
38
 
36
39
  export const Response = {
37
40
  accepted: sendAccepted,
41
+ badRequest: sendBadRequest,
38
42
  bytes: sendBytes,
39
43
  conflict: sendConflict,
40
44
  contentTooLarge: sendContentTooLarge,
41
45
  created: sendCreated,
42
46
  error: sendError,
43
47
  forbidden: sendForbidden,
48
+ found: sendFound,
44
49
  gone: sendGone,
45
50
  imATeapot: sendImATeapot,
46
51
  insufficientStorage: sendInsufficientStorage,
@@ -54,6 +59,7 @@ export const Response = {
54
59
  notImplemented: sendNotImplemented,
55
60
  notModified: sendNotModified,
56
61
  partialContent: sendPartialContent,
62
+ paymentRequired: sendPaymentRequired,
57
63
  permanentRedirect: sendPermanentRedirect,
58
64
  preconditionFailed: sendPreconditionFailed,
59
65
  preflight: sendPreflight,