@kerebron/extension-server-hono 0.4.28 → 0.4.30

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 (58) hide show
  1. package/esm/HonoYjsMemAdapter.js +1 -0
  2. package/esm/HonoYjsMemAdapter.js.map +1 -0
  3. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/compose.js +1 -0
  4. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/compose.js.map +1 -0
  5. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/context.js +1 -0
  6. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/context.js.map +1 -0
  7. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/helper/websocket/index.js +1 -0
  8. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/helper/websocket/index.js.map +1 -0
  9. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/hono-base.js +1 -0
  10. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/hono-base.js.map +1 -0
  11. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/http-exception.js +1 -0
  12. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/http-exception.js.map +1 -0
  13. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/request/constants.js +1 -0
  14. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/request/constants.js.map +1 -0
  15. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/request.js +1 -0
  16. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/request.js.map +1 -0
  17. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/router.js +1 -0
  18. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/router.js.map +1 -0
  19. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/types.js +1 -0
  20. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/types.js.map +1 -0
  21. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/body.js +1 -0
  22. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/body.js.map +1 -0
  23. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/constants.js +1 -0
  24. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/constants.js.map +1 -0
  25. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/headers.js +1 -0
  26. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/headers.js.map +1 -0
  27. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/html.js +1 -0
  28. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/html.js.map +1 -0
  29. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/http-status.js +1 -0
  30. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/http-status.js.map +1 -0
  31. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/mime.js +1 -0
  32. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/mime.js.map +1 -0
  33. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/types.js +1 -0
  34. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/types.js.map +1 -0
  35. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/url.js +1 -0
  36. package/esm/deps/jsr.io/@hono/hono/4.11.3/src/utils/url.js.map +1 -0
  37. package/esm/mod.js +1 -0
  38. package/esm/mod.js.map +1 -0
  39. package/package.json +5 -1
  40. package/src/HonoYjsMemAdapter.ts +264 -0
  41. package/src/deps/jsr.io/@hono/hono/4.11.3/src/compose.ts +73 -0
  42. package/src/deps/jsr.io/@hono/hono/4.11.3/src/context.ts +770 -0
  43. package/src/deps/jsr.io/@hono/hono/4.11.3/src/helper/websocket/index.ts +140 -0
  44. package/src/deps/jsr.io/@hono/hono/4.11.3/src/hono-base.ts +539 -0
  45. package/src/deps/jsr.io/@hono/hono/4.11.3/src/http-exception.ts +78 -0
  46. package/src/deps/jsr.io/@hono/hono/4.11.3/src/request/constants.ts +1 -0
  47. package/src/deps/jsr.io/@hono/hono/4.11.3/src/request.ts +487 -0
  48. package/src/deps/jsr.io/@hono/hono/4.11.3/src/router.ts +103 -0
  49. package/src/deps/jsr.io/@hono/hono/4.11.3/src/types.ts +2489 -0
  50. package/src/deps/jsr.io/@hono/hono/4.11.3/src/utils/body.ts +229 -0
  51. package/src/deps/jsr.io/@hono/hono/4.11.3/src/utils/constants.ts +4 -0
  52. package/src/deps/jsr.io/@hono/hono/4.11.3/src/utils/headers.ts +333 -0
  53. package/src/deps/jsr.io/@hono/hono/4.11.3/src/utils/html.ts +182 -0
  54. package/src/deps/jsr.io/@hono/hono/4.11.3/src/utils/http-status.ts +72 -0
  55. package/src/deps/jsr.io/@hono/hono/4.11.3/src/utils/mime.ts +96 -0
  56. package/src/deps/jsr.io/@hono/hono/4.11.3/src/utils/types.ts +116 -0
  57. package/src/deps/jsr.io/@hono/hono/4.11.3/src/utils/url.ts +310 -0
  58. package/src/mod.ts +5 -0
@@ -0,0 +1,229 @@
1
+ /**
2
+ * @module
3
+ * Body utility.
4
+ */
5
+
6
+ import { HonoRequest } from '../request.js'
7
+
8
+ type BodyDataValueDot = { [x: string]: string | File | BodyDataValueDot }
9
+ type BodyDataValueDotAll = {
10
+ [x: string]: string | File | (string | File)[] | BodyDataValueDotAll
11
+ }
12
+ type SimplifyBodyData<T> = {
13
+ [K in keyof T]: string | File | (string | File)[] | BodyDataValueDotAll extends T[K]
14
+ ? string | File | (string | File)[] | BodyDataValueDotAll
15
+ : string | File | BodyDataValueDot extends T[K]
16
+ ? string | File | BodyDataValueDot
17
+ : string | File | (string | File)[] extends T[K]
18
+ ? string | File | (string | File)[]
19
+ : string | File
20
+ } & {}
21
+
22
+ type BodyDataValueComponent<T> =
23
+ | string
24
+ | File
25
+ | (T extends { all: false }
26
+ ? never // explicitly set to false
27
+ : T extends { all: true } | { all: boolean }
28
+ ? (string | File)[] // use all option
29
+ : never) // without options
30
+ type BodyDataValueObject<T> = { [key: string]: BodyDataValueComponent<T> | BodyDataValueObject<T> }
31
+ type BodyDataValue<T> =
32
+ | BodyDataValueComponent<T>
33
+ | (T extends { dot: false }
34
+ ? never // explicitly set to false
35
+ : T extends { dot: true } | { dot: boolean }
36
+ ? BodyDataValueObject<T> // use dot option
37
+ : never) // without options
38
+ export type BodyData<T extends Partial<ParseBodyOptions> = {}> = SimplifyBodyData<
39
+ Record<string, BodyDataValue<T>>
40
+ >
41
+
42
+ export type ParseBodyOptions = {
43
+ /**
44
+ * Determines whether all fields with multiple values should be parsed as arrays.
45
+ * @default false
46
+ * @example
47
+ * const data = new FormData()
48
+ * data.append('file', 'aaa')
49
+ * data.append('file', 'bbb')
50
+ * data.append('message', 'hello')
51
+ *
52
+ * If all is false:
53
+ * parseBody should return { file: 'bbb', message: 'hello' }
54
+ *
55
+ * If all is true:
56
+ * parseBody should return { file: ['aaa', 'bbb'], message: 'hello' }
57
+ */
58
+ all: boolean
59
+ /**
60
+ * Determines whether all fields with dot notation should be parsed as nested objects.
61
+ * @default false
62
+ * @example
63
+ * const data = new FormData()
64
+ * data.append('obj.key1', 'value1')
65
+ * data.append('obj.key2', 'value2')
66
+ *
67
+ * If dot is false:
68
+ * parseBody should return { 'obj.key1': 'value1', 'obj.key2': 'value2' }
69
+ *
70
+ * If dot is true:
71
+ * parseBody should return { obj: { key1: 'value1', key2: 'value2' } }
72
+ */
73
+ dot: boolean
74
+ }
75
+
76
+ /**
77
+ * Parses the body of a request based on the provided options.
78
+ *
79
+ * @template T - The type of the parsed body data.
80
+ * @param {HonoRequest | Request} request - The request object to parse.
81
+ * @param {Partial<ParseBodyOptions>} [options] - Options for parsing the body.
82
+ * @returns {Promise<T>} The parsed body data.
83
+ */
84
+ interface ParseBody {
85
+ <Options extends Partial<ParseBodyOptions>, T extends BodyData<Options>>(
86
+ request: HonoRequest | Request,
87
+ options?: Options
88
+ ): Promise<T>
89
+ <T extends BodyData>(
90
+ request: HonoRequest | Request,
91
+ options?: Partial<ParseBodyOptions>
92
+ ): Promise<T>
93
+ }
94
+ export const parseBody: ParseBody = async (
95
+ request: HonoRequest | Request,
96
+ options = Object.create(null)
97
+ ) => {
98
+ const { all = false, dot = false } = options
99
+
100
+ const headers = request instanceof HonoRequest ? request.raw.headers : request.headers
101
+ const contentType = headers.get('Content-Type')
102
+
103
+ if (
104
+ contentType?.startsWith('multipart/form-data') ||
105
+ contentType?.startsWith('application/x-www-form-urlencoded')
106
+ ) {
107
+ return parseFormData(request, { all, dot })
108
+ }
109
+
110
+ return {}
111
+ }
112
+
113
+ /**
114
+ * Parses form data from a request.
115
+ *
116
+ * @template T - The type of the parsed body data.
117
+ * @param {HonoRequest | Request} request - The request object containing form data.
118
+ * @param {ParseBodyOptions} options - Options for parsing the form data.
119
+ * @returns {Promise<T>} The parsed body data.
120
+ */
121
+ async function parseFormData<T extends BodyData>(
122
+ request: HonoRequest | Request,
123
+ options: ParseBodyOptions
124
+ ): Promise<T> {
125
+ const formData = await (request as Request).formData()
126
+
127
+ if (formData) {
128
+ return convertFormDataToBodyData<T>(formData, options)
129
+ }
130
+
131
+ return {} as T
132
+ }
133
+
134
+ /**
135
+ * Converts form data to body data based on the provided options.
136
+ *
137
+ * @template T - The type of the parsed body data.
138
+ * @param {FormData} formData - The form data to convert.
139
+ * @param {ParseBodyOptions} options - Options for parsing the form data.
140
+ * @returns {T} The converted body data.
141
+ */
142
+ function convertFormDataToBodyData<T extends BodyData = BodyData>(
143
+ formData: FormData,
144
+ options: ParseBodyOptions
145
+ ): T {
146
+ const form: BodyData = Object.create(null)
147
+
148
+ formData.forEach((value, key) => {
149
+ const shouldParseAllValues = options.all || key.endsWith('[]')
150
+
151
+ if (!shouldParseAllValues) {
152
+ form[key] = value
153
+ } else {
154
+ handleParsingAllValues(form, key, value)
155
+ }
156
+ })
157
+
158
+ if (options.dot) {
159
+ Object.entries(form).forEach(([key, value]) => {
160
+ const shouldParseDotValues = key.includes('.')
161
+
162
+ if (shouldParseDotValues) {
163
+ handleParsingNestedValues(form, key, value)
164
+ delete form[key]
165
+ }
166
+ })
167
+ }
168
+
169
+ return form as T
170
+ }
171
+
172
+ /**
173
+ * Handles parsing all values for a given key, supporting multiple values as arrays.
174
+ *
175
+ * @param {BodyData} form - The form data object.
176
+ * @param {string} key - The key to parse.
177
+ * @param {FormDataEntryValue} value - The value to assign.
178
+ */
179
+ const handleParsingAllValues = (
180
+ form: BodyData<{ all: true }>,
181
+ key: string,
182
+ value: FormDataEntryValue
183
+ ): void => {
184
+ if (form[key] !== undefined) {
185
+ if (Array.isArray(form[key])) {
186
+ ;(form[key] as (string | File)[]).push(value)
187
+ } else {
188
+ form[key] = [form[key] as string | File, value]
189
+ }
190
+ } else {
191
+ if (!key.endsWith('[]')) {
192
+ form[key] = value
193
+ } else {
194
+ form[key] = [value]
195
+ }
196
+ }
197
+ }
198
+
199
+ /**
200
+ * Handles parsing nested values using dot notation keys.
201
+ *
202
+ * @param {BodyData} form - The form data object.
203
+ * @param {string} key - The dot notation key.
204
+ * @param {BodyDataValue} value - The value to assign.
205
+ */
206
+ const handleParsingNestedValues = (
207
+ form: BodyData,
208
+ key: string,
209
+ value: BodyDataValue<Partial<ParseBodyOptions>>
210
+ ): void => {
211
+ let nestedForm = form
212
+ const keys = key.split('.')
213
+
214
+ keys.forEach((key, index) => {
215
+ if (index === keys.length - 1) {
216
+ nestedForm[key] = value
217
+ } else {
218
+ if (
219
+ !nestedForm[key] ||
220
+ typeof nestedForm[key] !== 'object' ||
221
+ Array.isArray(nestedForm[key]) ||
222
+ nestedForm[key] instanceof File
223
+ ) {
224
+ nestedForm[key] = Object.create(null)
225
+ }
226
+ nestedForm = nestedForm[key] as unknown as BodyData
227
+ }
228
+ })
229
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Constant used to mark a composed handler.
3
+ */
4
+ export const COMPOSED_HANDLER = '__COMPOSED_HANDLER'
@@ -0,0 +1,333 @@
1
+ /**
2
+ * @module
3
+ * HTTP Headers utility.
4
+ */
5
+
6
+ // note: https://www.iana.org/assignments/http-fields/http-fields.xhtml
7
+
8
+ export type RequestHeader =
9
+ | 'A-IM'
10
+ | 'Accept'
11
+ | 'Accept-Additions'
12
+ | 'Accept-CH'
13
+ | 'Accept-Charset'
14
+ | 'Accept-Datetime'
15
+ | 'Accept-Encoding'
16
+ | 'Accept-Features'
17
+ | 'Accept-Language'
18
+ | 'Accept-Patch'
19
+ | 'Accept-Post'
20
+ | 'Accept-Ranges'
21
+ | 'Accept-Signature'
22
+ | 'Access-Control'
23
+ | 'Access-Control-Allow-Credentials'
24
+ | 'Access-Control-Allow-Headers'
25
+ | 'Access-Control-Allow-Methods'
26
+ | 'Access-Control-Allow-Origin'
27
+ | 'Access-Control-Expose-Headers'
28
+ | 'Access-Control-Max-Age'
29
+ | 'Access-Control-Request-Headers'
30
+ | 'Access-Control-Request-Method'
31
+ | 'Age'
32
+ | 'Allow'
33
+ | 'ALPN'
34
+ | 'Alt-Svc'
35
+ | 'Alt-Used'
36
+ | 'Alternates'
37
+ | 'AMP-Cache-Transform'
38
+ | 'Apply-To-Redirect-Ref'
39
+ | 'Authentication-Control'
40
+ | 'Authentication-Info'
41
+ | 'Authorization'
42
+ | 'Available-Dictionary'
43
+ | 'C-Ext'
44
+ | 'C-Man'
45
+ | 'C-Opt'
46
+ | 'C-PEP'
47
+ | 'C-PEP-Info'
48
+ | 'Cache-Control'
49
+ | 'Cache-Status'
50
+ | 'Cal-Managed-ID'
51
+ | 'CalDAV-Timezones'
52
+ | 'Capsule-Protocol'
53
+ | 'CDN-Cache-Control'
54
+ | 'CDN-Loop'
55
+ | 'Cert-Not-After'
56
+ | 'Cert-Not-Before'
57
+ | 'Clear-Site-Data'
58
+ | 'Client-Cert'
59
+ | 'Client-Cert-Chain'
60
+ | 'Close'
61
+ | 'CMCD-Object'
62
+ | 'CMCD-Request'
63
+ | 'CMCD-Session'
64
+ | 'CMCD-Status'
65
+ | 'CMSD-Dynamic'
66
+ | 'CMSD-Static'
67
+ | 'Concealed-Auth-Export'
68
+ | 'Configuration-Context'
69
+ | 'Connection'
70
+ | 'Content-Base'
71
+ | 'Content-Digest'
72
+ | 'Content-Disposition'
73
+ | 'Content-Encoding'
74
+ | 'Content-ID'
75
+ | 'Content-Language'
76
+ | 'Content-Length'
77
+ | 'Content-Location'
78
+ | 'Content-MD5'
79
+ | 'Content-Range'
80
+ | 'Content-Script-Type'
81
+ | 'Content-Security-Policy'
82
+ | 'Content-Security-Policy-Report-Only'
83
+ | 'Content-Style-Type'
84
+ | 'Content-Type'
85
+ | 'Content-Version'
86
+ | 'Cookie'
87
+ | 'Cookie2'
88
+ | 'Cross-Origin-Embedder-Policy'
89
+ | 'Cross-Origin-Embedder-Policy-Report-Only'
90
+ | 'Cross-Origin-Opener-Policy'
91
+ | 'Cross-Origin-Opener-Policy-Report-Only'
92
+ | 'Cross-Origin-Resource-Policy'
93
+ | 'CTA-Common-Access-Token'
94
+ | 'DASL'
95
+ | 'Date'
96
+ | 'DAV'
97
+ | 'Default-Style'
98
+ | 'Delta-Base'
99
+ | 'Deprecation'
100
+ | 'Depth'
101
+ | 'Derived-From'
102
+ | 'Destination'
103
+ | 'Differential-ID'
104
+ | 'Dictionary-ID'
105
+ | 'Digest'
106
+ | 'DPoP'
107
+ | 'DPoP-Nonce'
108
+ | 'Early-Data'
109
+ | 'EDIINT-Features'
110
+ | 'ETag'
111
+ | 'Expect'
112
+ | 'Expect-CT'
113
+ | 'Expires'
114
+ | 'Ext'
115
+ | 'Forwarded'
116
+ | 'From'
117
+ | 'GetProfile'
118
+ | 'Hobareg'
119
+ | 'Host'
120
+ | 'HTTP2-Settings'
121
+ | 'If'
122
+ | 'If-Match'
123
+ | 'If-Modified-Since'
124
+ | 'If-None-Match'
125
+ | 'If-Range'
126
+ | 'If-Schedule-Tag-Match'
127
+ | 'If-Unmodified-Since'
128
+ | 'IM'
129
+ | 'Include-Referred-Token-Binding-ID'
130
+ | 'Isolation'
131
+ | 'Keep-Alive'
132
+ | 'Label'
133
+ | 'Last-Event-ID'
134
+ | 'Last-Modified'
135
+ | 'Link'
136
+ | 'Link-Template'
137
+ | 'Location'
138
+ | 'Lock-Token'
139
+ | 'Man'
140
+ | 'Max-Forwards'
141
+ | 'Memento-Datetime'
142
+ | 'Meter'
143
+ | 'Method-Check'
144
+ | 'Method-Check-Expires'
145
+ | 'MIME-Version'
146
+ | 'Negotiate'
147
+ | 'NEL'
148
+ | 'OData-EntityId'
149
+ | 'OData-Isolation'
150
+ | 'OData-MaxVersion'
151
+ | 'OData-Version'
152
+ | 'Opt'
153
+ | 'Optional-WWW-Authenticate'
154
+ | 'Ordering-Type'
155
+ | 'Origin'
156
+ | 'Origin-Agent-Cluster'
157
+ | 'OSCORE'
158
+ | 'OSLC-Core-Version'
159
+ | 'Overwrite'
160
+ | 'P3P'
161
+ | 'PEP'
162
+ | 'PEP-Info'
163
+ | 'Permissions-Policy'
164
+ | 'PICS-Label'
165
+ | 'Ping-From'
166
+ | 'Ping-To'
167
+ | 'Position'
168
+ | 'Pragma'
169
+ | 'Prefer'
170
+ | 'Preference-Applied'
171
+ | 'Priority'
172
+ | 'ProfileObject'
173
+ | 'Protocol'
174
+ | 'Protocol-Info'
175
+ | 'Protocol-Query'
176
+ | 'Protocol-Request'
177
+ | 'Proxy-Authenticate'
178
+ | 'Proxy-Authentication-Info'
179
+ | 'Proxy-Authorization'
180
+ | 'Proxy-Features'
181
+ | 'Proxy-Instruction'
182
+ | 'Proxy-Status'
183
+ | 'Public'
184
+ | 'Public-Key-Pins'
185
+ | 'Public-Key-Pins-Report-Only'
186
+ | 'Range'
187
+ | 'Redirect-Ref'
188
+ | 'Referer'
189
+ | 'Referer-Root'
190
+ | 'Referrer-Policy'
191
+ | 'Refresh'
192
+ | 'Repeatability-Client-ID'
193
+ | 'Repeatability-First-Sent'
194
+ | 'Repeatability-Request-ID'
195
+ | 'Repeatability-Result'
196
+ | 'Replay-Nonce'
197
+ | 'Reporting-Endpoints'
198
+ | 'Repr-Digest'
199
+ | 'Retry-After'
200
+ | 'Safe'
201
+ | 'Schedule-Reply'
202
+ | 'Schedule-Tag'
203
+ | 'Sec-GPC'
204
+ | 'Sec-Purpose'
205
+ | 'Sec-Token-Binding'
206
+ | 'Sec-WebSocket-Accept'
207
+ | 'Sec-WebSocket-Extensions'
208
+ | 'Sec-WebSocket-Key'
209
+ | 'Sec-WebSocket-Protocol'
210
+ | 'Sec-WebSocket-Version'
211
+ | 'Security-Scheme'
212
+ | 'Server'
213
+ | 'Server-Timing'
214
+ | 'Set-Cookie'
215
+ | 'Set-Cookie2'
216
+ | 'SetProfile'
217
+ | 'Signature'
218
+ | 'Signature-Input'
219
+ | 'SLUG'
220
+ | 'SoapAction'
221
+ | 'Status-URI'
222
+ | 'Strict-Transport-Security'
223
+ | 'Sunset'
224
+ | 'Surrogate-Capability'
225
+ | 'Surrogate-Control'
226
+ | 'TCN'
227
+ | 'TE'
228
+ | 'Timeout'
229
+ | 'Timing-Allow-Origin'
230
+ | 'Topic'
231
+ | 'Traceparent'
232
+ | 'Tracestate'
233
+ | 'Trailer'
234
+ | 'Transfer-Encoding'
235
+ | 'TTL'
236
+ | 'Upgrade'
237
+ | 'Urgency'
238
+ | 'URI'
239
+ | 'Use-As-Dictionary'
240
+ | 'User-Agent'
241
+ | 'Variant-Vary'
242
+ | 'Vary'
243
+ | 'Via'
244
+ | 'Want-Content-Digest'
245
+ | 'Want-Digest'
246
+ | 'Want-Repr-Digest'
247
+ | 'Warning'
248
+ | 'WWW-Authenticate'
249
+ | 'X-Content-Type-Options'
250
+ | 'X-Frame-Options'
251
+
252
+ export type ResponseHeader =
253
+ | 'Access-Control-Allow-Credentials'
254
+ | 'Access-Control-Allow-Headers'
255
+ | 'Access-Control-Allow-Methods'
256
+ | 'Access-Control-Allow-Origin'
257
+ | 'Access-Control-Expose-Headers'
258
+ | 'Access-Control-Max-Age'
259
+ | 'Age'
260
+ | 'Allow'
261
+ | 'Cache-Control'
262
+ | 'Clear-Site-Data'
263
+ | 'Content-Disposition'
264
+ | 'Content-Encoding'
265
+ | 'Content-Language'
266
+ | 'Content-Length'
267
+ | 'Content-Location'
268
+ | 'Content-Range'
269
+ | 'Content-Security-Policy'
270
+ | 'Content-Security-Policy-Report-Only'
271
+ | 'Content-Type'
272
+ | 'Cookie'
273
+ | 'Cross-Origin-Embedder-Policy'
274
+ | 'Cross-Origin-Opener-Policy'
275
+ | 'Cross-Origin-Resource-Policy'
276
+ | 'Date'
277
+ | 'ETag'
278
+ | 'Expires'
279
+ | 'Last-Modified'
280
+ | 'Location'
281
+ | 'Permissions-Policy'
282
+ | 'Pragma'
283
+ | 'Retry-After'
284
+ | 'Save-Data'
285
+ | 'Sec-CH-Prefers-Color-Scheme'
286
+ | 'Sec-CH-Prefers-Reduced-Motion'
287
+ | 'Sec-CH-UA'
288
+ | 'Sec-CH-UA-Arch'
289
+ | 'Sec-CH-UA-Bitness'
290
+ | 'Sec-CH-UA-Form-Factor'
291
+ | 'Sec-CH-UA-Full-Version'
292
+ | 'Sec-CH-UA-Full-Version-List'
293
+ | 'Sec-CH-UA-Mobile'
294
+ | 'Sec-CH-UA-Model'
295
+ | 'Sec-CH-UA-Platform'
296
+ | 'Sec-CH-UA-Platform-Version'
297
+ | 'Sec-CH-UA-WoW64'
298
+ | 'Sec-Fetch-Dest'
299
+ | 'Sec-Fetch-Mode'
300
+ | 'Sec-Fetch-Site'
301
+ | 'Sec-Fetch-User'
302
+ | 'Sec-GPC'
303
+ | 'Server'
304
+ | 'Server-Timing'
305
+ | 'Service-Worker-Navigation-Preload'
306
+ | 'Set-Cookie'
307
+ | 'Strict-Transport-Security'
308
+ | 'Timing-Allow-Origin'
309
+ | 'Trailer'
310
+ | 'Transfer-Encoding'
311
+ | 'Upgrade'
312
+ | 'Vary'
313
+ | 'WWW-Authenticate'
314
+ | 'Warning'
315
+ | 'X-Content-Type-Options'
316
+ | 'X-DNS-Prefetch-Control'
317
+ | 'X-Frame-Options'
318
+ | 'X-Permitted-Cross-Domain-Policies'
319
+ | 'X-Powered-By'
320
+ | 'X-Robots-Tag'
321
+ | 'X-XSS-Protection'
322
+
323
+ export type AcceptHeader =
324
+ | 'Accept'
325
+ | 'Accept-Charset'
326
+ | 'Accept-Encoding'
327
+ | 'Accept-Language'
328
+ | 'Accept-Patch'
329
+ | 'Accept-Post'
330
+ | 'Accept-Ranges'
331
+
332
+ // note: `X-${string}` is deprecated
333
+ export type CustomHeader = string & {}