@tsed/schema 6.102.5 → 6.102.6

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.
@@ -1,102 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getStatusMessage = exports.getStatusConstant = exports.HTTP_STATUS_MESSAGES = void 0;
4
- exports.HTTP_STATUS_MESSAGES = {
5
- "100": { label: "Continue", code: "CONTINUE" },
6
- "101": { label: "Switching Protocols", code: "SWITCHING_PROTOCOLS" },
7
- "102": { label: "Processing", code: "PROCESSING" },
8
- "103": { label: "Early Hints", code: "EARLY_HINTS" },
9
- "200": { label: "Success", code: "SUCCESS" },
10
- "201": { label: "Created", code: "CREATED" },
11
- "202": { label: "Accepted", code: "ACCEPTED" },
12
- "203": {
13
- label: "Non-Authoritative Information",
14
- code: "NON_AUTHORITATIVE_INFORMATION"
15
- },
16
- "204": { label: "No Content", code: "NO_CONTENT" },
17
- "205": { label: "Reset Content", code: "RESET_CONTENT" },
18
- "206": { label: "Partial Content", code: "PARTIAL_CONTENT" },
19
- "207": { label: "Multi-Status", code: "MULTI_STATUS" },
20
- "208": { label: "Already Reported", code: "ALREADY_REPORTED" },
21
- "226": { label: "IM Used", code: "IM_USED" },
22
- "300": { label: "Multiple Choices", code: "MULTIPLE_CHOICES" },
23
- "301": { label: "Moved Permanently", code: "MOVED_PERMANENTLY" },
24
- "302": { label: "Found", code: "FOUND" },
25
- "303": { label: "See Other", code: "SEE_OTHER" },
26
- "304": { label: "Not Modified", code: "NOT_MODIFIED" },
27
- "305": { label: "Use Proxy", code: "USE_PROXY" },
28
- "306": { label: "(Unused)", code: "UNUSED" },
29
- "307": { label: "Temporary Redirect", code: "TEMPORARY_REDIRECT" },
30
- "308": { label: "Permanent Redirect", code: "PERMANENT_REDIRECT" },
31
- "310": { label: "Too Many Redirects", code: "TOO_MANY_REDIRECTS" },
32
- "400": { label: "Bad Request", code: "BAD_REQUEST" },
33
- "401": { label: "Unauthorized", code: "UNAUTHORIZED" },
34
- "402": { label: "Payment Required", code: "PAYMENT_REQUIRED" },
35
- "403": { label: "Forbidden", code: "FORBIDDEN" },
36
- "404": { label: "Not Found", code: "NOT_FOUND" },
37
- "405": { label: "Method Not Allowed", code: "METHOD_NOT_ALLOWED" },
38
- "406": { label: "Not Acceptable", code: "NOT_ACCEPTABLE" },
39
- "407": {
40
- label: "Proxy Authentication Required",
41
- code: "PROXY_AUTHENTICATION_REQUIRED"
42
- },
43
- "408": { label: "Request Timeout", code: "REQUEST_TIMEOUT" },
44
- "409": { label: "Conflict", code: "CONFLICT" },
45
- "410": { label: "Gone", code: "GONE" },
46
- "411": { label: "Length Required", code: "LENGTH_REQUIRED" },
47
- "412": { label: "Precondition Failed", code: "PRECONDITION_FAILED" },
48
- "413": {
49
- label: "Request Entity Too Large",
50
- code: "REQUEST_ENTITY_TOO_LARGE"
51
- },
52
- "414": { label: "Request URI Too Long", code: "REQUEST_URI_TOO_LONG" },
53
- "415": { label: "Unsupported Media Type", code: "UNSUPPORTED_MEDIA_TYPE" },
54
- "416": {
55
- label: "Request Range Unsatisfiable",
56
- code: "REQUEST_RANGE_UNSATISFIABLE"
57
- },
58
- "417": { label: "Expectation Failed", code: "EXPECTATION_FAILED" },
59
- "418": { label: "I'm a Teapot", code: "I_M_A_TEAPOT" },
60
- "421": { label: "Misdirected Request", code: "MISDIRECTED_REQUEST" },
61
- "422": { label: "Unprocessable Entity", code: "UNPROCESSABLE_ENTITY" },
62
- "423": { label: "Locked", code: "LOCKED" },
63
- "424": { label: "Failed Dependency", code: "FAILED_DEPENDENCY" },
64
- "425": { label: "Too Early", code: "TOO_EARLY" },
65
- "426": { label: "Upgrade Required", code: "UPGRADE_REQUIRED" },
66
- "427": { label: "Unassigned", code: "UNASSIGNED" },
67
- "428": { label: "Precondition Required", code: "PRECONDITION_REQUIRED" },
68
- "429": { label: "Too Many Requests", code: "TOO_MANY_REQUESTS" },
69
- "430": { label: "Unassigned", code: "UNASSIGNED" },
70
- "431": {
71
- label: "Request Header Fields Too Large",
72
- code: "REQUEST_HEADER_FIELDS_TOO_LARGE"
73
- },
74
- "451": {
75
- label: "Unavailable For Legal Reasons",
76
- code: "UNAVAILABLE_FOR_LEGAL_REASONS"
77
- },
78
- "500": { label: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" },
79
- "501": { label: "Not Implemented", code: "NOT_IMPLEMENTED" },
80
- "502": { label: "Bad Gateway", code: "BAD_GATEWAY" },
81
- "503": { label: "Service Unavailable", code: "SERVICE_UNAVAILABLE" },
82
- "504": { label: "Gateway Timeout", code: "GATEWAY_TIMEOUT" },
83
- "505": {
84
- label: "HTTP Version Not Supported",
85
- code: "HTTP_VERSION_NOT_SUPPORTED"
86
- },
87
- "506": { label: "Variant Also Negotiates", code: "VARIANT_ALSO_NEGOTIATES" },
88
- "507": { label: "Insufficient Storage", code: "INSUFFICIENT_STORAGE" },
89
- "508": { label: "Loop Detected", code: "LOOP_DETECTED" },
90
- "509": {
91
- label: "Bandwidth Limit Exceeded",
92
- code: "BANDWIDTH_LIMIT_EXCEEDED"
93
- },
94
- "510": { label: "Not Extended", code: "NOT_EXTENDED" },
95
- "511": {
96
- label: "Network Authentication Required",
97
- code: "NETWORK_AUTHENTICATION_REQUIRED"
98
- }
99
- };
4
+ const tslib_1 = require("tslib");
5
+ const statuses_1 = (0, tslib_1.__importDefault)(require("statuses"));
6
+ const change_case_1 = require("change-case");
7
+ exports.HTTP_STATUS_MESSAGES = statuses_1.default.codes.reduce((map, code) => {
8
+ const message = String((0, statuses_1.default)(code));
9
+ return {
10
+ ...map,
11
+ [String(code)]: { label: message, code: (0, change_case_1.constantCase)(message) }
12
+ };
13
+ }, {});
14
+ exports.HTTP_STATUS_MESSAGES["200"].label = "Success";
15
+ exports.HTTP_STATUS_MESSAGES["200"].code = "SUCCESS";
100
16
  function getStatusConstant(status) {
101
17
  var _a;
102
18
  return (_a = exports.HTTP_STATUS_MESSAGES[status]) === null || _a === void 0 ? void 0 : _a.code;
@@ -1 +1 @@
1
- {"version":3,"file":"httpStatusMessages.js","sourceRoot":"","sources":["../../../src/constants/httpStatusMessages.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG;IAClC,KAAK,EAAE,EAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAC;IAC5C,KAAK,EAAE,EAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,qBAAqB,EAAC;IAClE,KAAK,EAAE,EAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAC;IAChD,KAAK,EAAE,EAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAC;IAClD,KAAK,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;IAC1C,KAAK,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;IAC1C,KAAK,EAAE,EAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAC;IAC5C,KAAK,EAAE;QACL,KAAK,EAAE,+BAA+B;QACtC,IAAI,EAAE,+BAA+B;KACtC;IACD,KAAK,EAAE,EAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAC;IAChD,KAAK,EAAE,EAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAC;IACtD,KAAK,EAAE,EAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAC;IAC1D,KAAK,EAAE,EAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAC;IACpD,KAAK,EAAE,EAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAC;IAC5D,KAAK,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;IAC1C,KAAK,EAAE,EAAC,KAAK,EAAE,kBAA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,eAAe,EAAE,IAAI,EAAE,eAAe,EAAC;IACtD,KAAK,EAAE;QACL,KAAK,EAAE,0BAA0B;QACjC,IAAI,EAAE,0BAA0B;KACjC;IACD,KAAK,EAAE,EAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAC;IACpD,KAAK,EAAE;QACL,KAAK,EAAE,iCAAiC;QACxC,IAAI,EAAE,iCAAiC;KACxC;CACF,CAAC;AAEF,SAAgB,iBAAiB,CAAC,MAAuB;;IACvD,OAAO,MAAC,4BAA4B,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAC;AACrD,CAAC;AAFD,8CAEC;AAED,SAAgB,gBAAgB,CAAC,MAAuB;;IACtD,OAAO,MAAC,4BAA4B,CAAC,MAAM,CAAC,0CAAE,KAAK,CAAC;AACtD,CAAC;AAFD,4CAEC","sourcesContent":["export const HTTP_STATUS_MESSAGES = {\n \"100\": {label: \"Continue\", code: \"CONTINUE\"},\n \"101\": {label: \"Switching Protocols\", code: \"SWITCHING_PROTOCOLS\"},\n \"102\": {label: \"Processing\", code: \"PROCESSING\"},\n \"103\": {label: \"Early Hints\", code: \"EARLY_HINTS\"},\n \"200\": {label: \"Success\", code: \"SUCCESS\"},\n \"201\": {label: \"Created\", code: \"CREATED\"},\n \"202\": {label: \"Accepted\", code: \"ACCEPTED\"},\n \"203\": {\n label: \"Non-Authoritative Information\",\n code: \"NON_AUTHORITATIVE_INFORMATION\"\n },\n \"204\": {label: \"No Content\", code: \"NO_CONTENT\"},\n \"205\": {label: \"Reset Content\", code: \"RESET_CONTENT\"},\n \"206\": {label: \"Partial Content\", code: \"PARTIAL_CONTENT\"},\n \"207\": {label: \"Multi-Status\", code: \"MULTI_STATUS\"},\n \"208\": {label: \"Already Reported\", code: \"ALREADY_REPORTED\"},\n \"226\": {label: \"IM Used\", code: \"IM_USED\"},\n \"300\": {label: \"Multiple Choices\", code: \"MULTIPLE_CHOICES\"},\n \"301\": {label: \"Moved Permanently\", code: \"MOVED_PERMANENTLY\"},\n \"302\": {label: \"Found\", code: \"FOUND\"},\n \"303\": {label: \"See Other\", code: \"SEE_OTHER\"},\n \"304\": {label: \"Not Modified\", code: \"NOT_MODIFIED\"},\n \"305\": {label: \"Use Proxy\", code: \"USE_PROXY\"},\n \"306\": {label: \"(Unused)\", code: \"UNUSED\"},\n \"307\": {label: \"Temporary Redirect\", code: \"TEMPORARY_REDIRECT\"},\n \"308\": {label: \"Permanent Redirect\", code: \"PERMANENT_REDIRECT\"},\n \"310\": {label: \"Too Many Redirects\", code: \"TOO_MANY_REDIRECTS\"},\n \"400\": {label: \"Bad Request\", code: \"BAD_REQUEST\"},\n \"401\": {label: \"Unauthorized\", code: \"UNAUTHORIZED\"},\n \"402\": {label: \"Payment Required\", code: \"PAYMENT_REQUIRED\"},\n \"403\": {label: \"Forbidden\", code: \"FORBIDDEN\"},\n \"404\": {label: \"Not Found\", code: \"NOT_FOUND\"},\n \"405\": {label: \"Method Not Allowed\", code: \"METHOD_NOT_ALLOWED\"},\n \"406\": {label: \"Not Acceptable\", code: \"NOT_ACCEPTABLE\"},\n \"407\": {\n label: \"Proxy Authentication Required\",\n code: \"PROXY_AUTHENTICATION_REQUIRED\"\n },\n \"408\": {label: \"Request Timeout\", code: \"REQUEST_TIMEOUT\"},\n \"409\": {label: \"Conflict\", code: \"CONFLICT\"},\n \"410\": {label: \"Gone\", code: \"GONE\"},\n \"411\": {label: \"Length Required\", code: \"LENGTH_REQUIRED\"},\n \"412\": {label: \"Precondition Failed\", code: \"PRECONDITION_FAILED\"},\n \"413\": {\n label: \"Request Entity Too Large\",\n code: \"REQUEST_ENTITY_TOO_LARGE\"\n },\n \"414\": {label: \"Request URI Too Long\", code: \"REQUEST_URI_TOO_LONG\"},\n \"415\": {label: \"Unsupported Media Type\", code: \"UNSUPPORTED_MEDIA_TYPE\"},\n \"416\": {\n label: \"Request Range Unsatisfiable\",\n code: \"REQUEST_RANGE_UNSATISFIABLE\"\n },\n \"417\": {label: \"Expectation Failed\", code: \"EXPECTATION_FAILED\"},\n \"418\": {label: \"I'm a Teapot\", code: \"I_M_A_TEAPOT\"},\n \"421\": {label: \"Misdirected Request\", code: \"MISDIRECTED_REQUEST\"},\n \"422\": {label: \"Unprocessable Entity\", code: \"UNPROCESSABLE_ENTITY\"},\n \"423\": {label: \"Locked\", code: \"LOCKED\"},\n \"424\": {label: \"Failed Dependency\", code: \"FAILED_DEPENDENCY\"},\n \"425\": {label: \"Too Early\", code: \"TOO_EARLY\"},\n \"426\": {label: \"Upgrade Required\", code: \"UPGRADE_REQUIRED\"},\n \"427\": {label: \"Unassigned\", code: \"UNASSIGNED\"},\n \"428\": {label: \"Precondition Required\", code: \"PRECONDITION_REQUIRED\"},\n \"429\": {label: \"Too Many Requests\", code: \"TOO_MANY_REQUESTS\"},\n \"430\": {label: \"Unassigned\", code: \"UNASSIGNED\"},\n \"431\": {\n label: \"Request Header Fields Too Large\",\n code: \"REQUEST_HEADER_FIELDS_TOO_LARGE\"\n },\n \"451\": {\n label: \"Unavailable For Legal Reasons\",\n code: \"UNAVAILABLE_FOR_LEGAL_REASONS\"\n },\n \"500\": {label: \"Internal Server Error\", code: \"INTERNAL_SERVER_ERROR\"},\n \"501\": {label: \"Not Implemented\", code: \"NOT_IMPLEMENTED\"},\n \"502\": {label: \"Bad Gateway\", code: \"BAD_GATEWAY\"},\n \"503\": {label: \"Service Unavailable\", code: \"SERVICE_UNAVAILABLE\"},\n \"504\": {label: \"Gateway Timeout\", code: \"GATEWAY_TIMEOUT\"},\n \"505\": {\n label: \"HTTP Version Not Supported\",\n code: \"HTTP_VERSION_NOT_SUPPORTED\"\n },\n \"506\": {label: \"Variant Also Negotiates\", code: \"VARIANT_ALSO_NEGOTIATES\"},\n \"507\": {label: \"Insufficient Storage\", code: \"INSUFFICIENT_STORAGE\"},\n \"508\": {label: \"Loop Detected\", code: \"LOOP_DETECTED\"},\n \"509\": {\n label: \"Bandwidth Limit Exceeded\",\n code: \"BANDWIDTH_LIMIT_EXCEEDED\"\n },\n \"510\": {label: \"Not Extended\", code: \"NOT_EXTENDED\"},\n \"511\": {\n label: \"Network Authentication Required\",\n code: \"NETWORK_AUTHENTICATION_REQUIRED\"\n }\n};\n\nexport function getStatusConstant(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.code;\n}\n\nexport function getStatusMessage(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.label;\n}\n"]}
1
+ {"version":3,"file":"httpStatusMessages.js","sourceRoot":"","sources":["../../../src/constants/httpStatusMessages.ts"],"names":[],"mappings":";;;;AAAA,qEAAgC;AAChC,6CAAyC;AAE5B,QAAA,oBAAoB,GAAG,kBAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAkD,EAAE,IAAY,EAAE,EAAE;IAC7H,MAAM,OAAO,GAAW,MAAM,CAAC,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC;IAC/C,OAAO;QACL,GAAG,GAAG;QACN,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,EAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAA,0BAAY,EAAC,OAAO,CAAC,EAAC;KAC9D,CAAC;AACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AAEP,4BAAoB,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC;AAC9C,4BAAoB,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC;AAE7C,SAAgB,iBAAiB,CAAC,MAAuB;;IACvD,OAAO,MAAC,4BAA4B,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAC;AACrD,CAAC;AAFD,8CAEC;AAED,SAAgB,gBAAgB,CAAC,MAAuB;;IACtD,OAAO,MAAC,4BAA4B,CAAC,MAAM,CAAC,0CAAE,KAAK,CAAC;AACtD,CAAC;AAFD,4CAEC","sourcesContent":["import statuses from \"statuses\";\nimport {constantCase} from \"change-case\";\n\nexport const HTTP_STATUS_MESSAGES = statuses.codes.reduce((map: Record<string, {label: string; code: string}>, code: number) => {\n const message: string = String(statuses(code));\n return {\n ...map,\n [String(code)]: {label: message, code: constantCase(message)}\n };\n}, {});\n\nHTTP_STATUS_MESSAGES[\"200\"].label = \"Success\";\nHTTP_STATUS_MESSAGES[\"200\"].code = \"SUCCESS\";\n\nexport function getStatusConstant(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.code;\n}\n\nexport function getStatusMessage(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.label;\n}\n"]}
@@ -1,99 +1,14 @@
1
- export const HTTP_STATUS_MESSAGES = {
2
- "100": { label: "Continue", code: "CONTINUE" },
3
- "101": { label: "Switching Protocols", code: "SWITCHING_PROTOCOLS" },
4
- "102": { label: "Processing", code: "PROCESSING" },
5
- "103": { label: "Early Hints", code: "EARLY_HINTS" },
6
- "200": { label: "Success", code: "SUCCESS" },
7
- "201": { label: "Created", code: "CREATED" },
8
- "202": { label: "Accepted", code: "ACCEPTED" },
9
- "203": {
10
- label: "Non-Authoritative Information",
11
- code: "NON_AUTHORITATIVE_INFORMATION"
12
- },
13
- "204": { label: "No Content", code: "NO_CONTENT" },
14
- "205": { label: "Reset Content", code: "RESET_CONTENT" },
15
- "206": { label: "Partial Content", code: "PARTIAL_CONTENT" },
16
- "207": { label: "Multi-Status", code: "MULTI_STATUS" },
17
- "208": { label: "Already Reported", code: "ALREADY_REPORTED" },
18
- "226": { label: "IM Used", code: "IM_USED" },
19
- "300": { label: "Multiple Choices", code: "MULTIPLE_CHOICES" },
20
- "301": { label: "Moved Permanently", code: "MOVED_PERMANENTLY" },
21
- "302": { label: "Found", code: "FOUND" },
22
- "303": { label: "See Other", code: "SEE_OTHER" },
23
- "304": { label: "Not Modified", code: "NOT_MODIFIED" },
24
- "305": { label: "Use Proxy", code: "USE_PROXY" },
25
- "306": { label: "(Unused)", code: "UNUSED" },
26
- "307": { label: "Temporary Redirect", code: "TEMPORARY_REDIRECT" },
27
- "308": { label: "Permanent Redirect", code: "PERMANENT_REDIRECT" },
28
- "310": { label: "Too Many Redirects", code: "TOO_MANY_REDIRECTS" },
29
- "400": { label: "Bad Request", code: "BAD_REQUEST" },
30
- "401": { label: "Unauthorized", code: "UNAUTHORIZED" },
31
- "402": { label: "Payment Required", code: "PAYMENT_REQUIRED" },
32
- "403": { label: "Forbidden", code: "FORBIDDEN" },
33
- "404": { label: "Not Found", code: "NOT_FOUND" },
34
- "405": { label: "Method Not Allowed", code: "METHOD_NOT_ALLOWED" },
35
- "406": { label: "Not Acceptable", code: "NOT_ACCEPTABLE" },
36
- "407": {
37
- label: "Proxy Authentication Required",
38
- code: "PROXY_AUTHENTICATION_REQUIRED"
39
- },
40
- "408": { label: "Request Timeout", code: "REQUEST_TIMEOUT" },
41
- "409": { label: "Conflict", code: "CONFLICT" },
42
- "410": { label: "Gone", code: "GONE" },
43
- "411": { label: "Length Required", code: "LENGTH_REQUIRED" },
44
- "412": { label: "Precondition Failed", code: "PRECONDITION_FAILED" },
45
- "413": {
46
- label: "Request Entity Too Large",
47
- code: "REQUEST_ENTITY_TOO_LARGE"
48
- },
49
- "414": { label: "Request URI Too Long", code: "REQUEST_URI_TOO_LONG" },
50
- "415": { label: "Unsupported Media Type", code: "UNSUPPORTED_MEDIA_TYPE" },
51
- "416": {
52
- label: "Request Range Unsatisfiable",
53
- code: "REQUEST_RANGE_UNSATISFIABLE"
54
- },
55
- "417": { label: "Expectation Failed", code: "EXPECTATION_FAILED" },
56
- "418": { label: "I'm a Teapot", code: "I_M_A_TEAPOT" },
57
- "421": { label: "Misdirected Request", code: "MISDIRECTED_REQUEST" },
58
- "422": { label: "Unprocessable Entity", code: "UNPROCESSABLE_ENTITY" },
59
- "423": { label: "Locked", code: "LOCKED" },
60
- "424": { label: "Failed Dependency", code: "FAILED_DEPENDENCY" },
61
- "425": { label: "Too Early", code: "TOO_EARLY" },
62
- "426": { label: "Upgrade Required", code: "UPGRADE_REQUIRED" },
63
- "427": { label: "Unassigned", code: "UNASSIGNED" },
64
- "428": { label: "Precondition Required", code: "PRECONDITION_REQUIRED" },
65
- "429": { label: "Too Many Requests", code: "TOO_MANY_REQUESTS" },
66
- "430": { label: "Unassigned", code: "UNASSIGNED" },
67
- "431": {
68
- label: "Request Header Fields Too Large",
69
- code: "REQUEST_HEADER_FIELDS_TOO_LARGE"
70
- },
71
- "451": {
72
- label: "Unavailable For Legal Reasons",
73
- code: "UNAVAILABLE_FOR_LEGAL_REASONS"
74
- },
75
- "500": { label: "Internal Server Error", code: "INTERNAL_SERVER_ERROR" },
76
- "501": { label: "Not Implemented", code: "NOT_IMPLEMENTED" },
77
- "502": { label: "Bad Gateway", code: "BAD_GATEWAY" },
78
- "503": { label: "Service Unavailable", code: "SERVICE_UNAVAILABLE" },
79
- "504": { label: "Gateway Timeout", code: "GATEWAY_TIMEOUT" },
80
- "505": {
81
- label: "HTTP Version Not Supported",
82
- code: "HTTP_VERSION_NOT_SUPPORTED"
83
- },
84
- "506": { label: "Variant Also Negotiates", code: "VARIANT_ALSO_NEGOTIATES" },
85
- "507": { label: "Insufficient Storage", code: "INSUFFICIENT_STORAGE" },
86
- "508": { label: "Loop Detected", code: "LOOP_DETECTED" },
87
- "509": {
88
- label: "Bandwidth Limit Exceeded",
89
- code: "BANDWIDTH_LIMIT_EXCEEDED"
90
- },
91
- "510": { label: "Not Extended", code: "NOT_EXTENDED" },
92
- "511": {
93
- label: "Network Authentication Required",
94
- code: "NETWORK_AUTHENTICATION_REQUIRED"
95
- }
96
- };
1
+ import statuses from "statuses";
2
+ import { constantCase } from "change-case";
3
+ export const HTTP_STATUS_MESSAGES = statuses.codes.reduce((map, code) => {
4
+ const message = String(statuses(code));
5
+ return {
6
+ ...map,
7
+ [String(code)]: { label: message, code: constantCase(message) }
8
+ };
9
+ }, {});
10
+ HTTP_STATUS_MESSAGES["200"].label = "Success";
11
+ HTTP_STATUS_MESSAGES["200"].code = "SUCCESS";
97
12
  export function getStatusConstant(status) {
98
13
  var _a;
99
14
  return (_a = HTTP_STATUS_MESSAGES[status]) === null || _a === void 0 ? void 0 : _a.code;
@@ -1 +1 @@
1
- {"version":3,"file":"httpStatusMessages.js","sourceRoot":"","sources":["../../../src/constants/httpStatusMessages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,EAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAC;IAC5C,KAAK,EAAE,EAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,qBAAqB,EAAC;IAClE,KAAK,EAAE,EAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAC;IAChD,KAAK,EAAE,EAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAC;IAClD,KAAK,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;IAC1C,KAAK,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;IAC1C,KAAK,EAAE,EAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAC;IAC5C,KAAK,EAAE;QACL,KAAK,EAAE,+BAA+B;QACtC,IAAI,EAAE,+BAA+B;KACtC;IACD,KAAK,EAAE,EAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAC;IAChD,KAAK,EAAE,EAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAC;IACtD,KAAK,EAAE,EAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAC;IAC1D,KAAK,EAAE,EAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAC;IACpD,KAAK,EAAE,EAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAC;IAC5D,KAAK,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;IAC1C,K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ACpE,KAAK,EAAE,EAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAC;IACtD,KAAK,EAAE;QACL,KAAK,EAAE,0BAA0B;QACjC,IAAI,EAAE,0BAA0B;KACjC;IACD,KAAK,EAAE,EAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAC;IACpD,KAAK,EAAE;QACL,KAAK,EAAE,iCAAiC;QACxC,IAAI,EAAE,iCAAiC;KACxC;CACF,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,MAAuB;;IACvD,OAAO,MAAC,oBAA4B,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAuB;;IACtD,OAAO,MAAC,oBAA4B,CAAC,MAAM,CAAC,0CAAE,KAAK,CAAC;AACtD,CAAC","sourcesContent":["export const HTTP_STATUS_MESSAGES = {\n \"100\": {label: \"Continue\", code: \"CONTINUE\"},\n \"101\": {label: \"Switching Protocols\", code: \"SWITCHING_PROTOCOLS\"},\n \"102\": {label: \"Processing\", code: \"PROCESSING\"},\n \"103\": {label: \"Early Hints\", code: \"EARLY_HINTS\"},\n \"200\": {label: \"Success\", code: \"SUCCESS\"},\n \"201\": {label: \"Created\", code: \"CREATED\"},\n \"202\": {label: \"Accepted\", code: \"ACCEPTED\"},\n \"203\": {\n label: \"Non-Authoritative Information\",\n code: \"NON_AUTHORITATIVE_INFORMATION\"\n },\n \"204\": {label: \"No Content\", code: \"NO_CONTENT\"},\n \"205\": {label: \"Reset Content\", code: \"RESET_CONTENT\"},\n \"206\": {label: \"Partial Content\", code: \"PARTIAL_CONTENT\"},\n \"207\": {label: \"Multi-Status\", code: \"MULTI_STATUS\"},\n \"208\": {label: \"Already Reported\", code: \"ALREADY_REPORTED\"},\n \"226\": {label: \"IM Used\", code: \"IM_USED\"},\n \"300\": {label: \"Multiple Choices\", code: \"MULTIPLE_CHOICES\"},\n \"301\": {label: \"Moved Permanently\", code: \"MOVED_PERMANENTLY\"},\n \"302\": {label: \"Found\", code: \"FOUND\"},\n \"303\": {label: \"See Other\", code: \"SEE_OTHER\"},\n \"304\": {label: \"Not Modified\", code: \"NOT_MODIFIED\"},\n \"305\": {label: \"Use Proxy\", code: \"USE_PROXY\"},\n \"306\": {label: \"(Unused)\", code: \"UNUSED\"},\n \"307\": {label: \"Temporary Redirect\", code: \"TEMPORARY_REDIRECT\"},\n \"308\": {label: \"Permanent Redirect\", code: \"PERMANENT_REDIRECT\"},\n \"310\": {label: \"Too Many Redirects\", code: \"TOO_MANY_REDIRECTS\"},\n \"400\": {label: \"Bad Request\", code: \"BAD_REQUEST\"},\n \"401\": {label: \"Unauthorized\", code: \"UNAUTHORIZED\"},\n \"402\": {label: \"Payment Required\", code: \"PAYMENT_REQUIRED\"},\n \"403\": {label: \"Forbidden\", code: \"FORBIDDEN\"},\n \"404\": {label: \"Not Found\", code: \"NOT_FOUND\"},\n \"405\": {label: \"Method Not Allowed\", code: \"METHOD_NOT_ALLOWED\"},\n \"406\": {label: \"Not Acceptable\", code: \"NOT_ACCEPTABLE\"},\n \"407\": {\n label: \"Proxy Authentication Required\",\n code: \"PROXY_AUTHENTICATION_REQUIRED\"\n },\n \"408\": {label: \"Request Timeout\", code: \"REQUEST_TIMEOUT\"},\n \"409\": {label: \"Conflict\", code: \"CONFLICT\"},\n \"410\": {label: \"Gone\", code: \"GONE\"},\n \"411\": {label: \"Length Required\", code: \"LENGTH_REQUIRED\"},\n \"412\": {label: \"Precondition Failed\", code: \"PRECONDITION_FAILED\"},\n \"413\": {\n label: \"Request Entity Too Large\",\n code: \"REQUEST_ENTITY_TOO_LARGE\"\n },\n \"414\": {label: \"Request URI Too Long\", code: \"REQUEST_URI_TOO_LONG\"},\n \"415\": {label: \"Unsupported Media Type\", code: \"UNSUPPORTED_MEDIA_TYPE\"},\n \"416\": {\n label: \"Request Range Unsatisfiable\",\n code: \"REQUEST_RANGE_UNSATISFIABLE\"\n },\n \"417\": {label: \"Expectation Failed\", code: \"EXPECTATION_FAILED\"},\n \"418\": {label: \"I'm a Teapot\", code: \"I_M_A_TEAPOT\"},\n \"421\": {label: \"Misdirected Request\", code: \"MISDIRECTED_REQUEST\"},\n \"422\": {label: \"Unprocessable Entity\", code: \"UNPROCESSABLE_ENTITY\"},\n \"423\": {label: \"Locked\", code: \"LOCKED\"},\n \"424\": {label: \"Failed Dependency\", code: \"FAILED_DEPENDENCY\"},\n \"425\": {label: \"Too Early\", code: \"TOO_EARLY\"},\n \"426\": {label: \"Upgrade Required\", code: \"UPGRADE_REQUIRED\"},\n \"427\": {label: \"Unassigned\", code: \"UNASSIGNED\"},\n \"428\": {label: \"Precondition Required\", code: \"PRECONDITION_REQUIRED\"},\n \"429\": {label: \"Too Many Requests\", code: \"TOO_MANY_REQUESTS\"},\n \"430\": {label: \"Unassigned\", code: \"UNASSIGNED\"},\n \"431\": {\n label: \"Request Header Fields Too Large\",\n code: \"REQUEST_HEADER_FIELDS_TOO_LARGE\"\n },\n \"451\": {\n label: \"Unavailable For Legal Reasons\",\n code: \"UNAVAILABLE_FOR_LEGAL_REASONS\"\n },\n \"500\": {label: \"Internal Server Error\", code: \"INTERNAL_SERVER_ERROR\"},\n \"501\": {label: \"Not Implemented\", code: \"NOT_IMPLEMENTED\"},\n \"502\": {label: \"Bad Gateway\", code: \"BAD_GATEWAY\"},\n \"503\": {label: \"Service Unavailable\", code: \"SERVICE_UNAVAILABLE\"},\n \"504\": {label: \"Gateway Timeout\", code: \"GATEWAY_TIMEOUT\"},\n \"505\": {\n label: \"HTTP Version Not Supported\",\n code: \"HTTP_VERSION_NOT_SUPPORTED\"\n },\n \"506\": {label: \"Variant Also Negotiates\", code: \"VARIANT_ALSO_NEGOTIATES\"},\n \"507\": {label: \"Insufficient Storage\", code: \"INSUFFICIENT_STORAGE\"},\n \"508\": {label: \"Loop Detected\", code: \"LOOP_DETECTED\"},\n \"509\": {\n label: \"Bandwidth Limit Exceeded\",\n code: \"BANDWIDTH_LIMIT_EXCEEDED\"\n },\n \"510\": {label: \"Not Extended\", code: \"NOT_EXTENDED\"},\n \"511\": {\n label: \"Network Authentication Required\",\n code: \"NETWORK_AUTHENTICATION_REQUIRED\"\n }\n};\n\nexport function getStatusConstant(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.code;\n}\n\nexport function getStatusMessage(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.label;\n}\n"]}
1
+ {"version":3,"file":"httpStatusMessages.js","sourceRoot":"","sources":["../../../src/constants/httpStatusMessages.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAkD,EAAE,IAAY,EAAE,EAAE;IAC7H,MAAM,OAAO,GAAW,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/C,OAAO;QACL,GAAG,GAAG;QACN,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,EAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAC;KAC9D,CAAC;AACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AAEP,oBAAoB,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC;AAC9C,oBAAoB,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC;AAE7C,MAAM,UAAU,iBAAiB,CAAC,MAAuB;;IACvD,OAAO,MAAC,oBAA4B,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAuB;;IACtD,OAAO,MAAC,oBAA4B,CAAC,MAAM,CAAC,0CAAE,KAAK,CAAC;AACtD,CAAC","sourcesContent":["import statuses from \"statuses\";\nimport {constantCase} from \"change-case\";\n\nexport const HTTP_STATUS_MESSAGES = statuses.codes.reduce((map: Record<string, {label: string; code: string}>, code: number) => {\n const message: string = String(statuses(code));\n return {\n ...map,\n [String(code)]: {label: message, code: constantCase(message)}\n };\n}, {});\n\nHTTP_STATUS_MESSAGES[\"200\"].label = \"Success\";\nHTTP_STATUS_MESSAGES[\"200\"].code = \"SUCCESS\";\n\nexport function getStatusConstant(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.code;\n}\n\nexport function getStatusMessage(status: number | string) {\n return (HTTP_STATUS_MESSAGES as any)[status]?.label;\n}\n"]}
@@ -1,269 +1,8 @@
1
1
  export declare const HTTP_STATUS_MESSAGES: {
2
- "100": {
2
+ [x: string]: {
3
3
  label: string;
4
4
  code: string;
5
- };
6
- "101": {
7
- label: string;
8
- code: string;
9
- };
10
- "102": {
11
- label: string;
12
- code: string;
13
- };
14
- "103": {
15
- label: string;
16
- code: string;
17
- };
18
- "200": {
19
- label: string;
20
- code: string;
21
- };
22
- "201": {
23
- label: string;
24
- code: string;
25
- };
26
- "202": {
27
- label: string;
28
- code: string;
29
- };
30
- "203": {
31
- label: string;
32
- code: string;
33
- };
34
- "204": {
35
- label: string;
36
- code: string;
37
- };
38
- "205": {
39
- label: string;
40
- code: string;
41
- };
42
- "206": {
43
- label: string;
44
- code: string;
45
- };
46
- "207": {
47
- label: string;
48
- code: string;
49
- };
50
- "208": {
51
- label: string;
52
- code: string;
53
- };
54
- "226": {
55
- label: string;
56
- code: string;
57
- };
58
- "300": {
59
- label: string;
60
- code: string;
61
- };
62
- "301": {
63
- label: string;
64
- code: string;
65
- };
66
- "302": {
67
- label: string;
68
- code: string;
69
- };
70
- "303": {
71
- label: string;
72
- code: string;
73
- };
74
- "304": {
75
- label: string;
76
- code: string;
77
- };
78
- "305": {
79
- label: string;
80
- code: string;
81
- };
82
- "306": {
83
- label: string;
84
- code: string;
85
- };
86
- "307": {
87
- label: string;
88
- code: string;
89
- };
90
- "308": {
91
- label: string;
92
- code: string;
93
- };
94
- "310": {
95
- label: string;
96
- code: string;
97
- };
98
- "400": {
99
- label: string;
100
- code: string;
101
- };
102
- "401": {
103
- label: string;
104
- code: string;
105
- };
106
- "402": {
107
- label: string;
108
- code: string;
109
- };
110
- "403": {
111
- label: string;
112
- code: string;
113
- };
114
- "404": {
115
- label: string;
116
- code: string;
117
- };
118
- "405": {
119
- label: string;
120
- code: string;
121
- };
122
- "406": {
123
- label: string;
124
- code: string;
125
- };
126
- "407": {
127
- label: string;
128
- code: string;
129
- };
130
- "408": {
131
- label: string;
132
- code: string;
133
- };
134
- "409": {
135
- label: string;
136
- code: string;
137
- };
138
- "410": {
139
- label: string;
140
- code: string;
141
- };
142
- "411": {
143
- label: string;
144
- code: string;
145
- };
146
- "412": {
147
- label: string;
148
- code: string;
149
- };
150
- "413": {
151
- label: string;
152
- code: string;
153
- };
154
- "414": {
155
- label: string;
156
- code: string;
157
- };
158
- "415": {
159
- label: string;
160
- code: string;
161
- };
162
- "416": {
163
- label: string;
164
- code: string;
165
- };
166
- "417": {
167
- label: string;
168
- code: string;
169
- };
170
- "418": {
171
- label: string;
172
- code: string;
173
- };
174
- "421": {
175
- label: string;
176
- code: string;
177
- };
178
- "422": {
179
- label: string;
180
- code: string;
181
- };
182
- "423": {
183
- label: string;
184
- code: string;
185
- };
186
- "424": {
187
- label: string;
188
- code: string;
189
- };
190
- "425": {
191
- label: string;
192
- code: string;
193
- };
194
- "426": {
195
- label: string;
196
- code: string;
197
- };
198
- "427": {
199
- label: string;
200
- code: string;
201
- };
202
- "428": {
203
- label: string;
204
- code: string;
205
- };
206
- "429": {
207
- label: string;
208
- code: string;
209
- };
210
- "430": {
211
- label: string;
212
- code: string;
213
- };
214
- "431": {
215
- label: string;
216
- code: string;
217
- };
218
- "451": {
219
- label: string;
220
- code: string;
221
- };
222
- "500": {
223
- label: string;
224
- code: string;
225
- };
226
- "501": {
227
- label: string;
228
- code: string;
229
- };
230
- "502": {
231
- label: string;
232
- code: string;
233
- };
234
- "503": {
235
- label: string;
236
- code: string;
237
- };
238
- "504": {
239
- label: string;
240
- code: string;
241
- };
242
- "505": {
243
- label: string;
244
- code: string;
245
- };
246
- "506": {
247
- label: string;
248
- code: string;
249
- };
250
- "507": {
251
- label: string;
252
- code: string;
253
- };
254
- "508": {
255
- label: string;
256
- code: string;
257
- };
258
- "509": {
259
- label: string;
260
- code: string;
261
- };
262
- "510": {
263
- label: string;
264
- code: string;
265
- };
266
- "511": {
5
+ } | {
267
6
  label: string;
268
7
  code: string;
269
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/schema",
3
- "version": "6.102.5",
3
+ "version": "6.102.6",
4
4
  "description": "JsonSchema module for Ts.ED Framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -29,24 +29,26 @@
29
29
  "tsed"
30
30
  ],
31
31
  "dependencies": {
32
- "@tsed/openspec": "6.102.5",
32
+ "@tsed/openspec": "6.102.6",
33
33
  "camel-case": "4.1.2",
34
34
  "json-schema": "0.4.0",
35
35
  "micromatch": "4.0.4",
36
36
  "pascal-case": "3.1.2",
37
+ "statuses": ">=2.0.1",
37
38
  "tslib": "2.2.0"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@apidevtools/swagger-parser": "10.0.2",
41
- "@tsed/core": "6.102.5",
42
- "@tsed/openspec": "6.102.5",
42
+ "@tsed/core": "6.102.6",
43
+ "@tsed/openspec": "6.102.6",
43
44
  "@types/fs-extra": "9.0.6",
44
45
  "@types/json-schema": "7.0.7",
45
46
  "@types/micromatch": "4.0.1",
47
+ "@types/statuses": "2.0.0",
46
48
  "fs-extra": "9.0.1"
47
49
  },
48
50
  "peerDependencies": {
49
- "@tsed/core": "^6.102.5"
51
+ "@tsed/core": "^6.102.6"
50
52
  },
51
53
  "repository": "https://github.com/tsedio/tsed",
52
54
  "bugs": {