@little-nebulae/http 0.3.0 → 0.4.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.
- package/dist/index.d.ts +30 -2
- package/dist/index.js +23 -2
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare const HTTP_HEADER_ENUM: {
|
|
|
28
28
|
export type HttpHeader = ValueOf<typeof HTTP_HEADER_ENUM>;
|
|
29
29
|
export declare const HTTP_REQUEST_METHOD_ENUM: {
|
|
30
30
|
readonly GET: "GET";
|
|
31
|
+
readonly QUERY: "QUERY";
|
|
31
32
|
readonly POST: "POST";
|
|
32
33
|
readonly DELETE: "DELETE";
|
|
33
34
|
readonly PUT: "PUT";
|
|
@@ -38,7 +39,7 @@ export declare const HTTP_REQUEST_METHOD_ENUM: {
|
|
|
38
39
|
readonly CONNECT: "CONNECT";
|
|
39
40
|
};
|
|
40
41
|
export type HttpRequestMethod = ValueOf<typeof HTTP_REQUEST_METHOD_ENUM>;
|
|
41
|
-
export declare const
|
|
42
|
+
export declare const HTTP_RESPONSE_STATUS_ENUM: {
|
|
42
43
|
readonly BAD_REQUEST: {
|
|
43
44
|
readonly CODE: 400;
|
|
44
45
|
readonly TEXT: "Bad Request";
|
|
@@ -280,7 +281,7 @@ export declare const HTTP_RESPONSE_STATUS_RECORD: {
|
|
|
280
281
|
readonly TEXT: "IM Used";
|
|
281
282
|
};
|
|
282
283
|
};
|
|
283
|
-
type HttpResponseStatus = ValueOf<typeof
|
|
284
|
+
type HttpResponseStatus = ValueOf<typeof HTTP_RESPONSE_STATUS_ENUM>;
|
|
284
285
|
export type HttpResponseStatusCode = HttpResponseStatus["CODE"];
|
|
285
286
|
export type HttpResponseStatusText = HttpResponseStatus["TEXT"];
|
|
286
287
|
export declare const HTTP_INFORMATIONAL_RESPONSE_STATUS_ENUM: {
|
|
@@ -713,4 +714,31 @@ export declare const HTTP_SERVER_ERROR_RESPONSE_STATUS_ENUM: {
|
|
|
713
714
|
type HttpServerErrorResponseStatus = ValueOf<typeof HTTP_SERVER_ERROR_RESPONSE_STATUS_ENUM>;
|
|
714
715
|
export type HttpServerErrorResponseStatusCode = HttpServerErrorResponseStatus["CODE"];
|
|
715
716
|
export type HttpServerErrorResponseStatusText = HttpServerErrorResponseStatus["TEXT"];
|
|
717
|
+
export declare const HTTP_APPLICATION_MEDIA_TYPE_ENUM: {
|
|
718
|
+
readonly BINARY: "application/octet-stream";
|
|
719
|
+
readonly JSON: "application/json";
|
|
720
|
+
readonly PDF: "application/pdf";
|
|
721
|
+
};
|
|
722
|
+
export type HttpApplicationMediaType = ValueOf<typeof HTTP_APPLICATION_MEDIA_TYPE_ENUM>;
|
|
723
|
+
export declare const HTTP_TEXT_MEDIA_TYPE_ENUM: {
|
|
724
|
+
readonly CSS: "text/css";
|
|
725
|
+
readonly CSV: "text/csv";
|
|
726
|
+
readonly HTML: "text/html";
|
|
727
|
+
readonly JAVASCRIPT: "text/javascript";
|
|
728
|
+
readonly MARKDOWN: "text/markdown";
|
|
729
|
+
readonly PLAIN: "text/plain";
|
|
730
|
+
};
|
|
731
|
+
export type HttpTextMediaType = ValueOf<typeof HTTP_TEXT_MEDIA_TYPE_ENUM>;
|
|
732
|
+
export declare const HTTP_MEDIA_TYPE_ENUM: {
|
|
733
|
+
BINARY: "application/octet-stream";
|
|
734
|
+
JSON: "application/json";
|
|
735
|
+
PDF: "application/pdf";
|
|
736
|
+
CSS: "text/css";
|
|
737
|
+
CSV: "text/csv";
|
|
738
|
+
HTML: "text/html";
|
|
739
|
+
JAVASCRIPT: "text/javascript";
|
|
740
|
+
MARKDOWN: "text/markdown";
|
|
741
|
+
PLAIN: "text/plain";
|
|
742
|
+
};
|
|
743
|
+
export type HttpMediaType = ValueOf<typeof HTTP_MEDIA_TYPE_ENUM>;
|
|
716
744
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ const HTTP_HEADER_ENUM = {
|
|
|
28
28
|
// src/constants/request-methods.ts
|
|
29
29
|
const HTTP_REQUEST_METHOD_ENUM = {
|
|
30
30
|
GET: "GET",
|
|
31
|
+
QUERY: "QUERY",
|
|
31
32
|
POST: "POST",
|
|
32
33
|
DELETE: "DELETE",
|
|
33
34
|
PUT: "PUT",
|
|
@@ -298,10 +299,30 @@ const HTTP_SUCCESSFUL_RESPONSE_STATUS_ENUM = {
|
|
|
298
299
|
}
|
|
299
300
|
};
|
|
300
301
|
// src/constants/response-statuses/index.ts
|
|
301
|
-
const
|
|
302
|
+
const HTTP_RESPONSE_STATUS_ENUM = {
|
|
302
303
|
...HTTP_INFORMATIONAL_RESPONSE_STATUS_ENUM,
|
|
303
304
|
...HTTP_SUCCESSFUL_RESPONSE_STATUS_ENUM,
|
|
304
305
|
...HTTP_REDIRECTION_RESPONSE_STATUS_ENUM,
|
|
305
306
|
...HTTP_ERROR_RESPONSE_STATUS_ENUM
|
|
306
307
|
};
|
|
307
|
-
|
|
308
|
+
// src/constants/media-types/application.ts
|
|
309
|
+
const HTTP_APPLICATION_MEDIA_TYPE_ENUM = {
|
|
310
|
+
BINARY: "application/octet-stream",
|
|
311
|
+
JSON: "application/json",
|
|
312
|
+
PDF: "application/pdf"
|
|
313
|
+
};
|
|
314
|
+
// src/constants/media-types/text.ts
|
|
315
|
+
const HTTP_TEXT_MEDIA_TYPE_ENUM = {
|
|
316
|
+
CSS: "text/css",
|
|
317
|
+
CSV: "text/csv",
|
|
318
|
+
HTML: "text/html",
|
|
319
|
+
JAVASCRIPT: "text/javascript",
|
|
320
|
+
MARKDOWN: "text/markdown",
|
|
321
|
+
PLAIN: "text/plain"
|
|
322
|
+
};
|
|
323
|
+
// src/constants/media-types/index.ts
|
|
324
|
+
const HTTP_MEDIA_TYPE_ENUM = {
|
|
325
|
+
...HTTP_APPLICATION_MEDIA_TYPE_ENUM,
|
|
326
|
+
...HTTP_TEXT_MEDIA_TYPE_ENUM
|
|
327
|
+
};
|
|
328
|
+
export { HTTP_APPLICATION_MEDIA_TYPE_ENUM, HTTP_CLIENT_ERROR_RESPONSE_STATUS_ENUM, HTTP_ERROR_RESPONSE_STATUS_ENUM, HTTP_HEADER_ENUM, HTTP_INFORMATIONAL_RESPONSE_STATUS_ENUM, HTTP_MEDIA_TYPE_ENUM, HTTP_REDIRECTION_RESPONSE_STATUS_ENUM, HTTP_REQUEST_METHOD_ENUM, HTTP_RESPONSE_STATUS_ENUM, HTTP_SERVER_ERROR_RESPONSE_STATUS_ENUM, HTTP_SUCCESSFUL_RESPONSE_STATUS_ENUM, HTTP_TEXT_MEDIA_TYPE_ENUM };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@little-nebulae/http",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@types/node": "26.6.6",
|
|
21
21
|
"oxfmt": "0.78.0",
|
|
22
22
|
"oxlint": "1.93.0",
|
|
23
|
-
"oxlint-tsgolint": "7.0.
|
|
23
|
+
"oxlint-tsgolint": "7.0.2007",
|
|
24
24
|
"publint": "0.3.25",
|
|
25
25
|
"tsdown": "0.23.7",
|
|
26
26
|
"type-fest": "5.10.0",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"devEngines": {
|
|
34
34
|
"packageManager": {
|
|
35
35
|
"name": "pnpm",
|
|
36
|
-
"version": "
|
|
36
|
+
"version": "12.21.0",
|
|
37
37
|
"onFail": "warn"
|
|
38
38
|
},
|
|
39
39
|
"runtime": {
|
|
40
40
|
"name": "node",
|
|
41
|
-
"version": "
|
|
41
|
+
"version": "26.13.1",
|
|
42
42
|
"onFail": "warn"
|
|
43
43
|
}
|
|
44
44
|
},
|