@tsed/schema 7.79.4 → 7.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/lib/browser/schema.umd.min.js.map +1 -1
  2. package/lib/cjs/components/default/inlineEnumsMapper.js +2 -2
  3. package/lib/cjs/components/default/inlineEnumsMapper.js.map +1 -1
  4. package/lib/cjs/components/default/nullableMapper.js +4 -4
  5. package/lib/cjs/components/default/nullableMapper.js.map +1 -1
  6. package/lib/cjs/components/default/requiredMapper.js +4 -4
  7. package/lib/cjs/components/default/requiredMapper.js.map +1 -1
  8. package/lib/cjs/components/open-spec/nullableMapper.js +4 -4
  9. package/lib/cjs/components/open-spec/nullableMapper.js.map +1 -1
  10. package/lib/cjs/utils/generateSpec.js +1 -24
  11. package/lib/cjs/utils/generateSpec.js.map +1 -1
  12. package/lib/esm/components/default/inlineEnumsMapper.js.map +1 -1
  13. package/lib/esm/components/default/nullableMapper.js.map +1 -1
  14. package/lib/esm/components/default/requiredMapper.js.map +1 -1
  15. package/lib/esm/components/open-spec/nullableMapper.js.map +1 -1
  16. package/lib/esm/utils/getJsonSchema.js +1 -1
  17. package/lib/types/components/default/inlineEnumsMapper.d.ts +2 -2
  18. package/lib/types/components/default/nullableMapper.d.ts +1 -1
  19. package/lib/types/components/default/requiredMapper.d.ts +2 -2
  20. package/lib/types/components/open-spec/nullableMapper.d.ts +1 -1
  21. package/lib/types-esm/components/async-api/channelsMapper.d.ts +2 -0
  22. package/lib/types-esm/components/async-api/generate.d.ts +1 -0
  23. package/lib/types-esm/components/async-api/messageMapper.d.ts +6 -0
  24. package/lib/types-esm/components/async-api/payloadMapper.d.ts +4 -0
  25. package/lib/types-esm/components/async-api/responseMapper.d.ts +6 -0
  26. package/lib/types-esm/components/default/anyMapper.d.ts +2 -0
  27. package/lib/types-esm/components/default/classMapper.d.ts +3 -0
  28. package/lib/types-esm/components/default/genericsMapper.d.ts +5 -0
  29. package/lib/types-esm/components/default/inheritedClassMapper.d.ts +5 -0
  30. package/lib/types-esm/components/default/inlineEnumsMapper.d.ts +3 -0
  31. package/lib/types-esm/components/default/itemMapper.d.ts +2 -0
  32. package/lib/types-esm/components/default/lazyRefMapper.d.ts +3 -0
  33. package/lib/types-esm/components/default/mapMapper.d.ts +9 -0
  34. package/lib/types-esm/components/default/nullableMapper.d.ts +2 -0
  35. package/lib/types-esm/components/default/objectMapper.d.ts +8 -0
  36. package/lib/types-esm/components/default/ofMapper.d.ts +3 -0
  37. package/lib/types-esm/components/default/propertiesMapper.d.ts +3 -0
  38. package/lib/types-esm/components/default/requiredMapper.d.ts +3 -0
  39. package/lib/types-esm/components/default/schemaMapper.d.ts +3 -0
  40. package/lib/types-esm/components/index.d.ts +33 -0
  41. package/lib/types-esm/components/open-spec/generate.d.ts +1 -0
  42. package/lib/types-esm/components/open-spec/nullableMapper.d.ts +2 -0
  43. package/lib/types-esm/components/open-spec/operationInFilesMapper.d.ts +2 -0
  44. package/lib/types-esm/components/open-spec/operationInParameterMapper.d.ts +10 -0
  45. package/lib/types-esm/components/open-spec/operationInParametersMapper.d.ts +3 -0
  46. package/lib/types-esm/components/open-spec/operationInQueryMapper.d.ts +2 -0
  47. package/lib/types-esm/components/open-spec/operationMapper.d.ts +3 -0
  48. package/lib/types-esm/components/open-spec/operationMediaMapper.d.ts +3 -0
  49. package/lib/types-esm/components/open-spec/operationRequestBodyMapper.d.ts +3 -0
  50. package/lib/types-esm/components/open-spec/operationResponseMapper.d.ts +3 -0
  51. package/lib/types-esm/components/open-spec/pathsMapper.d.ts +2 -0
  52. package/lib/types-esm/constants/OperationVerbs.d.ts +20 -0
  53. package/lib/types-esm/constants/httpStatusMessages.d.ts +11 -0
  54. package/lib/types-esm/constants/jsonSchemaProperties.d.ts +7 -0
  55. package/lib/types-esm/decorators/class/children.d.ts +11 -0
  56. package/lib/types-esm/decorators/class/discriminatorValue.d.ts +42 -0
  57. package/lib/types-esm/decorators/collections/collectionContains.d.ts +21 -0
  58. package/lib/types-esm/decorators/collections/collectionOf.d.ts +101 -0
  59. package/lib/types-esm/decorators/collections/maxItems.d.ts +48 -0
  60. package/lib/types-esm/decorators/collections/maxProperties.d.ts +71 -0
  61. package/lib/types-esm/decorators/collections/minItems.d.ts +52 -0
  62. package/lib/types-esm/decorators/collections/minProperties.d.ts +70 -0
  63. package/lib/types-esm/decorators/collections/uniqueItems.d.ts +51 -0
  64. package/lib/types-esm/decorators/common/additionalProperties.d.ts +11 -0
  65. package/lib/types-esm/decorators/common/allOf.d.ts +13 -0
  66. package/lib/types-esm/decorators/common/allow.d.ts +28 -0
  67. package/lib/types-esm/decorators/common/any.d.ts +38 -0
  68. package/lib/types-esm/decorators/common/anyOf.d.ts +17 -0
  69. package/lib/types-esm/decorators/common/const.d.ts +61 -0
  70. package/lib/types-esm/decorators/common/customKey.d.ts +26 -0
  71. package/lib/types-esm/decorators/common/default.d.ts +41 -0
  72. package/lib/types-esm/decorators/common/defaultMsg.d.ts +32 -0
  73. package/lib/types-esm/decorators/common/description.d.ts +53 -0
  74. package/lib/types-esm/decorators/common/discriminatorKey.d.ts +1 -0
  75. package/lib/types-esm/decorators/common/enum.d.ts +101 -0
  76. package/lib/types-esm/decorators/common/errorMsg.d.ts +6 -0
  77. package/lib/types-esm/decorators/common/example.d.ts +11 -0
  78. package/lib/types-esm/decorators/common/examples.d.ts +12 -0
  79. package/lib/types-esm/decorators/common/exclusiveMaximum.d.ts +70 -0
  80. package/lib/types-esm/decorators/common/exclusiveMinimum.d.ts +70 -0
  81. package/lib/types-esm/decorators/common/format.d.ts +466 -0
  82. package/lib/types-esm/decorators/common/forwardGroups.d.ts +10 -0
  83. package/lib/types-esm/decorators/common/groups.d.ts +12 -0
  84. package/lib/types-esm/decorators/common/hidden.d.ts +32 -0
  85. package/lib/types-esm/decorators/common/ignore.d.ts +59 -0
  86. package/lib/types-esm/decorators/common/integer.d.ts +61 -0
  87. package/lib/types-esm/decorators/common/jsonEntityFn.d.ts +21 -0
  88. package/lib/types-esm/decorators/common/maxLength.d.ts +77 -0
  89. package/lib/types-esm/decorators/common/maximum.d.ts +139 -0
  90. package/lib/types-esm/decorators/common/minLength.d.ts +78 -0
  91. package/lib/types-esm/decorators/common/minimum.d.ts +137 -0
  92. package/lib/types-esm/decorators/common/multipleOf.d.ts +69 -0
  93. package/lib/types-esm/decorators/common/name.d.ts +32 -0
  94. package/lib/types-esm/decorators/common/nullable.d.ts +25 -0
  95. package/lib/types-esm/decorators/common/oneOf.d.ts +17 -0
  96. package/lib/types-esm/decorators/common/optional.d.ts +10 -0
  97. package/lib/types-esm/decorators/common/pattern.d.ts +94 -0
  98. package/lib/types-esm/decorators/common/property.d.ts +11 -0
  99. package/lib/types-esm/decorators/common/readOnly.d.ts +11 -0
  100. package/lib/types-esm/decorators/common/recordOf.d.ts +46 -0
  101. package/lib/types-esm/decorators/common/required.d.ts +44 -0
  102. package/lib/types-esm/decorators/common/requiredGroups.d.ts +10 -0
  103. package/lib/types-esm/decorators/common/schema.d.ts +53 -0
  104. package/lib/types-esm/decorators/common/title.d.ts +39 -0
  105. package/lib/types-esm/decorators/common/typeError.d.ts +8 -0
  106. package/lib/types-esm/decorators/common/writeOnly.d.ts +11 -0
  107. package/lib/types-esm/decorators/config/jsonEntityComponent.d.ts +10 -0
  108. package/lib/types-esm/decorators/generics/genericOf.d.ts +76 -0
  109. package/lib/types-esm/decorators/generics/generics.d.ts +14 -0
  110. package/lib/types-esm/decorators/operations/acceptMime.d.ts +19 -0
  111. package/lib/types-esm/decorators/operations/consumes.d.ts +19 -0
  112. package/lib/types-esm/decorators/operations/contentType.d.ts +20 -0
  113. package/lib/types-esm/decorators/operations/deprecated.d.ts +23 -0
  114. package/lib/types-esm/decorators/operations/header.d.ts +49 -0
  115. package/lib/types-esm/decorators/operations/in.d.ts +64 -0
  116. package/lib/types-esm/decorators/operations/inFile.d.ts +25 -0
  117. package/lib/types-esm/decorators/operations/location.d.ts +22 -0
  118. package/lib/types-esm/decorators/operations/operation.d.ts +60 -0
  119. package/lib/types-esm/decorators/operations/operationId.d.ts +10 -0
  120. package/lib/types-esm/decorators/operations/operationPath.d.ts +21 -0
  121. package/lib/types-esm/decorators/operations/partial.d.ts +10 -0
  122. package/lib/types-esm/decorators/operations/path.d.ts +15 -0
  123. package/lib/types-esm/decorators/operations/produces.d.ts +26 -0
  124. package/lib/types-esm/decorators/operations/publish.d.ts +1 -0
  125. package/lib/types-esm/decorators/operations/redirect.d.ts +52 -0
  126. package/lib/types-esm/decorators/operations/returns.d.ts +267 -0
  127. package/lib/types-esm/decorators/operations/route.d.ts +133 -0
  128. package/lib/types-esm/decorators/operations/security.d.ts +23 -0
  129. package/lib/types-esm/decorators/operations/status.d.ts +127 -0
  130. package/lib/types-esm/decorators/operations/subscribe.d.ts +1 -0
  131. package/lib/types-esm/decorators/operations/summary.d.ts +20 -0
  132. package/lib/types-esm/decorators/operations/tags.d.ts +23 -0
  133. package/lib/types-esm/decorators/operations/view.d.ts +23 -0
  134. package/lib/types-esm/domain/DecoratorContext.d.ts +28 -0
  135. package/lib/types-esm/domain/JsonAliasMap.d.ts +12 -0
  136. package/lib/types-esm/domain/JsonClassStore.d.ts +12 -0
  137. package/lib/types-esm/domain/JsonDiscriminator.d.ts +18 -0
  138. package/lib/types-esm/domain/JsonEntityStore.d.ts +110 -0
  139. package/lib/types-esm/domain/JsonFormatTypes.d.ts +17 -0
  140. package/lib/types-esm/domain/JsonLazyRef.d.ts +9 -0
  141. package/lib/types-esm/domain/JsonMap.d.ts +9 -0
  142. package/lib/types-esm/domain/JsonMedia.d.ts +11 -0
  143. package/lib/types-esm/domain/JsonMethodStore.d.ts +92 -0
  144. package/lib/types-esm/domain/JsonOperation.d.ts +51 -0
  145. package/lib/types-esm/domain/JsonOperationPathsMap.d.ts +7 -0
  146. package/lib/types-esm/domain/JsonOperationRoute.d.ts +25 -0
  147. package/lib/types-esm/domain/JsonParameter.d.ts +22 -0
  148. package/lib/types-esm/domain/JsonParameterStore.d.ts +52 -0
  149. package/lib/types-esm/domain/JsonParameterTypes.d.ts +16 -0
  150. package/lib/types-esm/domain/JsonPropertyStore.d.ts +32 -0
  151. package/lib/types-esm/domain/JsonRequestBody.d.ts +12 -0
  152. package/lib/types-esm/domain/JsonResponse.d.ts +18 -0
  153. package/lib/types-esm/domain/JsonSchema.d.ts +340 -0
  154. package/lib/types-esm/domain/SpecTypes.d.ts +6 -0
  155. package/lib/types-esm/hooks/alterIgnore.d.ts +10 -0
  156. package/lib/types-esm/hooks/alterOneOf.d.ts +3 -0
  157. package/lib/types-esm/hooks/alterRequiredGroups.d.ts +6 -0
  158. package/lib/types-esm/index.d.ts +182 -0
  159. package/lib/types-esm/interfaces/IgnoreCallback.d.ts +4 -0
  160. package/lib/types-esm/interfaces/JsonHookContext.d.ts +17 -0
  161. package/lib/types-esm/interfaces/JsonOpenSpec.d.ts +9 -0
  162. package/lib/types-esm/interfaces/JsonSchemaOptions.d.ts +30 -0
  163. package/lib/types-esm/registries/JsonSchemaMapperContainer.d.ts +21 -0
  164. package/lib/types-esm/registries/enumRegistries.d.ts +2 -0
  165. package/lib/types-esm/utils/buildPath.d.ts +6 -0
  166. package/lib/types-esm/utils/concatParameters.d.ts +4 -0
  167. package/lib/types-esm/utils/concatPath.d.ts +1 -0
  168. package/lib/types-esm/utils/defineStatusModel.d.ts +3 -0
  169. package/lib/types-esm/utils/from.d.ts +190 -0
  170. package/lib/types-esm/utils/generateSpec.d.ts +16 -0
  171. package/lib/types-esm/utils/generics.d.ts +50 -0
  172. package/lib/types-esm/utils/getComputedType.d.ts +5 -0
  173. package/lib/types-esm/utils/getInheritedStores.d.ts +8 -0
  174. package/lib/types-esm/utils/getJsonEntityStore.d.ts +15 -0
  175. package/lib/types-esm/utils/getJsonPathParameters.d.ts +7 -0
  176. package/lib/types-esm/utils/getJsonSchema.d.ts +4 -0
  177. package/lib/types-esm/utils/getJsonType.d.ts +5 -0
  178. package/lib/types-esm/utils/getOperationsRoutes.d.ts +10 -0
  179. package/lib/types-esm/utils/getOperationsStores.d.ts +6 -0
  180. package/lib/types-esm/utils/getPropertiesStores.d.ts +20 -0
  181. package/lib/types-esm/utils/getSpec.d.ts +34 -0
  182. package/lib/types-esm/utils/getSpecType.d.ts +12 -0
  183. package/lib/types-esm/utils/isSuccessStatus.d.ts +2 -0
  184. package/lib/types-esm/utils/mapHeaders.d.ts +9 -0
  185. package/lib/types-esm/utils/mapOpenSpec.d.ts +10 -0
  186. package/lib/types-esm/utils/mapOpenSpec2.d.ts +9 -0
  187. package/lib/types-esm/utils/mapOpenSpec3.d.ts +8 -0
  188. package/lib/types-esm/utils/mapOpenSpecInfo.d.ts +6 -0
  189. package/lib/types-esm/utils/mapOperationOptions.d.ts +5 -0
  190. package/lib/types-esm/utils/matchGroups.d.ts +4 -0
  191. package/lib/types-esm/utils/mergeSpec.d.ts +23 -0
  192. package/lib/types-esm/utils/operationIdFormatter.d.ts +6 -0
  193. package/lib/types-esm/utils/ref.d.ts +14 -0
  194. package/lib/types-esm/utils/removeHiddenOperation.d.ts +2 -0
  195. package/lib/types-esm/utils/serializeEnumValues.d.ts +5 -0
  196. package/lib/types-esm/utils/somethingOf.d.ts +1 -0
  197. package/lib/types-esm/utils/toJsonMapCollection.d.ts +7 -0
  198. package/lib/types-esm/utils/toJsonRegex.d.ts +5 -0
  199. package/lib/types-esm/utils/transformToOS2.d.ts +25 -0
  200. package/lib/types-esm/utils/withErrorMsg.d.ts +6 -0
  201. package/package.json +21 -17
  202. package/vitest.config.mts +21 -0
  203. package/jest.config.js +0 -21
  204. package/lib/cjs/package.json +0 -3
  205. package/lib/esm/package.json +0 -3
  206. package/tsconfig.esm.json +0 -36
@@ -0,0 +1,3 @@
1
+ import { Type } from "@tsed/core";
2
+ export declare function defineStatusModel(status: number, model: Type<any>): void;
3
+ export declare function getStatusModel(status: number): Type<any> | undefined;
@@ -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,5 @@
1
+ import { Type } from "@tsed/core";
2
+ /**
3
+ * @ignore
4
+ */
5
+ export declare function getComputedType(target: any): Type<any>;
@@ -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,7 @@
1
+ /**
2
+ * @ignore
3
+ */
4
+ export declare function getJsonPathParameters(base: string, path?: string | RegExp | (string | RegExp)[]): {
5
+ path: string;
6
+ parameters: any[];
7
+ }[];
@@ -0,0 +1,4 @@
1
+ import { Type } from "@tsed/core";
2
+ import "../components/index";
3
+ import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
4
+ export declare function getJsonSchema(model: Type<any> | any, options?: JsonSchemaOptions): any;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @ignore
3
+ */
4
+ export declare const JSON_TYPES: string[];
5
+ export declare function getJsonType(value: any): string;
@@ -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,6 @@
1
+ import { Type } from "@tsed/core";
2
+ import { JsonMethodStore } from "../domain/JsonMethodStore.js";
3
+ /**
4
+ * @ignore
5
+ */
6
+ export declare function getOperationsStores<T extends JsonMethodStore = JsonMethodStore>(target: Type<any> | any): Map<string, T>;
@@ -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,2 @@
1
+ export declare const isSuccessStatus: (code: string | number | undefined) => boolean | 0;
2
+ export declare const isRedirectionStatus: (code: string | number | undefined) => boolean | 0;
@@ -0,0 +1,9 @@
1
+ import { JsonHeader, JsonHeaders } from "../interfaces/JsonOpenSpec.js";
2
+ /**
3
+ * Map input header to a standard open spec header
4
+ * @param headers
5
+ * @ignore
6
+ */
7
+ export declare function mapHeaders(headers: JsonHeaders): {
8
+ [key: string]: JsonHeader;
9
+ };
@@ -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,8 @@
1
+ import { OpenSpec3 } from "@tsed/openspec";
2
+ /**
3
+ * @ignore
4
+ * @param spec
5
+ * @param version
6
+ * @param specVersion
7
+ */
8
+ export declare function mapOpenSpec3(spec: any, { specVersion }: any): Partial<OpenSpec3>;
@@ -0,0 +1,6 @@
1
+ import { OpenSpecInfo } from "@tsed/openspec";
2
+ /**
3
+ * @ignore
4
+ * @param info
5
+ */
6
+ export declare function mapOpenSpecInfo(info: Partial<OpenSpecInfo>): OpenSpecInfo;
@@ -0,0 +1,5 @@
1
+ export declare function mapOperationOptions(args: any[]): {
2
+ path: undefined;
3
+ method: undefined;
4
+ use: any[];
5
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @ignore
3
+ */
4
+ export declare function matchGroups(groups: string[], compareWith?: string[]): boolean;
@@ -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,2 @@
1
+ import { JsonMethodStore } from "../domain/JsonMethodStore.js";
2
+ export declare function removeHiddenOperation(operationStore: JsonMethodStore): boolean;
@@ -0,0 +1,5 @@
1
+ export declare const serializeEnum: (enumValue: any) => any;
2
+ export declare function serializeEnumValues(enumValues: any[]): {
3
+ values: any[];
4
+ types: any;
5
+ };
@@ -0,0 +1 @@
1
+ export declare function makeOf(key: string, schemes: unknown[]): unknown;
@@ -0,0 +1,7 @@
1
+ import { JsonMap } from "../domain/JsonMap.js";
2
+ /**
3
+ * @ignore
4
+ */
5
+ export declare function toJsonMapCollection(content: {
6
+ [key: string]: any;
7
+ }, klass?: typeof JsonMap): JsonMap<any>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @ignore
3
+ * @param pattern
4
+ */
5
+ export declare function toJsonRegex(pattern: string | RegExp): string;
@@ -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>;