@tsed/schema 8.33.0 → 8.35.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 (258) hide show
  1. package/lib/esm/compat.js +8 -0
  2. package/lib/esm/components/index.js +37 -27
  3. package/lib/esm/components/{default → mappers/default}/anyMapper.js +5 -5
  4. package/lib/esm/components/{default → mappers/default}/classMapper.js +5 -5
  5. package/lib/esm/components/{default → mappers/default}/discriminatorMappingMapper.js +3 -3
  6. package/lib/esm/components/{default → mappers/default}/enumsMapper.js +2 -2
  7. package/lib/esm/components/{default → mappers/default}/genericsMapper.js +7 -6
  8. package/lib/esm/components/{default → mappers/default}/inheritedClassMapper.js +3 -3
  9. package/lib/esm/components/{default → mappers/default}/lazyRefMapper.js +3 -3
  10. package/lib/esm/components/{default → mappers/default}/mapMapper.js +2 -2
  11. package/lib/esm/components/{default → mappers/default}/nextMapper.js +16 -16
  12. package/lib/esm/components/{default → mappers/default}/nullableMapper.js +3 -3
  13. package/lib/esm/components/{default → mappers/default}/objectMapper.js +4 -4
  14. package/lib/esm/components/mappers/default/ofMapper.js +9 -0
  15. package/lib/esm/components/{default → mappers/default}/requiredMapper.js +3 -3
  16. package/lib/esm/components/{default → mappers/default}/schemaMapper.js +11 -6
  17. package/lib/esm/components/mappers/open-spec/discriminatorMappingMapper.js +8 -0
  18. package/lib/esm/components/mappers/open-spec/enumsMapper.js +12 -0
  19. package/lib/esm/components/{open-spec → mappers/open-spec}/generate.js +3 -4
  20. package/lib/esm/components/{open-spec → mappers/open-spec}/nullableMapper.js +3 -4
  21. package/lib/esm/components/{open-spec → mappers/open-spec}/operationInFilesMapper.js +2 -2
  22. package/lib/esm/components/{open-spec → mappers/open-spec}/operationInParameterMapper.js +3 -3
  23. package/lib/esm/components/mappers/open-spec/operationInParametersMapper.js +5 -0
  24. package/lib/esm/components/{open-spec → mappers/open-spec}/operationInQueryMapper.js +3 -3
  25. package/lib/esm/components/{open-spec → mappers/open-spec}/operationMapper.js +4 -4
  26. package/lib/esm/components/{open-spec → mappers/open-spec}/operationMediaMapper.js +2 -2
  27. package/lib/esm/components/{open-spec → mappers/open-spec}/operationRequestBodyMapper.js +4 -4
  28. package/lib/esm/components/{open-spec → mappers/open-spec}/operationResponseMapper.js +2 -2
  29. package/lib/esm/components/{open-spec → mappers/open-spec}/pathsMapper.js +10 -10
  30. package/lib/esm/{domain → components/stores}/JsonClassStore.js +8 -13
  31. package/lib/esm/{domain → components/stores}/JsonMethodStore.js +33 -28
  32. package/lib/esm/{domain → components/stores}/JsonParameterStore.js +14 -18
  33. package/lib/esm/{domain → components/stores}/JsonPropertyStore.js +15 -18
  34. package/lib/esm/components/types/arrayType.js +15 -0
  35. package/lib/esm/components/types/classType.js +8 -0
  36. package/lib/esm/components/types/genericType.js +8 -0
  37. package/lib/esm/components/types/mapType.js +15 -0
  38. package/lib/esm/components/types/primitiveType.js +21 -0
  39. package/lib/esm/components/types/setType.js +12 -0
  40. package/lib/esm/decorators/class/discriminatorValue.js +1 -1
  41. package/lib/esm/decorators/collections/collectionOf.js +2 -2
  42. package/lib/esm/decorators/collections/maxItems.js +1 -1
  43. package/lib/esm/decorators/collections/maxProperties.js +1 -1
  44. package/lib/esm/decorators/collections/minItems.js +1 -1
  45. package/lib/esm/decorators/collections/minProperties.js +1 -1
  46. package/lib/esm/decorators/collections/uniqueItems.js +1 -1
  47. package/lib/esm/decorators/common/defaultMsg.js +1 -1
  48. package/lib/esm/decorators/common/discriminatorKey.js +1 -1
  49. package/lib/esm/decorators/common/enum.js +1 -1
  50. package/lib/esm/decorators/common/exclusiveMaximum.js +1 -1
  51. package/lib/esm/decorators/common/exclusiveMinimum.js +1 -1
  52. package/lib/esm/decorators/common/format.js +1 -1
  53. package/lib/esm/decorators/common/jsonEntityFn.js +2 -2
  54. package/lib/esm/decorators/common/maxLength.js +1 -1
  55. package/lib/esm/decorators/common/maximum.js +1 -1
  56. package/lib/esm/decorators/common/minLength.js +1 -1
  57. package/lib/esm/decorators/common/minimum.js +1 -1
  58. package/lib/esm/decorators/common/multipleOf.js +1 -1
  59. package/lib/esm/decorators/common/name.js +1 -1
  60. package/lib/esm/decorators/common/nullable.js +2 -2
  61. package/lib/esm/decorators/common/pattern.js +1 -1
  62. package/lib/esm/decorators/common/required.js +1 -1
  63. package/lib/esm/decorators/common/requiredGroups.js +1 -1
  64. package/lib/esm/decorators/common/typeError.js +1 -1
  65. package/lib/esm/decorators/config/jsonEntityComponent.js +3 -2
  66. package/lib/esm/decorators/generics/genericOf.js +2 -2
  67. package/lib/esm/decorators/generics/generics.js +2 -3
  68. package/lib/esm/decorators/operations/consumes.js +1 -1
  69. package/lib/esm/decorators/operations/deprecated.js +1 -1
  70. package/lib/esm/decorators/operations/header.js +1 -1
  71. package/lib/esm/decorators/operations/in.js +5 -6
  72. package/lib/esm/decorators/operations/inFile.js +2 -2
  73. package/lib/esm/decorators/operations/operation.js +1 -1
  74. package/lib/esm/decorators/operations/produces.js +1 -1
  75. package/lib/esm/decorators/operations/publish.js +1 -1
  76. package/lib/esm/decorators/operations/returns.js +4 -4
  77. package/lib/esm/decorators/operations/route.js +1 -1
  78. package/lib/esm/decorators/operations/security.js +1 -1
  79. package/lib/esm/decorators/operations/subscribe.js +1 -1
  80. package/lib/esm/decorators/operations/tags.js +1 -1
  81. package/lib/esm/domain/DecoratorContext.js +2 -2
  82. package/lib/esm/domain/JsonEntityStore.js +7 -41
  83. package/lib/esm/domain/JsonLazyRef.js +1 -1
  84. package/lib/esm/domain/JsonMap.js +1 -1
  85. package/lib/esm/domain/JsonOperation.js +1 -1
  86. package/lib/esm/domain/JsonParameter.js +3 -3
  87. package/lib/esm/domain/JsonRequestBody.js +1 -1
  88. package/lib/esm/domain/JsonResponse.js +2 -2
  89. package/lib/esm/domain/JsonSchema.js +94 -131
  90. package/lib/esm/domain/index.js +26 -0
  91. package/lib/esm/{utils/getJsonSchema.js → fn/compile.js} +20 -7
  92. package/lib/esm/fn/enums.js +1 -1
  93. package/lib/esm/fn/from.js +32 -9
  94. package/lib/esm/fn/generic.js +9 -0
  95. package/lib/esm/fn/index.js +25 -4
  96. package/lib/esm/fn/lazyRef.js +3 -3
  97. package/lib/esm/fn/oas/compileSpec.js +9 -0
  98. package/lib/esm/{utils → fn/oas}/generateSpec.js +2 -2
  99. package/lib/esm/{utils → fn/oas}/getSpec.js +4 -4
  100. package/lib/esm/{utils → fn/oas}/getSpecType.js +1 -1
  101. package/lib/esm/{utils → fn/oas}/mapOpenSpec.js +1 -1
  102. package/lib/esm/hooks/alterOneOf.js +1 -1
  103. package/lib/esm/index.js +59 -48
  104. package/lib/esm/registries/JsonEntitiesContainer.js +38 -0
  105. package/lib/esm/registries/JsonSchemaMapperContainer.js +10 -1
  106. package/lib/esm/registries/JsonTypesContainer.js +18 -0
  107. package/lib/esm/utils/generics.js +15 -2
  108. package/lib/esm/utils/getInheritedStores.js +1 -1
  109. package/lib/esm/utils/getJsonType.js +2 -2
  110. package/lib/esm/utils/getOperationsRoutes.js +3 -3
  111. package/lib/esm/utils/getOperationsStores.js +4 -4
  112. package/lib/esm/utils/getPropertiesStores.js +2 -2
  113. package/lib/esm/utils/ref.js +2 -2
  114. package/lib/types/compat.d.ts +17 -0
  115. package/lib/types/components/index.d.ts +37 -27
  116. package/lib/types/components/{default → mappers/default}/anyMapper.d.ts +1 -1
  117. package/lib/types/components/mappers/default/classMapper.d.ts +3 -0
  118. package/lib/types/components/{default → mappers/default}/discriminatorMappingMapper.d.ts +2 -2
  119. package/lib/types/components/mappers/default/enumsMapper.d.ts +3 -0
  120. package/lib/types/components/{default → mappers/default}/genericsMapper.d.ts +2 -2
  121. package/lib/types/components/{default → mappers/default}/inheritedClassMapper.d.ts +1 -1
  122. package/lib/types/components/mappers/default/lazyRefMapper.d.ts +3 -0
  123. package/lib/types/components/{default → mappers/default}/mapMapper.d.ts +1 -1
  124. package/lib/types/components/{default → mappers/default}/nextMapper.d.ts +2 -2
  125. package/lib/types/components/{default → mappers/default}/nullableMapper.d.ts +1 -1
  126. package/lib/types/components/{default → mappers/default}/objectMapper.d.ts +1 -1
  127. package/lib/types/components/mappers/default/ofMapper.d.ts +3 -0
  128. package/lib/types/components/mappers/default/requiredMapper.d.ts +3 -0
  129. package/lib/types/components/mappers/default/schemaMapper.d.ts +3 -0
  130. package/lib/types/components/mappers/open-spec/enumsMapper.d.ts +3 -0
  131. package/lib/types/components/mappers/open-spec/generate.d.ts +1 -0
  132. package/lib/types/components/mappers/open-spec/nullableMapper.d.ts +3 -0
  133. package/lib/types/components/{open-spec → mappers/open-spec}/operationInParameterMapper.d.ts +3 -3
  134. package/lib/types/components/mappers/open-spec/operationInParametersMapper.d.ts +3 -0
  135. package/lib/types/components/mappers/open-spec/operationMapper.d.ts +3 -0
  136. package/lib/types/components/mappers/open-spec/operationMediaMapper.d.ts +3 -0
  137. package/lib/types/components/mappers/open-spec/operationRequestBodyMapper.d.ts +3 -0
  138. package/lib/types/components/mappers/open-spec/operationResponseMapper.d.ts +3 -0
  139. package/lib/types/components/{open-spec → mappers/open-spec}/pathsMapper.d.ts +1 -1
  140. package/lib/types/{domain → components/stores}/JsonClassStore.d.ts +4 -4
  141. package/lib/types/{domain → components/stores}/JsonMethodStore.d.ts +33 -19
  142. package/lib/types/{domain → components/stores}/JsonParameterStore.d.ts +9 -5
  143. package/lib/types/{domain → components/stores}/JsonPropertyStore.d.ts +7 -4
  144. package/lib/types/components/types/arrayType.d.ts +2 -0
  145. package/lib/types/components/types/classType.d.ts +2 -0
  146. package/lib/types/components/types/genericType.d.ts +2 -0
  147. package/lib/types/components/types/mapType.d.ts +2 -0
  148. package/lib/types/components/types/primitiveType.d.ts +2 -0
  149. package/lib/types/components/types/setType.d.ts +2 -0
  150. package/lib/types/decorators/common/any.d.ts +1 -1
  151. package/lib/types/decorators/common/examples.d.ts +1 -1
  152. package/lib/types/decorators/common/format.d.ts +1 -1
  153. package/lib/types/decorators/common/ignore.d.ts +1 -1
  154. package/lib/types/decorators/common/jsonEntityFn.d.ts +1 -1
  155. package/lib/types/decorators/config/jsonEntityComponent.d.ts +2 -1
  156. package/lib/types/decorators/generics/genericOf.d.ts +1 -1
  157. package/lib/types/decorators/operations/header.d.ts +1 -1
  158. package/lib/types/decorators/operations/in.d.ts +1 -2
  159. package/lib/types/decorators/operations/location.d.ts +1 -1
  160. package/lib/types/decorators/operations/redirect.d.ts +1 -1
  161. package/lib/types/decorators/operations/returns.d.ts +3 -3
  162. package/lib/types/decorators/operations/status.d.ts +1 -1
  163. package/lib/types/domain/Generics.d.ts +6 -0
  164. package/lib/types/domain/JsonEntityStore.d.ts +8 -19
  165. package/lib/types/domain/JsonLazyRef.d.ts +1 -1
  166. package/lib/types/domain/JsonMap.d.ts +1 -1
  167. package/lib/types/domain/JsonMedia.d.ts +1 -1
  168. package/lib/types/domain/JsonOperation.d.ts +2 -2
  169. package/lib/types/domain/JsonOperationRoute.d.ts +3 -3
  170. package/lib/types/domain/JsonParameter.d.ts +3 -3
  171. package/lib/types/domain/JsonRequestBody.d.ts +1 -1
  172. package/lib/types/domain/JsonResponse.d.ts +1 -1
  173. package/lib/types/domain/JsonSchema.d.ts +28 -22
  174. package/lib/types/{interfaces → domain}/JsonSchemaOptions.d.ts +14 -6
  175. package/lib/types/domain/__fixtures__/inspectOperationsPaths.d.ts +1 -1
  176. package/lib/types/domain/index.d.ts +26 -0
  177. package/lib/types/domain/types.d.ts +1 -1
  178. package/lib/types/fn/any.d.ts +1 -1
  179. package/lib/types/fn/boolean.d.ts +1 -1
  180. package/lib/types/{utils → fn}/compile.d.ts +10 -3
  181. package/lib/types/fn/date.d.ts +3 -3
  182. package/lib/types/fn/email.d.ts +1 -1
  183. package/lib/types/fn/from.d.ts +31 -3
  184. package/lib/types/fn/generic.d.ts +10 -0
  185. package/lib/types/fn/index.d.ts +24 -3
  186. package/lib/types/fn/integer.d.ts +1 -1
  187. package/lib/types/fn/lazyRef.d.ts +1 -1
  188. package/lib/types/fn/number.d.ts +1 -1
  189. package/lib/types/fn/oas/compileSpec.d.ts +6 -0
  190. package/lib/types/{utils → fn/oas}/getSpec.d.ts +1 -1
  191. package/lib/types/{utils → fn/oas}/getSpecType.d.ts +1 -1
  192. package/lib/types/{utils → fn/oas}/transformToOS2.d.ts +1 -1
  193. package/lib/types/fn/object.d.ts +1 -1
  194. package/lib/types/fn/string.d.ts +1 -1
  195. package/lib/types/fn/uri.d.ts +1 -1
  196. package/lib/types/fn/url.d.ts +1 -1
  197. package/lib/types/hooks/alterOneOf.d.ts +1 -1
  198. package/lib/types/hooks/alterRequiredGroups.d.ts +1 -1
  199. package/lib/types/index.d.ts +59 -48
  200. package/lib/types/{utils/getJsonEntityStore.d.ts → registries/JsonEntitiesContainer.d.ts} +5 -10
  201. package/lib/types/registries/JsonSchemaMapperContainer.d.ts +7 -1
  202. package/lib/types/registries/JsonTypesContainer.d.ts +15 -0
  203. package/lib/types/registries/{enumRegistries.d.ts → enumRegistry.d.ts} +1 -1
  204. package/lib/types/utils/generics.d.ts +13 -5
  205. package/lib/types/utils/getInheritedStores.d.ts +1 -1
  206. package/lib/types/utils/getOperationsRoutes.d.ts +3 -3
  207. package/lib/types/utils/getOperationsStores.d.ts +1 -1
  208. package/lib/types/utils/getPropertiesStores.d.ts +1 -1
  209. package/lib/types/utils/mapHeaders.d.ts +1 -1
  210. package/lib/types/utils/operationIdFormatter.d.ts +1 -1
  211. package/lib/types/utils/ref.d.ts +1 -1
  212. package/lib/types/utils/removeHiddenOperation.d.ts +1 -1
  213. package/lib/types/utils/toJsonMapCollection.d.ts +1 -1
  214. package/package.json +19 -19
  215. package/vitest.setup.ts +6 -0
  216. package/lib/esm/components/default/ofMapper.js +0 -9
  217. package/lib/esm/components/open-spec/discriminatorMappingMapper.js +0 -6
  218. package/lib/esm/components/open-spec/enumsMapper.js +0 -14
  219. package/lib/esm/components/open-spec/operationInParametersMapper.js +0 -5
  220. package/lib/esm/utils/compile.js +0 -13
  221. package/lib/esm/utils/getJsonEntityStore.js +0 -13
  222. package/lib/types/components/default/classMapper.d.ts +0 -3
  223. package/lib/types/components/default/enumsMapper.d.ts +0 -3
  224. package/lib/types/components/default/lazyRefMapper.d.ts +0 -3
  225. package/lib/types/components/default/ofMapper.d.ts +0 -3
  226. package/lib/types/components/default/requiredMapper.d.ts +0 -3
  227. package/lib/types/components/default/schemaMapper.d.ts +0 -3
  228. package/lib/types/components/open-spec/enumsMapper.d.ts +0 -3
  229. package/lib/types/components/open-spec/nullableMapper.d.ts +0 -3
  230. package/lib/types/components/open-spec/operationInParametersMapper.d.ts +0 -3
  231. package/lib/types/components/open-spec/operationMapper.d.ts +0 -3
  232. package/lib/types/components/open-spec/operationMediaMapper.d.ts +0 -3
  233. package/lib/types/components/open-spec/operationRequestBodyMapper.d.ts +0 -3
  234. package/lib/types/components/open-spec/operationResponseMapper.d.ts +0 -3
  235. package/lib/types/utils/getJsonSchema.d.ts +0 -6
  236. package/lib/esm/{interfaces/IgnoreCallback.js → domain/Generics.js} +0 -0
  237. package/lib/esm/{interfaces/JsonHookContext.js → domain/IgnoreCallback.js} +0 -0
  238. package/lib/esm/{interfaces/JsonOpenSpec.js → domain/JsonHookContext.js} +0 -0
  239. package/lib/esm/{interfaces/JsonSchemaOptions.js → domain/JsonOpenSpec.js} +0 -0
  240. package/lib/{types/components/open-spec/discriminatorMappingMapper.d.ts → esm/domain/JsonSchemaOptions.js} +0 -0
  241. package/lib/esm/{utils → fn/oas}/mapOpenSpec2.js +0 -0
  242. package/lib/esm/{utils → fn/oas}/mapOpenSpec3.js +0 -0
  243. package/lib/esm/{utils → fn/oas}/mapOpenSpecInfo.js +0 -0
  244. package/lib/esm/{utils → fn/oas}/mergeSpec.js +0 -0
  245. package/lib/esm/{utils → fn/oas}/transformToOS2.js +0 -0
  246. package/lib/esm/registries/{enumRegistries.js → enumRegistry.js} +0 -0
  247. package/lib/types/components/{open-spec/generate.d.ts → mappers/open-spec/discriminatorMappingMapper.d.ts} +0 -0
  248. package/lib/types/components/{open-spec → mappers/open-spec}/operationInFilesMapper.d.ts +0 -0
  249. package/lib/types/components/{open-spec → mappers/open-spec}/operationInQueryMapper.d.ts +0 -0
  250. package/lib/types/{interfaces → domain}/IgnoreCallback.d.ts +0 -0
  251. package/lib/types/{interfaces → domain}/JsonHookContext.d.ts +0 -0
  252. package/lib/types/{interfaces → domain}/JsonOpenSpec.d.ts +0 -0
  253. package/lib/types/{utils → fn/oas}/generateSpec.d.ts +1 -1
  254. /package/lib/types/{utils → fn/oas}/mapOpenSpec.d.ts +0 -0
  255. /package/lib/types/{utils → fn/oas}/mapOpenSpec2.d.ts +0 -0
  256. /package/lib/types/{utils → fn/oas}/mapOpenSpec3.d.ts +0 -0
  257. /package/lib/types/{utils → fn/oas}/mapOpenSpecInfo.d.ts +0 -0
  258. /package/lib/types/{utils → fn/oas}/mergeSpec.d.ts +0 -0
@@ -1,5 +1,5 @@
1
- import { SpecTypes } from "../domain/SpecTypes.js";
2
- import type { GenericsMap } from "../utils/generics.js";
1
+ import type { GenericsMap } from "./Generics.js";
2
+ import { SpecTypes } from "./SpecTypes.js";
3
3
  /**
4
4
  * Configuration options for JSON schema generation.
5
5
  *
@@ -61,12 +61,20 @@ export interface JsonSchemaOptions {
61
61
  */
62
62
  inlineEnums?: boolean;
63
63
  /**
64
- * Represents optional generic definitions that adhere to the JSON Schema standard.
64
+ * Explicit generic bindings used during schema compilation.
65
65
  *
66
- * This property allows the specification of generics when constructing or representing a JSON schema.
67
- * It can be used to define reusable and parameterized components within the schema structure.
66
+ * Prefer attaching generics directly to a local schema instance with the
67
+ * functional API:
68
68
  *
69
- * @type {GenericsMap|undefined}
69
+ * ```typescript
70
+ * from(Pagination).genericOf(Product)
71
+ * generic(Pagination).of(Product)
72
+ * ```
73
+ *
74
+ * `options.generics` remains useful for low-level compilation flows where the
75
+ * generic bindings must be supplied externally, for example when compiling a
76
+ * shared class schema. When both are provided, the generics carried by the
77
+ * `JsonSchema` instance take precedence over `options.generics`.
70
78
  */
71
79
  generics?: GenericsMap;
72
80
  [key: string]: any;
@@ -1,4 +1,4 @@
1
- import type { JsonMethodStore } from "../JsonMethodStore.js";
1
+ import type { JsonMethodStore } from "../../components/stores/JsonMethodStore.js";
2
2
  export declare function inspectOperationsPaths(endpoint: JsonMethodStore): {
3
3
  method: string;
4
4
  path: string | RegExp;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @file Automatically generated by @tsed/barrels.
3
+ */
4
+ export * from "./DecoratorContext.js";
5
+ export * from "./Generics.js";
6
+ export * from "./IgnoreCallback.js";
7
+ export * from "./JsonAliasMap.js";
8
+ export * from "./JsonDiscriminator.js";
9
+ export * from "./JsonEntityStore.js";
10
+ export * from "./JsonFormatTypes.js";
11
+ export * from "./JsonHookContext.js";
12
+ export * from "./JsonLazyRef.js";
13
+ export * from "./JsonMap.js";
14
+ export * from "./JsonMedia.js";
15
+ export * from "./JsonOpenSpec.js";
16
+ export * from "./JsonOperation.js";
17
+ export * from "./JsonOperationPathsMap.js";
18
+ export * from "./JsonOperationRoute.js";
19
+ export * from "./JsonParameter.js";
20
+ export * from "./JsonParameterTypes.js";
21
+ export * from "./JsonRequestBody.js";
22
+ export * from "./JsonResponse.js";
23
+ export * from "./JsonSchema.js";
24
+ export * from "./JsonSchemaOptions.js";
25
+ export * from "./SpecTypes.js";
26
+ export * from "./types.js";
@@ -8,7 +8,7 @@ import type { JsonSchema } from "./JsonSchema.js";
8
8
  * ### Usage
9
9
  *
10
10
  * ```typescript
11
- * const userSchema = JsonSchema.from({ type: "object" });
11
+ * const userSchema = s.object();
12
12
  * type User = Infer<typeof userSchema>; // Extracts the type
13
13
  * ```
14
14
  *
@@ -1,5 +1,5 @@
1
- import type { JsonSchema } from "../domain/JsonSchema.js";
2
1
  import type { Infer } from "../domain/types.js";
2
+ import type { JsonSchema } from "../domain/JsonSchema.js";
3
3
  /**
4
4
  * Declare a model with any type (By default: `integer`, `number`, `string`, `boolean`, `array`, `object`, `null`)
5
5
  *
@@ -41,4 +41,4 @@
41
41
  *
42
42
  * @public
43
43
  */
44
- export declare function boolean(): import("../index.js").JsonSchema<boolean>;
44
+ export declare function boolean(): import("@tsed/schema").JsonSchema<boolean>;
@@ -1,7 +1,8 @@
1
+ import "../components/index.js";
1
2
  import { Type } from "@tsed/core";
2
- import { JsonParameterStore } from "../domain/JsonParameterStore.js";
3
- import { JsonSchema } from "../domain/JsonSchema.js";
4
- import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
3
+ import { JsonSchema } from "../domain/index.js";
4
+ import { JsonParameterStore } from "../components/index.js";
5
+ import { JsonSchemaOptions } from "../domain/JsonSchemaOptions.js";
5
6
  /**
6
7
  * Compile a class, parameter store, or `JsonSchema` into a plain JSON schema object.
7
8
  *
@@ -12,3 +13,9 @@ import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
12
13
  * @returns Compiled JSON schema object.
13
14
  */
14
15
  export declare function compile(model: Type<any> | JsonParameterStore | JsonSchema, options?: JsonSchemaOptions): any;
16
+ /**
17
+ * @deprecated Use s.compile() instead
18
+ * @param model
19
+ * @param options
20
+ */
21
+ export declare const getJsonSchema: typeof compile;
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * @schemaFunctional
7
7
  */
8
- export declare function date(): import("../index.js").JsonSchema<Date>;
8
+ export declare function date(): import("@tsed/schema").JsonSchema<Date>;
9
9
  /**
10
10
  * Declare a new string model with `format: datetime`.
11
11
  *
@@ -13,7 +13,7 @@ export declare function date(): import("../index.js").JsonSchema<Date>;
13
13
  *
14
14
  * @schemaFunctional
15
15
  */
16
- export declare function datetime(): import("../index.js").JsonSchema<Date>;
16
+ export declare function datetime(): import("@tsed/schema").JsonSchema<Date>;
17
17
  /**
18
18
  * Declare a new string model with `format: time`.
19
19
  *
@@ -21,4 +21,4 @@ export declare function datetime(): import("../index.js").JsonSchema<Date>;
21
21
  *
22
22
  * @schemaFunctional
23
23
  */
24
- export declare function time(): import("../index.js").JsonSchema<Date>;
24
+ export declare function time(): import("@tsed/schema").JsonSchema<Date>;
@@ -12,4 +12,4 @@
12
12
  *
13
13
  * @schemaFunctional
14
14
  */
15
- export declare function email(): import("../index.js").JsonSchema<string>;
15
+ export declare function email(): import("@tsed/schema").JsonSchema<string>;
@@ -1,16 +1,44 @@
1
1
  import { Type } from "@tsed/core";
2
- import { JsonSchema } from "../domain/JsonSchema.js";
3
2
  import type { CtorToType } from "../domain/types.js";
3
+ import { JsonSchema } from "../domain/JsonSchema.js";
4
4
  /**
5
- * Create a new model from the given type.
5
+ * Create a new local schema instance from the given type.
6
+ *
7
+ * When the input is a class, `from()` returns a cloned `JsonSchema` that can be
8
+ * composed safely without mutating the schema stored on the class metadata.
9
+ * This makes `from()` the functional entry point for schema composition.
10
+ *
11
+ * Use @@get@@ when you intentionally need the shared class schema in order to
12
+ * patch or extend the metadata attached to a class definition.
6
13
  *
7
14
  * ```typescript
8
15
  * from(String)
16
+ * from(UserModel).description("Local description")
9
17
  * ```
10
18
  *
11
- * * See @@JsonSchema@@ to discover available methods.
19
+ * See @@JsonSchema@@ to discover available methods.
12
20
  *
13
21
  * @schemaFunctional
14
22
  */
15
23
  export declare function from<TC extends Type<any> = Type<any>>(): JsonSchema<CtorToType<ObjectConstructor>>;
16
24
  export declare function from<TC extends Type<any> = Type<any>>(type?: TC): JsonSchema<CtorToType<TC>>;
25
+ /**
26
+ * Get the shared schema instance attached to a class.
27
+ *
28
+ * Contrary to @@from@@, `get()` returns the schema stored in the class metadata.
29
+ * Mutating the returned instance updates the class-level schema definition and
30
+ * therefore affects every consumer of that class schema.
31
+ *
32
+ * This helper is intended for low-level or internal patching scenarios where the
33
+ * source schema must be updated in place.
34
+ *
35
+ * ```typescript
36
+ * get(UserModel).properties({
37
+ * name: string()
38
+ * });
39
+ * ```
40
+ *
41
+ * @param type The class owning the shared schema metadata.
42
+ * @returns The shared `JsonSchema` instance for the class.
43
+ */
44
+ export declare function get(type: Type<any>): JsonSchema<import("json-schema").JSONSchema7Type>;
@@ -0,0 +1,10 @@
1
+ import { type GenericValue, type GenericsMap } from "../domain/Generics.js";
2
+ import { Type } from "@tsed/core";
3
+ import { from } from "./from.js";
4
+ export declare function generic(type?: Type<any>): {
5
+ of: {
6
+ (generics: GenericsMap): ReturnType<typeof from>;
7
+ (generic: GenericValue): ReturnType<typeof from>;
8
+ (...generics: Array<GenericValue[] | GenericValue>): ReturnType<typeof from>;
9
+ };
10
+ };
@@ -1,15 +1,21 @@
1
+ import { array, map, record, set } from "./collection.js";
2
+ import { date, datetime, time } from "./date.js";
3
+ import { from, get } from "./from.js";
4
+ import { getJsonEntityStore, getJsonMethodStore } from "../registries/JsonEntitiesContainer.js";
1
5
  import type { Infer } from "../domain/types.js";
2
6
  import { allOf } from "./allOf.js";
3
7
  import { any } from "./any.js";
4
8
  import { anyOf } from "./anyOf.js";
5
9
  import { boolean } from "./boolean.js";
6
- import { array, map, record, set } from "./collection.js";
7
- import { date, datetime, time } from "./date.js";
10
+ import { compile } from "./compile.js";
11
+ import { compileSpec } from "./oas/compileSpec.js";
8
12
  import { email } from "./email.js";
9
13
  import { enums } from "./enums.js";
10
- import { from } from "./from.js";
14
+ import { generic } from "./generic.js";
11
15
  import { integer } from "./integer.js";
12
16
  import { lazyRef } from "./lazyRef.js";
17
+ import { mergeSchema } from "../utils/mergeSchema.js";
18
+ import { mergeSpec } from "./oas/mergeSpec.js";
13
19
  import { number } from "./number.js";
14
20
  import { object } from "./object.js";
15
21
  import { oneOf } from "./oneOf.js";
@@ -45,6 +51,21 @@ export declare const s: {
45
51
  readonly string: typeof string;
46
52
  readonly uri: typeof uri;
47
53
  readonly url: typeof url;
54
+ readonly generic: typeof generic;
55
+ readonly get: typeof get;
56
+ readonly store: typeof getJsonEntityStore & {
57
+ get: typeof getJsonEntityStore;
58
+ method: typeof getJsonMethodStore;
59
+ };
60
+ readonly schema: {
61
+ readonly compile: typeof compile;
62
+ readonly merge: typeof mergeSchema;
63
+ };
64
+ readonly compile: typeof compile;
65
+ readonly oas: typeof compileSpec & {
66
+ compile: typeof compileSpec;
67
+ merge: typeof mergeSpec;
68
+ };
48
69
  };
49
70
  export declare namespace s {
50
71
  type infer<S> = Infer<S>;
@@ -6,4 +6,4 @@
6
6
  * @returns A schema configured for integer values
7
7
  * @schemaFunctional
8
8
  */
9
- export declare function integer(): import("../index.js").JsonSchema<number>;
9
+ export declare function integer(): import("@tsed/schema").JsonSchema<number>;
@@ -1,4 +1,4 @@
1
- import type { JsonSchema } from "../domain/JsonSchema.js";
1
+ import type { JsonSchema } from "../domain/index.js";
2
2
  /**
3
3
  * Declare a sub schema which will be resolved later. Use this function when you have a circular reference between two schemes.
4
4
  *
@@ -47,4 +47,4 @@
47
47
  *
48
48
  * @public
49
49
  */
50
- export declare function number(): import("../index.js").JsonSchema<number>;
50
+ export declare function number(): import("@tsed/schema").JsonSchema<number>;
@@ -0,0 +1,6 @@
1
+ import { type GenerateSpecOptions } from "./generateSpec.js";
2
+ import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
3
+ import { type SpecSerializerOptions } from "./getSpec.js";
4
+ import { Type } from "@tsed/core";
5
+ export declare function compileSpec(model: Type<any>, options?: SpecSerializerOptions): Partial<OpenSpec3>;
6
+ export declare function compileSpec(options: GenerateSpecOptions): OpenSpec2 | OpenSpec3;
@@ -1,6 +1,6 @@
1
1
  import { Type } from "@tsed/core";
2
+ import { JsonSchemaOptions } from "../../domain/JsonSchemaOptions.js";
2
3
  import { OpenSpec3 } from "@tsed/openspec";
3
- import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
4
4
  export type JsonTokenOptions = ({
5
5
  token: Type<any>;
6
6
  } & Partial<SpecSerializerOptions>)[];
@@ -1,5 +1,5 @@
1
1
  import { OpenSpec2, OpenSpec3 } from "@tsed/openspec";
2
- import { SpecTypes } from "../domain/SpecTypes.js";
2
+ import { SpecTypes } from "../../domain/index.js";
3
3
  /**
4
4
  * @ignore
5
5
  * @param version
@@ -1,4 +1,4 @@
1
- import { OpenSpec2, OpenSpec3, type OS2Security, OS3Operation } from "@tsed/openspec";
1
+ import { type OS2Security, OS3Operation, OpenSpec2, OpenSpec3 } from "@tsed/openspec";
2
2
  export declare function transformSecurity(securitySchemes: any): Record<string, OS2Security>;
3
3
  export declare function transformInformation(server: any): {
4
4
  host: string | undefined;
@@ -17,4 +17,4 @@ import { JsonSchema } from "../domain/JsonSchema.js";
17
17
  * @returns A new object model with the specified properties
18
18
  * @schemaFunctional
19
19
  */
20
- export declare function object<P extends Record<string, JsonSchema<any>> = Record<string, JsonSchema<any>>>(properties?: P): JsonSchema<import("../index.js").PropsToShape<P>>;
20
+ export declare function object<P extends Record<string, JsonSchema<any>> = Record<string, JsonSchema<any>>>(properties?: P): JsonSchema<import("@tsed/schema").PropsToShape<P>>;
@@ -45,4 +45,4 @@
45
45
  *
46
46
  * @public
47
47
  */
48
- export declare function string(): import("../index.js").JsonSchema<string>;
48
+ export declare function string(): import("@tsed/schema").JsonSchema<string>;
@@ -5,4 +5,4 @@
5
5
  *
6
6
  * @schemaFunctional
7
7
  */
8
- export declare function uri(): import("../index.js").JsonSchema<string>;
8
+ export declare function uri(): import("@tsed/schema").JsonSchema<string>;
@@ -5,4 +5,4 @@
5
5
  *
6
6
  * @schemaFunctional
7
7
  */
8
- export declare function url(): import("../index.js").JsonSchema<string>;
8
+ export declare function url(): import("@tsed/schema").JsonSchema<string>;
@@ -1,3 +1,3 @@
1
1
  import type { JsonSchema } from "../domain/JsonSchema.js";
2
- import type { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
2
+ import type { JsonSchemaOptions } from "../domain/JsonSchemaOptions.js";
3
3
  export declare function alterOneOf(obj: any, schema: JsonSchema, options: JsonSchemaOptions): any;
@@ -1,5 +1,5 @@
1
1
  import type { JsonSchema } from "../domain/JsonSchema.js";
2
- import type { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
2
+ import type { JsonSchemaOptions } from "../domain/JsonSchemaOptions.js";
3
3
  /**
4
4
  * @ignore
5
5
  */
@@ -1,34 +1,45 @@
1
1
  /**
2
2
  * @file Automatically generated by @tsed/barrels.
3
3
  */
4
- export * from "./components/default/anyMapper.js";
5
- export * from "./components/default/classMapper.js";
6
- export * from "./components/default/discriminatorMappingMapper.js";
7
- export * from "./components/default/enumsMapper.js";
8
- export * from "./components/default/genericsMapper.js";
9
- export * from "./components/default/inheritedClassMapper.js";
10
- export * from "./components/default/lazyRefMapper.js";
11
- export * from "./components/default/mapMapper.js";
12
- export * from "./components/default/nextMapper.js";
13
- export * from "./components/default/nullableMapper.js";
14
- export * from "./components/default/objectMapper.js";
15
- export * from "./components/default/ofMapper.js";
16
- export * from "./components/default/requiredMapper.js";
17
- export * from "./components/default/schemaMapper.js";
4
+ export * from "./compat.js";
18
5
  export * from "./components/index.js";
19
- export * from "./components/open-spec/discriminatorMappingMapper.js";
20
- export * from "./components/open-spec/enumsMapper.js";
21
- export * from "./components/open-spec/generate.js";
22
- export * from "./components/open-spec/nullableMapper.js";
23
- export * from "./components/open-spec/operationInFilesMapper.js";
24
- export * from "./components/open-spec/operationInParameterMapper.js";
25
- export * from "./components/open-spec/operationInParametersMapper.js";
26
- export * from "./components/open-spec/operationInQueryMapper.js";
27
- export * from "./components/open-spec/operationMapper.js";
28
- export * from "./components/open-spec/operationMediaMapper.js";
29
- export * from "./components/open-spec/operationRequestBodyMapper.js";
30
- export * from "./components/open-spec/operationResponseMapper.js";
31
- export * from "./components/open-spec/pathsMapper.js";
6
+ export * from "./components/mappers/default/anyMapper.js";
7
+ export * from "./components/mappers/default/classMapper.js";
8
+ export * from "./components/mappers/default/discriminatorMappingMapper.js";
9
+ export * from "./components/mappers/default/enumsMapper.js";
10
+ export * from "./components/mappers/default/genericsMapper.js";
11
+ export * from "./components/mappers/default/inheritedClassMapper.js";
12
+ export * from "./components/mappers/default/lazyRefMapper.js";
13
+ export * from "./components/mappers/default/mapMapper.js";
14
+ export * from "./components/mappers/default/nextMapper.js";
15
+ export * from "./components/mappers/default/nullableMapper.js";
16
+ export * from "./components/mappers/default/objectMapper.js";
17
+ export * from "./components/mappers/default/ofMapper.js";
18
+ export * from "./components/mappers/default/requiredMapper.js";
19
+ export * from "./components/mappers/default/schemaMapper.js";
20
+ export * from "./components/mappers/open-spec/discriminatorMappingMapper.js";
21
+ export * from "./components/mappers/open-spec/enumsMapper.js";
22
+ export * from "./components/mappers/open-spec/generate.js";
23
+ export * from "./components/mappers/open-spec/nullableMapper.js";
24
+ export * from "./components/mappers/open-spec/operationInFilesMapper.js";
25
+ export * from "./components/mappers/open-spec/operationInParameterMapper.js";
26
+ export * from "./components/mappers/open-spec/operationInParametersMapper.js";
27
+ export * from "./components/mappers/open-spec/operationInQueryMapper.js";
28
+ export * from "./components/mappers/open-spec/operationMapper.js";
29
+ export * from "./components/mappers/open-spec/operationMediaMapper.js";
30
+ export * from "./components/mappers/open-spec/operationRequestBodyMapper.js";
31
+ export * from "./components/mappers/open-spec/operationResponseMapper.js";
32
+ export * from "./components/mappers/open-spec/pathsMapper.js";
33
+ export * from "./components/stores/JsonClassStore.js";
34
+ export * from "./components/stores/JsonMethodStore.js";
35
+ export * from "./components/stores/JsonParameterStore.js";
36
+ export * from "./components/stores/JsonPropertyStore.js";
37
+ export * from "./components/types/arrayType.js";
38
+ export * from "./components/types/classType.js";
39
+ export * from "./components/types/genericType.js";
40
+ export * from "./components/types/mapType.js";
41
+ export * from "./components/types/primitiveType.js";
42
+ export * from "./components/types/setType.js";
32
43
  export * from "./constants/httpStatusMessages.js";
33
44
  export * from "./constants/jsonSchemaProperties.js";
34
45
  export * from "./constants/OperationVerbs.js";
@@ -115,25 +126,27 @@ export * from "./decorators/operations/summary.js";
115
126
  export * from "./decorators/operations/tags.js";
116
127
  export * from "./decorators/operations/view.js";
117
128
  export * from "./domain/DecoratorContext.js";
129
+ export * from "./domain/Generics.js";
130
+ export * from "./domain/IgnoreCallback.js";
131
+ export * from "./domain/index.js";
118
132
  export * from "./domain/JsonAliasMap.js";
119
- export * from "./domain/JsonClassStore.js";
120
133
  export * from "./domain/JsonDiscriminator.js";
121
134
  export * from "./domain/JsonEntityStore.js";
122
135
  export * from "./domain/JsonFormatTypes.js";
136
+ export * from "./domain/JsonHookContext.js";
123
137
  export * from "./domain/JsonLazyRef.js";
124
138
  export * from "./domain/JsonMap.js";
125
139
  export * from "./domain/JsonMedia.js";
126
- export * from "./domain/JsonMethodStore.js";
140
+ export * from "./domain/JsonOpenSpec.js";
127
141
  export * from "./domain/JsonOperation.js";
128
142
  export * from "./domain/JsonOperationPathsMap.js";
129
143
  export * from "./domain/JsonOperationRoute.js";
130
144
  export * from "./domain/JsonParameter.js";
131
- export * from "./domain/JsonParameterStore.js";
132
145
  export * from "./domain/JsonParameterTypes.js";
133
- export * from "./domain/JsonPropertyStore.js";
134
146
  export * from "./domain/JsonRequestBody.js";
135
147
  export * from "./domain/JsonResponse.js";
136
148
  export * from "./domain/JsonSchema.js";
149
+ export * from "./domain/JsonSchemaOptions.js";
137
150
  export * from "./domain/SpecTypes.js";
138
151
  export * from "./domain/types.js";
139
152
  export * from "./fn/allOf.js";
@@ -141,14 +154,26 @@ export * from "./fn/any.js";
141
154
  export * from "./fn/anyOf.js";
142
155
  export * from "./fn/boolean.js";
143
156
  export * from "./fn/collection.js";
157
+ export * from "./fn/compile.js";
144
158
  export * from "./fn/date.js";
145
159
  export * from "./fn/email.js";
146
160
  export * from "./fn/enums.js";
147
161
  export * from "./fn/from.js";
162
+ export * from "./fn/generic.js";
148
163
  export * from "./fn/index.js";
149
164
  export * from "./fn/integer.js";
150
165
  export * from "./fn/lazyRef.js";
151
166
  export * from "./fn/number.js";
167
+ export * from "./fn/oas/compileSpec.js";
168
+ export * from "./fn/oas/generateSpec.js";
169
+ export * from "./fn/oas/getSpec.js";
170
+ export * from "./fn/oas/getSpecType.js";
171
+ export * from "./fn/oas/mapOpenSpec.js";
172
+ export * from "./fn/oas/mapOpenSpec2.js";
173
+ export * from "./fn/oas/mapOpenSpec3.js";
174
+ export * from "./fn/oas/mapOpenSpecInfo.js";
175
+ export * from "./fn/oas/mergeSpec.js";
176
+ export * from "./fn/oas/transformToOS2.js";
152
177
  export * from "./fn/object.js";
153
178
  export * from "./fn/oneOf.js";
154
179
  export * from "./fn/ref.js";
@@ -158,45 +183,31 @@ export * from "./fn/url.js";
158
183
  export * from "./hooks/alterIgnore.js";
159
184
  export * from "./hooks/alterOneOf.js";
160
185
  export * from "./hooks/alterRequiredGroups.js";
161
- export * from "./interfaces/IgnoreCallback.js";
162
- export * from "./interfaces/JsonHookContext.js";
163
- export * from "./interfaces/JsonOpenSpec.js";
164
- export * from "./interfaces/JsonSchemaOptions.js";
165
- export * from "./registries/enumRegistries.js";
186
+ export * from "./registries/enumRegistry.js";
187
+ export * from "./registries/JsonEntitiesContainer.js";
166
188
  export * from "./registries/JsonSchemaMapperContainer.js";
189
+ export * from "./registries/JsonTypesContainer.js";
167
190
  export * from "./utils/buildPath.js";
168
- export * from "./utils/compile.js";
169
191
  export * from "./utils/concatParameters.js";
170
192
  export * from "./utils/concatPath.js";
171
193
  export * from "./utils/defineStatusModel.js";
172
- export * from "./utils/generateSpec.js";
173
194
  export * from "./utils/generics.js";
174
195
  export * from "./utils/getComputedType.js";
175
196
  export * from "./utils/getInheritedStores.js";
176
- export * from "./utils/getJsonEntityStore.js";
177
197
  export * from "./utils/getJsonPathParameters.js";
178
- export * from "./utils/getJsonSchema.js";
179
198
  export * from "./utils/getJsonType.js";
180
199
  export * from "./utils/getOperationsRoutes.js";
181
200
  export * from "./utils/getOperationsStores.js";
182
201
  export * from "./utils/getPropertiesStores.js";
183
- export * from "./utils/getSpec.js";
184
- export * from "./utils/getSpecType.js";
185
202
  export * from "./utils/isSuccessStatus.js";
186
203
  export * from "./utils/mapHeaders.js";
187
- export * from "./utils/mapOpenSpec.js";
188
- export * from "./utils/mapOpenSpec2.js";
189
- export * from "./utils/mapOpenSpec3.js";
190
- export * from "./utils/mapOpenSpecInfo.js";
191
204
  export * from "./utils/mapOperationOptions.js";
192
205
  export * from "./utils/matchGroups.js";
193
206
  export * from "./utils/mergeSchema.js";
194
- export * from "./utils/mergeSpec.js";
195
207
  export * from "./utils/operationIdFormatter.js";
196
208
  export * from "./utils/ref.js";
197
209
  export * from "./utils/removeHiddenOperation.js";
198
210
  export * from "./utils/serializeEnumValues.js";
199
211
  export * from "./utils/toJsonMapCollection.js";
200
212
  export * from "./utils/toJsonRegex.js";
201
- export * from "./utils/transformToOS2.js";
202
213
  export * from "./utils/withErrorMsg.js";
@@ -1,15 +1,10 @@
1
- import { Type } from "@tsed/core";
2
- import { JsonClassStore } from "../domain/JsonClassStore.js";
3
- import { JsonEntityStore } from "../domain/JsonEntityStore.js";
4
- import { JsonMethodStore } from "../domain/JsonMethodStore.js";
5
- import { JsonParameterStore } from "../domain/JsonParameterStore.js";
6
- import { JsonPropertyStore } from "../domain/JsonPropertyStore.js";
7
- /**
8
- * Get entity store from decorator args
9
- * @param target
10
- */
1
+ import { DecoratorTypes, type Type } from "@tsed/core";
2
+ import type { JsonClassStore, JsonMethodStore, JsonParameterStore, JsonPropertyStore } from "../components/index.js";
3
+ import type { JsonEntityStore } from "../domain/JsonEntityStore.js";
4
+ export declare function defineStore(type: DecoratorTypes, store: Type<JsonEntityStore>): Type<JsonEntityStore>;
11
5
  export declare function getJsonEntityStore<T extends JsonClassStore = JsonClassStore>(target: Type<any>): T;
12
6
  export declare function getJsonEntityStore<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any, propertyKey: string | symbol): T;
13
7
  export declare function getJsonEntityStore<T extends JsonParameterStore = JsonParameterStore>(target: Type<any> | any, propertyKey: string | symbol, index: number): T;
14
8
  export declare function getJsonEntityStore<T extends JsonMethodStore = JsonMethodStore>(target: Type<any> | any, propertyKey: string | symbol, descriptor: PropertyDescriptor): T;
15
9
  export declare function getJsonEntityStore<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T;
10
+ export declare function getJsonMethodStore<T extends JsonMethodStore = JsonMethodStore>(target: any, propertyKey: string | symbol): T;
@@ -7,8 +7,14 @@ export interface JsonSchemaMapper {
7
7
  }
8
8
  /**
9
9
  * @ignore
10
+ * @deprecated
10
11
  */
11
- export declare function registerJsonSchemaMapper(type: string, mapper: JsonSchemaMapper, spec?: SpecTypes): Map<string, JsonSchemaMapper>;
12
+ export declare function registerJsonSchemaMapper(type: string, mapper: JsonSchemaMapper, spec?: SpecTypes): void;
13
+ export declare function defineSchemaMapper({ spec, type, transform }: {
14
+ type: string;
15
+ transform: JsonSchemaMapper;
16
+ spec?: SpecTypes | SpecTypes[];
17
+ }): void;
12
18
  /**
13
19
  * @ignore
14
20
  */
@@ -0,0 +1,15 @@
1
+ import type { JSONSchema7TypeName } from "json-schema";
2
+ import type { JsonSchema } from "../domain/index.js";
3
+ import { Type } from "@tsed/core";
4
+ export type AnyJsonType = string | Type | JSONSchema7TypeName | JSONSchema7TypeName[];
5
+ export interface JsonTypesResolver {
6
+ name: string;
7
+ priority?: number;
8
+ isCollection?: boolean;
9
+ match(type: AnyJsonType): boolean;
10
+ jsonType?(type: AnyJsonType): string;
11
+ targetType?(type: AnyJsonType): Type;
12
+ init?(schema: JsonSchema<any>, type: AnyJsonType): JsonSchema<any>;
13
+ }
14
+ export declare function defineType(resolver: JsonTypesResolver): JsonTypesResolver;
15
+ export declare function getTypeResolver(type: AnyJsonType): JsonTypesResolver | undefined;
@@ -1,2 +1,2 @@
1
- import { JsonSchema } from "../domain/JsonSchema.js";
1
+ import type { JsonSchema } from "../domain/JsonSchema.js";
2
2
  export declare const enumsRegistry: Map<any, JsonSchema<import("json-schema").JSONSchema7Type>>;
@@ -1,9 +1,17 @@
1
- import { Type } from "@tsed/core";
2
1
  import { JsonSchema } from "../domain/JsonSchema.js";
3
- import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
4
- export type GenericValue = Type<any> | JsonSchema | String | Number | Boolean | Object | Date;
5
- export type GenericsMap = Record<string, [GenericValue] | [GenericValue, GenericsMap]>;
2
+ import { JsonSchemaOptions } from "../domain/JsonSchemaOptions.js";
3
+ /**
4
+ * Resolve generic bindings for the current compilation.
5
+ *
6
+ * Local generics attached to the `JsonSchema` instance take precedence over the
7
+ * externally provided `options.generics` bindings.
8
+ */
9
+ export declare function getGenerics(value: JsonSchema, options: JsonSchemaOptions): import("@tsed/schema").GenericsMap | undefined;
10
+ /**
11
+ * Resolve generic bindings and the mapper strategy associated with their
12
+ * origin.
13
+ */
6
14
  export declare function getGenericsOptions(value: JsonSchema, options: JsonSchemaOptions): {
7
- generics: GenericsMap | undefined;
15
+ generics: import("@tsed/schema").GenericsMap | undefined;
8
16
  mapper: string;
9
17
  };
@@ -1,5 +1,5 @@
1
1
  import { Type } from "@tsed/core";
2
- import type { JsonClassStore } from "../domain/JsonClassStore.js";
2
+ import type { JsonClassStore } from "../components/stores/JsonClassStore.js";
3
3
  /**
4
4
  * Return store and his inherited stores
5
5
  * @param target