@tsed/schema 6.102.4 → 6.102.8-rc.1
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/lib/cjs/constants/httpStatusMessages.js +12 -96
- package/lib/cjs/constants/httpStatusMessages.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/esm/components/anyMapper.js +4 -4
- package/lib/esm/components/classMapper.js +4 -4
- package/lib/esm/components/genericsMapper.js +4 -4
- package/lib/esm/components/index.js +11 -11
- package/lib/esm/components/inheritedClassMapper.js +2 -2
- package/lib/esm/components/itemMapper.js +1 -1
- package/lib/esm/components/lazyRefMapper.js +3 -3
- package/lib/esm/components/mapMapper.js +2 -2
- package/lib/esm/components/objectMapper.js +3 -3
- package/lib/esm/components/ofMapper.js +1 -1
- package/lib/esm/components/propertiesMapper.js +1 -1
- package/lib/esm/components/schemaMapper.js +6 -6
- package/lib/esm/constants/httpStatusMessages.js +11 -96
- package/lib/esm/constants/httpStatusMessages.js.map +1 -1
- package/lib/esm/decorators/class/children.js +1 -1
- package/lib/esm/decorators/collections/collectionContains.js +1 -1
- package/lib/esm/decorators/collections/collectionOf.js +1 -1
- package/lib/esm/decorators/collections/maxItems.js +1 -1
- package/lib/esm/decorators/collections/maxProperties.js +1 -1
- package/lib/esm/decorators/collections/minItems.js +1 -1
- package/lib/esm/decorators/collections/minProperties.js +1 -1
- package/lib/esm/decorators/collections/uniqueItems.js +1 -1
- package/lib/esm/decorators/common/additionalProperties.js +1 -1
- package/lib/esm/decorators/common/allOf.js +1 -1
- package/lib/esm/decorators/common/allow.js +2 -2
- package/lib/esm/decorators/common/any.js +1 -1
- package/lib/esm/decorators/common/anyOf.js +1 -1
- package/lib/esm/decorators/common/const.js +1 -1
- package/lib/esm/decorators/common/customKey.js +1 -1
- package/lib/esm/decorators/common/default.js +1 -1
- package/lib/esm/decorators/common/description.js +1 -1
- package/lib/esm/decorators/common/enum.js +1 -1
- package/lib/esm/decorators/common/example.js +1 -1
- package/lib/esm/decorators/common/examples.js +1 -1
- package/lib/esm/decorators/common/exclusiveMaximum.js +1 -1
- package/lib/esm/decorators/common/exclusiveMinimum.js +1 -1
- package/lib/esm/decorators/common/format.js +2 -2
- package/lib/esm/decorators/common/forwardGroups.js +1 -1
- package/lib/esm/decorators/common/groups.js +2 -2
- package/lib/esm/decorators/common/ignore.js +1 -1
- package/lib/esm/decorators/common/integer.js +1 -1
- package/lib/esm/decorators/common/jsonEntityFn.js +1 -1
- package/lib/esm/decorators/common/maxLength.js +1 -1
- package/lib/esm/decorators/common/maximum.js +1 -1
- package/lib/esm/decorators/common/minLength.js +1 -1
- package/lib/esm/decorators/common/minimum.js +1 -1
- package/lib/esm/decorators/common/multipleOf.js +1 -1
- package/lib/esm/decorators/common/name.js +1 -1
- package/lib/esm/decorators/common/nullable.js +2 -2
- package/lib/esm/decorators/common/oneOf.js +1 -1
- package/lib/esm/decorators/common/optional.js +1 -1
- package/lib/esm/decorators/common/pattern.js +1 -1
- package/lib/esm/decorators/common/property.js +1 -1
- package/lib/esm/decorators/common/readOnly.js +1 -1
- package/lib/esm/decorators/common/required.js +2 -2
- package/lib/esm/decorators/common/requiredGroups.js +2 -2
- package/lib/esm/decorators/common/schema.js +1 -1
- package/lib/esm/decorators/common/title.js +1 -1
- package/lib/esm/decorators/common/writeOnly.js +1 -1
- package/lib/esm/decorators/config/jsonEntityComponent.js +1 -1
- package/lib/esm/decorators/generics/genericOf.js +2 -2
- package/lib/esm/decorators/generics/generics.js +1 -1
- package/lib/esm/decorators/index.js +70 -70
- package/lib/esm/decorators/operations/acceptMime.js +1 -1
- package/lib/esm/decorators/operations/consumes.js +1 -1
- package/lib/esm/decorators/operations/contentType.js +1 -1
- package/lib/esm/decorators/operations/deprecated.js +1 -1
- package/lib/esm/decorators/operations/header.js +1 -1
- package/lib/esm/decorators/operations/in.js +1 -1
- package/lib/esm/decorators/operations/inFile.js +5 -5
- package/lib/esm/decorators/operations/location.js +1 -1
- package/lib/esm/decorators/operations/operationId.js +1 -1
- package/lib/esm/decorators/operations/operationPath.js +1 -1
- package/lib/esm/decorators/operations/partial.js +1 -1
- package/lib/esm/decorators/operations/path.js +1 -1
- package/lib/esm/decorators/operations/produces.js +1 -1
- package/lib/esm/decorators/operations/redirect.js +2 -2
- package/lib/esm/decorators/operations/returns.js +8 -8
- package/lib/esm/decorators/operations/route.js +3 -3
- package/lib/esm/decorators/operations/security.js +1 -1
- package/lib/esm/decorators/operations/status.js +1 -1
- package/lib/esm/decorators/operations/summary.js +1 -1
- package/lib/esm/decorators/operations/tags.js +1 -1
- package/lib/esm/domain/DecoratorContext.js +1 -1
- package/lib/esm/domain/JsonClassStore.js +3 -3
- package/lib/esm/domain/JsonLazyRef.js +2 -2
- package/lib/esm/domain/JsonMap.js +1 -1
- package/lib/esm/domain/JsonMethodStore.js +4 -4
- package/lib/esm/domain/JsonOperation.js +8 -8
- package/lib/esm/domain/JsonOperationPathsMap.js +1 -1
- package/lib/esm/domain/JsonOperationRoute.js +1 -1
- package/lib/esm/domain/JsonParameter.js +6 -6
- package/lib/esm/domain/JsonParameterStore.js +4 -4
- package/lib/esm/domain/JsonPropertyStore.js +3 -3
- package/lib/esm/domain/JsonRequestBody.js +2 -2
- package/lib/esm/domain/JsonResponse.js +4 -4
- package/lib/esm/domain/JsonSchema.js +6 -6
- package/lib/esm/domain/index.js +16 -16
- package/lib/esm/index.js +20 -20
- package/lib/esm/interfaces/index.js +4 -4
- package/lib/esm/package.json +3 -0
- package/lib/esm/utils/from.js +4 -4
- package/lib/esm/utils/getInheritedStores.js +1 -1
- package/lib/esm/utils/getJsonEntityStore.js +5 -5
- package/lib/esm/utils/getJsonSchema.js +4 -4
- package/lib/esm/utils/getOperationsRoutes.js +3 -3
- package/lib/esm/utils/getOperationsStores.js +4 -4
- package/lib/esm/utils/getPropertiesStores.js +3 -3
- package/lib/esm/utils/getRequiredProperties.js +1 -1
- package/lib/esm/utils/getSpec.js +6 -6
- package/lib/esm/utils/mapNullableType.js +1 -1
- package/lib/esm/utils/mapRouteOptions.js +1 -1
- package/lib/esm/utils/mergeOperation.js +3 -3
- package/lib/esm/utils/ref.js +1 -1
- package/lib/esm/utils/toJsonMapCollection.js +1 -1
- package/lib/types/constants/httpStatusMessages.d.ts +2 -263
- package/package.json +16 -5
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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":"
|
|
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,7 +1,7 @@
|
|
|
1
|
-
import { JsonLazyRef } from "../domain/JsonLazyRef";
|
|
2
|
-
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
3
|
-
import { mapGenericsOptions } from "../utils/generics";
|
|
4
|
-
import { toRef } from "../utils/ref";
|
|
1
|
+
import { JsonLazyRef } from "../domain/JsonLazyRef.js";
|
|
2
|
+
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
3
|
+
import { mapGenericsOptions } from "../utils/generics.js";
|
|
4
|
+
import { toRef } from "../utils/ref.js";
|
|
5
5
|
export function anyMapper(input, options = {}) {
|
|
6
6
|
if (typeof input !== "object" || input === null) {
|
|
7
7
|
return input;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { JsonEntityStore } from "../domain/JsonEntityStore";
|
|
2
|
-
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
3
|
-
import { mapGenericsOptions, popGenerics } from "../utils/generics";
|
|
4
|
-
import { createRef, createRefName } from "../utils/ref";
|
|
1
|
+
import { JsonEntityStore } from "../domain/JsonEntityStore.js";
|
|
2
|
+
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
3
|
+
import { mapGenericsOptions, popGenerics } from "../utils/generics.js";
|
|
4
|
+
import { createRef, createRefName } from "../utils/ref.js";
|
|
5
5
|
export function classMapper(value, options) {
|
|
6
6
|
const store = JsonEntityStore.from(value.class);
|
|
7
7
|
const name = createRefName(store.schema.getName() || value.getName(), options);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isClass, isPrimitiveClass } from "@tsed/core";
|
|
2
|
-
import { JsonEntityStore } from "../domain/JsonEntityStore";
|
|
3
|
-
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
4
|
-
import { popGenerics } from "../utils/generics";
|
|
5
|
-
import { getJsonType } from "../utils/getJsonType";
|
|
2
|
+
import { JsonEntityStore } from "../domain/JsonEntityStore.js";
|
|
3
|
+
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
4
|
+
import { popGenerics } from "../utils/generics.js";
|
|
5
|
+
import { getJsonType } from "../utils/getJsonType.js";
|
|
6
6
|
/**
|
|
7
7
|
* @ignore
|
|
8
8
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from "./anyMapper";
|
|
2
|
-
export * from "./classMapper";
|
|
3
|
-
export * from "./genericsMapper";
|
|
4
|
-
export * from "./inheritedClassMapper";
|
|
5
|
-
export * from "./itemMapper";
|
|
6
|
-
export * from "./lazyRefMapper";
|
|
7
|
-
export * from "./mapMapper";
|
|
8
|
-
export * from "./objectMapper";
|
|
9
|
-
export * from "./schemaMapper";
|
|
10
|
-
export * from "./ofMapper";
|
|
11
|
-
export * from "./propertiesMapper";
|
|
1
|
+
export * from "./anyMapper.js";
|
|
2
|
+
export * from "./classMapper.js";
|
|
3
|
+
export * from "./genericsMapper.js";
|
|
4
|
+
export * from "./inheritedClassMapper.js";
|
|
5
|
+
export * from "./itemMapper.js";
|
|
6
|
+
export * from "./lazyRefMapper.js";
|
|
7
|
+
export * from "./mapMapper.js";
|
|
8
|
+
export * from "./objectMapper.js";
|
|
9
|
+
export * from "./schemaMapper.js";
|
|
10
|
+
export * from "./ofMapper.js";
|
|
11
|
+
export * from "./propertiesMapper.js";
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { classOf, deepMerge } from "@tsed/core";
|
|
2
|
-
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
3
|
-
import { getInheritedStores } from "../utils/getInheritedStores";
|
|
2
|
+
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
3
|
+
import { getInheritedStores } from "../utils/getInheritedStores.js";
|
|
4
4
|
/**
|
|
5
5
|
* @ignore
|
|
6
6
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
1
|
+
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
2
2
|
export function itemMapper(value, options) {
|
|
3
3
|
return value && value.isClass ? execMapper("class", value, options) : execMapper("any", value, options);
|
|
4
4
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
2
|
-
import { mapGenericsOptions } from "../utils/generics";
|
|
3
|
-
import { createRef, toRef } from "../utils/ref";
|
|
1
|
+
import { registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
2
|
+
import { mapGenericsOptions } from "../utils/generics.js";
|
|
3
|
+
import { createRef, toRef } from "../utils/ref.js";
|
|
4
4
|
export function lazyRefMapper(input, options) {
|
|
5
5
|
var _a;
|
|
6
6
|
const name = input.name;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mapGenericsOptions } from "../utils/generics";
|
|
2
|
-
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
1
|
+
import { mapGenericsOptions } from "../utils/generics.js";
|
|
2
|
+
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
3
3
|
/**
|
|
4
4
|
* Serialize class which inherit from Map like JsonMap, JsonOperation, JsonParameter.
|
|
5
5
|
* @param input
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isArray } from "@tsed/core";
|
|
2
|
-
import { alterIgnore } from "../hooks/alterIgnore";
|
|
3
|
-
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
4
|
-
import { mapNullableType } from "../utils/mapNullableType";
|
|
2
|
+
import { alterIgnore } from "../hooks/alterIgnore.js";
|
|
3
|
+
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
4
|
+
import { mapNullableType } from "../utils/mapNullableType.js";
|
|
5
5
|
/**
|
|
6
6
|
* Serialize Any object to a json schema
|
|
7
7
|
* @param input
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
1
|
+
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
2
2
|
export function ofMapper(input, options, parent) {
|
|
3
3
|
return input.map((value) => {
|
|
4
4
|
return execMapper("item", value, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
1
|
+
import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
2
2
|
export function propertiesMapper(input, options, parent) {
|
|
3
3
|
if (input.isClass) {
|
|
4
4
|
return execMapper("class", input, options);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isObject } from "@tsed/core";
|
|
2
|
-
import { mapAliasedProperties } from "../domain/JsonAliasMap";
|
|
3
|
-
import { SpecTypes } from "../domain/SpecTypes";
|
|
4
|
-
import { execMapper, hasMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
|
|
5
|
-
import { getRequiredProperties } from "../utils/getRequiredProperties";
|
|
6
|
-
import { alterOneOf } from "../hooks/alterOneOf";
|
|
7
|
-
import { mapNullableType } from "../utils/mapNullableType";
|
|
2
|
+
import { mapAliasedProperties } from "../domain/JsonAliasMap.js";
|
|
3
|
+
import { SpecTypes } from "../domain/SpecTypes.js";
|
|
4
|
+
import { execMapper, hasMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
|
|
5
|
+
import { getRequiredProperties } from "../utils/getRequiredProperties.js";
|
|
6
|
+
import { alterOneOf } from "../hooks/alterOneOf.js";
|
|
7
|
+
import { mapNullableType } from "../utils/mapNullableType.js";
|
|
8
8
|
/**
|
|
9
9
|
* @ignore
|
|
10
10
|
*/
|
|
@@ -1,99 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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,
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { JsonEntityFn } from "../common/jsonEntityFn";
|
|
1
|
+
import { JsonEntityFn } from "../common/jsonEntityFn.js";
|
|
2
2
|
/**
|
|
3
3
|
* If this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique.
|
|
4
4
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DecoratorTypes, isClass, useDecorators } from "@tsed/core";
|
|
2
|
-
import { JsonEntityFn } from "./jsonEntityFn";
|
|
3
|
-
import { Property } from "./property";
|
|
2
|
+
import { JsonEntityFn } from "./jsonEntityFn.js";
|
|
3
|
+
import { Property } from "./property.js";
|
|
4
4
|
/**
|
|
5
5
|
* Add allowed values when the property or parameters is required.
|
|
6
6
|
*
|