@tsed/schema 7.79.4 → 7.80.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/browser/schema.umd.min.js.map +1 -1
- package/lib/cjs/components/default/inlineEnumsMapper.js +2 -2
- package/lib/cjs/components/default/inlineEnumsMapper.js.map +1 -1
- package/lib/cjs/components/default/nullableMapper.js +4 -4
- package/lib/cjs/components/default/nullableMapper.js.map +1 -1
- package/lib/cjs/components/default/requiredMapper.js +4 -4
- package/lib/cjs/components/default/requiredMapper.js.map +1 -1
- package/lib/cjs/components/open-spec/nullableMapper.js +4 -4
- package/lib/cjs/components/open-spec/nullableMapper.js.map +1 -1
- package/lib/cjs/utils/generateSpec.js +1 -24
- package/lib/cjs/utils/generateSpec.js.map +1 -1
- package/lib/esm/components/default/inlineEnumsMapper.js.map +1 -1
- package/lib/esm/components/default/nullableMapper.js.map +1 -1
- package/lib/esm/components/default/requiredMapper.js.map +1 -1
- package/lib/esm/components/open-spec/nullableMapper.js.map +1 -1
- package/lib/esm/utils/getJsonSchema.js +1 -1
- package/lib/types/components/default/inlineEnumsMapper.d.ts +2 -2
- package/lib/types/components/default/nullableMapper.d.ts +1 -1
- package/lib/types/components/default/requiredMapper.d.ts +2 -2
- package/lib/types/components/open-spec/nullableMapper.d.ts +1 -1
- package/lib/types-esm/components/async-api/channelsMapper.d.ts +2 -0
- package/lib/types-esm/components/async-api/generate.d.ts +1 -0
- package/lib/types-esm/components/async-api/messageMapper.d.ts +6 -0
- package/lib/types-esm/components/async-api/payloadMapper.d.ts +4 -0
- package/lib/types-esm/components/async-api/responseMapper.d.ts +6 -0
- package/lib/types-esm/components/default/anyMapper.d.ts +2 -0
- package/lib/types-esm/components/default/classMapper.d.ts +3 -0
- package/lib/types-esm/components/default/genericsMapper.d.ts +5 -0
- package/lib/types-esm/components/default/inheritedClassMapper.d.ts +5 -0
- package/lib/types-esm/components/default/inlineEnumsMapper.d.ts +3 -0
- package/lib/types-esm/components/default/itemMapper.d.ts +2 -0
- package/lib/types-esm/components/default/lazyRefMapper.d.ts +3 -0
- package/lib/types-esm/components/default/mapMapper.d.ts +9 -0
- package/lib/types-esm/components/default/nullableMapper.d.ts +2 -0
- package/lib/types-esm/components/default/objectMapper.d.ts +8 -0
- package/lib/types-esm/components/default/ofMapper.d.ts +3 -0
- package/lib/types-esm/components/default/propertiesMapper.d.ts +3 -0
- package/lib/types-esm/components/default/requiredMapper.d.ts +3 -0
- package/lib/types-esm/components/default/schemaMapper.d.ts +3 -0
- package/lib/types-esm/components/index.d.ts +33 -0
- package/lib/types-esm/components/open-spec/generate.d.ts +1 -0
- package/lib/types-esm/components/open-spec/nullableMapper.d.ts +2 -0
- package/lib/types-esm/components/open-spec/operationInFilesMapper.d.ts +2 -0
- package/lib/types-esm/components/open-spec/operationInParameterMapper.d.ts +10 -0
- package/lib/types-esm/components/open-spec/operationInParametersMapper.d.ts +3 -0
- package/lib/types-esm/components/open-spec/operationInQueryMapper.d.ts +2 -0
- package/lib/types-esm/components/open-spec/operationMapper.d.ts +3 -0
- package/lib/types-esm/components/open-spec/operationMediaMapper.d.ts +3 -0
- package/lib/types-esm/components/open-spec/operationRequestBodyMapper.d.ts +3 -0
- package/lib/types-esm/components/open-spec/operationResponseMapper.d.ts +3 -0
- package/lib/types-esm/components/open-spec/pathsMapper.d.ts +2 -0
- package/lib/types-esm/constants/OperationVerbs.d.ts +20 -0
- package/lib/types-esm/constants/httpStatusMessages.d.ts +11 -0
- package/lib/types-esm/constants/jsonSchemaProperties.d.ts +7 -0
- package/lib/types-esm/decorators/class/children.d.ts +11 -0
- package/lib/types-esm/decorators/class/discriminatorValue.d.ts +42 -0
- package/lib/types-esm/decorators/collections/collectionContains.d.ts +21 -0
- package/lib/types-esm/decorators/collections/collectionOf.d.ts +101 -0
- package/lib/types-esm/decorators/collections/maxItems.d.ts +48 -0
- package/lib/types-esm/decorators/collections/maxProperties.d.ts +71 -0
- package/lib/types-esm/decorators/collections/minItems.d.ts +52 -0
- package/lib/types-esm/decorators/collections/minProperties.d.ts +70 -0
- package/lib/types-esm/decorators/collections/uniqueItems.d.ts +51 -0
- package/lib/types-esm/decorators/common/additionalProperties.d.ts +11 -0
- package/lib/types-esm/decorators/common/allOf.d.ts +13 -0
- package/lib/types-esm/decorators/common/allow.d.ts +28 -0
- package/lib/types-esm/decorators/common/any.d.ts +38 -0
- package/lib/types-esm/decorators/common/anyOf.d.ts +17 -0
- package/lib/types-esm/decorators/common/const.d.ts +61 -0
- package/lib/types-esm/decorators/common/customKey.d.ts +26 -0
- package/lib/types-esm/decorators/common/default.d.ts +41 -0
- package/lib/types-esm/decorators/common/defaultMsg.d.ts +32 -0
- package/lib/types-esm/decorators/common/description.d.ts +53 -0
- package/lib/types-esm/decorators/common/discriminatorKey.d.ts +1 -0
- package/lib/types-esm/decorators/common/enum.d.ts +101 -0
- package/lib/types-esm/decorators/common/errorMsg.d.ts +6 -0
- package/lib/types-esm/decorators/common/example.d.ts +11 -0
- package/lib/types-esm/decorators/common/examples.d.ts +12 -0
- package/lib/types-esm/decorators/common/exclusiveMaximum.d.ts +70 -0
- package/lib/types-esm/decorators/common/exclusiveMinimum.d.ts +70 -0
- package/lib/types-esm/decorators/common/format.d.ts +466 -0
- package/lib/types-esm/decorators/common/forwardGroups.d.ts +10 -0
- package/lib/types-esm/decorators/common/groups.d.ts +12 -0
- package/lib/types-esm/decorators/common/hidden.d.ts +32 -0
- package/lib/types-esm/decorators/common/ignore.d.ts +59 -0
- package/lib/types-esm/decorators/common/integer.d.ts +61 -0
- package/lib/types-esm/decorators/common/jsonEntityFn.d.ts +21 -0
- package/lib/types-esm/decorators/common/maxLength.d.ts +77 -0
- package/lib/types-esm/decorators/common/maximum.d.ts +139 -0
- package/lib/types-esm/decorators/common/minLength.d.ts +78 -0
- package/lib/types-esm/decorators/common/minimum.d.ts +137 -0
- package/lib/types-esm/decorators/common/multipleOf.d.ts +69 -0
- package/lib/types-esm/decorators/common/name.d.ts +32 -0
- package/lib/types-esm/decorators/common/nullable.d.ts +25 -0
- package/lib/types-esm/decorators/common/oneOf.d.ts +17 -0
- package/lib/types-esm/decorators/common/optional.d.ts +10 -0
- package/lib/types-esm/decorators/common/pattern.d.ts +94 -0
- package/lib/types-esm/decorators/common/property.d.ts +11 -0
- package/lib/types-esm/decorators/common/readOnly.d.ts +11 -0
- package/lib/types-esm/decorators/common/recordOf.d.ts +46 -0
- package/lib/types-esm/decorators/common/required.d.ts +44 -0
- package/lib/types-esm/decorators/common/requiredGroups.d.ts +10 -0
- package/lib/types-esm/decorators/common/schema.d.ts +53 -0
- package/lib/types-esm/decorators/common/title.d.ts +39 -0
- package/lib/types-esm/decorators/common/typeError.d.ts +8 -0
- package/lib/types-esm/decorators/common/writeOnly.d.ts +11 -0
- package/lib/types-esm/decorators/config/jsonEntityComponent.d.ts +10 -0
- package/lib/types-esm/decorators/generics/genericOf.d.ts +76 -0
- package/lib/types-esm/decorators/generics/generics.d.ts +14 -0
- package/lib/types-esm/decorators/operations/acceptMime.d.ts +19 -0
- package/lib/types-esm/decorators/operations/consumes.d.ts +19 -0
- package/lib/types-esm/decorators/operations/contentType.d.ts +20 -0
- package/lib/types-esm/decorators/operations/deprecated.d.ts +23 -0
- package/lib/types-esm/decorators/operations/header.d.ts +49 -0
- package/lib/types-esm/decorators/operations/in.d.ts +64 -0
- package/lib/types-esm/decorators/operations/inFile.d.ts +25 -0
- package/lib/types-esm/decorators/operations/location.d.ts +22 -0
- package/lib/types-esm/decorators/operations/operation.d.ts +60 -0
- package/lib/types-esm/decorators/operations/operationId.d.ts +10 -0
- package/lib/types-esm/decorators/operations/operationPath.d.ts +21 -0
- package/lib/types-esm/decorators/operations/partial.d.ts +10 -0
- package/lib/types-esm/decorators/operations/path.d.ts +15 -0
- package/lib/types-esm/decorators/operations/produces.d.ts +26 -0
- package/lib/types-esm/decorators/operations/publish.d.ts +1 -0
- package/lib/types-esm/decorators/operations/redirect.d.ts +52 -0
- package/lib/types-esm/decorators/operations/returns.d.ts +267 -0
- package/lib/types-esm/decorators/operations/route.d.ts +133 -0
- package/lib/types-esm/decorators/operations/security.d.ts +23 -0
- package/lib/types-esm/decorators/operations/status.d.ts +127 -0
- package/lib/types-esm/decorators/operations/subscribe.d.ts +1 -0
- package/lib/types-esm/decorators/operations/summary.d.ts +20 -0
- package/lib/types-esm/decorators/operations/tags.d.ts +23 -0
- package/lib/types-esm/decorators/operations/view.d.ts +23 -0
- package/lib/types-esm/domain/DecoratorContext.d.ts +28 -0
- package/lib/types-esm/domain/JsonAliasMap.d.ts +12 -0
- package/lib/types-esm/domain/JsonClassStore.d.ts +12 -0
- package/lib/types-esm/domain/JsonDiscriminator.d.ts +18 -0
- package/lib/types-esm/domain/JsonEntityStore.d.ts +110 -0
- package/lib/types-esm/domain/JsonFormatTypes.d.ts +17 -0
- package/lib/types-esm/domain/JsonLazyRef.d.ts +9 -0
- package/lib/types-esm/domain/JsonMap.d.ts +9 -0
- package/lib/types-esm/domain/JsonMedia.d.ts +11 -0
- package/lib/types-esm/domain/JsonMethodStore.d.ts +92 -0
- package/lib/types-esm/domain/JsonOperation.d.ts +51 -0
- package/lib/types-esm/domain/JsonOperationPathsMap.d.ts +7 -0
- package/lib/types-esm/domain/JsonOperationRoute.d.ts +25 -0
- package/lib/types-esm/domain/JsonParameter.d.ts +22 -0
- package/lib/types-esm/domain/JsonParameterStore.d.ts +52 -0
- package/lib/types-esm/domain/JsonParameterTypes.d.ts +16 -0
- package/lib/types-esm/domain/JsonPropertyStore.d.ts +32 -0
- package/lib/types-esm/domain/JsonRequestBody.d.ts +12 -0
- package/lib/types-esm/domain/JsonResponse.d.ts +18 -0
- package/lib/types-esm/domain/JsonSchema.d.ts +340 -0
- package/lib/types-esm/domain/SpecTypes.d.ts +6 -0
- package/lib/types-esm/hooks/alterIgnore.d.ts +10 -0
- package/lib/types-esm/hooks/alterOneOf.d.ts +3 -0
- package/lib/types-esm/hooks/alterRequiredGroups.d.ts +6 -0
- package/lib/types-esm/index.d.ts +182 -0
- package/lib/types-esm/interfaces/IgnoreCallback.d.ts +4 -0
- package/lib/types-esm/interfaces/JsonHookContext.d.ts +17 -0
- package/lib/types-esm/interfaces/JsonOpenSpec.d.ts +9 -0
- package/lib/types-esm/interfaces/JsonSchemaOptions.d.ts +30 -0
- package/lib/types-esm/registries/JsonSchemaMapperContainer.d.ts +21 -0
- package/lib/types-esm/registries/enumRegistries.d.ts +2 -0
- package/lib/types-esm/utils/buildPath.d.ts +6 -0
- package/lib/types-esm/utils/concatParameters.d.ts +4 -0
- package/lib/types-esm/utils/concatPath.d.ts +1 -0
- package/lib/types-esm/utils/defineStatusModel.d.ts +3 -0
- package/lib/types-esm/utils/from.d.ts +190 -0
- package/lib/types-esm/utils/generateSpec.d.ts +16 -0
- package/lib/types-esm/utils/generics.d.ts +50 -0
- package/lib/types-esm/utils/getComputedType.d.ts +5 -0
- package/lib/types-esm/utils/getInheritedStores.d.ts +8 -0
- package/lib/types-esm/utils/getJsonEntityStore.d.ts +15 -0
- package/lib/types-esm/utils/getJsonPathParameters.d.ts +7 -0
- package/lib/types-esm/utils/getJsonSchema.d.ts +4 -0
- package/lib/types-esm/utils/getJsonType.d.ts +5 -0
- package/lib/types-esm/utils/getOperationsRoutes.d.ts +10 -0
- package/lib/types-esm/utils/getOperationsStores.d.ts +6 -0
- package/lib/types-esm/utils/getPropertiesStores.d.ts +20 -0
- package/lib/types-esm/utils/getSpec.d.ts +34 -0
- package/lib/types-esm/utils/getSpecType.d.ts +12 -0
- package/lib/types-esm/utils/isSuccessStatus.d.ts +2 -0
- package/lib/types-esm/utils/mapHeaders.d.ts +9 -0
- package/lib/types-esm/utils/mapOpenSpec.d.ts +10 -0
- package/lib/types-esm/utils/mapOpenSpec2.d.ts +9 -0
- package/lib/types-esm/utils/mapOpenSpec3.d.ts +8 -0
- package/lib/types-esm/utils/mapOpenSpecInfo.d.ts +6 -0
- package/lib/types-esm/utils/mapOperationOptions.d.ts +5 -0
- package/lib/types-esm/utils/matchGroups.d.ts +4 -0
- package/lib/types-esm/utils/mergeSpec.d.ts +23 -0
- package/lib/types-esm/utils/operationIdFormatter.d.ts +6 -0
- package/lib/types-esm/utils/ref.d.ts +14 -0
- package/lib/types-esm/utils/removeHiddenOperation.d.ts +2 -0
- package/lib/types-esm/utils/serializeEnumValues.d.ts +5 -0
- package/lib/types-esm/utils/somethingOf.d.ts +1 -0
- package/lib/types-esm/utils/toJsonMapCollection.d.ts +7 -0
- package/lib/types-esm/utils/toJsonRegex.d.ts +5 -0
- package/lib/types-esm/utils/transformToOS2.d.ts +25 -0
- package/lib/types-esm/utils/withErrorMsg.d.ts +6 -0
- package/package.json +21 -17
- package/vitest.config.mts +21 -0
- package/jest.config.js +0 -21
- package/lib/cjs/package.json +0 -3
- package/lib/esm/package.json +0 -3
- package/tsconfig.esm.json +0 -36
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { JsonSchema } from "../domain/JsonSchema.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create a new model from the given type.
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* from(String)
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
11
|
+
*
|
|
12
|
+
* @schemaFunctional
|
|
13
|
+
*/
|
|
14
|
+
export declare function from(type?: Type<any>): JsonSchema;
|
|
15
|
+
/**
|
|
16
|
+
* Declare a new number model.
|
|
17
|
+
*
|
|
18
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
19
|
+
*
|
|
20
|
+
* @schemaFunctional
|
|
21
|
+
*/
|
|
22
|
+
export declare function number(): JsonSchema;
|
|
23
|
+
/**
|
|
24
|
+
* Declare a new integer model.
|
|
25
|
+
*
|
|
26
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
27
|
+
*
|
|
28
|
+
* @schemaFunctional
|
|
29
|
+
*/
|
|
30
|
+
export declare function integer(): JsonSchema;
|
|
31
|
+
/**
|
|
32
|
+
* Declare a new string model.
|
|
33
|
+
*
|
|
34
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
35
|
+
*
|
|
36
|
+
* @schemaFunctional
|
|
37
|
+
*/
|
|
38
|
+
export declare function string(): JsonSchema;
|
|
39
|
+
/**
|
|
40
|
+
* Declare a new boolean model.
|
|
41
|
+
*
|
|
42
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
43
|
+
*
|
|
44
|
+
* @schemaFunctional
|
|
45
|
+
*/
|
|
46
|
+
export declare function boolean(): JsonSchema;
|
|
47
|
+
/**
|
|
48
|
+
* Declare a new string model with `format: date`.
|
|
49
|
+
*
|
|
50
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
51
|
+
*
|
|
52
|
+
* @schemaFunctional
|
|
53
|
+
*/
|
|
54
|
+
export declare function date(): JsonSchema;
|
|
55
|
+
/**
|
|
56
|
+
* Declare a new string model with `format: datetime`.
|
|
57
|
+
*
|
|
58
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
59
|
+
*
|
|
60
|
+
* @schemaFunctional
|
|
61
|
+
*/
|
|
62
|
+
export declare function datetime(): JsonSchema;
|
|
63
|
+
/**
|
|
64
|
+
* Declare a new string model with `format: time`.
|
|
65
|
+
*
|
|
66
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
67
|
+
*
|
|
68
|
+
* @schemaFunctional
|
|
69
|
+
*/
|
|
70
|
+
export declare function time(): JsonSchema;
|
|
71
|
+
/**
|
|
72
|
+
* Declare a new string model with `format: email`.
|
|
73
|
+
*
|
|
74
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
75
|
+
*
|
|
76
|
+
* @schemaFunctional
|
|
77
|
+
*/
|
|
78
|
+
export declare function email(): JsonSchema;
|
|
79
|
+
/**
|
|
80
|
+
* Declare a new string model with `format: uri`.
|
|
81
|
+
*
|
|
82
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
83
|
+
*
|
|
84
|
+
* @schemaFunctional
|
|
85
|
+
*/
|
|
86
|
+
export declare function uri(): JsonSchema;
|
|
87
|
+
/**
|
|
88
|
+
* Declare a new string model with `format: url`.
|
|
89
|
+
*
|
|
90
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
91
|
+
*
|
|
92
|
+
* @schemaFunctional
|
|
93
|
+
*/
|
|
94
|
+
export declare function url(): JsonSchema;
|
|
95
|
+
/**
|
|
96
|
+
* Declare a new object model with `additionalProperties: true`.
|
|
97
|
+
*
|
|
98
|
+
* ```json
|
|
99
|
+
* {
|
|
100
|
+
* "type": "array"
|
|
101
|
+
* }
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
105
|
+
*
|
|
106
|
+
* @schemaFunctional
|
|
107
|
+
*/
|
|
108
|
+
export declare function array(): JsonSchema;
|
|
109
|
+
/**
|
|
110
|
+
* Declare a new object model with `additionalProperties: true`.
|
|
111
|
+
*
|
|
112
|
+
* ```json
|
|
113
|
+
* {
|
|
114
|
+
* "type": "object",
|
|
115
|
+
* "additionalProperties": true
|
|
116
|
+
* }
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
120
|
+
*
|
|
121
|
+
* @schemaFunctional
|
|
122
|
+
*/
|
|
123
|
+
export declare function map(): JsonSchema;
|
|
124
|
+
/**
|
|
125
|
+
* Declare a new array model with `uniqueItems: true`.
|
|
126
|
+
*
|
|
127
|
+
* ```json
|
|
128
|
+
* {
|
|
129
|
+
* "type": "array",
|
|
130
|
+
* "uniqueItems": true
|
|
131
|
+
* }
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
135
|
+
*
|
|
136
|
+
* @schemaFunctional
|
|
137
|
+
*/
|
|
138
|
+
export declare function set(): JsonSchema;
|
|
139
|
+
/**
|
|
140
|
+
* Declare a new object model.
|
|
141
|
+
*
|
|
142
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
143
|
+
*
|
|
144
|
+
* @schemaFunctional
|
|
145
|
+
*/
|
|
146
|
+
export declare function object(properties?: {
|
|
147
|
+
[key: string]: JsonSchema;
|
|
148
|
+
}): JsonSchema;
|
|
149
|
+
/**
|
|
150
|
+
* Declare a model with any type (By default: `integer`, `number`, `string`, `boolean`, `array`, `object`, `null`)
|
|
151
|
+
*
|
|
152
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
153
|
+
*
|
|
154
|
+
* @schemaFunctional
|
|
155
|
+
*/
|
|
156
|
+
export declare function any(...types: any[]): JsonSchema;
|
|
157
|
+
/**
|
|
158
|
+
* See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
|
|
159
|
+
*
|
|
160
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
161
|
+
*
|
|
162
|
+
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
|
|
163
|
+
* @schemaFunctional
|
|
164
|
+
*/
|
|
165
|
+
export declare function anyOf(...anyOf: any[]): JsonSchema;
|
|
166
|
+
/**
|
|
167
|
+
* See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
|
|
168
|
+
*
|
|
169
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
170
|
+
*
|
|
171
|
+
* @schemaFunctional
|
|
172
|
+
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
|
|
173
|
+
*/
|
|
174
|
+
export declare function oneOf(...oneOf: any[]): JsonSchema;
|
|
175
|
+
/**
|
|
176
|
+
* See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26
|
|
177
|
+
*
|
|
178
|
+
* * See @@JsonSchema@@ to discover available methods.
|
|
179
|
+
*
|
|
180
|
+
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26
|
|
181
|
+
* @schemaFunctional
|
|
182
|
+
*/
|
|
183
|
+
export declare function allOf(...allOf: any[]): JsonSchema;
|
|
184
|
+
/**
|
|
185
|
+
* Declare a sub schema which will be resolved later. Use this function when you have a circular reference between two schemes.
|
|
186
|
+
*
|
|
187
|
+
* @schemaFunctional
|
|
188
|
+
*/
|
|
189
|
+
export declare function lazyRef(cb: () => Type<any>): any;
|
|
190
|
+
export declare function enums(e: Record<string, any>): JsonSchema;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
2
|
+
import { JsonTokenOptions, SpecSerializerOptions } from "./getSpec.js";
|
|
3
|
+
export interface GenerateSpecOptions extends Omit<SpecSerializerOptions, "specType"> {
|
|
4
|
+
tokens: JsonTokenOptions;
|
|
5
|
+
version?: string;
|
|
6
|
+
acceptMimes?: string;
|
|
7
|
+
specPath?: string;
|
|
8
|
+
specVersion?: string;
|
|
9
|
+
spec?: any;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generate OpenAPI spec from multiple sources (models, files, conf)
|
|
13
|
+
* @param tokens
|
|
14
|
+
* @param options
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateSpec({ tokens, ...options }: GenerateSpecOptions): Promise<OpenSpec2 | OpenSpec3>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { JsonSchema } from "../domain/JsonSchema.js";
|
|
3
|
+
export type GenericValue = Type<any> | JsonSchema | any;
|
|
4
|
+
/**
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
export type GenericsMap = Map<string, GenericValue>;
|
|
8
|
+
/**
|
|
9
|
+
* @ignore
|
|
10
|
+
*/
|
|
11
|
+
export interface GenericTypes {
|
|
12
|
+
genericTypes: Type<any>[];
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @ignore
|
|
17
|
+
*/
|
|
18
|
+
export interface GenericLabels {
|
|
19
|
+
genericLabels: string[];
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
export interface NestedGenerics {
|
|
26
|
+
nestedGenerics: GenericValue[][];
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @ignore
|
|
31
|
+
*/
|
|
32
|
+
export interface GenericsContext extends GenericTypes, GenericLabels, NestedGenerics {
|
|
33
|
+
generics: GenericsMap;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @ignore
|
|
37
|
+
* @param genericLabels
|
|
38
|
+
* @param genericTypes
|
|
39
|
+
*/
|
|
40
|
+
export declare function getGenericsMap(genericLabels: string[], genericTypes: GenericValue[]): GenericsMap;
|
|
41
|
+
/**
|
|
42
|
+
* @ignore
|
|
43
|
+
* @param options
|
|
44
|
+
*/
|
|
45
|
+
export declare function mapGenericsOptions(options: Partial<GenericTypes & GenericLabels>): Partial<GenericTypes & GenericLabels>;
|
|
46
|
+
/**
|
|
47
|
+
* @ignore
|
|
48
|
+
* @param value
|
|
49
|
+
*/
|
|
50
|
+
export declare function popGenerics(value: NestedGenerics): NestedGenerics & GenericTypes;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import type { JsonClassStore } from "../domain/JsonClassStore.js";
|
|
3
|
+
/**
|
|
4
|
+
* Return store and his inherited stores
|
|
5
|
+
* @param target
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
8
|
+
export declare function getInheritedStores(target: Type<any> | any): Map<Type<any>, JsonClassStore>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { JsonEntityStore } from "../domain/JsonEntityStore.js";
|
|
3
|
+
import { JsonClassStore } from "../domain/JsonClassStore.js";
|
|
4
|
+
import { JsonPropertyStore } from "../domain/JsonPropertyStore.js";
|
|
5
|
+
import { JsonParameterStore } from "../domain/JsonParameterStore.js";
|
|
6
|
+
import { JsonMethodStore } from "../domain/JsonMethodStore.js";
|
|
7
|
+
/**
|
|
8
|
+
* Get entity store from decorator args
|
|
9
|
+
* @param target
|
|
10
|
+
*/
|
|
11
|
+
export declare function getJsonEntityStore<T extends JsonClassStore = JsonClassStore>(target: Type<any>): T;
|
|
12
|
+
export declare function getJsonEntityStore<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any, propertyKey: string | symbol): T;
|
|
13
|
+
export declare function getJsonEntityStore<T extends JsonParameterStore = JsonParameterStore>(target: Type<any> | any, propertyKey: string | symbol, index: number): T;
|
|
14
|
+
export declare function getJsonEntityStore<T extends JsonMethodStore = JsonMethodStore>(target: Type<any> | any, propertyKey: string | symbol, descriptor: PropertyDescriptor): T;
|
|
15
|
+
export declare function getJsonEntityStore<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { OperationVerbs } from "../constants/OperationVerbs.js";
|
|
3
|
+
import { JsonMethodStore } from "../domain/JsonMethodStore.js";
|
|
4
|
+
import { JsonOperationRoute } from "../domain/JsonOperationRoute.js";
|
|
5
|
+
export interface GetOperationsRoutesOptions {
|
|
6
|
+
withChildren?: boolean;
|
|
7
|
+
basePath?: string;
|
|
8
|
+
allowedVerbs?: OperationVerbs[];
|
|
9
|
+
}
|
|
10
|
+
export declare function getOperationsRoutes<Entity extends JsonMethodStore = JsonMethodStore>(token: Type<any> | any, options?: GetOperationsRoutesOptions): JsonOperationRoute<Entity>[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import type { JsonPropertyStore } from "../domain/JsonPropertyStore.js";
|
|
3
|
+
/**
|
|
4
|
+
* Return the list of properties including properties from inherited classes
|
|
5
|
+
* @param target
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPropertiesStores<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any): Map<string | symbol | number, T>;
|
|
9
|
+
/**
|
|
10
|
+
* @ignore
|
|
11
|
+
*/
|
|
12
|
+
export interface GetPropertiesOptions {
|
|
13
|
+
withIgnoredProps?: boolean;
|
|
14
|
+
groups?: string[] | false;
|
|
15
|
+
[type: string]: any;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @ignore
|
|
19
|
+
*/
|
|
20
|
+
export declare function getProperties<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any, options?: GetPropertiesOptions): Map<string | number | symbol, T>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { OpenSpec3 } from "@tsed/openspec";
|
|
3
|
+
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
|
|
4
|
+
export type JsonTokenOptions = ({
|
|
5
|
+
token: Type<any>;
|
|
6
|
+
} & Partial<SpecSerializerOptions>)[];
|
|
7
|
+
export interface SpecSerializerOptions extends JsonSchemaOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Paths
|
|
10
|
+
*/
|
|
11
|
+
paths?: Record<string, any>;
|
|
12
|
+
/**
|
|
13
|
+
* Channels
|
|
14
|
+
*/
|
|
15
|
+
channels?: Record<string, any>;
|
|
16
|
+
/**
|
|
17
|
+
* Root path. This paths will be added to all generated paths Object.
|
|
18
|
+
*/
|
|
19
|
+
rootPath?: string;
|
|
20
|
+
/**
|
|
21
|
+
* A function to generate the operationId.
|
|
22
|
+
*/
|
|
23
|
+
operationIdFormatter?: (name: string, propertyKey: string, path: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* A pattern to generate the operationId.
|
|
26
|
+
*/
|
|
27
|
+
operationIdPattern?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Return the swagger or open spec for the given class.
|
|
31
|
+
* @param model
|
|
32
|
+
* @param options
|
|
33
|
+
*/
|
|
34
|
+
export declare function getSpec(model: Type<any> | JsonTokenOptions, options?: SpecSerializerOptions): Partial<OpenSpec3>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
2
|
+
import { SpecTypes } from "../domain/SpecTypes.js";
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
* @param version
|
|
6
|
+
*/
|
|
7
|
+
export declare function getSpecType(version: string): SpecTypes.SWAGGER | SpecTypes.OPENAPI;
|
|
8
|
+
/**
|
|
9
|
+
* @ignore
|
|
10
|
+
* @param spec
|
|
11
|
+
*/
|
|
12
|
+
export declare function getSpecTypeFromSpec(spec: Partial<OpenSpec2 | OpenSpec3>): SpecTypes.SWAGGER | SpecTypes.OPENAPI;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
2
|
+
/**
|
|
3
|
+
* @ignore
|
|
4
|
+
* @param spec
|
|
5
|
+
* @param fileSpec
|
|
6
|
+
* @param version
|
|
7
|
+
* @param acceptMimes
|
|
8
|
+
* @param specVersion
|
|
9
|
+
*/
|
|
10
|
+
export declare function mapOpenSpec(spec: any, { fileSpec, acceptMimes, specVersion, version }: any): Partial<OpenSpec2 | OpenSpec3>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSpec2 } from "@tsed/openspec";
|
|
2
|
+
/**
|
|
3
|
+
* @ignore
|
|
4
|
+
* @param spec
|
|
5
|
+
* @param version
|
|
6
|
+
* @param specVersion
|
|
7
|
+
* @param acceptMimes
|
|
8
|
+
*/
|
|
9
|
+
export declare function mapOpenSpec2(spec: Partial<OpenSpec2>, { version, specVersion, acceptMimes }: any): Partial<OpenSpec2>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
|
|
2
|
+
/**
|
|
3
|
+
* @ignore
|
|
4
|
+
*/
|
|
5
|
+
export declare const schemesReducer: (collection: any[], value: any, options: import("@tsed/core").DeepMergeOptions) => any[];
|
|
6
|
+
/**
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
export declare const parameters: (collection: any[], value: any, options: import("@tsed/core").DeepMergeOptions) => any[];
|
|
10
|
+
/**
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
export declare const security: (collection: any[], value: any, options: import("@tsed/core").DeepMergeOptions) => any[];
|
|
14
|
+
/**
|
|
15
|
+
* @ignore
|
|
16
|
+
*/
|
|
17
|
+
export declare const tagsReducer: (collection: any[], value: any, options: import("@tsed/core").DeepMergeOptions) => any[];
|
|
18
|
+
/**
|
|
19
|
+
* Merge two spec
|
|
20
|
+
* @param spec
|
|
21
|
+
* @param input
|
|
22
|
+
*/
|
|
23
|
+
export declare function mergeSpec<Spec = OpenSpec2 | OpenSpec3>(spec: Partial<Spec>, input: Partial<Spec>): Partial<Spec>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
|
|
2
|
+
/**
|
|
3
|
+
* @ignore
|
|
4
|
+
*/
|
|
5
|
+
export declare function operationIdFormatter(pattern?: string): (name: string, propertyKey: string, path?: string) => string;
|
|
6
|
+
export declare function getOperationId(path: string, { store, operationIdFormatter }: JsonSchemaOptions): any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JsonSchema } from "../domain/JsonSchema.js";
|
|
2
|
+
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
export declare function createRefName(name: string, options: JsonSchemaOptions): string;
|
|
7
|
+
/**
|
|
8
|
+
* @ignore
|
|
9
|
+
*/
|
|
10
|
+
export declare function createRef(name: string, schema: JsonSchema, options: JsonSchemaOptions): any;
|
|
11
|
+
/**
|
|
12
|
+
* @ignore
|
|
13
|
+
*/
|
|
14
|
+
export declare function toRef(value: JsonSchema, schema: any, options: JsonSchemaOptions): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function makeOf(key: string, schemes: unknown[]): unknown;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OpenSpec2, OpenSpec3, OS3Operation } from "@tsed/openspec";
|
|
2
|
+
export declare function transformSecurity(securitySchemes: any): {};
|
|
3
|
+
export declare function transformInformation(server: any): {
|
|
4
|
+
host: string | undefined;
|
|
5
|
+
basePath: string;
|
|
6
|
+
schemes: string[] | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare class Converter {
|
|
9
|
+
private spec;
|
|
10
|
+
constructor(spec: Partial<OpenSpec3>);
|
|
11
|
+
convertInfos(): {};
|
|
12
|
+
resolveReference(base: any, obj: any, shouldClone: boolean): any;
|
|
13
|
+
convert(): any;
|
|
14
|
+
convertOperations(paths: any, spec: any): any;
|
|
15
|
+
convertOperationParameters(operation: OS3Operation): void;
|
|
16
|
+
convertParameters(obj: any): void;
|
|
17
|
+
copySchemaProperties(obj: any, props: any[]): void;
|
|
18
|
+
copySchemaXProperties(obj: Record<string, any>): void;
|
|
19
|
+
convertResponses(operation: Record<string, any>): void;
|
|
20
|
+
convertSchema(def: any, operationDirection?: any): void;
|
|
21
|
+
convertSchemas(): void;
|
|
22
|
+
convertDiscriminatorMapping(mapping: any): void;
|
|
23
|
+
convertSecurityDefinitions(): void;
|
|
24
|
+
}
|
|
25
|
+
export declare function transformToOS2(spec: any): Partial<OpenSpec2>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ErrorChainedMethods<T> {
|
|
2
|
+
<T>(target: Object, propertyKey?: string | symbol | undefined, descriptor?: TypedPropertyDescriptor<T> | number): any;
|
|
3
|
+
Error(msg: string): this;
|
|
4
|
+
}
|
|
5
|
+
export type ErrorChainedDecorator<Decorator extends (...args: any[]) => any> = (...args: Parameters<Decorator>) => ErrorChainedMethods<Decorator>;
|
|
6
|
+
export declare function withErrorMsg<Decorator extends (...args: any[]) => any>(errorKey: string, originalDecorator: Decorator): ErrorChainedDecorator<Decorator>;
|