@ekumlin/typescript-toolkit 1.0.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 (80) hide show
  1. package/README.md +98 -0
  2. package/dist/collections.d.mts +7 -0
  3. package/dist/collections.d.ts +7 -0
  4. package/dist/collections.js +60 -0
  5. package/dist/collections.js.map +1 -0
  6. package/dist/collections.mjs +31 -0
  7. package/dist/collections.mjs.map +1 -0
  8. package/dist/dom.d.mts +161 -0
  9. package/dist/dom.d.ts +161 -0
  10. package/dist/dom.js +359 -0
  11. package/dist/dom.js.map +1 -0
  12. package/dist/dom.mjs +314 -0
  13. package/dist/dom.mjs.map +1 -0
  14. package/dist/environment.d.mts +3 -0
  15. package/dist/environment.d.ts +3 -0
  16. package/dist/environment.js +33 -0
  17. package/dist/environment.js.map +1 -0
  18. package/dist/environment.mjs +6 -0
  19. package/dist/environment.mjs.map +1 -0
  20. package/dist/error.d.mts +5 -0
  21. package/dist/error.d.ts +5 -0
  22. package/dist/error.js +61 -0
  23. package/dist/error.js.map +1 -0
  24. package/dist/error.mjs +33 -0
  25. package/dist/error.mjs.map +1 -0
  26. package/dist/http.d.mts +145 -0
  27. package/dist/http.d.ts +145 -0
  28. package/dist/http.js +439 -0
  29. package/dist/http.js.map +1 -0
  30. package/dist/http.mjs +283 -0
  31. package/dist/http.mjs.map +1 -0
  32. package/dist/io.d.mts +244 -0
  33. package/dist/io.d.ts +244 -0
  34. package/dist/io.js +521 -0
  35. package/dist/io.js.map +1 -0
  36. package/dist/io.mjs +365 -0
  37. package/dist/io.mjs.map +1 -0
  38. package/dist/number.d.mts +8 -0
  39. package/dist/number.d.ts +8 -0
  40. package/dist/number.js +70 -0
  41. package/dist/number.js.map +1 -0
  42. package/dist/number.mjs +40 -0
  43. package/dist/number.mjs.map +1 -0
  44. package/dist/promise.d.mts +3 -0
  45. package/dist/promise.d.ts +3 -0
  46. package/dist/promise.js +37 -0
  47. package/dist/promise.js.map +1 -0
  48. package/dist/promise.mjs +10 -0
  49. package/dist/promise.mjs.map +1 -0
  50. package/dist/routing.d.mts +3 -0
  51. package/dist/routing.d.ts +3 -0
  52. package/dist/routing.js +43 -0
  53. package/dist/routing.js.map +1 -0
  54. package/dist/routing.mjs +16 -0
  55. package/dist/routing.mjs.map +1 -0
  56. package/dist/string.d.mts +9 -0
  57. package/dist/string.d.ts +9 -0
  58. package/dist/string.js +75 -0
  59. package/dist/string.js.map +1 -0
  60. package/dist/string.mjs +45 -0
  61. package/dist/string.mjs.map +1 -0
  62. package/dist/time.d.mts +9 -0
  63. package/dist/time.d.ts +9 -0
  64. package/dist/time.js +50 -0
  65. package/dist/time.js.map +1 -0
  66. package/dist/time.mjs +21 -0
  67. package/dist/time.mjs.map +1 -0
  68. package/dist/types.d.mts +11 -0
  69. package/dist/types.d.ts +11 -0
  70. package/dist/types.js +58 -0
  71. package/dist/types.js.map +1 -0
  72. package/dist/types.mjs +23 -0
  73. package/dist/types.mjs.map +1 -0
  74. package/dist/values.d.mts +8 -0
  75. package/dist/values.d.ts +8 -0
  76. package/dist/values.js +58 -0
  77. package/dist/values.js.map +1 -0
  78. package/dist/values.mjs +30 -0
  79. package/dist/values.mjs.map +1 -0
  80. package/package.json +40 -0
package/dist/http.js ADDED
@@ -0,0 +1,439 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/http/index.ts
21
+ var http_exports = {};
22
+ __export(http_exports, {
23
+ Accept: () => Accept,
24
+ AcceptCharset: () => AcceptCharset,
25
+ AcceptDatetime: () => AcceptDatetime,
26
+ AcceptEncoding: () => AcceptEncoding,
27
+ AcceptLanguage: () => AcceptLanguage,
28
+ AcceptRanges: () => AcceptRanges,
29
+ Accepted: () => Accepted,
30
+ Age: () => Age,
31
+ Allow: () => Allow,
32
+ AlreadyReported: () => AlreadyReported,
33
+ Authorization: () => Authorization,
34
+ BadGateway: () => BadGateway,
35
+ BadRequest: () => BadRequest,
36
+ CacheControl: () => CacheControl,
37
+ Conflict: () => Conflict,
38
+ Connection: () => Connection,
39
+ ContentDisposition: () => ContentDisposition,
40
+ ContentEncoding: () => ContentEncoding,
41
+ ContentLanguage: () => ContentLanguage,
42
+ ContentLength: () => ContentLength,
43
+ ContentLocation: () => ContentLocation,
44
+ ContentMd5: () => ContentMd5,
45
+ ContentRange: () => ContentRange,
46
+ ContentType: () => ContentType,
47
+ Continue: () => Continue,
48
+ Cookie: () => Cookie,
49
+ Created: () => Created,
50
+ DateTime: () => DateTime,
51
+ ETag: () => ETag,
52
+ EarlyHints: () => EarlyHints,
53
+ Expect: () => Expect,
54
+ ExpectationFailed: () => ExpectationFailed,
55
+ Expires: () => Expires,
56
+ FailedDependency: () => FailedDependency,
57
+ Forbidden: () => Forbidden,
58
+ Found: () => Found,
59
+ From: () => From,
60
+ GatewayTimeout: () => GatewayTimeout,
61
+ Gone: () => Gone,
62
+ Host: () => Host,
63
+ HttpVersionNotSupported: () => HttpVersionNotSupported,
64
+ IfMatch: () => IfMatch,
65
+ IfModifiedSince: () => IfModifiedSince,
66
+ IfNoneMatch: () => IfNoneMatch,
67
+ IfRange: () => IfRange,
68
+ IfunmodifiedSince: () => IfunmodifiedSince,
69
+ ImATeapot: () => ImATeapot,
70
+ ImUsed: () => ImUsed,
71
+ InsufficientStorage: () => InsufficientStorage,
72
+ InternalServerError: () => InternalServerError,
73
+ LastModified: () => LastModified,
74
+ LengthRequired: () => LengthRequired,
75
+ Link: () => Link,
76
+ LocationUri: () => LocationUri,
77
+ Locked: () => Locked,
78
+ LoopDetected: () => LoopDetected,
79
+ MaxForwards: () => MaxForwards,
80
+ MethodNotAllowed: () => MethodNotAllowed,
81
+ MisdirectedRequest: () => MisdirectedRequest,
82
+ MovedPermanently: () => MovedPermanently,
83
+ MultiStatus: () => MultiStatus,
84
+ MultipleChoices: () => MultipleChoices,
85
+ NetworkAuthenticationRequired: () => NetworkAuthenticationRequired,
86
+ NoContent: () => NoContent,
87
+ NonAuthoritativeInformation: () => NonAuthoritativeInformation,
88
+ NotAcceptable: () => NotAcceptable,
89
+ NotExtended: () => NotExtended,
90
+ NotFound: () => NotFound,
91
+ NotImplemented: () => NotImplemented,
92
+ NotModified: () => NotModified,
93
+ Ok: () => Ok,
94
+ P3P: () => P3P,
95
+ PartialContent: () => PartialContent,
96
+ PayloadTooLarge: () => PayloadTooLarge,
97
+ PaymentRequired: () => PaymentRequired,
98
+ PermanentRedirect: () => PermanentRedirect,
99
+ Pragma: () => Pragma,
100
+ PreconditionFailed: () => PreconditionFailed,
101
+ PreconditionRequired: () => PreconditionRequired,
102
+ Processing: () => Processing,
103
+ ProxyAuthenticate: () => ProxyAuthenticate,
104
+ ProxyAuthenticationRequired: () => ProxyAuthenticationRequired,
105
+ ProxyAuthorization: () => ProxyAuthorization,
106
+ RangeNotSatisfiable: () => RangeNotSatisfiable,
107
+ Ranges: () => Ranges,
108
+ Referer: () => Referer,
109
+ Referrer: () => Referrer,
110
+ Refresh: () => Refresh,
111
+ RequestHeaderFieldsTooLarge: () => RequestHeaderFieldsTooLarge,
112
+ RequestTimeout: () => RequestTimeout,
113
+ ResetContent: () => ResetContent,
114
+ RetryAfter: () => RetryAfter,
115
+ SeeOther: () => SeeOther,
116
+ Server: () => Server,
117
+ ServiceUnavailable: () => ServiceUnavailable,
118
+ SetCookie: () => SetCookie,
119
+ StrictTransportSecurity: () => StrictTransportSecurity,
120
+ SwitchingProtocols: () => SwitchingProtocols,
121
+ TE: () => TE,
122
+ TemporaryRedirect: () => TemporaryRedirect,
123
+ TooEarly: () => TooEarly,
124
+ TooManyRequests: () => TooManyRequests,
125
+ Trailer: () => Trailer,
126
+ TransferEncodingRequest: () => TransferEncodingRequest,
127
+ TransferEncodingResponse: () => TransferEncodingResponse,
128
+ Unauthorized: () => Unauthorized,
129
+ UnavailableForLegalReasons: () => UnavailableForLegalReasons,
130
+ UnprocessableContent: () => UnprocessableContent,
131
+ UnsupportedMediaType: () => UnsupportedMediaType,
132
+ Upgrade: () => Upgrade,
133
+ UpgradeRequired: () => UpgradeRequired,
134
+ UriTooLong: () => UriTooLong,
135
+ UseProxyDeprecated: () => UseProxyDeprecated,
136
+ UserAgent: () => UserAgent,
137
+ VariantAlsoNegotiates: () => VariantAlsoNegotiates,
138
+ Vary: () => Vary,
139
+ Via: () => Via,
140
+ Warning: () => Warning,
141
+ WwwAuthenticate: () => WwwAuthenticate,
142
+ clientErrorHttpStatusCodeSchema: () => clientErrorHttpStatusCodeSchema,
143
+ getAuthorizationHeader: () => getAuthorizationHeader,
144
+ getQueryParameters: () => getQueryParameters,
145
+ httpStatusCodeSchema: () => httpStatusCodeSchema,
146
+ isClientErrorHttpStatusCode: () => isClientErrorHttpStatusCode,
147
+ isExpired: () => isExpired,
148
+ isHttpStatusCode: () => isHttpStatusCode,
149
+ isServerErrorHttpStatusCode: () => isServerErrorHttpStatusCode,
150
+ isSuccessHttpStatusCode: () => isSuccessHttpStatusCode,
151
+ serverErrorHttpStatusCodeSchema: () => serverErrorHttpStatusCodeSchema,
152
+ successHttpStatusCodeSchema: () => successHttpStatusCodeSchema
153
+ });
154
+ module.exports = __toCommonJS(http_exports);
155
+
156
+ // src/http/authorizationToken.ts
157
+ var getAuthorizationHeader = (token) => `${token.tokenType} ${token.value}`;
158
+ var isExpired = (token) => token.expiresOn < Date.now();
159
+
160
+ // src/http/getQueryParameters.ts
161
+ var getQueryParameters = (url) => {
162
+ const urlString = url.toString();
163
+ const queryStringIndex = urlString.indexOf("?");
164
+ const queryString = queryStringIndex >= 0 ? urlString.substring(queryStringIndex) : "";
165
+ const query = new URLSearchParams(queryString);
166
+ return query;
167
+ };
168
+
169
+ // src/http/httpHeaders.ts
170
+ var Accept = "Accept";
171
+ var AcceptCharset = "Accept-Charset";
172
+ var AcceptDatetime = "Accept-Datetime";
173
+ var AcceptEncoding = "Accept-Encoding";
174
+ var AcceptLanguage = "Accept-Language";
175
+ var AcceptRanges = "Accept-Ranges";
176
+ var Age = "Age";
177
+ var Allow = "Allow";
178
+ var Authorization = "Authorization";
179
+ var CacheControl = "Cache-Control";
180
+ var Connection = "Connection";
181
+ var ContentDisposition = "Content-Disposition";
182
+ var ContentEncoding = "Content-Encoding";
183
+ var ContentLanguage = "Content-Language";
184
+ var ContentLength = "Content-Length";
185
+ var ContentLocation = "Content-Location";
186
+ var ContentMd5 = "Content-MD5";
187
+ var ContentRange = "Content-Range";
188
+ var ContentType = "Content-Type";
189
+ var Cookie = "Cookie";
190
+ var DateTime = "Date";
191
+ var ETag = "ETag";
192
+ var Expect = "Expect";
193
+ var Expires = "Expires";
194
+ var From = "From";
195
+ var Host = "Host";
196
+ var IfMatch = "If-Match";
197
+ var IfModifiedSince = "If-Modified-Since";
198
+ var IfNoneMatch = "If-None-Match";
199
+ var IfRange = "If-Range";
200
+ var IfunmodifiedSince = "If-Unmodified-Since";
201
+ var LastModified = "Last-Modified";
202
+ var Link = "Link";
203
+ var LocationUri = "Location";
204
+ var MaxForwards = "Max-Forwards";
205
+ var P3P = "P3P";
206
+ var Pragma = "Pragma";
207
+ var ProxyAuthenticate = "Proxy-Authenticate";
208
+ var ProxyAuthorization = "Proxy-Authorization";
209
+ var Ranges = "Range";
210
+ var Referer = "Referer";
211
+ var Referrer = Referer;
212
+ var Refresh = "Refresh";
213
+ var RetryAfter = "Retry-After";
214
+ var Server = "Server";
215
+ var SetCookie = "Set-Cookie";
216
+ var StrictTransportSecurity = "Strict-Transport-Security";
217
+ var TE = "TE";
218
+ var Trailer = "Trailer";
219
+ var TransferEncodingRequest = TE;
220
+ var TransferEncodingResponse = "Transfer-Encoding";
221
+ var Upgrade = "Upgrade";
222
+ var UserAgent = "User-Agent";
223
+ var Vary = "Vary";
224
+ var Via = "Via";
225
+ var Warning = "Warning";
226
+ var WwwAuthenticate = "WWW-Authenticate";
227
+
228
+ // src/http/httpStatusCodes.ts
229
+ var import_zod = require("zod");
230
+ var Continue = 100;
231
+ var SwitchingProtocols = 101;
232
+ var Processing = 102;
233
+ var EarlyHints = 103;
234
+ var Ok = 200;
235
+ var Created = 201;
236
+ var Accepted = 202;
237
+ var NonAuthoritativeInformation = 203;
238
+ var NoContent = 204;
239
+ var ResetContent = 205;
240
+ var PartialContent = 206;
241
+ var MultiStatus = 207;
242
+ var AlreadyReported = 208;
243
+ var ImUsed = 226;
244
+ var MultipleChoices = 300;
245
+ var MovedPermanently = 301;
246
+ var Found = 302;
247
+ var SeeOther = 303;
248
+ var NotModified = 304;
249
+ var UseProxyDeprecated = 305;
250
+ var TemporaryRedirect = 307;
251
+ var PermanentRedirect = 308;
252
+ var BadRequest = 400;
253
+ var Unauthorized = 401;
254
+ var PaymentRequired = 402;
255
+ var Forbidden = 403;
256
+ var NotFound = 404;
257
+ var MethodNotAllowed = 405;
258
+ var NotAcceptable = 406;
259
+ var ProxyAuthenticationRequired = 407;
260
+ var RequestTimeout = 408;
261
+ var Conflict = 409;
262
+ var Gone = 410;
263
+ var LengthRequired = 411;
264
+ var PreconditionFailed = 412;
265
+ var PayloadTooLarge = 413;
266
+ var UriTooLong = 414;
267
+ var UnsupportedMediaType = 415;
268
+ var RangeNotSatisfiable = 416;
269
+ var ExpectationFailed = 417;
270
+ var ImATeapot = 418;
271
+ var MisdirectedRequest = 421;
272
+ var UnprocessableContent = 422;
273
+ var Locked = 423;
274
+ var FailedDependency = 424;
275
+ var TooEarly = 425;
276
+ var UpgradeRequired = 426;
277
+ var PreconditionRequired = 428;
278
+ var TooManyRequests = 429;
279
+ var RequestHeaderFieldsTooLarge = 431;
280
+ var UnavailableForLegalReasons = 451;
281
+ var InternalServerError = 500;
282
+ var NotImplemented = 501;
283
+ var BadGateway = 502;
284
+ var ServiceUnavailable = 503;
285
+ var GatewayTimeout = 504;
286
+ var HttpVersionNotSupported = 505;
287
+ var VariantAlsoNegotiates = 506;
288
+ var InsufficientStorage = 507;
289
+ var LoopDetected = 508;
290
+ var NotExtended = 510;
291
+ var NetworkAuthenticationRequired = 511;
292
+ var httpStatusCodeSchema = import_zod.z.number().int().gte(100).lt(600);
293
+ var clientErrorHttpStatusCodeSchema = httpStatusCodeSchema.and(
294
+ import_zod.z.number().gte(400).lt(500)
295
+ );
296
+ var serverErrorHttpStatusCodeSchema = httpStatusCodeSchema.and(
297
+ import_zod.z.number().gte(500).lt(600)
298
+ );
299
+ var successHttpStatusCodeSchema = httpStatusCodeSchema.and(
300
+ import_zod.z.number().gte(100).lt(400)
301
+ );
302
+ var isHttpStatusCode = (obj) => httpStatusCodeSchema.safeParse(obj).success;
303
+ var isClientErrorHttpStatusCode = (obj) => clientErrorHttpStatusCodeSchema.safeParse(obj).success;
304
+ var isServerErrorHttpStatusCode = (obj) => serverErrorHttpStatusCodeSchema.safeParse(obj).success;
305
+ var isSuccessHttpStatusCode = (obj) => successHttpStatusCodeSchema.safeParse(obj).success;
306
+ // Annotate the CommonJS export names for ESM import in node:
307
+ 0 && (module.exports = {
308
+ Accept,
309
+ AcceptCharset,
310
+ AcceptDatetime,
311
+ AcceptEncoding,
312
+ AcceptLanguage,
313
+ AcceptRanges,
314
+ Accepted,
315
+ Age,
316
+ Allow,
317
+ AlreadyReported,
318
+ Authorization,
319
+ BadGateway,
320
+ BadRequest,
321
+ CacheControl,
322
+ Conflict,
323
+ Connection,
324
+ ContentDisposition,
325
+ ContentEncoding,
326
+ ContentLanguage,
327
+ ContentLength,
328
+ ContentLocation,
329
+ ContentMd5,
330
+ ContentRange,
331
+ ContentType,
332
+ Continue,
333
+ Cookie,
334
+ Created,
335
+ DateTime,
336
+ ETag,
337
+ EarlyHints,
338
+ Expect,
339
+ ExpectationFailed,
340
+ Expires,
341
+ FailedDependency,
342
+ Forbidden,
343
+ Found,
344
+ From,
345
+ GatewayTimeout,
346
+ Gone,
347
+ Host,
348
+ HttpVersionNotSupported,
349
+ IfMatch,
350
+ IfModifiedSince,
351
+ IfNoneMatch,
352
+ IfRange,
353
+ IfunmodifiedSince,
354
+ ImATeapot,
355
+ ImUsed,
356
+ InsufficientStorage,
357
+ InternalServerError,
358
+ LastModified,
359
+ LengthRequired,
360
+ Link,
361
+ LocationUri,
362
+ Locked,
363
+ LoopDetected,
364
+ MaxForwards,
365
+ MethodNotAllowed,
366
+ MisdirectedRequest,
367
+ MovedPermanently,
368
+ MultiStatus,
369
+ MultipleChoices,
370
+ NetworkAuthenticationRequired,
371
+ NoContent,
372
+ NonAuthoritativeInformation,
373
+ NotAcceptable,
374
+ NotExtended,
375
+ NotFound,
376
+ NotImplemented,
377
+ NotModified,
378
+ Ok,
379
+ P3P,
380
+ PartialContent,
381
+ PayloadTooLarge,
382
+ PaymentRequired,
383
+ PermanentRedirect,
384
+ Pragma,
385
+ PreconditionFailed,
386
+ PreconditionRequired,
387
+ Processing,
388
+ ProxyAuthenticate,
389
+ ProxyAuthenticationRequired,
390
+ ProxyAuthorization,
391
+ RangeNotSatisfiable,
392
+ Ranges,
393
+ Referer,
394
+ Referrer,
395
+ Refresh,
396
+ RequestHeaderFieldsTooLarge,
397
+ RequestTimeout,
398
+ ResetContent,
399
+ RetryAfter,
400
+ SeeOther,
401
+ Server,
402
+ ServiceUnavailable,
403
+ SetCookie,
404
+ StrictTransportSecurity,
405
+ SwitchingProtocols,
406
+ TE,
407
+ TemporaryRedirect,
408
+ TooEarly,
409
+ TooManyRequests,
410
+ Trailer,
411
+ TransferEncodingRequest,
412
+ TransferEncodingResponse,
413
+ Unauthorized,
414
+ UnavailableForLegalReasons,
415
+ UnprocessableContent,
416
+ UnsupportedMediaType,
417
+ Upgrade,
418
+ UpgradeRequired,
419
+ UriTooLong,
420
+ UseProxyDeprecated,
421
+ UserAgent,
422
+ VariantAlsoNegotiates,
423
+ Vary,
424
+ Via,
425
+ Warning,
426
+ WwwAuthenticate,
427
+ clientErrorHttpStatusCodeSchema,
428
+ getAuthorizationHeader,
429
+ getQueryParameters,
430
+ httpStatusCodeSchema,
431
+ isClientErrorHttpStatusCode,
432
+ isExpired,
433
+ isHttpStatusCode,
434
+ isServerErrorHttpStatusCode,
435
+ isSuccessHttpStatusCode,
436
+ serverErrorHttpStatusCodeSchema,
437
+ successHttpStatusCodeSchema
438
+ });
439
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/http/index.ts","../src/http/authorizationToken.ts","../src/http/getQueryParameters.ts","../src/http/httpHeaders.ts","../src/http/httpStatusCodes.ts"],"sourcesContent":["export * from \"./authorizationToken\";\nexport * from \"./getQueryParameters\";\nexport * from \"./httpHeaders\";\nexport * from \"./httpStatusCodes\";\n","export interface AuthorizationToken {\n\texpiresOn: number;\n\ttokenType: string;\n\tvalue: string;\n}\n\nexport const getAuthorizationHeader = (token: AuthorizationToken): string =>\n\t`${token.tokenType} ${token.value}`;\n\nexport const isExpired = (token: AuthorizationToken): boolean =>\n\ttoken.expiresOn < Date.now();\n","export const getQueryParameters = (url: string | URL): URLSearchParams => {\n\tconst urlString = url.toString();\n\n\tconst queryStringIndex = urlString.indexOf(\"?\");\n\tconst queryString =\n\t\tqueryStringIndex >= 0 ? urlString.substring(queryStringIndex) : \"\";\n\tconst query = new URLSearchParams(queryString);\n\n\treturn query;\n};\n","export type HttpRequestHeader =\n\t| \"Accept\"\n\t| \"Accept-Charset\"\n\t| \"Accept-Datetime\"\n\t| \"Accept-Encoding\"\n\t| \"Accept-Language\"\n\t| \"Authorization\"\n\t| \"Cache-Control\"\n\t| \"Connection\"\n\t| \"Content-Length\"\n\t| \"Content-MD5\"\n\t| \"Content-Type\"\n\t| \"Cookie\"\n\t| \"Date\"\n\t| \"Expect\"\n\t| \"From\"\n\t| \"Host\"\n\t| \"If-Match\"\n\t| \"If-Modified-Since\"\n\t| \"If-None-Match\"\n\t| \"If-Range\"\n\t| \"If-Unmodified-Since\"\n\t| \"Max-Forwards\"\n\t| \"Pragma\"\n\t| \"Proxy-Authorization\"\n\t| \"Range\"\n\t| \"Referer\"\n\t| \"TE\"\n\t| \"Upgrade\"\n\t| \"User-Agent\"\n\t| \"Via\"\n\t| \"Warning\";\n\nexport type HttpResponseHeader =\n\t| \"Accept-Ranges\"\n\t| \"Age\"\n\t| \"Allow\"\n\t| \"Cache-Control\"\n\t| \"Connection\"\n\t| \"Content-Disposition\"\n\t| \"Content-Encoding\"\n\t| \"Content-Language\"\n\t| \"Content-Length\"\n\t| \"Content-Location\"\n\t| \"Content-MD5\"\n\t| \"Content-Range\"\n\t| \"Content-Type\"\n\t| \"Date\"\n\t| \"ETag\"\n\t| \"Expires\"\n\t| \"Last-Modified\"\n\t| \"Link\"\n\t| \"Location\"\n\t| \"P3P\"\n\t| \"Pragma\"\n\t| \"Proxy-Authenticate\"\n\t| \"Refresh\"\n\t| \"Retry-After\"\n\t| \"Server\"\n\t| \"Set-Cookie\"\n\t| \"Strict-Transport-Security\"\n\t| \"Trailer\"\n\t| \"Transfer-Encoding\"\n\t| \"Vary\"\n\t| \"Via\"\n\t| \"Warning\"\n\t| \"WWW-Authenticate\";\n\nexport const Accept: HttpRequestHeader = \"Accept\";\nexport const AcceptCharset: HttpRequestHeader = \"Accept-Charset\";\nexport const AcceptDatetime: HttpRequestHeader = \"Accept-Datetime\";\nexport const AcceptEncoding: HttpRequestHeader = \"Accept-Encoding\";\nexport const AcceptLanguage: HttpRequestHeader = \"Accept-Language\";\nexport const AcceptRanges: HttpResponseHeader = \"Accept-Ranges\";\nexport const Age: HttpResponseHeader = \"Age\";\nexport const Allow: HttpResponseHeader = \"Allow\";\nexport const Authorization: HttpRequestHeader = \"Authorization\";\nexport const CacheControl: HttpRequestHeader | HttpResponseHeader =\n\t\"Cache-Control\";\nexport const Connection: HttpRequestHeader | HttpResponseHeader = \"Connection\";\nexport const ContentDisposition: HttpResponseHeader = \"Content-Disposition\";\nexport const ContentEncoding: HttpResponseHeader = \"Content-Encoding\";\nexport const ContentLanguage: HttpResponseHeader = \"Content-Language\";\nexport const ContentLength: HttpRequestHeader | HttpResponseHeader =\n\t\"Content-Length\";\nexport const ContentLocation: HttpResponseHeader = \"Content-Location\";\nexport const ContentMd5: HttpRequestHeader | HttpResponseHeader = \"Content-MD5\";\nexport const ContentRange: HttpResponseHeader = \"Content-Range\";\nexport const ContentType: HttpRequestHeader | HttpResponseHeader =\n\t\"Content-Type\";\nexport const Cookie: HttpRequestHeader = \"Cookie\";\nexport const DateTime: HttpRequestHeader | HttpResponseHeader = \"Date\";\nexport const ETag: HttpResponseHeader = \"ETag\";\nexport const Expect: HttpRequestHeader = \"Expect\";\nexport const Expires: HttpResponseHeader = \"Expires\";\nexport const From: HttpRequestHeader = \"From\";\nexport const Host: HttpRequestHeader = \"Host\";\nexport const IfMatch: HttpRequestHeader = \"If-Match\";\nexport const IfModifiedSince: HttpRequestHeader = \"If-Modified-Since\";\nexport const IfNoneMatch: HttpRequestHeader = \"If-None-Match\";\nexport const IfRange: HttpRequestHeader = \"If-Range\";\nexport const IfunmodifiedSince: HttpRequestHeader = \"If-Unmodified-Since\";\nexport const LastModified: HttpResponseHeader = \"Last-Modified\";\nexport const Link: HttpResponseHeader = \"Link\";\nexport const LocationUri: HttpResponseHeader = \"Location\";\nexport const MaxForwards: HttpRequestHeader = \"Max-Forwards\";\nexport const P3P: HttpResponseHeader = \"P3P\";\nexport const Pragma: HttpRequestHeader | HttpResponseHeader = \"Pragma\";\nexport const ProxyAuthenticate: HttpResponseHeader = \"Proxy-Authenticate\";\nexport const ProxyAuthorization: HttpRequestHeader = \"Proxy-Authorization\";\nexport const Ranges: HttpRequestHeader = \"Range\";\nexport const Referer: HttpRequestHeader = \"Referer\";\nexport const Referrer: HttpRequestHeader = Referer;\nexport const Refresh: HttpResponseHeader = \"Refresh\";\nexport const RetryAfter: HttpResponseHeader = \"Retry-After\";\nexport const Server: HttpResponseHeader = \"Server\";\nexport const SetCookie: HttpResponseHeader = \"Set-Cookie\";\nexport const StrictTransportSecurity: HttpResponseHeader =\n\t\"Strict-Transport-Security\";\nexport const TE: HttpRequestHeader = \"TE\";\nexport const Trailer: HttpResponseHeader = \"Trailer\";\nexport const TransferEncodingRequest: HttpRequestHeader = TE;\nexport const TransferEncodingResponse: HttpResponseHeader = \"Transfer-Encoding\";\nexport const Upgrade: HttpRequestHeader = \"Upgrade\";\nexport const UserAgent: HttpRequestHeader = \"User-Agent\";\nexport const Vary: HttpResponseHeader = \"Vary\";\nexport const Via: HttpRequestHeader | HttpResponseHeader = \"Via\";\nexport const Warning: HttpRequestHeader | HttpResponseHeader = \"Warning\";\nexport const WwwAuthenticate: HttpResponseHeader = \"WWW-Authenticate\";\n","import { z } from \"zod\";\n\nexport type HttpStatusCode =\n\t| 100\n\t| 101\n\t| 102\n\t| 103\n\t| 200\n\t| 201\n\t| 202\n\t| 203\n\t| 204\n\t| 205\n\t| 206\n\t| 207\n\t| 208\n\t| 226\n\t| 300\n\t| 301\n\t| 302\n\t| 303\n\t| 304\n\t| 305\n\t| 307\n\t| 308\n\t| 400\n\t| 401\n\t| 402\n\t| 403\n\t| 404\n\t| 405\n\t| 406\n\t| 407\n\t| 408\n\t| 409\n\t| 410\n\t| 411\n\t| 412\n\t| 413\n\t| 414\n\t| 415\n\t| 416\n\t| 417\n\t| 418\n\t| 421\n\t| 422\n\t| 423\n\t| 424\n\t| 425\n\t| 426\n\t| 428\n\t| 429\n\t| 431\n\t| 451\n\t| 500\n\t| 501\n\t| 502\n\t| 503\n\t| 504\n\t| 505\n\t| 506\n\t| 507\n\t| 508\n\t| 510\n\t| 511;\n\nexport const Continue: HttpStatusCode = 100 as const;\nexport const SwitchingProtocols: HttpStatusCode = 101 as const;\nexport const Processing: HttpStatusCode = 102 as const;\nexport const EarlyHints: HttpStatusCode = 103 as const;\nexport const Ok: HttpStatusCode = 200 as const;\nexport const Created: HttpStatusCode = 201 as const;\nexport const Accepted: HttpStatusCode = 202 as const;\nexport const NonAuthoritativeInformation: HttpStatusCode = 203 as const;\nexport const NoContent: HttpStatusCode = 204 as const;\nexport const ResetContent: HttpStatusCode = 205 as const;\nexport const PartialContent: HttpStatusCode = 206 as const;\nexport const MultiStatus: HttpStatusCode = 207 as const;\nexport const AlreadyReported: HttpStatusCode = 208 as const;\nexport const ImUsed: HttpStatusCode = 226 as const;\nexport const MultipleChoices: HttpStatusCode = 300 as const;\nexport const MovedPermanently: HttpStatusCode = 301 as const;\nexport const Found: HttpStatusCode = 302 as const;\nexport const SeeOther: HttpStatusCode = 303 as const;\nexport const NotModified: HttpStatusCode = 304 as const;\nexport const UseProxyDeprecated: HttpStatusCode = 305 as const;\nexport const TemporaryRedirect: HttpStatusCode = 307 as const;\nexport const PermanentRedirect: HttpStatusCode = 308 as const;\nexport const BadRequest: HttpStatusCode = 400 as const;\nexport const Unauthorized: HttpStatusCode = 401 as const;\nexport const PaymentRequired: HttpStatusCode = 402 as const;\nexport const Forbidden: HttpStatusCode = 403 as const;\nexport const NotFound: HttpStatusCode = 404 as const;\nexport const MethodNotAllowed: HttpStatusCode = 405 as const;\nexport const NotAcceptable: HttpStatusCode = 406 as const;\nexport const ProxyAuthenticationRequired: HttpStatusCode = 407 as const;\nexport const RequestTimeout: HttpStatusCode = 408 as const;\nexport const Conflict: HttpStatusCode = 409 as const;\nexport const Gone: HttpStatusCode = 410 as const;\nexport const LengthRequired: HttpStatusCode = 411 as const;\nexport const PreconditionFailed: HttpStatusCode = 412 as const;\nexport const PayloadTooLarge: HttpStatusCode = 413 as const;\nexport const UriTooLong: HttpStatusCode = 414 as const;\nexport const UnsupportedMediaType: HttpStatusCode = 415 as const;\nexport const RangeNotSatisfiable: HttpStatusCode = 416 as const;\nexport const ExpectationFailed: HttpStatusCode = 417 as const;\nexport const ImATeapot: HttpStatusCode = 418 as const;\nexport const MisdirectedRequest: HttpStatusCode = 421 as const;\nexport const UnprocessableContent: HttpStatusCode = 422 as const;\nexport const Locked: HttpStatusCode = 423 as const;\nexport const FailedDependency: HttpStatusCode = 424 as const;\nexport const TooEarly: HttpStatusCode = 425 as const;\nexport const UpgradeRequired: HttpStatusCode = 426 as const;\nexport const PreconditionRequired: HttpStatusCode = 428 as const;\nexport const TooManyRequests: HttpStatusCode = 429 as const;\nexport const RequestHeaderFieldsTooLarge: HttpStatusCode = 431 as const;\nexport const UnavailableForLegalReasons: HttpStatusCode = 451 as const;\nexport const InternalServerError: HttpStatusCode = 500 as const;\nexport const NotImplemented: HttpStatusCode = 501 as const;\nexport const BadGateway: HttpStatusCode = 502 as const;\nexport const ServiceUnavailable: HttpStatusCode = 503 as const;\nexport const GatewayTimeout: HttpStatusCode = 504 as const;\nexport const HttpVersionNotSupported: HttpStatusCode = 505 as const;\nexport const VariantAlsoNegotiates: HttpStatusCode = 506 as const;\nexport const InsufficientStorage: HttpStatusCode = 507 as const;\nexport const LoopDetected: HttpStatusCode = 508 as const;\nexport const NotExtended: HttpStatusCode = 510 as const;\nexport const NetworkAuthenticationRequired: HttpStatusCode = 511 as const;\n\n// Allow any numbers between 100 and 599 as those are potentially valid.\n// https://en.wikipedia.org/wiki/List_of_HTTP_status_codes\nexport const httpStatusCodeSchema = z.number().int().gte(100).lt(600);\n\nexport const clientErrorHttpStatusCodeSchema = httpStatusCodeSchema.and(\n\tz.number().gte(400).lt(500),\n);\nexport const serverErrorHttpStatusCodeSchema = httpStatusCodeSchema.and(\n\tz.number().gte(500).lt(600),\n);\nexport const successHttpStatusCodeSchema = httpStatusCodeSchema.and(\n\tz.number().gte(100).lt(400),\n);\n\nexport const isHttpStatusCode = (obj: unknown): obj is HttpStatusCode =>\n\thttpStatusCodeSchema.safeParse(obj).success;\n\nexport const isClientErrorHttpStatusCode = (\n\tobj: unknown,\n): obj is HttpStatusCode =>\n\tclientErrorHttpStatusCodeSchema.safeParse(obj).success;\n\nexport const isServerErrorHttpStatusCode = (\n\tobj: unknown,\n): obj is HttpStatusCode =>\n\tserverErrorHttpStatusCodeSchema.safeParse(obj).success;\n\nexport const isSuccessHttpStatusCode = (obj: unknown): obj is HttpStatusCode =>\n\tsuccessHttpStatusCodeSchema.safeParse(obj).success;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO,IAAM,yBAAyB,CAAC,UACtC,GAAG,MAAM,SAAS,IAAI,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