@little-nebulae/http 0.1.0 → 0.3.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 (3) hide show
  1. package/dist/index.d.ts +623 -110
  2. package/dist/index.js +261 -52
  3. package/package.json +22 -14
package/dist/index.d.ts CHANGED
@@ -1,15 +1,32 @@
1
- import { ValueOf } from "@little-nebulae/type-utils";
2
- //#region src/constants/headers.d.ts
3
- export declare const HTTP_HEADER_RECORD: {
1
+ import { ValueOf } from "type-fest";
2
+ export declare const HTTP_HEADER_ENUM: {
4
3
  readonly AUTHORIZATION: "authorization";
4
+ readonly CACHE_CONTROL: "cache-control";
5
+ readonly CONNECTION: "connection";
6
+ readonly CONTENT_ENCODING: "content-encoding";
7
+ readonly CONTENT_SECURITY_POLICY: "content-security-policy";
5
8
  readonly CONTENT_TYPE: "content-type";
6
9
  readonly COOKIE: "cookie";
10
+ readonly CROSS_ORIGIN_RESOURCE_POLICY: "cross-origin-resource-policy";
11
+ readonly DATE: "date";
12
+ readonly ETAG: "etag";
13
+ readonly EXPIRES: "expires";
14
+ readonly FORWARDED: "forwarded";
15
+ readonly HOST: "host";
16
+ readonly KEEP_ALIVE: "keep-alive";
17
+ readonly LAST_MODIFIED: "last-modified";
18
+ readonly LOCATION: "location";
19
+ readonly ORIGIN: "origin";
20
+ readonly REFERER: "referer";
21
+ readonly REFERRER_POLICY: "referrer-policy";
7
22
  readonly RETRY_AFTER: "retry-after";
23
+ readonly SET_COOKIE: "set-cookie";
24
+ readonly TRANSFER_ENCODING: "transfer-encoding";
25
+ readonly UPGRADE: "upgrade";
26
+ readonly USER_AGENT: "user-agent";
8
27
  };
9
- export type HttpHeader = ValueOf<typeof HTTP_HEADER_RECORD>;
10
- //#endregion
11
- //#region src/constants/request-methods.d.ts
12
- export declare const HTTP_REQUEST_METHOD_RECORD: {
28
+ export type HttpHeader = ValueOf<typeof HTTP_HEADER_ENUM>;
29
+ export declare const HTTP_REQUEST_METHOD_ENUM: {
13
30
  readonly GET: "GET";
14
31
  readonly POST: "POST";
15
32
  readonly DELETE: "DELETE";
@@ -20,184 +37,680 @@ export declare const HTTP_REQUEST_METHOD_RECORD: {
20
37
  readonly TRACE: "TRACE";
21
38
  readonly CONNECT: "CONNECT";
22
39
  };
23
- export type HttpRequestMethod = ValueOf<typeof HTTP_REQUEST_METHOD_RECORD>;
24
- //#endregion
25
- //#region src/constants/response-statuses/index.d.ts
40
+ export type HttpRequestMethod = ValueOf<typeof HTTP_REQUEST_METHOD_ENUM>;
26
41
  export declare const HTTP_RESPONSE_STATUS_RECORD: {
27
42
  readonly BAD_REQUEST: {
28
- readonly code: 400;
29
- readonly text: "Bad Request";
43
+ readonly CODE: 400;
44
+ readonly TEXT: "Bad Request";
30
45
  };
31
46
  readonly UNAUTHORIZED: {
32
- readonly code: 401;
33
- readonly text: "Unauthorized";
47
+ readonly CODE: 401;
48
+ readonly TEXT: "Unauthorized";
49
+ };
50
+ readonly PAYMENT_REQUIRED: {
51
+ readonly CODE: 402;
52
+ readonly TEXT: "Payment Required";
34
53
  };
35
54
  readonly FORBIDDEN: {
36
- readonly code: 403;
37
- readonly text: "Forbidden";
55
+ readonly CODE: 403;
56
+ readonly TEXT: "Forbidden";
38
57
  };
39
58
  readonly NOT_FOUND: {
40
- readonly code: 404;
41
- readonly text: "Not Found";
59
+ readonly CODE: 404;
60
+ readonly TEXT: "Not Found";
61
+ };
62
+ readonly METHOD_NOT_ALLOWED: {
63
+ readonly CODE: 405;
64
+ readonly TEXT: "Method Not Allowed";
65
+ };
66
+ readonly NOT_ACCEPTABLE: {
67
+ readonly CODE: 406;
68
+ readonly TEXT: "Not Acceptable";
69
+ };
70
+ readonly PROXY_AUTHENTICATION_REQUIRED: {
71
+ readonly CODE: 407;
72
+ readonly TEXT: "Proxy Authentication Required";
73
+ };
74
+ readonly REQUEST_TIMEOUT: {
75
+ readonly CODE: 408;
76
+ readonly TEXT: "Request Timeout";
42
77
  };
43
78
  readonly CONFLICT: {
44
- readonly code: 409;
45
- readonly text: "Conflict";
79
+ readonly CODE: 409;
80
+ readonly TEXT: "Conflict";
81
+ };
82
+ readonly GONE: {
83
+ readonly CODE: 410;
84
+ readonly TEXT: "Gone";
85
+ };
86
+ readonly LENGTH_REQUIRED: {
87
+ readonly CODE: 411;
88
+ readonly TEXT: "Length Required";
89
+ };
90
+ readonly PRECONDITION_FAILED: {
91
+ readonly CODE: 412;
92
+ readonly TEXT: "Precondition Failed";
93
+ };
94
+ readonly CONTENT_TOO_LARGE: {
95
+ readonly CODE: 413;
96
+ readonly TEXT: "Content Too Large";
97
+ };
98
+ readonly URI_TOO_LONG: {
99
+ readonly CODE: 414;
100
+ readonly TEXT: "URI Too Long";
101
+ };
102
+ readonly UNSUPPORTED_MEDIA_TYPE: {
103
+ readonly CODE: 415;
104
+ readonly TEXT: "Unsupported Media Type";
105
+ };
106
+ readonly RANGE_NOT_SATISFIABLE: {
107
+ readonly CODE: 416;
108
+ readonly TEXT: "Range Not Satisfiable";
109
+ };
110
+ readonly EXPECTATION_FAILED: {
111
+ readonly CODE: 417;
112
+ readonly TEXT: "Expectation Failed";
113
+ };
114
+ readonly IM_A_TEAPOT: {
115
+ readonly CODE: 418;
116
+ readonly TEXT: "I'm a teapot";
117
+ };
118
+ readonly MISDIRECTED_REQUEST: {
119
+ readonly CODE: 421;
120
+ readonly TEXT: "Misdirected Request";
46
121
  };
47
122
  readonly UNPROCESSABLE_CONTENT: {
48
- readonly code: 422;
49
- readonly text: "Unprocessable Content";
123
+ readonly CODE: 422;
124
+ readonly TEXT: "Unprocessable Content";
125
+ };
126
+ readonly LOCKED: {
127
+ readonly CODE: 423;
128
+ readonly TEXT: "Locked";
129
+ };
130
+ readonly FAILED_DEPENDENCY: {
131
+ readonly CODE: 424;
132
+ readonly TEXT: "Failed Dependency";
133
+ };
134
+ readonly TOO_EARLY: {
135
+ readonly CODE: 425;
136
+ readonly TEXT: "Too Early";
137
+ };
138
+ readonly UPGRADE_REQUIRED: {
139
+ readonly CODE: 426;
140
+ readonly TEXT: "Upgrade Required";
141
+ };
142
+ readonly PRECONDITION_REQUIRED: {
143
+ readonly CODE: 428;
144
+ readonly TEXT: "Precondition Required";
50
145
  };
51
146
  readonly TOO_MANY_REQUESTS: {
52
- readonly code: 429;
53
- readonly text: "Too Many Requests";
147
+ readonly CODE: 429;
148
+ readonly TEXT: "Too Many Requests";
149
+ };
150
+ readonly REQUEST_HEADER_FIELDS_TOO_LARGE: {
151
+ readonly CODE: 431;
152
+ readonly TEXT: "Request Header Fields Too Large";
153
+ };
154
+ readonly UNAVAILABLE_FOR_LEGAL_REASONS: {
155
+ readonly CODE: 451;
156
+ readonly TEXT: "Unavailable For Legal Reasons";
54
157
  };
55
158
  readonly INTERNAL_SERVER_ERROR: {
56
- readonly code: 500;
57
- readonly text: "Internal Server Error";
159
+ readonly CODE: 500;
160
+ readonly TEXT: "Internal Server Error";
161
+ };
162
+ readonly NOT_IMPLEMENTED: {
163
+ readonly CODE: 501;
164
+ readonly TEXT: "Not Implemented";
165
+ };
166
+ readonly BAD_GATEWAY: {
167
+ readonly CODE: 502;
168
+ readonly TEXT: "Bad Gateway";
58
169
  };
59
170
  readonly SERVICE_UNAVAILABLE: {
60
- readonly code: 503;
61
- readonly text: "Service Unavailable";
171
+ readonly CODE: 503;
172
+ readonly TEXT: "Service Unavailable";
62
173
  };
63
174
  readonly GATEWAY_TIMEOUT: {
64
- readonly code: 504;
65
- readonly text: "Gateway Timeout";
175
+ readonly CODE: 504;
176
+ readonly TEXT: "Gateway Timeout";
177
+ };
178
+ readonly HTTP_VERSION_NOT_SUPPORTED: {
179
+ readonly CODE: 505;
180
+ readonly TEXT: "HTTP Version Not Supported";
181
+ };
182
+ readonly VARIANT_ALSO_NEGOTIATES: {
183
+ readonly CODE: 506;
184
+ readonly TEXT: "Variant Also Negotiates";
185
+ };
186
+ readonly INSUFFICIENT_STORAGE: {
187
+ readonly CODE: 507;
188
+ readonly TEXT: "Insufficient Storage";
189
+ };
190
+ readonly LOOP_DETECTED: {
191
+ readonly CODE: 508;
192
+ readonly TEXT: "Loop Detected";
193
+ };
194
+ readonly NOT_EXTENDED: {
195
+ readonly CODE: 510;
196
+ readonly TEXT: "Not Extended";
197
+ };
198
+ readonly NETWORK_AUTHENTICATION_REQUIRED: {
199
+ readonly CODE: 511;
200
+ readonly TEXT: "Network Authentication Required";
201
+ };
202
+ readonly CONTINUE: {
203
+ readonly CODE: 100;
204
+ readonly TEXT: "Continue";
205
+ };
206
+ readonly SWITCHING_PROTOCOLS: {
207
+ readonly CODE: 101;
208
+ readonly TEXT: "Switching Protocols";
209
+ };
210
+ readonly EARLY_HINTS: {
211
+ readonly CODE: 103;
212
+ readonly TEXT: "Early Hints";
213
+ };
214
+ readonly MULTIPLE_CHOICES: {
215
+ readonly CODE: 300;
216
+ readonly TEXT: "Multiple Choices";
217
+ };
218
+ readonly MOVED_PERMANENTLY: {
219
+ readonly CODE: 301;
220
+ readonly TEXT: "Moved Permanently";
221
+ };
222
+ readonly FOUND: {
223
+ readonly CODE: 302;
224
+ readonly TEXT: "Found";
225
+ };
226
+ readonly SEE_OTHER: {
227
+ readonly CODE: 303;
228
+ readonly TEXT: "See Other";
229
+ };
230
+ readonly NOT_MODIFIED: {
231
+ readonly CODE: 304;
232
+ readonly TEXT: "Not Modified";
233
+ };
234
+ readonly TEMPORARY_REDIRECT: {
235
+ readonly CODE: 307;
236
+ readonly TEXT: "Temporary Redirect";
237
+ };
238
+ readonly PERMANENT_REDIRECT: {
239
+ readonly CODE: 308;
240
+ readonly TEXT: "Permanent Redirect";
66
241
  };
67
242
  readonly OK: {
68
- readonly code: 200;
69
- readonly text: "OK";
243
+ readonly CODE: 200;
244
+ readonly TEXT: "OK";
70
245
  };
71
246
  readonly CREATED: {
72
- readonly code: 201;
73
- readonly text: "Created";
247
+ readonly CODE: 201;
248
+ readonly TEXT: "Created";
249
+ };
250
+ readonly ACCEPTED: {
251
+ readonly CODE: 202;
252
+ readonly TEXT: "Accepted";
253
+ };
254
+ readonly NON_AUTHORITATIVE_INFORMATION: {
255
+ readonly CODE: 203;
256
+ readonly TEXT: "Non-Authoritative Information";
74
257
  };
75
258
  readonly NO_CONTENT: {
76
- readonly code: 204;
77
- readonly text: "No Content";
259
+ readonly CODE: 204;
260
+ readonly TEXT: "No Content";
261
+ };
262
+ readonly RESET_CONTENT: {
263
+ readonly CODE: 205;
264
+ readonly TEXT: "Reset Content";
265
+ };
266
+ readonly PARTIAL_CONTENT: {
267
+ readonly CODE: 206;
268
+ readonly TEXT: "Partial Content";
269
+ };
270
+ readonly MULTI_STATUS: {
271
+ readonly CODE: 207;
272
+ readonly TEXT: "Multi-Status";
273
+ };
274
+ readonly ALREADY_REPORTED: {
275
+ readonly CODE: 208;
276
+ readonly TEXT: "Already Reported";
277
+ };
278
+ readonly IM_USED: {
279
+ readonly CODE: 226;
280
+ readonly TEXT: "IM Used";
281
+ };
282
+ };
283
+ type HttpResponseStatus = ValueOf<typeof HTTP_RESPONSE_STATUS_RECORD>;
284
+ export type HttpResponseStatusCode = HttpResponseStatus["CODE"];
285
+ export type HttpResponseStatusText = HttpResponseStatus["TEXT"];
286
+ export declare const HTTP_INFORMATIONAL_RESPONSE_STATUS_ENUM: {
287
+ readonly CONTINUE: {
288
+ readonly CODE: 100;
289
+ readonly TEXT: "Continue";
290
+ };
291
+ readonly SWITCHING_PROTOCOLS: {
292
+ readonly CODE: 101;
293
+ readonly TEXT: "Switching Protocols";
294
+ };
295
+ readonly EARLY_HINTS: {
296
+ readonly CODE: 103;
297
+ readonly TEXT: "Early Hints";
78
298
  };
79
299
  };
80
- export type HttpResponseStatusRecord = typeof HTTP_RESPONSE_STATUS_RECORD;
81
- export type HttpResponseStatusCode = ValueOf<HttpResponseStatusRecord>["code"];
82
- export type HttpResponseStatusText = ValueOf<HttpResponseStatusRecord>["text"];
83
- //#endregion
84
- //#region src/constants/response-statuses/success.d.ts
85
- export declare const HTTP_SUCCESSFUL_RESPONSE_STATUS_RECORD: {
300
+ type HttpInformationalResponseStatus = ValueOf<typeof HTTP_INFORMATIONAL_RESPONSE_STATUS_ENUM>;
301
+ export type HttpInformationalResponseStatusCode = HttpInformationalResponseStatus["CODE"];
302
+ export type HttpInformationalResponseStatusText = HttpInformationalResponseStatus["TEXT"];
303
+ export declare const HTTP_SUCCESSFUL_RESPONSE_STATUS_ENUM: {
86
304
  readonly OK: {
87
- readonly code: 200;
88
- readonly text: "OK";
305
+ readonly CODE: 200;
306
+ readonly TEXT: "OK";
89
307
  };
90
308
  readonly CREATED: {
91
- readonly code: 201;
92
- readonly text: "Created";
309
+ readonly CODE: 201;
310
+ readonly TEXT: "Created";
311
+ };
312
+ readonly ACCEPTED: {
313
+ readonly CODE: 202;
314
+ readonly TEXT: "Accepted";
315
+ };
316
+ readonly NON_AUTHORITATIVE_INFORMATION: {
317
+ readonly CODE: 203;
318
+ readonly TEXT: "Non-Authoritative Information";
93
319
  };
94
320
  readonly NO_CONTENT: {
95
- readonly code: 204;
96
- readonly text: "No Content";
321
+ readonly CODE: 204;
322
+ readonly TEXT: "No Content";
323
+ };
324
+ readonly RESET_CONTENT: {
325
+ readonly CODE: 205;
326
+ readonly TEXT: "Reset Content";
327
+ };
328
+ readonly PARTIAL_CONTENT: {
329
+ readonly CODE: 206;
330
+ readonly TEXT: "Partial Content";
331
+ };
332
+ readonly MULTI_STATUS: {
333
+ readonly CODE: 207;
334
+ readonly TEXT: "Multi-Status";
335
+ };
336
+ readonly ALREADY_REPORTED: {
337
+ readonly CODE: 208;
338
+ readonly TEXT: "Already Reported";
339
+ };
340
+ readonly IM_USED: {
341
+ readonly CODE: 226;
342
+ readonly TEXT: "IM Used";
97
343
  };
98
344
  };
99
- export type HttpSuccessfulResponseStatusRecord = typeof HTTP_SUCCESSFUL_RESPONSE_STATUS_RECORD;
100
- export type HttpSuccessfulResponseStatusCode = ValueOf<HttpSuccessfulResponseStatusRecord>["code"];
101
- export type HttpSuccessfulResponseStatusText = ValueOf<HttpSuccessfulResponseStatusRecord>["text"];
102
- //#endregion
103
- //#region src/constants/response-statuses/error/index.d.ts
104
- export declare const HTTP_ERROR_RESPONSE_STATUS_RECORD: {
345
+ type HttpSuccessfulResponseStatus = ValueOf<typeof HTTP_SUCCESSFUL_RESPONSE_STATUS_ENUM>;
346
+ export type HttpSuccessfulResponseStatusCode = HttpSuccessfulResponseStatus["CODE"];
347
+ export type HttpSuccessfulResponseStatusText = HttpSuccessfulResponseStatus["TEXT"];
348
+ export declare const HTTP_REDIRECTION_RESPONSE_STATUS_ENUM: {
349
+ readonly MULTIPLE_CHOICES: {
350
+ readonly CODE: 300;
351
+ readonly TEXT: "Multiple Choices";
352
+ };
353
+ readonly MOVED_PERMANENTLY: {
354
+ readonly CODE: 301;
355
+ readonly TEXT: "Moved Permanently";
356
+ };
357
+ readonly FOUND: {
358
+ readonly CODE: 302;
359
+ readonly TEXT: "Found";
360
+ };
361
+ readonly SEE_OTHER: {
362
+ readonly CODE: 303;
363
+ readonly TEXT: "See Other";
364
+ };
365
+ readonly NOT_MODIFIED: {
366
+ readonly CODE: 304;
367
+ readonly TEXT: "Not Modified";
368
+ };
369
+ readonly TEMPORARY_REDIRECT: {
370
+ readonly CODE: 307;
371
+ readonly TEXT: "Temporary Redirect";
372
+ };
373
+ readonly PERMANENT_REDIRECT: {
374
+ readonly CODE: 308;
375
+ readonly TEXT: "Permanent Redirect";
376
+ };
377
+ };
378
+ type HttpRedirectionResponseStatus = ValueOf<typeof HTTP_REDIRECTION_RESPONSE_STATUS_ENUM>;
379
+ export type HttpRedirectionResponseStatusCode = HttpRedirectionResponseStatus["CODE"];
380
+ export type HttpRedirectionResponseStatusText = HttpRedirectionResponseStatus["TEXT"];
381
+ export declare const HTTP_ERROR_RESPONSE_STATUS_ENUM: {
105
382
  readonly BAD_REQUEST: {
106
- readonly code: 400;
107
- readonly text: "Bad Request";
383
+ readonly CODE: 400;
384
+ readonly TEXT: "Bad Request";
108
385
  };
109
386
  readonly UNAUTHORIZED: {
110
- readonly code: 401;
111
- readonly text: "Unauthorized";
387
+ readonly CODE: 401;
388
+ readonly TEXT: "Unauthorized";
389
+ };
390
+ readonly PAYMENT_REQUIRED: {
391
+ readonly CODE: 402;
392
+ readonly TEXT: "Payment Required";
112
393
  };
113
394
  readonly FORBIDDEN: {
114
- readonly code: 403;
115
- readonly text: "Forbidden";
395
+ readonly CODE: 403;
396
+ readonly TEXT: "Forbidden";
116
397
  };
117
398
  readonly NOT_FOUND: {
118
- readonly code: 404;
119
- readonly text: "Not Found";
399
+ readonly CODE: 404;
400
+ readonly TEXT: "Not Found";
401
+ };
402
+ readonly METHOD_NOT_ALLOWED: {
403
+ readonly CODE: 405;
404
+ readonly TEXT: "Method Not Allowed";
405
+ };
406
+ readonly NOT_ACCEPTABLE: {
407
+ readonly CODE: 406;
408
+ readonly TEXT: "Not Acceptable";
409
+ };
410
+ readonly PROXY_AUTHENTICATION_REQUIRED: {
411
+ readonly CODE: 407;
412
+ readonly TEXT: "Proxy Authentication Required";
413
+ };
414
+ readonly REQUEST_TIMEOUT: {
415
+ readonly CODE: 408;
416
+ readonly TEXT: "Request Timeout";
120
417
  };
121
418
  readonly CONFLICT: {
122
- readonly code: 409;
123
- readonly text: "Conflict";
419
+ readonly CODE: 409;
420
+ readonly TEXT: "Conflict";
421
+ };
422
+ readonly GONE: {
423
+ readonly CODE: 410;
424
+ readonly TEXT: "Gone";
425
+ };
426
+ readonly LENGTH_REQUIRED: {
427
+ readonly CODE: 411;
428
+ readonly TEXT: "Length Required";
429
+ };
430
+ readonly PRECONDITION_FAILED: {
431
+ readonly CODE: 412;
432
+ readonly TEXT: "Precondition Failed";
433
+ };
434
+ readonly CONTENT_TOO_LARGE: {
435
+ readonly CODE: 413;
436
+ readonly TEXT: "Content Too Large";
437
+ };
438
+ readonly URI_TOO_LONG: {
439
+ readonly CODE: 414;
440
+ readonly TEXT: "URI Too Long";
441
+ };
442
+ readonly UNSUPPORTED_MEDIA_TYPE: {
443
+ readonly CODE: 415;
444
+ readonly TEXT: "Unsupported Media Type";
445
+ };
446
+ readonly RANGE_NOT_SATISFIABLE: {
447
+ readonly CODE: 416;
448
+ readonly TEXT: "Range Not Satisfiable";
449
+ };
450
+ readonly EXPECTATION_FAILED: {
451
+ readonly CODE: 417;
452
+ readonly TEXT: "Expectation Failed";
453
+ };
454
+ readonly IM_A_TEAPOT: {
455
+ readonly CODE: 418;
456
+ readonly TEXT: "I'm a teapot";
457
+ };
458
+ readonly MISDIRECTED_REQUEST: {
459
+ readonly CODE: 421;
460
+ readonly TEXT: "Misdirected Request";
124
461
  };
125
462
  readonly UNPROCESSABLE_CONTENT: {
126
- readonly code: 422;
127
- readonly text: "Unprocessable Content";
463
+ readonly CODE: 422;
464
+ readonly TEXT: "Unprocessable Content";
465
+ };
466
+ readonly LOCKED: {
467
+ readonly CODE: 423;
468
+ readonly TEXT: "Locked";
469
+ };
470
+ readonly FAILED_DEPENDENCY: {
471
+ readonly CODE: 424;
472
+ readonly TEXT: "Failed Dependency";
473
+ };
474
+ readonly TOO_EARLY: {
475
+ readonly CODE: 425;
476
+ readonly TEXT: "Too Early";
477
+ };
478
+ readonly UPGRADE_REQUIRED: {
479
+ readonly CODE: 426;
480
+ readonly TEXT: "Upgrade Required";
481
+ };
482
+ readonly PRECONDITION_REQUIRED: {
483
+ readonly CODE: 428;
484
+ readonly TEXT: "Precondition Required";
128
485
  };
129
486
  readonly TOO_MANY_REQUESTS: {
130
- readonly code: 429;
131
- readonly text: "Too Many Requests";
487
+ readonly CODE: 429;
488
+ readonly TEXT: "Too Many Requests";
489
+ };
490
+ readonly REQUEST_HEADER_FIELDS_TOO_LARGE: {
491
+ readonly CODE: 431;
492
+ readonly TEXT: "Request Header Fields Too Large";
493
+ };
494
+ readonly UNAVAILABLE_FOR_LEGAL_REASONS: {
495
+ readonly CODE: 451;
496
+ readonly TEXT: "Unavailable For Legal Reasons";
132
497
  };
133
498
  readonly INTERNAL_SERVER_ERROR: {
134
- readonly code: 500;
135
- readonly text: "Internal Server Error";
499
+ readonly CODE: 500;
500
+ readonly TEXT: "Internal Server Error";
501
+ };
502
+ readonly NOT_IMPLEMENTED: {
503
+ readonly CODE: 501;
504
+ readonly TEXT: "Not Implemented";
505
+ };
506
+ readonly BAD_GATEWAY: {
507
+ readonly CODE: 502;
508
+ readonly TEXT: "Bad Gateway";
136
509
  };
137
510
  readonly SERVICE_UNAVAILABLE: {
138
- readonly code: 503;
139
- readonly text: "Service Unavailable";
511
+ readonly CODE: 503;
512
+ readonly TEXT: "Service Unavailable";
140
513
  };
141
514
  readonly GATEWAY_TIMEOUT: {
142
- readonly code: 504;
143
- readonly text: "Gateway Timeout";
515
+ readonly CODE: 504;
516
+ readonly TEXT: "Gateway Timeout";
517
+ };
518
+ readonly HTTP_VERSION_NOT_SUPPORTED: {
519
+ readonly CODE: 505;
520
+ readonly TEXT: "HTTP Version Not Supported";
521
+ };
522
+ readonly VARIANT_ALSO_NEGOTIATES: {
523
+ readonly CODE: 506;
524
+ readonly TEXT: "Variant Also Negotiates";
525
+ };
526
+ readonly INSUFFICIENT_STORAGE: {
527
+ readonly CODE: 507;
528
+ readonly TEXT: "Insufficient Storage";
529
+ };
530
+ readonly LOOP_DETECTED: {
531
+ readonly CODE: 508;
532
+ readonly TEXT: "Loop Detected";
533
+ };
534
+ readonly NOT_EXTENDED: {
535
+ readonly CODE: 510;
536
+ readonly TEXT: "Not Extended";
537
+ };
538
+ readonly NETWORK_AUTHENTICATION_REQUIRED: {
539
+ readonly CODE: 511;
540
+ readonly TEXT: "Network Authentication Required";
144
541
  };
145
542
  };
146
- export type HttpErrorResponseStatusRecord = typeof HTTP_ERROR_RESPONSE_STATUS_RECORD;
147
- export type HttpErrorResponseStatusCode = ValueOf<HttpErrorResponseStatusRecord>["code"];
148
- export type HttpErrorResponseStatusText = ValueOf<HttpErrorResponseStatusRecord>["text"];
149
- //#endregion
150
- //#region src/constants/response-statuses/error/client.d.ts
151
- export declare const HTTP_CLIENT_ERROR_RESPONSE_STATUS_RECORD: {
543
+ type HttpErrorResponseStatus = ValueOf<typeof HTTP_ERROR_RESPONSE_STATUS_ENUM>;
544
+ export type HttpErrorResponseStatusCode = HttpErrorResponseStatus["CODE"];
545
+ export type HttpErrorResponseStatusText = HttpErrorResponseStatus["TEXT"];
546
+ export declare const HTTP_CLIENT_ERROR_RESPONSE_STATUS_ENUM: {
152
547
  readonly BAD_REQUEST: {
153
- readonly code: 400;
154
- readonly text: "Bad Request";
548
+ readonly CODE: 400;
549
+ readonly TEXT: "Bad Request";
155
550
  };
156
551
  readonly UNAUTHORIZED: {
157
- readonly code: 401;
158
- readonly text: "Unauthorized";
552
+ readonly CODE: 401;
553
+ readonly TEXT: "Unauthorized";
554
+ };
555
+ readonly PAYMENT_REQUIRED: {
556
+ readonly CODE: 402;
557
+ readonly TEXT: "Payment Required";
159
558
  };
160
559
  readonly FORBIDDEN: {
161
- readonly code: 403;
162
- readonly text: "Forbidden";
560
+ readonly CODE: 403;
561
+ readonly TEXT: "Forbidden";
163
562
  };
164
563
  readonly NOT_FOUND: {
165
- readonly code: 404;
166
- readonly text: "Not Found";
564
+ readonly CODE: 404;
565
+ readonly TEXT: "Not Found";
566
+ };
567
+ readonly METHOD_NOT_ALLOWED: {
568
+ readonly CODE: 405;
569
+ readonly TEXT: "Method Not Allowed";
570
+ };
571
+ readonly NOT_ACCEPTABLE: {
572
+ readonly CODE: 406;
573
+ readonly TEXT: "Not Acceptable";
574
+ };
575
+ readonly PROXY_AUTHENTICATION_REQUIRED: {
576
+ readonly CODE: 407;
577
+ readonly TEXT: "Proxy Authentication Required";
578
+ };
579
+ readonly REQUEST_TIMEOUT: {
580
+ readonly CODE: 408;
581
+ readonly TEXT: "Request Timeout";
167
582
  };
168
583
  readonly CONFLICT: {
169
- readonly code: 409;
170
- readonly text: "Conflict";
584
+ readonly CODE: 409;
585
+ readonly TEXT: "Conflict";
586
+ };
587
+ readonly GONE: {
588
+ readonly CODE: 410;
589
+ readonly TEXT: "Gone";
590
+ };
591
+ readonly LENGTH_REQUIRED: {
592
+ readonly CODE: 411;
593
+ readonly TEXT: "Length Required";
594
+ };
595
+ readonly PRECONDITION_FAILED: {
596
+ readonly CODE: 412;
597
+ readonly TEXT: "Precondition Failed";
598
+ };
599
+ readonly CONTENT_TOO_LARGE: {
600
+ readonly CODE: 413;
601
+ readonly TEXT: "Content Too Large";
602
+ };
603
+ readonly URI_TOO_LONG: {
604
+ readonly CODE: 414;
605
+ readonly TEXT: "URI Too Long";
606
+ };
607
+ readonly UNSUPPORTED_MEDIA_TYPE: {
608
+ readonly CODE: 415;
609
+ readonly TEXT: "Unsupported Media Type";
610
+ };
611
+ readonly RANGE_NOT_SATISFIABLE: {
612
+ readonly CODE: 416;
613
+ readonly TEXT: "Range Not Satisfiable";
614
+ };
615
+ readonly EXPECTATION_FAILED: {
616
+ readonly CODE: 417;
617
+ readonly TEXT: "Expectation Failed";
618
+ };
619
+ readonly IM_A_TEAPOT: {
620
+ readonly CODE: 418;
621
+ readonly TEXT: "I'm a teapot";
622
+ };
623
+ readonly MISDIRECTED_REQUEST: {
624
+ readonly CODE: 421;
625
+ readonly TEXT: "Misdirected Request";
171
626
  };
172
627
  readonly UNPROCESSABLE_CONTENT: {
173
- readonly code: 422;
174
- readonly text: "Unprocessable Content";
628
+ readonly CODE: 422;
629
+ readonly TEXT: "Unprocessable Content";
630
+ };
631
+ readonly LOCKED: {
632
+ readonly CODE: 423;
633
+ readonly TEXT: "Locked";
634
+ };
635
+ readonly FAILED_DEPENDENCY: {
636
+ readonly CODE: 424;
637
+ readonly TEXT: "Failed Dependency";
638
+ };
639
+ readonly TOO_EARLY: {
640
+ readonly CODE: 425;
641
+ readonly TEXT: "Too Early";
642
+ };
643
+ readonly UPGRADE_REQUIRED: {
644
+ readonly CODE: 426;
645
+ readonly TEXT: "Upgrade Required";
646
+ };
647
+ readonly PRECONDITION_REQUIRED: {
648
+ readonly CODE: 428;
649
+ readonly TEXT: "Precondition Required";
175
650
  };
176
651
  readonly TOO_MANY_REQUESTS: {
177
- readonly code: 429;
178
- readonly text: "Too Many Requests";
652
+ readonly CODE: 429;
653
+ readonly TEXT: "Too Many Requests";
654
+ };
655
+ readonly REQUEST_HEADER_FIELDS_TOO_LARGE: {
656
+ readonly CODE: 431;
657
+ readonly TEXT: "Request Header Fields Too Large";
658
+ };
659
+ readonly UNAVAILABLE_FOR_LEGAL_REASONS: {
660
+ readonly CODE: 451;
661
+ readonly TEXT: "Unavailable For Legal Reasons";
179
662
  };
180
663
  };
181
- export type HttpClientErrorResponseStatusRecord = typeof HTTP_CLIENT_ERROR_RESPONSE_STATUS_RECORD;
182
- export type HttpClientErrorResponseStatusCode = ValueOf<HttpClientErrorResponseStatusRecord>["code"];
183
- export type HttpClientErrorResponseStatusText = ValueOf<HttpClientErrorResponseStatusRecord>["text"];
184
- //#endregion
185
- //#region src/constants/response-statuses/error/server.d.ts
186
- export declare const HTTP_SERVER_ERROR_RESPONSE_STATUS_RECORD: {
664
+ type HttpClientErrorResponseStatus = ValueOf<typeof HTTP_CLIENT_ERROR_RESPONSE_STATUS_ENUM>;
665
+ export type HttpClientErrorResponseStatusCode = HttpClientErrorResponseStatus["CODE"];
666
+ export type HttpClientErrorResponseStatusText = HttpClientErrorResponseStatus["TEXT"];
667
+ export declare const HTTP_SERVER_ERROR_RESPONSE_STATUS_ENUM: {
187
668
  readonly INTERNAL_SERVER_ERROR: {
188
- readonly code: 500;
189
- readonly text: "Internal Server Error";
669
+ readonly CODE: 500;
670
+ readonly TEXT: "Internal Server Error";
671
+ };
672
+ readonly NOT_IMPLEMENTED: {
673
+ readonly CODE: 501;
674
+ readonly TEXT: "Not Implemented";
675
+ };
676
+ readonly BAD_GATEWAY: {
677
+ readonly CODE: 502;
678
+ readonly TEXT: "Bad Gateway";
190
679
  };
191
680
  readonly SERVICE_UNAVAILABLE: {
192
- readonly code: 503;
193
- readonly text: "Service Unavailable";
681
+ readonly CODE: 503;
682
+ readonly TEXT: "Service Unavailable";
194
683
  };
195
684
  readonly GATEWAY_TIMEOUT: {
196
- readonly code: 504;
197
- readonly text: "Gateway Timeout";
685
+ readonly CODE: 504;
686
+ readonly TEXT: "Gateway Timeout";
687
+ };
688
+ readonly HTTP_VERSION_NOT_SUPPORTED: {
689
+ readonly CODE: 505;
690
+ readonly TEXT: "HTTP Version Not Supported";
691
+ };
692
+ readonly VARIANT_ALSO_NEGOTIATES: {
693
+ readonly CODE: 506;
694
+ readonly TEXT: "Variant Also Negotiates";
695
+ };
696
+ readonly INSUFFICIENT_STORAGE: {
697
+ readonly CODE: 507;
698
+ readonly TEXT: "Insufficient Storage";
699
+ };
700
+ readonly LOOP_DETECTED: {
701
+ readonly CODE: 508;
702
+ readonly TEXT: "Loop Detected";
703
+ };
704
+ readonly NOT_EXTENDED: {
705
+ readonly CODE: 510;
706
+ readonly TEXT: "Not Extended";
707
+ };
708
+ readonly NETWORK_AUTHENTICATION_REQUIRED: {
709
+ readonly CODE: 511;
710
+ readonly TEXT: "Network Authentication Required";
198
711
  };
199
712
  };
200
- export type HttpServerErrorResponseStatusRecord = typeof HTTP_SERVER_ERROR_RESPONSE_STATUS_RECORD;
201
- export type HttpServerErrorResponseStatusCode = ValueOf<HttpServerErrorResponseStatusRecord>["code"];
202
- export type HttpServerErrorResponseStatusText = ValueOf<HttpServerErrorResponseStatusRecord>["text"];
203
- //#endregion
713
+ type HttpServerErrorResponseStatus = ValueOf<typeof HTTP_SERVER_ERROR_RESPONSE_STATUS_ENUM>;
714
+ export type HttpServerErrorResponseStatusCode = HttpServerErrorResponseStatus["CODE"];
715
+ export type HttpServerErrorResponseStatusText = HttpServerErrorResponseStatus["TEXT"];
716
+ export {};
package/dist/index.js CHANGED
@@ -1,13 +1,32 @@
1
- //#region src/constants/headers.ts
2
- const HTTP_HEADER_RECORD = {
1
+ // src/constants/headers.ts
2
+ const HTTP_HEADER_ENUM = {
3
3
  AUTHORIZATION: "authorization",
4
+ CACHE_CONTROL: "cache-control",
5
+ CONNECTION: "connection",
6
+ CONTENT_ENCODING: "content-encoding",
7
+ CONTENT_SECURITY_POLICY: "content-security-policy",
4
8
  CONTENT_TYPE: "content-type",
5
9
  COOKIE: "cookie",
6
- RETRY_AFTER: "retry-after"
10
+ CROSS_ORIGIN_RESOURCE_POLICY: "cross-origin-resource-policy",
11
+ DATE: "date",
12
+ ETAG: "etag",
13
+ EXPIRES: "expires",
14
+ FORWARDED: "forwarded",
15
+ HOST: "host",
16
+ KEEP_ALIVE: "keep-alive",
17
+ LAST_MODIFIED: "last-modified",
18
+ LOCATION: "location",
19
+ ORIGIN: "origin",
20
+ REFERER: "referer",
21
+ REFERRER_POLICY: "referrer-policy",
22
+ RETRY_AFTER: "retry-after",
23
+ SET_COOKIE: "set-cookie",
24
+ TRANSFER_ENCODING: "transfer-encoding",
25
+ UPGRADE: "upgrade",
26
+ USER_AGENT: "user-agent"
7
27
  };
8
- //#endregion
9
- //#region src/constants/request-methods.ts
10
- const HTTP_REQUEST_METHOD_RECORD = {
28
+ // src/constants/request-methods.ts
29
+ const HTTP_REQUEST_METHOD_ENUM = {
11
30
  GET: "GET",
12
31
  POST: "POST",
13
32
  DELETE: "DELETE",
@@ -18,81 +37,271 @@ const HTTP_REQUEST_METHOD_RECORD = {
18
37
  TRACE: "TRACE",
19
38
  CONNECT: "CONNECT"
20
39
  };
21
- //#endregion
22
- //#region src/constants/response-statuses/error/client.ts
23
- const HTTP_CLIENT_ERROR_RESPONSE_STATUS_RECORD = {
40
+ // src/constants/response-statuses/error/client.ts
41
+ const HTTP_CLIENT_ERROR_RESPONSE_STATUS_ENUM = {
24
42
  BAD_REQUEST: {
25
- code: 400,
26
- text: "Bad Request"
43
+ CODE: 400,
44
+ TEXT: "Bad Request"
27
45
  },
28
46
  UNAUTHORIZED: {
29
- code: 401,
30
- text: "Unauthorized"
47
+ CODE: 401,
48
+ TEXT: "Unauthorized"
49
+ },
50
+ PAYMENT_REQUIRED: {
51
+ CODE: 402,
52
+ TEXT: "Payment Required"
31
53
  },
32
54
  FORBIDDEN: {
33
- code: 403,
34
- text: "Forbidden"
55
+ CODE: 403,
56
+ TEXT: "Forbidden"
35
57
  },
36
58
  NOT_FOUND: {
37
- code: 404,
38
- text: "Not Found"
59
+ CODE: 404,
60
+ TEXT: "Not Found"
61
+ },
62
+ METHOD_NOT_ALLOWED: {
63
+ CODE: 405,
64
+ TEXT: "Method Not Allowed"
65
+ },
66
+ NOT_ACCEPTABLE: {
67
+ CODE: 406,
68
+ TEXT: "Not Acceptable"
69
+ },
70
+ PROXY_AUTHENTICATION_REQUIRED: {
71
+ CODE: 407,
72
+ TEXT: "Proxy Authentication Required"
73
+ },
74
+ REQUEST_TIMEOUT: {
75
+ CODE: 408,
76
+ TEXT: "Request Timeout"
39
77
  },
40
78
  CONFLICT: {
41
- code: 409,
42
- text: "Conflict"
79
+ CODE: 409,
80
+ TEXT: "Conflict"
81
+ },
82
+ GONE: {
83
+ CODE: 410,
84
+ TEXT: "Gone"
85
+ },
86
+ LENGTH_REQUIRED: {
87
+ CODE: 411,
88
+ TEXT: "Length Required"
89
+ },
90
+ PRECONDITION_FAILED: {
91
+ CODE: 412,
92
+ TEXT: "Precondition Failed"
93
+ },
94
+ CONTENT_TOO_LARGE: {
95
+ CODE: 413,
96
+ TEXT: "Content Too Large"
97
+ },
98
+ URI_TOO_LONG: {
99
+ CODE: 414,
100
+ TEXT: "URI Too Long"
101
+ },
102
+ UNSUPPORTED_MEDIA_TYPE: {
103
+ CODE: 415,
104
+ TEXT: "Unsupported Media Type"
105
+ },
106
+ RANGE_NOT_SATISFIABLE: {
107
+ CODE: 416,
108
+ TEXT: "Range Not Satisfiable"
109
+ },
110
+ EXPECTATION_FAILED: {
111
+ CODE: 417,
112
+ TEXT: "Expectation Failed"
113
+ },
114
+ IM_A_TEAPOT: {
115
+ CODE: 418,
116
+ TEXT: "I'm a teapot"
117
+ },
118
+ MISDIRECTED_REQUEST: {
119
+ CODE: 421,
120
+ TEXT: "Misdirected Request"
43
121
  },
44
122
  UNPROCESSABLE_CONTENT: {
45
- code: 422,
46
- text: "Unprocessable Content"
123
+ CODE: 422,
124
+ TEXT: "Unprocessable Content"
125
+ },
126
+ LOCKED: {
127
+ CODE: 423,
128
+ TEXT: "Locked"
129
+ },
130
+ FAILED_DEPENDENCY: {
131
+ CODE: 424,
132
+ TEXT: "Failed Dependency"
133
+ },
134
+ TOO_EARLY: {
135
+ CODE: 425,
136
+ TEXT: "Too Early"
137
+ },
138
+ UPGRADE_REQUIRED: {
139
+ CODE: 426,
140
+ TEXT: "Upgrade Required"
141
+ },
142
+ PRECONDITION_REQUIRED: {
143
+ CODE: 428,
144
+ TEXT: "Precondition Required"
47
145
  },
48
146
  TOO_MANY_REQUESTS: {
49
- code: 429,
50
- text: "Too Many Requests"
147
+ CODE: 429,
148
+ TEXT: "Too Many Requests"
149
+ },
150
+ REQUEST_HEADER_FIELDS_TOO_LARGE: {
151
+ CODE: 431,
152
+ TEXT: "Request Header Fields Too Large"
153
+ },
154
+ UNAVAILABLE_FOR_LEGAL_REASONS: {
155
+ CODE: 451,
156
+ TEXT: "Unavailable For Legal Reasons"
51
157
  }
52
158
  };
53
- //#endregion
54
- //#region src/constants/response-statuses/error/server.ts
55
- const HTTP_SERVER_ERROR_RESPONSE_STATUS_RECORD = {
159
+ // src/constants/response-statuses/error/server.ts
160
+ const HTTP_SERVER_ERROR_RESPONSE_STATUS_ENUM = {
56
161
  INTERNAL_SERVER_ERROR: {
57
- code: 500,
58
- text: "Internal Server Error"
162
+ CODE: 500,
163
+ TEXT: "Internal Server Error"
164
+ },
165
+ NOT_IMPLEMENTED: {
166
+ CODE: 501,
167
+ TEXT: "Not Implemented"
168
+ },
169
+ BAD_GATEWAY: {
170
+ CODE: 502,
171
+ TEXT: "Bad Gateway"
59
172
  },
60
173
  SERVICE_UNAVAILABLE: {
61
- code: 503,
62
- text: "Service Unavailable"
174
+ CODE: 503,
175
+ TEXT: "Service Unavailable"
63
176
  },
64
177
  GATEWAY_TIMEOUT: {
65
- code: 504,
66
- text: "Gateway Timeout"
178
+ CODE: 504,
179
+ TEXT: "Gateway Timeout"
180
+ },
181
+ HTTP_VERSION_NOT_SUPPORTED: {
182
+ CODE: 505,
183
+ TEXT: "HTTP Version Not Supported"
184
+ },
185
+ VARIANT_ALSO_NEGOTIATES: {
186
+ CODE: 506,
187
+ TEXT: "Variant Also Negotiates"
188
+ },
189
+ INSUFFICIENT_STORAGE: {
190
+ CODE: 507,
191
+ TEXT: "Insufficient Storage"
192
+ },
193
+ LOOP_DETECTED: {
194
+ CODE: 508,
195
+ TEXT: "Loop Detected"
196
+ },
197
+ NOT_EXTENDED: {
198
+ CODE: 510,
199
+ TEXT: "Not Extended"
200
+ },
201
+ NETWORK_AUTHENTICATION_REQUIRED: {
202
+ CODE: 511,
203
+ TEXT: "Network Authentication Required"
204
+ }
205
+ };
206
+ // src/constants/response-statuses/error/index.ts
207
+ const HTTP_ERROR_RESPONSE_STATUS_ENUM = {
208
+ ...HTTP_CLIENT_ERROR_RESPONSE_STATUS_ENUM,
209
+ ...HTTP_SERVER_ERROR_RESPONSE_STATUS_ENUM
210
+ };
211
+ // src/constants/response-statuses/information.ts
212
+ const HTTP_INFORMATIONAL_RESPONSE_STATUS_ENUM = {
213
+ CONTINUE: {
214
+ CODE: 100,
215
+ TEXT: "Continue"
216
+ },
217
+ SWITCHING_PROTOCOLS: {
218
+ CODE: 101,
219
+ TEXT: "Switching Protocols"
220
+ },
221
+ EARLY_HINTS: {
222
+ CODE: 103,
223
+ TEXT: "Early Hints"
67
224
  }
68
225
  };
69
- //#endregion
70
- //#region src/constants/response-statuses/error/index.ts
71
- const HTTP_ERROR_RESPONSE_STATUS_RECORD = {
72
- ...HTTP_CLIENT_ERROR_RESPONSE_STATUS_RECORD,
73
- ...HTTP_SERVER_ERROR_RESPONSE_STATUS_RECORD
226
+ // src/constants/response-statuses/redirection.ts
227
+ const HTTP_REDIRECTION_RESPONSE_STATUS_ENUM = {
228
+ MULTIPLE_CHOICES: {
229
+ CODE: 300,
230
+ TEXT: "Multiple Choices"
231
+ },
232
+ MOVED_PERMANENTLY: {
233
+ CODE: 301,
234
+ TEXT: "Moved Permanently"
235
+ },
236
+ FOUND: {
237
+ CODE: 302,
238
+ TEXT: "Found"
239
+ },
240
+ SEE_OTHER: {
241
+ CODE: 303,
242
+ TEXT: "See Other"
243
+ },
244
+ NOT_MODIFIED: {
245
+ CODE: 304,
246
+ TEXT: "Not Modified"
247
+ },
248
+ TEMPORARY_REDIRECT: {
249
+ CODE: 307,
250
+ TEXT: "Temporary Redirect"
251
+ },
252
+ PERMANENT_REDIRECT: {
253
+ CODE: 308,
254
+ TEXT: "Permanent Redirect"
255
+ }
74
256
  };
75
- //#endregion
76
- //#region src/constants/response-statuses/success.ts
77
- const HTTP_SUCCESSFUL_RESPONSE_STATUS_RECORD = {
257
+ // src/constants/response-statuses/success.ts
258
+ const HTTP_SUCCESSFUL_RESPONSE_STATUS_ENUM = {
78
259
  OK: {
79
- code: 200,
80
- text: "OK"
260
+ CODE: 200,
261
+ TEXT: "OK"
81
262
  },
82
263
  CREATED: {
83
- code: 201,
84
- text: "Created"
264
+ CODE: 201,
265
+ TEXT: "Created"
266
+ },
267
+ ACCEPTED: {
268
+ CODE: 202,
269
+ TEXT: "Accepted"
270
+ },
271
+ NON_AUTHORITATIVE_INFORMATION: {
272
+ CODE: 203,
273
+ TEXT: "Non-Authoritative Information"
85
274
  },
86
275
  NO_CONTENT: {
87
- code: 204,
88
- text: "No Content"
276
+ CODE: 204,
277
+ TEXT: "No Content"
278
+ },
279
+ RESET_CONTENT: {
280
+ CODE: 205,
281
+ TEXT: "Reset Content"
282
+ },
283
+ PARTIAL_CONTENT: {
284
+ CODE: 206,
285
+ TEXT: "Partial Content"
286
+ },
287
+ MULTI_STATUS: {
288
+ CODE: 207,
289
+ TEXT: "Multi-Status"
290
+ },
291
+ ALREADY_REPORTED: {
292
+ CODE: 208,
293
+ TEXT: "Already Reported"
294
+ },
295
+ IM_USED: {
296
+ CODE: 226,
297
+ TEXT: "IM Used"
89
298
  }
90
299
  };
91
- //#endregion
92
- //#region src/constants/response-statuses/index.ts
300
+ // src/constants/response-statuses/index.ts
93
301
  const HTTP_RESPONSE_STATUS_RECORD = {
94
- ...HTTP_SUCCESSFUL_RESPONSE_STATUS_RECORD,
95
- ...HTTP_ERROR_RESPONSE_STATUS_RECORD
302
+ ...HTTP_INFORMATIONAL_RESPONSE_STATUS_ENUM,
303
+ ...HTTP_SUCCESSFUL_RESPONSE_STATUS_ENUM,
304
+ ...HTTP_REDIRECTION_RESPONSE_STATUS_ENUM,
305
+ ...HTTP_ERROR_RESPONSE_STATUS_ENUM
96
306
  };
97
- //#endregion
98
- export { HTTP_CLIENT_ERROR_RESPONSE_STATUS_RECORD, HTTP_ERROR_RESPONSE_STATUS_RECORD, HTTP_HEADER_RECORD, HTTP_REQUEST_METHOD_RECORD, HTTP_RESPONSE_STATUS_RECORD, HTTP_SERVER_ERROR_RESPONSE_STATUS_RECORD, HTTP_SUCCESSFUL_RESPONSE_STATUS_RECORD };
307
+ export { HTTP_CLIENT_ERROR_RESPONSE_STATUS_ENUM, HTTP_ERROR_RESPONSE_STATUS_ENUM, HTTP_HEADER_ENUM, HTTP_INFORMATIONAL_RESPONSE_STATUS_ENUM, HTTP_REDIRECTION_RESPONSE_STATUS_ENUM, HTTP_REQUEST_METHOD_ENUM, HTTP_RESPONSE_STATUS_RECORD, HTTP_SERVER_ERROR_RESPONSE_STATUS_ENUM, HTTP_SUCCESSFUL_RESPONSE_STATUS_ENUM };
package/package.json CHANGED
@@ -1,41 +1,49 @@
1
1
  {
2
2
  "name": "@little-nebulae/http",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "type": "module",
9
+ "sideEffects": false,
9
10
  "exports": {
10
11
  ".": "./dist/index.js",
11
12
  "./package.json": "./package.json"
12
13
  },
14
+ "publishConfig": {
15
+ "access": "public",
16
+ "tag": "latest"
17
+ },
13
18
  "devDependencies": {
14
19
  "@arethetypeswrong/core": "0.18.5",
15
- "@little-nebulae/type-utils": "1.1.0",
16
- "@types/node": "26.6.2",
17
- "oxfmt": "0.68.0",
18
- "oxlint": "1.83.0",
19
- "oxlint-tsgolint": "7.0.2002",
20
- "publint": "0.3.24",
21
- "tsdown": "0.23.0",
22
- "tsx": "4.23.13",
23
- "typescript": "7.0.2",
24
- "vitest": "5.0.1"
20
+ "@types/node": "26.6.6",
21
+ "oxfmt": "0.78.0",
22
+ "oxlint": "1.93.0",
23
+ "oxlint-tsgolint": "7.0.2006",
24
+ "publint": "0.3.25",
25
+ "tsdown": "0.23.7",
26
+ "type-fest": "5.10.0",
27
+ "typescript": "7.1.0-beta",
28
+ "vitest": "5.1.0"
25
29
  },
26
30
  "peerDependencies": {
27
- "@little-nebulae/type-utils": "^1.0.0"
31
+ "type-fest": "^5.0.0"
28
32
  },
29
33
  "devEngines": {
30
34
  "packageManager": {
31
35
  "name": "pnpm",
32
- "version": "12.5.1",
36
+ "version": "^12.0.0",
37
+ "onFail": "warn"
38
+ },
39
+ "runtime": {
40
+ "name": "node",
41
+ "version": "^26.0.0",
33
42
  "onFail": "warn"
34
43
  }
35
44
  },
36
45
  "scripts": {
37
46
  "build": "tsdown",
38
- "try": "tsx ./src/try.ts",
39
47
  "fmt": "oxfmt --disable-nested-config",
40
48
  "fmt:check": "oxfmt --check --disable-nested-config",
41
49
  "lint": "oxlint --disable-nested-config",