@tsed/schema 8.34.0 → 8.36.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 (260) 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 +92 -137
  90. package/lib/esm/domain/index.js +26 -0
  91. package/lib/esm/fn/compile.js +82 -0
  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 +60 -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/getOperationsRoutes.js +3 -3
  110. package/lib/esm/utils/getOperationsStores.js +4 -4
  111. package/lib/esm/utils/getPropertiesStores.js +2 -2
  112. package/lib/esm/utils/inlineRefs.js +64 -0
  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 +20 -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/fn/compile.d.ts +21 -0
  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 +60 -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/inlineRefs.d.ts +7 -0
  210. package/lib/types/utils/mapHeaders.d.ts +1 -1
  211. package/lib/types/utils/operationIdFormatter.d.ts +1 -1
  212. package/lib/types/utils/ref.d.ts +1 -1
  213. package/lib/types/utils/removeHiddenOperation.d.ts +1 -1
  214. package/lib/types/utils/toJsonMapCollection.d.ts +1 -1
  215. package/package.json +18 -19
  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/esm/utils/getJsonSchema.js +0 -66
  223. package/lib/types/components/default/classMapper.d.ts +0 -3
  224. package/lib/types/components/default/enumsMapper.d.ts +0 -3
  225. package/lib/types/components/default/lazyRefMapper.d.ts +0 -3
  226. package/lib/types/components/default/ofMapper.d.ts +0 -3
  227. package/lib/types/components/default/requiredMapper.d.ts +0 -3
  228. package/lib/types/components/default/schemaMapper.d.ts +0 -3
  229. package/lib/types/components/open-spec/enumsMapper.d.ts +0 -3
  230. package/lib/types/components/open-spec/nullableMapper.d.ts +0 -3
  231. package/lib/types/components/open-spec/operationInParametersMapper.d.ts +0 -3
  232. package/lib/types/components/open-spec/operationMapper.d.ts +0 -3
  233. package/lib/types/components/open-spec/operationMediaMapper.d.ts +0 -3
  234. package/lib/types/components/open-spec/operationRequestBodyMapper.d.ts +0 -3
  235. package/lib/types/components/open-spec/operationResponseMapper.d.ts +0 -3
  236. package/lib/types/utils/compile.d.ts +0 -14
  237. package/lib/types/utils/getJsonSchema.d.ts +0 -6
  238. package/lib/esm/{interfaces/IgnoreCallback.js → domain/Generics.js} +0 -0
  239. package/lib/esm/{interfaces/JsonHookContext.js → domain/IgnoreCallback.js} +0 -0
  240. package/lib/esm/{interfaces/JsonOpenSpec.js → domain/JsonHookContext.js} +0 -0
  241. package/lib/esm/{interfaces/JsonSchemaOptions.js → domain/JsonOpenSpec.js} +0 -0
  242. package/lib/{types/components/open-spec/discriminatorMappingMapper.d.ts → esm/domain/JsonSchemaOptions.js} +0 -0
  243. package/lib/esm/{utils → fn/oas}/mapOpenSpec2.js +0 -0
  244. package/lib/esm/{utils → fn/oas}/mapOpenSpec3.js +0 -0
  245. package/lib/esm/{utils → fn/oas}/mapOpenSpecInfo.js +0 -0
  246. package/lib/esm/{utils → fn/oas}/mergeSpec.js +0 -0
  247. package/lib/esm/{utils → fn/oas}/transformToOS2.js +0 -0
  248. package/lib/esm/registries/{enumRegistries.js → enumRegistry.js} +0 -0
  249. package/lib/types/components/{open-spec/generate.d.ts → mappers/open-spec/discriminatorMappingMapper.d.ts} +0 -0
  250. package/lib/types/components/{open-spec → mappers/open-spec}/operationInFilesMapper.d.ts +0 -0
  251. package/lib/types/components/{open-spec → mappers/open-spec}/operationInQueryMapper.d.ts +0 -0
  252. package/lib/types/{interfaces → domain}/IgnoreCallback.d.ts +0 -0
  253. package/lib/types/{interfaces → domain}/JsonHookContext.d.ts +0 -0
  254. package/lib/types/{interfaces → domain}/JsonOpenSpec.d.ts +0 -0
  255. package/lib/types/{utils → fn/oas}/generateSpec.d.ts +1 -1
  256. /package/lib/types/{utils → fn/oas}/mapOpenSpec.d.ts +0 -0
  257. /package/lib/types/{utils → fn/oas}/mapOpenSpec2.d.ts +0 -0
  258. /package/lib/types/{utils → fn/oas}/mapOpenSpec3.d.ts +0 -0
  259. /package/lib/types/{utils → fn/oas}/mapOpenSpecInfo.d.ts +0 -0
  260. /package/lib/types/{utils → fn/oas}/mergeSpec.d.ts +0 -0
@@ -0,0 +1,3 @@
1
+ import { JsonSchema } from "../../../domain/JsonSchema.js";
2
+ import { JsonSchemaOptions } from "../../../domain/JsonSchemaOptions.js";
3
+ export declare function schemaMapper(schema: JsonSchema, opts: JsonSchemaOptions): any;
@@ -0,0 +1,3 @@
1
+ import { JsonSchema } from "../../../domain/index.js";
2
+ import { JsonSchemaOptions } from "../../../domain/JsonSchemaOptions.js";
3
+ export declare function wrapEnumsMapper(obj: any, schema: JsonSchema, options: JsonSchemaOptions): any;
@@ -0,0 +1,3 @@
1
+ import type { JsonSchema } from "../../../domain/JsonSchema.js";
2
+ import { JsonSchemaOptions } from "../../../domain/JsonSchemaOptions.js";
3
+ export declare function nullableMapperOpenApi(obj: any, schema: JsonSchema | null, options: JsonSchemaOptions): any;
@@ -1,7 +1,7 @@
1
- import { OS3Schema } from "@tsed/openspec";
2
1
  import type { JSONSchema6 } from "json-schema";
3
- import { JsonParameter } from "../../domain/JsonParameter.js";
4
- import { JsonSchemaOptions } from "../../interfaces/JsonSchemaOptions.js";
2
+ import { JsonParameter } from "../../../domain/JsonParameter.js";
3
+ import { JsonSchemaOptions } from "../../../domain/JsonSchemaOptions.js";
4
+ import { OS3Schema } from "@tsed/openspec";
5
5
  export type JsonParameterOptions = JsonSchemaOptions & {
6
6
  jsonParameter: JsonParameter;
7
7
  jsonSchema: JSONSchema6;
@@ -0,0 +1,3 @@
1
+ import { JsonParameter } from "../../../domain/JsonParameter.js";
2
+ import { JsonSchemaOptions } from "../../../domain/JsonSchemaOptions.js";
3
+ export declare function operationInParametersMapper(parameters: JsonParameter[], options: JsonSchemaOptions): any[];
@@ -0,0 +1,3 @@
1
+ import { JsonOperation } from "../../../domain/JsonOperation.js";
2
+ import { JsonSchemaOptions } from "../../../domain/JsonSchemaOptions.js";
3
+ export declare function operationMapper(jsonOperation: JsonOperation, { tags, defaultTags, ...options }?: JsonSchemaOptions): any;
@@ -0,0 +1,3 @@
1
+ import { JsonMedia } from "../../../domain/JsonMedia.js";
2
+ import { JsonSchemaOptions } from "../../../domain/JsonSchemaOptions.js";
3
+ export declare function operationMediaMapper(jsonMedia: JsonMedia, options: JsonSchemaOptions): any;
@@ -0,0 +1,3 @@
1
+ import { JsonParameter } from "../../../domain/JsonParameter.js";
2
+ import { JsonSchemaOptions } from "../../../domain/JsonSchemaOptions.js";
3
+ export declare function operationRequestBodyMapper(bodyParameters: JsonParameter[], { consumes, ...options }: JsonSchemaOptions): any;
@@ -0,0 +1,3 @@
1
+ import { JsonResponse } from "../../../domain/JsonResponse.js";
2
+ import { JsonSchemaOptions } from "../../../domain/JsonSchemaOptions.js";
3
+ export declare function operationResponseMapper(jsonResponse: JsonResponse, options?: JsonSchemaOptions): any;
@@ -1,3 +1,3 @@
1
1
  import { OS3Paths } from "@tsed/openspec";
2
- import { JsonSchemaOptions } from "../../interfaces/JsonSchemaOptions.js";
2
+ import { JsonSchemaOptions } from "../../../domain/JsonSchemaOptions.js";
3
3
  export declare function pathsMapper(model: any, { paths, rootPath, ...options }: JsonSchemaOptions): OS3Paths<import("@tsed/openspec").OS3Schema>;
@@ -1,4 +1,4 @@
1
- import { JsonEntityStore } from "./JsonEntityStore.js";
1
+ import { JsonEntityStore } from "../../domain/index.js";
2
2
  import type { JsonMethodStore } from "./JsonMethodStore.js";
3
3
  import type { JsonPropertyStore } from "./JsonPropertyStore.js";
4
4
  /**
@@ -21,10 +21,10 @@ import type { JsonPropertyStore } from "./JsonPropertyStore.js";
21
21
  *
22
22
  * ```typescript
23
23
  * // Get class store
24
- * const classStore = JsonEntityStore.from(MyClass);
24
+ * const classStore = s.store(MyClass);
25
25
  *
26
26
  * // Access class schema
27
- * const schema = classStore.schema;
27
+ * const schema = s.get(MyClass);
28
28
  *
29
29
  * // Get all properties
30
30
  * const properties = classStore.children;
@@ -83,5 +83,5 @@ export declare class JsonClassStore extends JsonEntityStore {
83
83
  readonly children: Map<string | number, JsonMethodStore | JsonPropertyStore>;
84
84
  get path(): string;
85
85
  set path(path: string);
86
- protected build(): void;
86
+ build(): void;
87
87
  }
@@ -1,9 +1,9 @@
1
1
  import { Type } from "@tsed/core";
2
- import { type JsonClassStore } from "./JsonClassStore.js";
3
- import { JsonEntityStore, JsonEntityStoreOptions } from "./JsonEntityStore.js";
4
- import { JsonOperation } from "./JsonOperation.js";
5
- import { type JsonParameterStore } from "./JsonParameterStore.js";
6
- import { JsonSchema } from "./JsonSchema.js";
2
+ import { JsonEntityStore, JsonEntityStoreOptions } from "../../domain/JsonEntityStore.js";
3
+ import type { JsonClassStore } from "./JsonClassStore.js";
4
+ import { JsonOperation } from "../../domain/JsonOperation.js";
5
+ import type { JsonParameterStore } from "./JsonParameterStore.js";
6
+ import { JsonSchema } from "../../domain/JsonSchema.js";
7
7
  /**
8
8
  * Configuration options for view rendering.
9
9
  *
@@ -41,7 +41,7 @@ export interface JsonRedirectOptions {
41
41
  *
42
42
  * ```typescript
43
43
  * // Get method store
44
- * const methodStore = JsonEntityStore.from(MyController, "myMethod");
44
+ * const methodStore = getJsonEntityStore(MyController, "myMethod");
45
45
  *
46
46
  * // Access operation for OpenAPI
47
47
  * const operation = methodStore.operation;
@@ -98,18 +98,11 @@ export declare class JsonMethodStore extends JsonEntityStore {
98
98
  get acceptMimes(): string[];
99
99
  set acceptMimes(mimes: string[]);
100
100
  get parameters(): JsonParameterStore[];
101
- get operationPaths(): Map<string, import("./JsonOperation.js").JsonMethodPath>;
101
+ get operationPaths(): Map<string, import("../../domain/JsonOperation.js").JsonMethodPath>;
102
102
  get collectionType(): Type<any>;
103
103
  set collectionType(type: Type<any>);
104
104
  get isCollection(): boolean;
105
105
  get schema(): JsonSchema;
106
- /**
107
- * Get an endpoint.
108
- * @param target
109
- * @param propertyKey
110
- * @param descriptor
111
- */
112
- static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): JsonMethodStore;
113
106
  /**
114
107
  * TODO must be located on JsonOperation level directly
115
108
  * @param status
@@ -123,13 +116,13 @@ export declare class JsonMethodStore extends JsonEntityStore {
123
116
  /**
124
117
  * Append middlewares to the beforeMiddlewares list.
125
118
  * @param args
126
- * @returns {EndpointMetadata}
119
+ * @returns {JsonMethodStore}
127
120
  */
128
121
  before(args: Function[]): this;
129
122
  /**
130
123
  * Append middlewares to the afterMiddlewares list.
131
124
  * @param args
132
- * @returns {EndpointMetadata}
125
+ * @returns {JsonMethodStore}
133
126
  */
134
127
  after(args: Function[]): this;
135
128
  /**
@@ -145,12 +138,12 @@ export declare class JsonMethodStore extends JsonEntityStore {
145
138
  */
146
139
  get<T = any>(key: any): T;
147
140
  getParamTypes(): Record<string, boolean>;
148
- protected build(): void;
141
+ build(): void;
149
142
  }
150
143
  /**
151
- * EndpointMetadata contains metadata about a controller and his method.
144
+ * JsonMethodStore contains metadata about a controller and his method.
152
145
  * Each annotation (@Get, @Body...) attached to a method are stored into endpoint.
153
- * EndpointMetadata converts this metadata to an array which contain arguments to call an Express method.
146
+ * JsonMethodStore converts this metadata to an array which contain arguments to call an Express method.
154
147
  *
155
148
  * Example :
156
149
  *
@@ -165,6 +158,27 @@ export declare class JsonMethodStore extends JsonEntityStore {
165
158
  *```
166
159
  *
167
160
  * @alias JsonMethodStore
161
+ * @deprecated use s.store.method() to retrieve endpoint metadata or JsonMethodStore instead
168
162
  */
169
163
  export type EndpointMetadata = JsonMethodStore;
164
+ /**
165
+ * JsonMethodStore contains metadata about a controller and his method.
166
+ * Each annotation (@Get, @Body...) attached to a method are stored into endpoint.
167
+ * JsonMethodStore converts this metadata to an array which contain arguments to call an Express method.
168
+ *
169
+ * Example :
170
+ *
171
+ *```ts
172
+ * @Controller("/my-path")
173
+ * provide MyClass {
174
+ *
175
+ * @Get("/")
176
+ * @Authenticated()
177
+ * public myMethod(){}
178
+ * }
179
+ *```
180
+ *
181
+ * @alias JsonMethodStore
182
+ * @deprecated use s.store.method() to retrieve endpoint metadata or JsonMethodStore instead
183
+ */
170
184
  export declare const EndpointMetadata: typeof JsonMethodStore;
@@ -1,7 +1,7 @@
1
1
  import { Type } from "@tsed/core";
2
- import { JsonEntityStore, JsonEntityStoreOptions } from "./JsonEntityStore.js";
2
+ import { JsonEntityStore, JsonEntityStoreOptions } from "../../domain/JsonEntityStore.js";
3
3
  import type { JsonMethodStore } from "./JsonMethodStore.js";
4
- import { JsonParameter } from "./JsonParameter.js";
4
+ import { JsonParameter } from "../../domain/JsonParameter.js";
5
5
  /**
6
6
  * Configuration options for creating a JsonParameterStore.
7
7
  *
@@ -128,19 +128,23 @@ export declare class JsonParameterStore extends JsonEntityStore {
128
128
  get required(): boolean;
129
129
  set required(value: boolean);
130
130
  get allowedRequiredValues(): any[];
131
- get schema(): import("./JsonSchema.js").JsonSchema<import("json-schema").JSONSchema7Type>;
131
+ get schema(): import("@tsed/schema").JsonSchema<import("json-schema").JSONSchema7Type>;
132
132
  static getParams<T extends JsonParameterStore = JsonParameterStore>(target: Type<any>, propertyKey: string | symbol): T[];
133
- static get(target: Type<any>, propertyKey: string | symbol, index: number): JsonParameterStore;
134
133
  /**
135
134
  * Check precondition between value, required and allowedRequiredValues to know if the entity is required.
136
135
  * @param value
137
136
  * @returns {boolean}
138
137
  */
139
138
  isRequired(value: any): boolean;
140
- protected build(): void;
139
+ build(): void;
141
140
  }
142
141
  /**
143
142
  * @alias JsonParameterStore
143
+ * @deprecated
144
144
  */
145
145
  export type ParamMetadata = JsonParameterStore;
146
+ /**
147
+ * @alias JsonParameterStore
148
+ * @deprecated
149
+ */
146
150
  export declare const ParamMetadata: typeof JsonParameterStore;
@@ -1,6 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import type { JsonClassStore } from "./JsonClassStore.js";
3
- import { JsonEntityStore } from "./JsonEntityStore.js";
2
+ import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
4
3
  /**
5
4
  * Store for property metadata and schema information.
6
5
  *
@@ -47,11 +46,15 @@ import { JsonEntityStore } from "./JsonEntityStore.js";
47
46
  */
48
47
  export declare class JsonPropertyStore extends JsonEntityStore {
49
48
  readonly parent: JsonClassStore;
50
- static get(target: Type<any>, propertyKey: string | symbol): JsonPropertyStore;
51
- protected build(): void;
49
+ build(): void;
52
50
  }
53
51
  /**
54
52
  * @alias JsonPropertyStore
53
+ * @deprecated
55
54
  */
56
55
  export type PropertyMetadata = JsonPropertyStore;
56
+ /**
57
+ * @alias JsonPropertyStore
58
+ * @deprecated
59
+ */
57
60
  export declare const PropertyMetadata: typeof JsonPropertyStore;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import type { JSONSchema6TypeName } from "json-schema";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * Allows a property to accept any type or a union of specified types.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { OpenSpecHash, OpenSpecRef, OS3Example } from "@tsed/openspec";
1
+ import { OS3Example, OpenSpecHash, OpenSpecRef } from "@tsed/openspec";
2
2
  /**
3
3
  * Adds named examples for parameters in OpenAPI 3.0 format.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { ValueOf } from "@tsed/core";
2
1
  import { JsonFormatTypes } from "../../domain/JsonFormatTypes.js";
2
+ import { ValueOf } from "@tsed/core";
3
3
  /**
4
4
  * Applies a format validation to string properties using JSON Schema's `format` keyword.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { IgnoreCallback } from "../../interfaces/IgnoreCallback.js";
1
+ import { IgnoreCallback } from "../../domain/IgnoreCallback.js";
2
2
  /**
3
3
  * Ignore the property when JsonMapper serialize the class to a Plain Object JavaScript.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { DecoratorParameters } from "@tsed/core";
2
- import type { JsonEntityStore } from "../../domain/JsonEntityStore.js";
2
+ import type { JsonEntityStore } from "../../domain/index.js";
3
3
  /**
4
4
  * Decorator util to compose another decorator. See @@Description@@ decorator implementation for more details.
5
5
  *
@@ -1,10 +1,11 @@
1
1
  import { DecoratorTypes, Type } from "@tsed/core";
2
- import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
2
+ import { JsonEntityStore } from "../../domain/index.js";
3
3
  /**
4
4
  * Declare a new JsonEntityStore class for a specific decorator type.
5
5
  *
6
6
  * @ignore
7
7
  * @param type
8
8
  * @decorator
9
+ * @deprecated
9
10
  */
10
11
  export declare function JsonEntityComponent(type: DecoratorTypes): (target: Type<JsonEntityStore>) => void;
@@ -1,4 +1,4 @@
1
- import { GenericValue } from "../../utils/generics.js";
1
+ import { GenericValue } from "../../domain/Generics.js";
2
2
  /**
3
3
  * @ignore
4
4
  */
@@ -1,4 +1,4 @@
1
- import { JsonHeader, JsonHeaders } from "../../interfaces/JsonOpenSpec.js";
1
+ import { JsonHeader, JsonHeaders } from "../../domain/JsonOpenSpec.js";
2
2
  /**
3
3
  * Sets the response’s HTTP header field to value. To set multiple fields at once, pass an object as the parameter.
4
4
  *
@@ -1,6 +1,5 @@
1
1
  import { Type } from "@tsed/core";
2
- import { JsonParameterTypes } from "../../domain/JsonParameterTypes.js";
3
- import { JsonSchema, JsonSchemaObject } from "../../domain/JsonSchema.js";
2
+ import { JsonParameterTypes, JsonSchema, JsonSchemaObject } from "../../domain/index.js";
4
3
  export interface InChainedDecorators {
5
4
  <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
6
5
  (target: Object, propertyKey: string | symbol, parameterIndex: number): void;
@@ -1,4 +1,4 @@
1
- import { JsonHeader } from "../../interfaces/JsonOpenSpec.js";
1
+ import { JsonHeader } from "../../domain/JsonOpenSpec.js";
2
2
  /**
3
3
  * Sets the response Location HTTP header to the specified path parameter.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonHeader } from "../../interfaces/JsonOpenSpec.js";
1
+ import { JsonHeader } from "../../domain/JsonOpenSpec.js";
2
2
  /**
3
3
  * Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code . If not specified, status defaults to “302 “Found”.
4
4
  *
@@ -1,8 +1,8 @@
1
+ import { JsonSchema, JsonSchemaObject } from "../../domain/index.js";
1
2
  import { Type } from "@tsed/core";
3
+ import { JsonHeader, JsonHeaders } from "../../domain/JsonOpenSpec.js";
4
+ import { GenericValue } from "../../domain/Generics.js";
2
5
  import { OS3Example } from "@tsed/openspec";
3
- import { JsonSchema, JsonSchemaObject } from "../../domain/JsonSchema.js";
4
- import { JsonHeader, JsonHeaders } from "../../interfaces/JsonOpenSpec.js";
5
- import { GenericValue } from "../../utils/generics.js";
6
6
  export interface ReturnsChainedDecorators {
7
7
  <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
8
8
  (target: Function): void;
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import { ReturnsChainedDecorators } from "./returns.js";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * Add responses documentation for a specific status code.
5
5
  *
@@ -0,0 +1,6 @@
1
+ import type { JsonSchema } from "./JsonSchema.js";
2
+ import { Type } from "@tsed/core";
3
+ export type GenericValue = Type<any> | JsonSchema | String | Number | Boolean | Object | Date;
4
+ export type GenericsMap = Record<string, [GenericValue] | [GenericValue, GenericsMap]>;
5
+ export type GenericInputValue = GenericValue | [GenericValue, GenericInput];
6
+ export type GenericInput = Record<string, GenericInputValue>;
@@ -1,13 +1,9 @@
1
1
  import { DecoratorTypes, Store, Type } from "@tsed/core";
2
- import type { JsonClassStore } from "./JsonClassStore.js";
3
- import type { JsonMethodStore } from "./JsonMethodStore.js";
4
- import type { JsonParameterStore } from "./JsonParameterStore.js";
5
- import type { JsonPropertyStore } from "./JsonPropertyStore.js";
2
+ import type { JsonClassStore } from "../components/stores/JsonClassStore.js";
3
+ import type { JsonMethodStore } from "../components/stores/JsonMethodStore.js";
4
+ import type { JsonParameterStore } from "../components/stores/JsonParameterStore.js";
5
+ import type { JsonPropertyStore } from "../components/stores/JsonPropertyStore.js";
6
6
  import type { JsonSchema } from "./JsonSchema.js";
7
- /**
8
- * @ignore
9
- */
10
- export declare const JsonEntitiesContainer: Map<DecoratorTypes, Type<JsonEntityStore>>;
11
7
  /**
12
8
  * Configuration options for creating a JsonEntityStore.
13
9
  *
@@ -54,13 +50,13 @@ export interface JsonEntityStoreOptions {
54
50
  *
55
51
  * ```typescript
56
52
  * // Get store for a class
57
- * const classStore = JsonEntityStore.from(MyClass);
53
+ * const classStore = getJsonEntityStore(MyClass);
58
54
  *
59
55
  * // Get store for a property
60
- * const propStore = JsonEntityStore.from(MyClass, "propertyName");
56
+ * const propStore = getJsonEntityStore(MyClass, "propertyName");
61
57
  *
62
58
  * // Get store for a method parameter
63
- * const paramStore = JsonEntityStore.from(MyClass, "methodName", 0);
59
+ * const paramStore = getJsonEntityStore(MyClass, "methodName", 0);
64
60
  * ```
65
61
  *
66
62
  * ### Architecture
@@ -146,13 +142,6 @@ export declare abstract class JsonEntityStore implements JsonEntityStoreOptions
146
142
  get isDiscriminatorChild(): boolean;
147
143
  get path(): string;
148
144
  set path(path: string);
149
- static from<T extends JsonClassStore = JsonClassStore>(target: Type<any>): T;
150
- static from<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any, propertyKey: string | symbol): T;
151
- static from<T extends JsonParameterStore = JsonParameterStore>(target: Type<any> | any, propertyKey: string | symbol, index: number): T;
152
- static from<T extends JsonMethodStore = JsonMethodStore>(target: Type<any> | any, propertyKey: string | symbol, descriptor: PropertyDescriptor): T;
153
- static from<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T;
154
- static fromMethod<T extends JsonMethodStore = JsonMethodStore>(target: any, propertyKey: string | symbol): T;
155
- static get(target: Type<any>, propertyKey: string | symbol, descriptor?: any): JsonEntityStore;
156
145
  isGetterOnly(): boolean | undefined;
157
146
  get<T = any>(key: string, defaultValue?: any): T;
158
147
  set(key: string, value?: any): Store;
@@ -162,6 +151,6 @@ export declare abstract class JsonEntityStore implements JsonEntityStoreOptions
162
151
  is(input: DecoratorTypes.PROP): this is JsonPropertyStore;
163
152
  is(input: DecoratorTypes.METHOD): this is JsonMethodStore;
164
153
  is(input: DecoratorTypes.PARAM): this is JsonParameterStore;
165
- protected abstract build(): void;
154
+ abstract build(): void;
166
155
  protected buildType(type: any): void;
167
156
  }
@@ -37,6 +37,6 @@ export declare class JsonLazyRef {
37
37
  readonly isLazyRef = true;
38
38
  constructor(getType: () => Type<any>);
39
39
  get target(): Type<any>;
40
- get schema(): import("./JsonSchema.js").JsonSchema<import("json-schema").JSONSchema7Type>;
40
+ get schema(): import("@tsed/schema").JsonSchema<import("json-schema").JSONSchema7Type>;
41
41
  get name(): string;
42
42
  }
@@ -1,4 +1,4 @@
1
- import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
1
+ import { JsonSchemaOptions } from "./JsonSchemaOptions.js";
2
2
  /**
3
3
  * Base class for JSON document representations using a Map structure.
4
4
  *
@@ -1,6 +1,6 @@
1
- import { OS3MediaType } from "@tsed/openspec";
2
1
  import { JsonMap } from "./JsonMap.js";
3
2
  import { JsonSchema } from "./JsonSchema.js";
3
+ import { OS3MediaType } from "@tsed/openspec";
4
4
  /**
5
5
  * Represents a media type definition for HTTP request or response bodies.
6
6
  *
@@ -1,5 +1,5 @@
1
- import { OpenSpecSecurity, OpenSpecTag, OS3Operation } from "@tsed/openspec";
2
- import { JsonHeader } from "../interfaces/JsonOpenSpec.js";
1
+ import { OS3Operation, OpenSpecSecurity, OpenSpecTag } from "@tsed/openspec";
2
+ import { JsonHeader } from "./JsonOpenSpec.js";
3
3
  import { JsonMap } from "./JsonMap.js";
4
4
  import { JsonParameter } from "./JsonParameter.js";
5
5
  import { JsonResponse } from "./JsonResponse.js";
@@ -1,6 +1,6 @@
1
- import { Type } from "@tsed/core";
2
- import { JsonMethodStore } from "./JsonMethodStore.js";
3
1
  import { JsonMethodPath, JsonOperation } from "./JsonOperation.js";
2
+ import type { JsonMethodStore } from "../components/stores/JsonMethodStore.js";
3
+ import { Type } from "@tsed/core";
4
4
  /**
5
5
  * Represents a fully resolved HTTP route combining controller and method metadata.
6
6
  *
@@ -69,7 +69,7 @@ export declare class JsonOperationRoute<Entity extends JsonMethodStore = JsonMet
69
69
  get name(): string;
70
70
  get className(): string;
71
71
  get methodClassName(): string;
72
- get parameters(): import("./JsonParameterStore.js").JsonParameterStore[];
72
+ get parameters(): import("@tsed/schema").JsonParameterStore[];
73
73
  get propertyKey(): string;
74
74
  get propertyName(): string;
75
75
  get store(): import("@tsed/core").Store;
@@ -1,7 +1,7 @@
1
- import { OpenSpecHash, OpenSpecRef, OS3Example, OS3Parameter } from "@tsed/openspec";
2
- import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
1
+ import { OS3Example, OS3Parameter, OpenSpecHash, OpenSpecRef } from "@tsed/openspec";
3
2
  import { JsonMap } from "./JsonMap.js";
4
3
  import { JsonSchema } from "./JsonSchema.js";
4
+ import { JsonSchemaOptions } from "./JsonSchemaOptions.js";
5
5
  /**
6
6
  * Represents an HTTP operation parameter for OpenAPI specifications.
7
7
  *
@@ -25,7 +25,7 @@ import { JsonSchema } from "./JsonSchema.js";
25
25
  * .in("path")
26
26
  * .required(true)
27
27
  * .description("The user identifier")
28
- * .schema(JsonSchema.from(String));
28
+ * .schema(s.string());
29
29
  * ```
30
30
  *
31
31
  * ### Key Features
@@ -1,4 +1,4 @@
1
- import { OpenSpecHash, OS3MediaType, OS3RequestBody } from "@tsed/openspec";
1
+ import { OS3MediaType, OS3RequestBody, OpenSpecHash } from "@tsed/openspec";
2
2
  import { JsonMap } from "./JsonMap.js";
3
3
  import { JsonSchema } from "./JsonSchema.js";
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { OS3MediaType, OS3Response } from "@tsed/openspec";
2
- import { JsonHeader } from "../interfaces/JsonOpenSpec.js";
2
+ import { JsonHeader } from "./JsonOpenSpec.js";
3
3
  import { JsonMap } from "./JsonMap.js";
4
4
  import { JsonMedia } from "./JsonMedia.js";
5
5
  import { JsonSchema } from "./JsonSchema.js";