@tsed/schema 7.0.0-alpha.1 → 7.0.0-beta.3

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 (725) hide show
  1. package/benchmark/cold-start.js +17 -0
  2. package/jest.config.js +14 -0
  3. package/lib/cjs/components/anyMapper.js +23 -0
  4. package/lib/cjs/components/anyMapper.js.map +1 -0
  5. package/lib/cjs/components/classMapper.js +41 -0
  6. package/lib/cjs/components/classMapper.js.map +1 -0
  7. package/lib/cjs/components/genericsMapper.js +62 -0
  8. package/lib/cjs/components/genericsMapper.js.map +1 -0
  9. package/lib/cjs/components/index.js +15 -0
  10. package/lib/cjs/components/index.js.map +1 -0
  11. package/lib/cjs/components/inheritedClassMapper.js +22 -0
  12. package/lib/cjs/components/inheritedClassMapper.js.map +1 -0
  13. package/lib/cjs/components/itemMapper.js +10 -0
  14. package/lib/cjs/components/itemMapper.js.map +1 -0
  15. package/lib/cjs/components/lazyRefMapper.js +19 -0
  16. package/lib/cjs/components/lazyRefMapper.js.map +1 -0
  17. package/lib/cjs/components/mapMapper.js +25 -0
  18. package/lib/cjs/components/mapMapper.js.map +1 -0
  19. package/lib/cjs/components/objectMapper.js +31 -0
  20. package/lib/cjs/components/objectMapper.js.map +1 -0
  21. package/lib/cjs/components/ofMapper.js +17 -0
  22. package/lib/cjs/components/ofMapper.js.map +1 -0
  23. package/lib/cjs/components/propertiesMapper.js +25 -0
  24. package/lib/cjs/components/propertiesMapper.js.map +1 -0
  25. package/lib/cjs/components/schemaMapper.js +95 -0
  26. package/lib/cjs/components/schemaMapper.js.map +1 -0
  27. package/lib/cjs/constants/httpMethods.js +46 -0
  28. package/lib/cjs/constants/httpMethods.js.map +1 -0
  29. package/lib/cjs/constants/httpStatusMessages.js +110 -0
  30. package/lib/cjs/constants/httpStatusMessages.js.map +1 -0
  31. package/lib/cjs/decorators/class/children.js +24 -0
  32. package/lib/cjs/decorators/class/children.js.map +1 -0
  33. package/lib/cjs/decorators/collections/collectionContains.js +29 -0
  34. package/lib/cjs/decorators/collections/collectionContains.js.map +1 -0
  35. package/lib/cjs/decorators/collections/collectionOf.js +103 -0
  36. package/lib/cjs/decorators/collections/collectionOf.js.map +1 -0
  37. package/lib/cjs/decorators/collections/maxItems.js +60 -0
  38. package/lib/cjs/decorators/collections/maxItems.js.map +1 -0
  39. package/lib/cjs/decorators/collections/maxProperties.js +83 -0
  40. package/lib/cjs/decorators/collections/maxProperties.js.map +1 -0
  41. package/lib/cjs/decorators/collections/minItems.js +64 -0
  42. package/lib/cjs/decorators/collections/minItems.js.map +1 -0
  43. package/lib/cjs/decorators/collections/minProperties.js +82 -0
  44. package/lib/cjs/decorators/collections/minProperties.js.map +1 -0
  45. package/lib/cjs/decorators/collections/uniqueItems.js +60 -0
  46. package/lib/cjs/decorators/collections/uniqueItems.js.map +1 -0
  47. package/lib/cjs/decorators/common/additionalProperties.js +20 -0
  48. package/lib/cjs/decorators/common/additionalProperties.js.map +1 -0
  49. package/lib/cjs/decorators/common/allOf.js +22 -0
  50. package/lib/cjs/decorators/common/allOf.js.map +1 -0
  51. package/lib/cjs/decorators/common/allow.js +47 -0
  52. package/lib/cjs/decorators/common/allow.js.map +1 -0
  53. package/lib/cjs/decorators/common/any.js +46 -0
  54. package/lib/cjs/decorators/common/any.js.map +1 -0
  55. package/lib/cjs/decorators/common/anyOf.js +22 -0
  56. package/lib/cjs/decorators/common/anyOf.js.map +1 -0
  57. package/lib/cjs/decorators/common/const.js +70 -0
  58. package/lib/cjs/decorators/common/const.js.map +1 -0
  59. package/lib/cjs/decorators/common/customKey.js +43 -0
  60. package/lib/cjs/decorators/common/customKey.js.map +1 -0
  61. package/lib/cjs/decorators/common/default.js +51 -0
  62. package/lib/cjs/decorators/common/default.js.map +1 -0
  63. package/lib/cjs/decorators/common/description.js +76 -0
  64. package/lib/cjs/decorators/common/description.js.map +1 -0
  65. package/lib/cjs/decorators/common/enum.js +30 -0
  66. package/lib/cjs/decorators/common/enum.js.map +1 -0
  67. package/lib/cjs/decorators/common/example.js +21 -0
  68. package/lib/cjs/decorators/common/example.js.map +1 -0
  69. package/lib/cjs/decorators/common/examples.js +21 -0
  70. package/lib/cjs/decorators/common/examples.js.map +1 -0
  71. package/lib/cjs/decorators/common/exclusiveMaximum.js +77 -0
  72. package/lib/cjs/decorators/common/exclusiveMaximum.js.map +1 -0
  73. package/lib/cjs/decorators/common/exclusiveMinimum.js +77 -0
  74. package/lib/cjs/decorators/common/exclusiveMinimum.js.map +1 -0
  75. package/lib/cjs/decorators/common/format.js +486 -0
  76. package/lib/cjs/decorators/common/format.js.map +1 -0
  77. package/lib/cjs/decorators/common/forwardGroups.js +20 -0
  78. package/lib/cjs/decorators/common/forwardGroups.js.map +1 -0
  79. package/lib/cjs/decorators/common/groups.js +41 -0
  80. package/lib/cjs/decorators/common/groups.js.map +1 -0
  81. package/lib/cjs/decorators/common/hidden.js +40 -0
  82. package/lib/cjs/decorators/common/hidden.js.map +1 -0
  83. package/lib/cjs/decorators/common/ignore.js +71 -0
  84. package/lib/cjs/decorators/common/ignore.js.map +1 -0
  85. package/lib/cjs/decorators/common/integer.js +71 -0
  86. package/lib/cjs/decorators/common/integer.js.map +1 -0
  87. package/lib/cjs/decorators/common/jsonEntityFn.js +32 -0
  88. package/lib/cjs/decorators/common/jsonEntityFn.js.map +1 -0
  89. package/lib/cjs/decorators/common/maxLength.js +89 -0
  90. package/lib/cjs/decorators/common/maxLength.js.map +1 -0
  91. package/lib/cjs/decorators/common/maximum.js +151 -0
  92. package/lib/cjs/decorators/common/maximum.js.map +1 -0
  93. package/lib/cjs/decorators/common/minLength.js +90 -0
  94. package/lib/cjs/decorators/common/minLength.js.map +1 -0
  95. package/lib/cjs/decorators/common/minimum.js +149 -0
  96. package/lib/cjs/decorators/common/minimum.js.map +1 -0
  97. package/lib/cjs/decorators/common/multipleOf.js +81 -0
  98. package/lib/cjs/decorators/common/multipleOf.js.map +1 -0
  99. package/lib/cjs/decorators/common/name.js +52 -0
  100. package/lib/cjs/decorators/common/name.js.map +1 -0
  101. package/lib/cjs/decorators/common/nullable.js +34 -0
  102. package/lib/cjs/decorators/common/nullable.js.map +1 -0
  103. package/lib/cjs/decorators/common/oneOf.js +23 -0
  104. package/lib/cjs/decorators/common/oneOf.js.map +1 -0
  105. package/lib/cjs/decorators/common/optional.js +28 -0
  106. package/lib/cjs/decorators/common/optional.js.map +1 -0
  107. package/lib/cjs/decorators/common/pattern.js +103 -0
  108. package/lib/cjs/decorators/common/pattern.js.map +1 -0
  109. package/lib/cjs/decorators/common/property.js +27 -0
  110. package/lib/cjs/decorators/common/property.js.map +1 -0
  111. package/lib/cjs/decorators/common/readOnly.js +21 -0
  112. package/lib/cjs/decorators/common/readOnly.js.map +1 -0
  113. package/lib/cjs/decorators/common/required.js +53 -0
  114. package/lib/cjs/decorators/common/required.js.map +1 -0
  115. package/lib/cjs/decorators/common/requiredGroups.js +26 -0
  116. package/lib/cjs/decorators/common/requiredGroups.js.map +1 -0
  117. package/lib/cjs/decorators/common/schema.js +68 -0
  118. package/lib/cjs/decorators/common/schema.js.map +1 -0
  119. package/lib/cjs/decorators/common/title.js +49 -0
  120. package/lib/cjs/decorators/common/title.js.map +1 -0
  121. package/lib/cjs/decorators/common/writeOnly.js +21 -0
  122. package/lib/cjs/decorators/common/writeOnly.js.map +1 -0
  123. package/lib/cjs/decorators/config/jsonEntityComponent.js +18 -0
  124. package/lib/cjs/decorators/config/jsonEntityComponent.js.map +1 -0
  125. package/lib/cjs/decorators/generics/genericOf.js +99 -0
  126. package/lib/cjs/decorators/generics/genericOf.js.map +1 -0
  127. package/lib/cjs/decorators/generics/generics.js +25 -0
  128. package/lib/cjs/decorators/generics/generics.js.map +1 -0
  129. package/lib/cjs/decorators/index.js +77 -0
  130. package/lib/cjs/decorators/index.js.map +1 -0
  131. package/lib/cjs/decorators/operations/consumes.js +39 -0
  132. package/lib/cjs/decorators/operations/consumes.js.map +1 -0
  133. package/lib/cjs/decorators/operations/contentType.js +28 -0
  134. package/lib/cjs/decorators/operations/contentType.js.map +1 -0
  135. package/lib/cjs/decorators/operations/deprecated.js +43 -0
  136. package/lib/cjs/decorators/operations/deprecated.js.map +1 -0
  137. package/lib/cjs/decorators/operations/header.js +59 -0
  138. package/lib/cjs/decorators/operations/header.js.map +1 -0
  139. package/lib/cjs/decorators/operations/in.js +78 -0
  140. package/lib/cjs/decorators/operations/in.js.map +1 -0
  141. package/lib/cjs/decorators/operations/inFile.js +45 -0
  142. package/lib/cjs/decorators/operations/inFile.js.map +1 -0
  143. package/lib/cjs/decorators/operations/location.js +29 -0
  144. package/lib/cjs/decorators/operations/location.js.map +1 -0
  145. package/lib/cjs/decorators/operations/operationId.js +24 -0
  146. package/lib/cjs/decorators/operations/operationId.js.map +1 -0
  147. package/lib/cjs/decorators/operations/operationPath.js +34 -0
  148. package/lib/cjs/decorators/operations/operationPath.js.map +1 -0
  149. package/lib/cjs/decorators/operations/partial.js +18 -0
  150. package/lib/cjs/decorators/operations/partial.js.map +1 -0
  151. package/lib/cjs/decorators/operations/path.js +29 -0
  152. package/lib/cjs/decorators/operations/path.js.map +1 -0
  153. package/lib/cjs/decorators/operations/produces.js +46 -0
  154. package/lib/cjs/decorators/operations/produces.js.map +1 -0
  155. package/lib/cjs/decorators/operations/redirect.js +26 -0
  156. package/lib/cjs/decorators/operations/redirect.js.map +1 -0
  157. package/lib/cjs/decorators/operations/returns.js +252 -0
  158. package/lib/cjs/decorators/operations/returns.js.map +1 -0
  159. package/lib/cjs/decorators/operations/route.js +200 -0
  160. package/lib/cjs/decorators/operations/route.js.map +1 -0
  161. package/lib/cjs/decorators/operations/security.js +43 -0
  162. package/lib/cjs/decorators/operations/security.js.map +1 -0
  163. package/lib/cjs/decorators/operations/status.js +133 -0
  164. package/lib/cjs/decorators/operations/status.js.map +1 -0
  165. package/lib/cjs/decorators/operations/summary.js +34 -0
  166. package/lib/cjs/decorators/operations/summary.js.map +1 -0
  167. package/lib/cjs/decorators/operations/tags.js +52 -0
  168. package/lib/cjs/decorators/operations/tags.js.map +1 -0
  169. package/lib/cjs/domain/DecoratorContext.js +88 -0
  170. package/lib/cjs/domain/DecoratorContext.js.map +1 -0
  171. package/lib/cjs/domain/JsonAliasMap.js +15 -0
  172. package/lib/cjs/domain/JsonAliasMap.js.map +1 -0
  173. package/lib/cjs/domain/JsonClassStore.js +37 -0
  174. package/lib/cjs/domain/JsonClassStore.js.map +1 -0
  175. package/lib/cjs/domain/JsonEntityStore.js +166 -0
  176. package/lib/cjs/domain/JsonEntityStore.js.map +1 -0
  177. package/lib/cjs/domain/JsonFormatTypes.js +22 -0
  178. package/lib/cjs/domain/JsonFormatTypes.js.map +1 -0
  179. package/lib/cjs/domain/JsonLazyRef.js +26 -0
  180. package/lib/cjs/domain/JsonLazyRef.js.map +1 -0
  181. package/lib/cjs/domain/JsonMap.js +27 -0
  182. package/lib/cjs/domain/JsonMap.js.map +1 -0
  183. package/lib/cjs/domain/JsonMethodStore.js +101 -0
  184. package/lib/cjs/domain/JsonMethodStore.js.map +1 -0
  185. package/lib/cjs/domain/JsonOperation.js +250 -0
  186. package/lib/cjs/domain/JsonOperation.js.map +1 -0
  187. package/lib/cjs/domain/JsonOperationPathsMap.js +29 -0
  188. package/lib/cjs/domain/JsonOperationPathsMap.js.map +1 -0
  189. package/lib/cjs/domain/JsonOperationRoute.js +56 -0
  190. package/lib/cjs/domain/JsonOperationRoute.js.map +1 -0
  191. package/lib/cjs/domain/JsonParameter.js +125 -0
  192. package/lib/cjs/domain/JsonParameter.js.map +1 -0
  193. package/lib/cjs/domain/JsonParameterStore.js +90 -0
  194. package/lib/cjs/domain/JsonParameterStore.js.map +1 -0
  195. package/lib/cjs/domain/JsonParameterTypes.js +27 -0
  196. package/lib/cjs/domain/JsonParameterTypes.js.map +1 -0
  197. package/lib/cjs/domain/JsonPropertyStore.js +68 -0
  198. package/lib/cjs/domain/JsonPropertyStore.js.map +1 -0
  199. package/lib/cjs/domain/JsonRequestBody.js +32 -0
  200. package/lib/cjs/domain/JsonRequestBody.js.map +1 -0
  201. package/lib/cjs/domain/JsonResponse.js +86 -0
  202. package/lib/cjs/domain/JsonResponse.js.map +1 -0
  203. package/lib/cjs/domain/JsonSchema.js +723 -0
  204. package/lib/cjs/domain/JsonSchema.js.map +1 -0
  205. package/lib/cjs/domain/SpecTypes.js +9 -0
  206. package/lib/cjs/domain/SpecTypes.js.map +1 -0
  207. package/lib/cjs/domain/index.js +20 -0
  208. package/lib/cjs/domain/index.js.map +1 -0
  209. package/lib/cjs/hooks/alterIgnore.js +21 -0
  210. package/lib/cjs/hooks/alterIgnore.js.map +1 -0
  211. package/lib/cjs/hooks/alterOneOf.js +14 -0
  212. package/lib/cjs/hooks/alterOneOf.js.map +1 -0
  213. package/lib/cjs/hooks/alterRequiredGroups.js +15 -0
  214. package/lib/cjs/hooks/alterRequiredGroups.js.map +1 -0
  215. package/lib/cjs/index.js +24 -0
  216. package/lib/cjs/index.js.map +1 -0
  217. package/lib/cjs/interfaces/IgnoreCallback.js +3 -0
  218. package/lib/cjs/interfaces/IgnoreCallback.js.map +1 -0
  219. package/lib/cjs/interfaces/JsonHookContext.js +3 -0
  220. package/lib/cjs/interfaces/JsonHookContext.js.map +1 -0
  221. package/lib/cjs/interfaces/JsonOpenSpec.js +3 -0
  222. package/lib/cjs/interfaces/JsonOpenSpec.js.map +1 -0
  223. package/lib/cjs/interfaces/JsonSchemaOptions.js +3 -0
  224. package/lib/cjs/interfaces/JsonSchemaOptions.js.map +1 -0
  225. package/lib/cjs/interfaces/index.js +8 -0
  226. package/lib/cjs/interfaces/index.js.map +1 -0
  227. package/lib/cjs/registries/JsonSchemaMapperContainer.js +37 -0
  228. package/lib/cjs/registries/JsonSchemaMapperContainer.js.map +1 -0
  229. package/lib/cjs/utils/buildPath.js +13 -0
  230. package/lib/cjs/utils/buildPath.js.map +1 -0
  231. package/lib/cjs/utils/concatParameters.js +16 -0
  232. package/lib/cjs/utils/concatParameters.js.map +1 -0
  233. package/lib/cjs/utils/concatPath.js +8 -0
  234. package/lib/cjs/utils/concatPath.js.map +1 -0
  235. package/lib/cjs/utils/defineStatusModel.js +13 -0
  236. package/lib/cjs/utils/defineStatusModel.js.map +1 -0
  237. package/lib/cjs/utils/from.js +272 -0
  238. package/lib/cjs/utils/from.js.map +1 -0
  239. package/lib/cjs/utils/generics.js +40 -0
  240. package/lib/cjs/utils/generics.js.map +1 -0
  241. package/lib/cjs/utils/getComputedType.js +26 -0
  242. package/lib/cjs/utils/getComputedType.js.map +1 -0
  243. package/lib/cjs/utils/getInheritedStores.js +23 -0
  244. package/lib/cjs/utils/getInheritedStores.js.map +1 -0
  245. package/lib/cjs/utils/getJsonEntityStore.js +18 -0
  246. package/lib/cjs/utils/getJsonEntityStore.js.map +1 -0
  247. package/lib/cjs/utils/getJsonPathParameters.js +73 -0
  248. package/lib/cjs/utils/getJsonPathParameters.js.map +1 -0
  249. package/lib/cjs/utils/getJsonSchema.js +55 -0
  250. package/lib/cjs/utils/getJsonSchema.js.map +1 -0
  251. package/lib/cjs/utils/getJsonType.js +40 -0
  252. package/lib/cjs/utils/getJsonType.js.map +1 -0
  253. package/lib/cjs/utils/getOperationsRoutes.js +36 -0
  254. package/lib/cjs/utils/getOperationsRoutes.js.map +1 -0
  255. package/lib/cjs/utils/getOperationsStores.js +33 -0
  256. package/lib/cjs/utils/getOperationsStores.js.map +1 -0
  257. package/lib/cjs/utils/getPropertiesStores.js +45 -0
  258. package/lib/cjs/utils/getPropertiesStores.js.map +1 -0
  259. package/lib/cjs/utils/getRequiredProperties.js +66 -0
  260. package/lib/cjs/utils/getRequiredProperties.js.map +1 -0
  261. package/lib/cjs/utils/getSpec.js +87 -0
  262. package/lib/cjs/utils/getSpec.js.map +1 -0
  263. package/lib/cjs/utils/isSuccessStatus.js +8 -0
  264. package/lib/cjs/utils/isSuccessStatus.js.map +1 -0
  265. package/lib/cjs/utils/mapHeaders.js +29 -0
  266. package/lib/cjs/utils/mapHeaders.js.map +1 -0
  267. package/lib/cjs/utils/mapNullableType.js +44 -0
  268. package/lib/cjs/utils/mapNullableType.js.map +1 -0
  269. package/lib/cjs/utils/mapRouteOptions.js +26 -0
  270. package/lib/cjs/utils/mapRouteOptions.js.map +1 -0
  271. package/lib/cjs/utils/matchGroups.js +23 -0
  272. package/lib/cjs/utils/matchGroups.js.map +1 -0
  273. package/lib/cjs/utils/mergeOperation.js +44 -0
  274. package/lib/cjs/utils/mergeOperation.js.map +1 -0
  275. package/lib/cjs/utils/mergeSpec.js +46 -0
  276. package/lib/cjs/utils/mergeSpec.js.map +1 -0
  277. package/lib/cjs/utils/operationIdFormatter.js +37 -0
  278. package/lib/cjs/utils/operationIdFormatter.js.map +1 -0
  279. package/lib/cjs/utils/ref.js +65 -0
  280. package/lib/cjs/utils/ref.js.map +1 -0
  281. package/lib/cjs/utils/toJsonMapCollection.js +15 -0
  282. package/lib/cjs/utils/toJsonMapCollection.js.map +1 -0
  283. package/lib/cjs/utils/toJsonRegex.js +12 -0
  284. package/lib/cjs/utils/toJsonRegex.js.map +1 -0
  285. package/lib/esm/components/anyMapper.js +19 -0
  286. package/lib/esm/components/anyMapper.js.map +1 -0
  287. package/lib/esm/components/classMapper.js +37 -0
  288. package/lib/esm/components/classMapper.js.map +1 -0
  289. package/lib/esm/components/genericsMapper.js +58 -0
  290. package/lib/esm/components/genericsMapper.js.map +1 -0
  291. package/lib/esm/components/index.js +12 -0
  292. package/lib/esm/components/index.js.map +1 -0
  293. package/lib/esm/components/inheritedClassMapper.js +18 -0
  294. package/lib/esm/components/inheritedClassMapper.js.map +1 -0
  295. package/lib/esm/components/itemMapper.js +6 -0
  296. package/lib/esm/components/itemMapper.js.map +1 -0
  297. package/lib/esm/components/lazyRefMapper.js +15 -0
  298. package/lib/esm/components/lazyRefMapper.js.map +1 -0
  299. package/lib/esm/components/mapMapper.js +21 -0
  300. package/lib/esm/components/mapMapper.js.map +1 -0
  301. package/lib/esm/components/objectMapper.js +27 -0
  302. package/lib/esm/components/objectMapper.js.map +1 -0
  303. package/lib/esm/components/ofMapper.js +13 -0
  304. package/lib/esm/components/ofMapper.js.map +1 -0
  305. package/lib/esm/components/propertiesMapper.js +21 -0
  306. package/lib/esm/components/propertiesMapper.js.map +1 -0
  307. package/lib/esm/components/schemaMapper.js +91 -0
  308. package/lib/esm/components/schemaMapper.js.map +1 -0
  309. package/lib/esm/constants/httpMethods.js +43 -0
  310. package/lib/esm/constants/httpMethods.js.map +1 -0
  311. package/lib/esm/constants/httpStatusMessages.js +105 -0
  312. package/lib/esm/constants/httpStatusMessages.js.map +1 -0
  313. package/lib/esm/decorators/class/children.js +20 -0
  314. package/lib/esm/decorators/class/children.js.map +1 -0
  315. package/lib/esm/decorators/collections/collectionContains.js +25 -0
  316. package/lib/esm/decorators/collections/collectionContains.js.map +1 -0
  317. package/lib/esm/decorators/collections/collectionOf.js +97 -0
  318. package/lib/esm/decorators/collections/collectionOf.js.map +1 -0
  319. package/lib/esm/decorators/collections/maxItems.js +56 -0
  320. package/lib/esm/decorators/collections/maxItems.js.map +1 -0
  321. package/lib/esm/decorators/collections/maxProperties.js +79 -0
  322. package/lib/esm/decorators/collections/maxProperties.js.map +1 -0
  323. package/lib/esm/decorators/collections/minItems.js +60 -0
  324. package/lib/esm/decorators/collections/minItems.js.map +1 -0
  325. package/lib/esm/decorators/collections/minProperties.js +78 -0
  326. package/lib/esm/decorators/collections/minProperties.js.map +1 -0
  327. package/lib/esm/decorators/collections/uniqueItems.js +56 -0
  328. package/lib/esm/decorators/collections/uniqueItems.js.map +1 -0
  329. package/lib/esm/decorators/common/additionalProperties.js +16 -0
  330. package/lib/esm/decorators/common/additionalProperties.js.map +1 -0
  331. package/lib/esm/decorators/common/allOf.js +18 -0
  332. package/lib/esm/decorators/common/allOf.js.map +1 -0
  333. package/lib/esm/decorators/common/allow.js +43 -0
  334. package/lib/esm/decorators/common/allow.js.map +1 -0
  335. package/lib/esm/decorators/common/any.js +42 -0
  336. package/lib/esm/decorators/common/any.js.map +1 -0
  337. package/lib/esm/decorators/common/anyOf.js +18 -0
  338. package/lib/esm/decorators/common/anyOf.js.map +1 -0
  339. package/lib/esm/decorators/common/const.js +66 -0
  340. package/lib/esm/decorators/common/const.js.map +1 -0
  341. package/lib/esm/decorators/common/customKey.js +38 -0
  342. package/lib/esm/decorators/common/customKey.js.map +1 -0
  343. package/lib/esm/decorators/common/default.js +47 -0
  344. package/lib/esm/decorators/common/default.js.map +1 -0
  345. package/lib/esm/decorators/common/description.js +72 -0
  346. package/lib/esm/decorators/common/description.js.map +1 -0
  347. package/lib/esm/decorators/common/enum.js +26 -0
  348. package/lib/esm/decorators/common/enum.js.map +1 -0
  349. package/lib/esm/decorators/common/example.js +17 -0
  350. package/lib/esm/decorators/common/example.js.map +1 -0
  351. package/lib/esm/decorators/common/examples.js +17 -0
  352. package/lib/esm/decorators/common/examples.js.map +1 -0
  353. package/lib/esm/decorators/common/exclusiveMaximum.js +73 -0
  354. package/lib/esm/decorators/common/exclusiveMaximum.js.map +1 -0
  355. package/lib/esm/decorators/common/exclusiveMinimum.js +73 -0
  356. package/lib/esm/decorators/common/exclusiveMinimum.js.map +1 -0
  357. package/lib/esm/decorators/common/format.js +476 -0
  358. package/lib/esm/decorators/common/format.js.map +1 -0
  359. package/lib/esm/decorators/common/forwardGroups.js +16 -0
  360. package/lib/esm/decorators/common/forwardGroups.js.map +1 -0
  361. package/lib/esm/decorators/common/groups.js +37 -0
  362. package/lib/esm/decorators/common/groups.js.map +1 -0
  363. package/lib/esm/decorators/common/hidden.js +36 -0
  364. package/lib/esm/decorators/common/hidden.js.map +1 -0
  365. package/lib/esm/decorators/common/ignore.js +67 -0
  366. package/lib/esm/decorators/common/ignore.js.map +1 -0
  367. package/lib/esm/decorators/common/integer.js +67 -0
  368. package/lib/esm/decorators/common/integer.js.map +1 -0
  369. package/lib/esm/decorators/common/jsonEntityFn.js +28 -0
  370. package/lib/esm/decorators/common/jsonEntityFn.js.map +1 -0
  371. package/lib/esm/decorators/common/maxLength.js +85 -0
  372. package/lib/esm/decorators/common/maxLength.js.map +1 -0
  373. package/lib/esm/decorators/common/maximum.js +146 -0
  374. package/lib/esm/decorators/common/maximum.js.map +1 -0
  375. package/lib/esm/decorators/common/minLength.js +86 -0
  376. package/lib/esm/decorators/common/minLength.js.map +1 -0
  377. package/lib/esm/decorators/common/minimum.js +144 -0
  378. package/lib/esm/decorators/common/minimum.js.map +1 -0
  379. package/lib/esm/decorators/common/multipleOf.js +77 -0
  380. package/lib/esm/decorators/common/multipleOf.js.map +1 -0
  381. package/lib/esm/decorators/common/name.js +48 -0
  382. package/lib/esm/decorators/common/name.js.map +1 -0
  383. package/lib/esm/decorators/common/nullable.js +30 -0
  384. package/lib/esm/decorators/common/nullable.js.map +1 -0
  385. package/lib/esm/decorators/common/oneOf.js +19 -0
  386. package/lib/esm/decorators/common/oneOf.js.map +1 -0
  387. package/lib/esm/decorators/common/optional.js +24 -0
  388. package/lib/esm/decorators/common/optional.js.map +1 -0
  389. package/lib/esm/decorators/common/pattern.js +99 -0
  390. package/lib/esm/decorators/common/pattern.js.map +1 -0
  391. package/lib/esm/decorators/common/property.js +23 -0
  392. package/lib/esm/decorators/common/property.js.map +1 -0
  393. package/lib/esm/decorators/common/readOnly.js +17 -0
  394. package/lib/esm/decorators/common/readOnly.js.map +1 -0
  395. package/lib/esm/decorators/common/required.js +49 -0
  396. package/lib/esm/decorators/common/required.js.map +1 -0
  397. package/lib/esm/decorators/common/requiredGroups.js +22 -0
  398. package/lib/esm/decorators/common/requiredGroups.js.map +1 -0
  399. package/lib/esm/decorators/common/schema.js +63 -0
  400. package/lib/esm/decorators/common/schema.js.map +1 -0
  401. package/lib/esm/decorators/common/title.js +45 -0
  402. package/lib/esm/decorators/common/title.js.map +1 -0
  403. package/lib/esm/decorators/common/writeOnly.js +17 -0
  404. package/lib/esm/decorators/common/writeOnly.js.map +1 -0
  405. package/lib/esm/decorators/config/jsonEntityComponent.js +14 -0
  406. package/lib/esm/decorators/config/jsonEntityComponent.js.map +1 -0
  407. package/lib/esm/decorators/generics/genericOf.js +95 -0
  408. package/lib/esm/decorators/generics/genericOf.js.map +1 -0
  409. package/lib/esm/decorators/generics/generics.js +21 -0
  410. package/lib/esm/decorators/generics/generics.js.map +1 -0
  411. package/lib/esm/decorators/index.js +74 -0
  412. package/lib/esm/decorators/index.js.map +1 -0
  413. package/lib/esm/decorators/operations/consumes.js +35 -0
  414. package/lib/esm/decorators/operations/consumes.js.map +1 -0
  415. package/lib/esm/decorators/operations/contentType.js +24 -0
  416. package/lib/esm/decorators/operations/contentType.js.map +1 -0
  417. package/lib/esm/decorators/operations/deprecated.js +39 -0
  418. package/lib/esm/decorators/operations/deprecated.js.map +1 -0
  419. package/lib/esm/decorators/operations/header.js +55 -0
  420. package/lib/esm/decorators/operations/header.js.map +1 -0
  421. package/lib/esm/decorators/operations/in.js +74 -0
  422. package/lib/esm/decorators/operations/in.js.map +1 -0
  423. package/lib/esm/decorators/operations/inFile.js +41 -0
  424. package/lib/esm/decorators/operations/inFile.js.map +1 -0
  425. package/lib/esm/decorators/operations/location.js +25 -0
  426. package/lib/esm/decorators/operations/location.js.map +1 -0
  427. package/lib/esm/decorators/operations/operationId.js +20 -0
  428. package/lib/esm/decorators/operations/operationId.js.map +1 -0
  429. package/lib/esm/decorators/operations/operationPath.js +30 -0
  430. package/lib/esm/decorators/operations/operationPath.js.map +1 -0
  431. package/lib/esm/decorators/operations/partial.js +14 -0
  432. package/lib/esm/decorators/operations/partial.js.map +1 -0
  433. package/lib/esm/decorators/operations/path.js +25 -0
  434. package/lib/esm/decorators/operations/path.js.map +1 -0
  435. package/lib/esm/decorators/operations/produces.js +42 -0
  436. package/lib/esm/decorators/operations/produces.js.map +1 -0
  437. package/lib/esm/decorators/operations/redirect.js +22 -0
  438. package/lib/esm/decorators/operations/redirect.js.map +1 -0
  439. package/lib/esm/decorators/operations/returns.js +248 -0
  440. package/lib/esm/decorators/operations/returns.js.map +1 -0
  441. package/lib/esm/decorators/operations/route.js +188 -0
  442. package/lib/esm/decorators/operations/route.js.map +1 -0
  443. package/lib/esm/decorators/operations/security.js +39 -0
  444. package/lib/esm/decorators/operations/security.js.map +1 -0
  445. package/lib/esm/decorators/operations/status.js +129 -0
  446. package/lib/esm/decorators/operations/status.js.map +1 -0
  447. package/lib/esm/decorators/operations/summary.js +30 -0
  448. package/lib/esm/decorators/operations/summary.js.map +1 -0
  449. package/lib/esm/decorators/operations/tags.js +48 -0
  450. package/lib/esm/decorators/operations/tags.js.map +1 -0
  451. package/lib/esm/domain/DecoratorContext.js +84 -0
  452. package/lib/esm/domain/DecoratorContext.js.map +1 -0
  453. package/lib/esm/domain/JsonAliasMap.js +11 -0
  454. package/lib/esm/domain/JsonAliasMap.js.map +1 -0
  455. package/lib/esm/domain/JsonClassStore.js +34 -0
  456. package/lib/esm/domain/JsonClassStore.js.map +1 -0
  457. package/lib/esm/domain/JsonEntityStore.js +162 -0
  458. package/lib/esm/domain/JsonEntityStore.js.map +1 -0
  459. package/lib/esm/domain/JsonFormatTypes.js +19 -0
  460. package/lib/esm/domain/JsonFormatTypes.js.map +1 -0
  461. package/lib/esm/domain/JsonLazyRef.js +22 -0
  462. package/lib/esm/domain/JsonLazyRef.js.map +1 -0
  463. package/lib/esm/domain/JsonMap.js +23 -0
  464. package/lib/esm/domain/JsonMap.js.map +1 -0
  465. package/lib/esm/domain/JsonMethodStore.js +98 -0
  466. package/lib/esm/domain/JsonMethodStore.js.map +1 -0
  467. package/lib/esm/domain/JsonOperation.js +246 -0
  468. package/lib/esm/domain/JsonOperation.js.map +1 -0
  469. package/lib/esm/domain/JsonOperationPathsMap.js +25 -0
  470. package/lib/esm/domain/JsonOperationPathsMap.js.map +1 -0
  471. package/lib/esm/domain/JsonOperationRoute.js +52 -0
  472. package/lib/esm/domain/JsonOperationRoute.js.map +1 -0
  473. package/lib/esm/domain/JsonParameter.js +121 -0
  474. package/lib/esm/domain/JsonParameter.js.map +1 -0
  475. package/lib/esm/domain/JsonParameterStore.js +87 -0
  476. package/lib/esm/domain/JsonParameterStore.js.map +1 -0
  477. package/lib/esm/domain/JsonParameterTypes.js +22 -0
  478. package/lib/esm/domain/JsonParameterTypes.js.map +1 -0
  479. package/lib/esm/domain/JsonPropertyStore.js +65 -0
  480. package/lib/esm/domain/JsonPropertyStore.js.map +1 -0
  481. package/lib/esm/domain/JsonRequestBody.js +28 -0
  482. package/lib/esm/domain/JsonRequestBody.js.map +1 -0
  483. package/lib/esm/domain/JsonResponse.js +81 -0
  484. package/lib/esm/domain/JsonResponse.js.map +1 -0
  485. package/lib/esm/domain/JsonSchema.js +719 -0
  486. package/lib/esm/domain/JsonSchema.js.map +1 -0
  487. package/lib/esm/domain/SpecTypes.js +6 -0
  488. package/lib/esm/domain/SpecTypes.js.map +1 -0
  489. package/lib/esm/domain/index.js +17 -0
  490. package/lib/esm/domain/index.js.map +1 -0
  491. package/lib/esm/hooks/alterIgnore.js +17 -0
  492. package/lib/esm/hooks/alterIgnore.js.map +1 -0
  493. package/lib/esm/hooks/alterOneOf.js +10 -0
  494. package/lib/esm/hooks/alterOneOf.js.map +1 -0
  495. package/lib/esm/hooks/alterRequiredGroups.js +11 -0
  496. package/lib/esm/hooks/alterRequiredGroups.js.map +1 -0
  497. package/lib/esm/index.js +21 -0
  498. package/lib/esm/index.js.map +1 -0
  499. package/lib/esm/interfaces/IgnoreCallback.js +2 -0
  500. package/lib/esm/interfaces/IgnoreCallback.js.map +1 -0
  501. package/lib/esm/interfaces/JsonHookContext.js +2 -0
  502. package/lib/esm/interfaces/JsonHookContext.js.map +1 -0
  503. package/lib/esm/interfaces/JsonOpenSpec.js +2 -0
  504. package/lib/esm/interfaces/JsonOpenSpec.js.map +1 -0
  505. package/lib/esm/interfaces/JsonSchemaOptions.js +2 -0
  506. package/lib/esm/interfaces/JsonSchemaOptions.js.map +1 -0
  507. package/lib/esm/interfaces/index.js +5 -0
  508. package/lib/esm/interfaces/index.js.map +1 -0
  509. package/lib/esm/registries/JsonSchemaMapperContainer.js +30 -0
  510. package/lib/esm/registries/JsonSchemaMapperContainer.js.map +1 -0
  511. package/lib/esm/utils/buildPath.js +9 -0
  512. package/lib/esm/utils/buildPath.js.map +1 -0
  513. package/lib/esm/utils/concatParameters.js +12 -0
  514. package/lib/esm/utils/concatParameters.js.map +1 -0
  515. package/lib/esm/utils/concatPath.js +4 -0
  516. package/lib/esm/utils/concatPath.js.map +1 -0
  517. package/lib/esm/utils/defineStatusModel.js +8 -0
  518. package/lib/esm/utils/defineStatusModel.js.map +1 -0
  519. package/lib/esm/utils/from.js +249 -0
  520. package/lib/esm/utils/from.js.map +1 -0
  521. package/lib/esm/utils/generics.js +34 -0
  522. package/lib/esm/utils/generics.js.map +1 -0
  523. package/lib/esm/utils/getComputedType.js +22 -0
  524. package/lib/esm/utils/getComputedType.js.map +1 -0
  525. package/lib/esm/utils/getInheritedStores.js +19 -0
  526. package/lib/esm/utils/getInheritedStores.js.map +1 -0
  527. package/lib/esm/utils/getJsonEntityStore.js +14 -0
  528. package/lib/esm/utils/getJsonEntityStore.js.map +1 -0
  529. package/lib/esm/utils/getJsonPathParameters.js +69 -0
  530. package/lib/esm/utils/getJsonPathParameters.js.map +1 -0
  531. package/lib/esm/utils/getJsonSchema.js +51 -0
  532. package/lib/esm/utils/getJsonSchema.js.map +1 -0
  533. package/lib/esm/utils/getJsonType.js +36 -0
  534. package/lib/esm/utils/getJsonType.js.map +1 -0
  535. package/lib/esm/utils/getOperationsRoutes.js +32 -0
  536. package/lib/esm/utils/getOperationsRoutes.js.map +1 -0
  537. package/lib/esm/utils/getOperationsStores.js +29 -0
  538. package/lib/esm/utils/getOperationsStores.js.map +1 -0
  539. package/lib/esm/utils/getPropertiesStores.js +40 -0
  540. package/lib/esm/utils/getPropertiesStores.js.map +1 -0
  541. package/lib/esm/utils/getRequiredProperties.js +62 -0
  542. package/lib/esm/utils/getRequiredProperties.js.map +1 -0
  543. package/lib/esm/utils/getSpec.js +83 -0
  544. package/lib/esm/utils/getSpec.js.map +1 -0
  545. package/lib/esm/utils/isSuccessStatus.js +3 -0
  546. package/lib/esm/utils/isSuccessStatus.js.map +1 -0
  547. package/lib/esm/utils/mapHeaders.js +25 -0
  548. package/lib/esm/utils/mapHeaders.js.map +1 -0
  549. package/lib/esm/utils/mapNullableType.js +40 -0
  550. package/lib/esm/utils/mapNullableType.js.map +1 -0
  551. package/lib/esm/utils/mapRouteOptions.js +22 -0
  552. package/lib/esm/utils/mapRouteOptions.js.map +1 -0
  553. package/lib/esm/utils/matchGroups.js +18 -0
  554. package/lib/esm/utils/matchGroups.js.map +1 -0
  555. package/lib/esm/utils/mergeOperation.js +40 -0
  556. package/lib/esm/utils/mergeOperation.js.map +1 -0
  557. package/lib/esm/utils/mergeSpec.js +42 -0
  558. package/lib/esm/utils/mergeSpec.js.map +1 -0
  559. package/lib/esm/utils/operationIdFormatter.js +33 -0
  560. package/lib/esm/utils/operationIdFormatter.js.map +1 -0
  561. package/lib/esm/utils/ref.js +59 -0
  562. package/lib/esm/utils/ref.js.map +1 -0
  563. package/lib/esm/utils/toJsonMapCollection.js +11 -0
  564. package/lib/esm/utils/toJsonMapCollection.js.map +1 -0
  565. package/lib/esm/utils/toJsonRegex.js +8 -0
  566. package/lib/esm/utils/toJsonRegex.js.map +1 -0
  567. package/lib/{components → types/components}/anyMapper.d.ts +0 -0
  568. package/lib/{components → types/components}/classMapper.d.ts +1 -1
  569. package/lib/{components → types/components}/genericsMapper.d.ts +0 -0
  570. package/lib/{components → types/components}/index.d.ts +2 -0
  571. package/lib/{components → types/components}/inheritedClassMapper.d.ts +1 -1
  572. package/lib/{components → types/components}/itemMapper.d.ts +0 -0
  573. package/lib/types/components/lazyRefMapper.d.ts +3 -0
  574. package/lib/{components → types/components}/mapMapper.d.ts +1 -1
  575. package/lib/{components → types/components}/objectMapper.d.ts +0 -0
  576. package/lib/types/components/ofMapper.d.ts +3 -0
  577. package/lib/types/components/propertiesMapper.d.ts +3 -0
  578. package/lib/{components → types/components}/schemaMapper.d.ts +1 -1
  579. package/lib/types/constants/httpMethods.d.ts +12 -0
  580. package/lib/types/constants/httpStatusMessages.d.ts +272 -0
  581. package/lib/types/decorators/class/children.d.ts +11 -0
  582. package/lib/{decorators → types/decorators}/collections/collectionContains.d.ts +0 -0
  583. package/lib/{decorators → types/decorators}/collections/collectionOf.d.ts +1 -1
  584. package/lib/{decorators → types/decorators}/collections/maxItems.d.ts +0 -0
  585. package/lib/{decorators → types/decorators}/collections/maxProperties.d.ts +0 -0
  586. package/lib/{decorators → types/decorators}/collections/minItems.d.ts +0 -0
  587. package/lib/{decorators → types/decorators}/collections/minProperties.d.ts +0 -0
  588. package/lib/{decorators → types/decorators}/collections/uniqueItems.d.ts +0 -0
  589. package/lib/{decorators → types/decorators}/common/additionalProperties.d.ts +0 -0
  590. package/lib/{decorators → types/decorators}/common/allOf.d.ts +0 -0
  591. package/lib/{decorators → types/decorators}/common/allow.d.ts +0 -0
  592. package/lib/{decorators → types/decorators}/common/any.d.ts +1 -1
  593. package/lib/{decorators → types/decorators}/common/anyOf.d.ts +0 -4
  594. package/lib/{decorators → types/decorators}/common/const.d.ts +1 -1
  595. package/lib/{decorators → types/decorators}/common/customKey.d.ts +0 -0
  596. package/lib/{decorators → types/decorators}/common/default.d.ts +0 -0
  597. package/lib/{decorators → types/decorators}/common/description.d.ts +0 -0
  598. package/lib/{decorators → types/decorators}/common/enum.d.ts +1 -1
  599. package/lib/{decorators → types/decorators}/common/example.d.ts +0 -0
  600. package/lib/types/decorators/common/examples.d.ts +12 -0
  601. package/lib/{decorators → types/decorators}/common/exclusiveMaximum.d.ts +0 -0
  602. package/lib/{decorators → types/decorators}/common/exclusiveMinimum.d.ts +0 -0
  603. package/lib/{decorators → types/decorators}/common/format.d.ts +0 -0
  604. package/lib/{decorators → types/decorators}/common/forwardGroups.d.ts +0 -0
  605. package/lib/{decorators → types/decorators}/common/groups.d.ts +0 -0
  606. package/lib/{decorators → types/decorators}/common/hidden.d.ts +0 -0
  607. package/lib/{decorators → types/decorators}/common/ignore.d.ts +0 -0
  608. package/lib/{decorators → types/decorators}/common/integer.d.ts +0 -0
  609. package/lib/{decorators → types/decorators}/common/jsonEntityFn.d.ts +2 -2
  610. package/lib/{decorators → types/decorators}/common/maxLength.d.ts +0 -0
  611. package/lib/{decorators → types/decorators}/common/maximum.d.ts +0 -0
  612. package/lib/{decorators → types/decorators}/common/minLength.d.ts +0 -0
  613. package/lib/{decorators → types/decorators}/common/minimum.d.ts +0 -0
  614. package/lib/{decorators → types/decorators}/common/multipleOf.d.ts +0 -0
  615. package/lib/{decorators → types/decorators}/common/name.d.ts +0 -0
  616. package/lib/{decorators → types/decorators}/common/nullable.d.ts +1 -1
  617. package/lib/{decorators → types/decorators}/common/oneOf.d.ts +0 -4
  618. package/lib/{decorators → types/decorators}/common/optional.d.ts +0 -0
  619. package/lib/{decorators → types/decorators}/common/pattern.d.ts +0 -0
  620. package/lib/{decorators → types/decorators}/common/property.d.ts +1 -0
  621. package/lib/{decorators → types/decorators}/common/readOnly.d.ts +0 -0
  622. package/lib/{decorators → types/decorators}/common/required.d.ts +0 -0
  623. package/lib/{decorators → types/decorators}/common/requiredGroups.d.ts +1 -1
  624. package/lib/{decorators → types/decorators}/common/schema.d.ts +0 -0
  625. package/lib/{decorators → types/decorators}/common/title.d.ts +0 -0
  626. package/lib/{decorators → types/decorators}/common/writeOnly.d.ts +0 -0
  627. package/lib/{decorators → types/decorators}/config/jsonEntityComponent.d.ts +0 -0
  628. package/lib/{decorators → types/decorators}/generics/genericOf.d.ts +0 -0
  629. package/lib/{decorators → types/decorators}/generics/generics.d.ts +0 -0
  630. package/lib/{decorators → types/decorators}/index.d.ts +4 -0
  631. package/lib/{decorators → types/decorators}/operations/consumes.d.ts +0 -0
  632. package/lib/{decorators → types/decorators}/operations/contentType.d.ts +0 -0
  633. package/lib/{decorators → types/decorators}/operations/deprecated.d.ts +0 -0
  634. package/lib/{decorators → types/decorators}/operations/header.d.ts +0 -0
  635. package/lib/{decorators → types/decorators}/operations/in.d.ts +0 -0
  636. package/lib/types/decorators/operations/inFile.d.ts +25 -0
  637. package/lib/{decorators → types/decorators}/operations/location.d.ts +0 -0
  638. package/lib/{decorators → types/decorators}/operations/operationId.d.ts +0 -0
  639. package/lib/{decorators → types/decorators}/operations/operationPath.d.ts +1 -11
  640. package/lib/{decorators → types/decorators}/operations/partial.d.ts +0 -0
  641. package/lib/{decorators → types/decorators}/operations/path.d.ts +0 -0
  642. package/lib/{decorators → types/decorators}/operations/produces.d.ts +0 -0
  643. package/lib/{decorators → types/decorators}/operations/redirect.d.ts +0 -0
  644. package/lib/{decorators → types/decorators}/operations/returns.d.ts +16 -1
  645. package/lib/types/decorators/operations/route.d.ts +188 -0
  646. package/lib/{decorators → types/decorators}/operations/security.d.ts +0 -0
  647. package/lib/{decorators → types/decorators}/operations/status.d.ts +0 -0
  648. package/lib/{decorators → types/decorators}/operations/summary.d.ts +0 -0
  649. package/lib/{decorators → types/decorators}/operations/tags.d.ts +0 -0
  650. package/lib/{domain → types/domain}/DecoratorContext.d.ts +7 -2
  651. package/lib/{domain → types/domain}/JsonAliasMap.d.ts +0 -0
  652. package/lib/types/domain/JsonClassStore.d.ts +12 -0
  653. package/lib/types/domain/JsonEntityStore.d.ts +136 -0
  654. package/lib/{domain → types/domain}/JsonFormatTypes.d.ts +0 -0
  655. package/lib/{domain → types/domain}/JsonLazyRef.d.ts +0 -0
  656. package/lib/{domain → types/domain}/JsonMap.d.ts +0 -0
  657. package/lib/types/domain/JsonMethodStore.d.ts +40 -0
  658. package/lib/{domain → types/domain}/JsonOperation.d.ts +1 -0
  659. package/lib/types/domain/JsonOperationPathsMap.d.ts +7 -0
  660. package/lib/types/domain/JsonOperationRoute.d.ts +24 -0
  661. package/lib/{domain → types/domain}/JsonParameter.d.ts +3 -1
  662. package/lib/types/domain/JsonParameterStore.d.ts +30 -0
  663. package/lib/{domain → types/domain}/JsonParameterTypes.d.ts +0 -0
  664. package/lib/types/domain/JsonPropertyStore.d.ts +23 -0
  665. package/lib/{domain → types/domain}/JsonRequestBody.d.ts +0 -0
  666. package/lib/{domain → types/domain}/JsonResponse.d.ts +0 -0
  667. package/lib/{domain → types/domain}/JsonSchema.d.ts +6 -12
  668. package/lib/{domain → types/domain}/SpecTypes.d.ts +0 -1
  669. package/lib/{domain → types/domain}/index.d.ts +5 -0
  670. package/lib/{hooks → types/hooks}/alterIgnore.d.ts +0 -0
  671. package/lib/types/hooks/alterOneOf.d.ts +3 -0
  672. package/lib/{hooks → types/hooks}/alterRequiredGroups.d.ts +0 -0
  673. package/lib/{index.d.ts → types/index.d.ts} +4 -0
  674. package/lib/{interfaces → types/interfaces}/IgnoreCallback.d.ts +0 -0
  675. package/lib/{interfaces → types/interfaces}/JsonHookContext.d.ts +0 -0
  676. package/lib/{interfaces → types/interfaces}/JsonOpenSpec.d.ts +0 -0
  677. package/lib/{interfaces → types/interfaces}/JsonSchemaOptions.d.ts +2 -2
  678. package/lib/{interfaces → types/interfaces}/index.d.ts +0 -0
  679. package/lib/{registries → types/registries}/JsonSchemaMapperContainer.d.ts +3 -2
  680. package/lib/{utils → types/utils}/buildPath.d.ts +0 -0
  681. package/lib/{utils → types/utils}/concatParameters.d.ts +0 -0
  682. package/lib/types/utils/concatPath.d.ts +1 -0
  683. package/lib/{utils → types/utils}/defineStatusModel.d.ts +0 -0
  684. package/lib/{utils → types/utils}/from.d.ts +0 -0
  685. package/lib/{utils → types/utils}/generics.d.ts +0 -0
  686. package/lib/{utils → types/utils}/getComputedType.d.ts +0 -0
  687. package/lib/{utils → types/utils}/getInheritedStores.d.ts +2 -2
  688. package/lib/types/utils/getJsonEntityStore.d.ts +15 -0
  689. package/lib/{utils → types/utils}/getJsonPathParameters.d.ts +0 -0
  690. package/lib/types/utils/getJsonSchema.d.ts +4 -0
  691. package/lib/{utils → types/utils}/getJsonType.d.ts +0 -0
  692. package/lib/types/utils/getOperationsRoutes.d.ts +8 -0
  693. package/lib/types/utils/getOperationsStores.d.ts +6 -0
  694. package/lib/types/utils/getPropertiesStores.d.ts +20 -0
  695. package/lib/{utils → types/utils}/getRequiredProperties.d.ts +0 -0
  696. package/lib/types/utils/getSpec.d.ts +29 -0
  697. package/lib/{utils → types/utils}/isSuccessStatus.d.ts +0 -0
  698. package/lib/{utils → types/utils}/mapHeaders.d.ts +0 -0
  699. package/lib/{utils → types/utils}/mapNullableType.d.ts +0 -0
  700. package/lib/types/utils/mapRouteOptions.d.ts +5 -0
  701. package/lib/{utils → types/utils}/matchGroups.d.ts +0 -0
  702. package/lib/{utils → types/utils}/mergeOperation.d.ts +0 -0
  703. package/lib/{utils → types/utils}/mergeSpec.d.ts +2 -2
  704. package/lib/{utils → types/utils}/operationIdFormatter.d.ts +0 -0
  705. package/lib/types/utils/ref.d.ts +14 -0
  706. package/lib/{utils → types/utils}/toJsonMapCollection.d.ts +0 -0
  707. package/lib/{utils → types/utils}/toJsonRegex.d.ts +0 -0
  708. package/package.json +21 -14
  709. package/tsconfig.compile.esm.json +23 -0
  710. package/lib/components/lazyRefMapper.d.ts +0 -19
  711. package/lib/constants/httpStatusMessages.d.ts +0 -5
  712. package/lib/domain/JsonEntityStore.d.ts +0 -94
  713. package/lib/index.js +0 -7632
  714. package/lib/index.js.map +0 -1
  715. package/lib/index.modern.js +0 -7499
  716. package/lib/index.modern.js.map +0 -1
  717. package/lib/registries/JsonEntitiesContainer.d.ts +0 -6
  718. package/lib/utils/getJsonEntityStore.d.ts +0 -6
  719. package/lib/utils/getJsonSchema.d.ts +0 -5
  720. package/lib/utils/getOperationsStores.d.ts +0 -6
  721. package/lib/utils/getPropertiesStores.d.ts +0 -20
  722. package/lib/utils/getSpec.d.ts +0 -49
  723. package/lib/utils/isJsonClass.d.ts +0 -4
  724. package/lib/utils/mergeSpec.benchmark.d.ts +0 -1
  725. package/lib/utils/ref.d.ts +0 -46
@@ -0,0 +1,719 @@
1
+ var _JsonSchema_nullable, _JsonSchema_genericLabels, _JsonSchema_nestedGenerics, _JsonSchema_alias, _JsonSchema_itemSchema, _JsonSchema_target, _JsonSchema_isGeneric, _JsonSchema_isCollection, _JsonSchema_ref;
2
+ import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
+ import { classOf, Hooks, isArray, isClass, isFunction, isObject, nameOf, uniq } from "@tsed/core";
4
+ import { execMapper } from "../registries/JsonSchemaMapperContainer";
5
+ import { getComputedType } from "../utils/getComputedType";
6
+ import { getJsonType } from "../utils/getJsonType";
7
+ import { toJsonRegex } from "../utils/toJsonRegex";
8
+ import { JsonEntityStore } from "./JsonEntityStore";
9
+ function mapProperties(properties) {
10
+ // istanbul ignore next
11
+ if (properties instanceof JsonSchema) {
12
+ return properties;
13
+ }
14
+ return Object.entries(properties).reduce((properties, [key, schema]) => {
15
+ properties[toJsonRegex(key)] = mapToJsonSchema(schema);
16
+ return properties;
17
+ }, {});
18
+ }
19
+ function mapToJsonSchema(item) {
20
+ if (isArray(item)) {
21
+ return item.map(mapToJsonSchema);
22
+ }
23
+ if (item.isStore || item.isJsonSchema || item.isLazyRef) {
24
+ return item;
25
+ }
26
+ if (classOf(item) !== Object && isClass(item)) {
27
+ return JsonEntityStore.from(item).schema;
28
+ }
29
+ if (isObject(item)) {
30
+ return JsonSchema.from(item);
31
+ }
32
+ return item;
33
+ }
34
+ export class JsonSchema extends Map {
35
+ constructor(obj = {}) {
36
+ super();
37
+ this.isJsonSchema = true;
38
+ this.$hooks = new Hooks();
39
+ this.$required = new Set();
40
+ this.$allow = [];
41
+ this.$forwardGroups = false;
42
+ _JsonSchema_nullable.set(this, false);
43
+ _JsonSchema_genericLabels.set(this, void 0);
44
+ _JsonSchema_nestedGenerics.set(this, []);
45
+ _JsonSchema_alias.set(this, new Map());
46
+ _JsonSchema_itemSchema.set(this, void 0);
47
+ _JsonSchema_target.set(this, void 0);
48
+ _JsonSchema_isGeneric.set(this, false);
49
+ _JsonSchema_isCollection.set(this, false);
50
+ _JsonSchema_ref.set(this, false);
51
+ if (obj) {
52
+ this.assign(obj);
53
+ }
54
+ }
55
+ get alias() {
56
+ return __classPrivateFieldGet(this, _JsonSchema_alias, "f");
57
+ }
58
+ get nestedGenerics() {
59
+ return __classPrivateFieldGet(this, _JsonSchema_nestedGenerics, "f");
60
+ }
61
+ set nestedGenerics(value) {
62
+ __classPrivateFieldSet(this, _JsonSchema_nestedGenerics, value, "f");
63
+ }
64
+ get genericLabels() {
65
+ return __classPrivateFieldGet(this, _JsonSchema_genericLabels, "f");
66
+ }
67
+ set genericLabels(value) {
68
+ __classPrivateFieldSet(this, _JsonSchema_genericLabels, value, "f");
69
+ }
70
+ get isClass() {
71
+ return isClass(this.class) && ![Map, Array, Set, Object, Date, Boolean, Number, String].includes(__classPrivateFieldGet(this, _JsonSchema_target, "f"));
72
+ }
73
+ /**
74
+ * Current schema is a collection
75
+ */
76
+ get isCollection() {
77
+ return __classPrivateFieldGet(this, _JsonSchema_isCollection, "f");
78
+ }
79
+ /**
80
+ * Current schema is a generic
81
+ */
82
+ get isGeneric() {
83
+ return __classPrivateFieldGet(this, _JsonSchema_isGeneric, "f");
84
+ }
85
+ /**
86
+ * Current schema has generics items
87
+ */
88
+ get hasGenerics() {
89
+ return !!(this.nestedGenerics && this.nestedGenerics.length);
90
+ }
91
+ get genericType() {
92
+ return this.get("$ref");
93
+ }
94
+ get class() {
95
+ return this.getComputedType();
96
+ }
97
+ get canRef() {
98
+ return __classPrivateFieldGet(this, _JsonSchema_ref, "f");
99
+ }
100
+ get isNullable() {
101
+ return __classPrivateFieldGet(this, _JsonSchema_nullable, "f") || this.$allow.includes(null);
102
+ }
103
+ get isReadOnly() {
104
+ return this.get("readOnly");
105
+ }
106
+ get isWriteOnly() {
107
+ return this.get("writeOnly");
108
+ }
109
+ static from(obj = {}) {
110
+ return new JsonSchema(obj);
111
+ }
112
+ nullable(value) {
113
+ __classPrivateFieldSet(this, _JsonSchema_nullable, value, "f");
114
+ }
115
+ itemSchema(obj = {}) {
116
+ __classPrivateFieldSet(this, _JsonSchema_itemSchema, __classPrivateFieldGet(this, _JsonSchema_itemSchema, "f") || mapToJsonSchema(obj), "f");
117
+ __classPrivateFieldGet(this, _JsonSchema_itemSchema, "f").assign(obj);
118
+ return __classPrivateFieldGet(this, _JsonSchema_itemSchema, "f");
119
+ }
120
+ getAliasOf(property) {
121
+ return __classPrivateFieldGet(this, _JsonSchema_alias, "f").get(property);
122
+ }
123
+ addAlias(property, alias) {
124
+ __classPrivateFieldGet(this, _JsonSchema_alias, "f").set(property, alias);
125
+ __classPrivateFieldGet(this, _JsonSchema_alias, "f").set(alias, property);
126
+ return this;
127
+ }
128
+ removeAlias(property) {
129
+ const alias = __classPrivateFieldGet(this, _JsonSchema_alias, "f").get(property);
130
+ alias && __classPrivateFieldGet(this, _JsonSchema_alias, "f").delete(alias);
131
+ __classPrivateFieldGet(this, _JsonSchema_alias, "f").delete(property);
132
+ return this;
133
+ }
134
+ $id($id) {
135
+ super.set("$id", $id);
136
+ return this;
137
+ }
138
+ $ref($ref) {
139
+ super.set("$ref", $ref);
140
+ return this;
141
+ }
142
+ $schema($schema) {
143
+ super.set("$schema", $schema);
144
+ return this;
145
+ }
146
+ /**
147
+ * Create a ref and use name to sharing schema
148
+ * @param name
149
+ */
150
+ label(name) {
151
+ __classPrivateFieldSet(this, _JsonSchema_ref, true, "f");
152
+ super.set("name", name);
153
+ return this;
154
+ }
155
+ name(name) {
156
+ super.set("name", name);
157
+ return this;
158
+ }
159
+ ignore(cb) {
160
+ if (typeof cb === "boolean") {
161
+ const bool = cb;
162
+ cb = () => bool;
163
+ }
164
+ this.$hooks.on("ignore", cb);
165
+ return this;
166
+ }
167
+ /**
168
+ * This keyword can be used to supply a default JSON value associated with a particular schema.
169
+ * It is RECOMMENDED that a default value be valid against the associated schema.
170
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3
171
+ */
172
+ default(value) {
173
+ super.set("default", value);
174
+ return this;
175
+ }
176
+ /**
177
+ * More readible form of a one-element "enum"
178
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24
179
+ */
180
+ const(value) {
181
+ super.set("const", value);
182
+ return this;
183
+ }
184
+ /**
185
+ * This attribute is a string that provides a full description of the of purpose the instance property.
186
+ *
187
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
188
+ */
189
+ description(description) {
190
+ super.set("description", description);
191
+ return this;
192
+ }
193
+ /**
194
+ * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
195
+ * If "items" is an array of schemas, validation succeeds if every instance element
196
+ * at a position greater than the size of "items" validates against "additionalItems".
197
+ * Otherwise, "additionalItems" MUST be ignored, as the "items" schema
198
+ * (possibly the default value of an empty schema) is applied to all elements.
199
+ * Omitting this keyword has the same behavior as an empty schema.
200
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10
201
+ */
202
+ additionalItems(additionalItems) {
203
+ super.set("additionalItems", mapToJsonSchema(additionalItems));
204
+ return this;
205
+ }
206
+ /**
207
+ * An array instance is valid against "contains" if at least one of its elements is valid against the given schema.
208
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14
209
+ */
210
+ contains(contains) {
211
+ super.set("contains", mapToJsonSchema(contains));
212
+ return this;
213
+ }
214
+ /**
215
+ * Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword
216
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4
217
+ */
218
+ examples(examples) {
219
+ super.set("examples", examples);
220
+ return this;
221
+ }
222
+ /**
223
+ * Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword
224
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4
225
+ */
226
+ example(...examples) {
227
+ return this.examples(examples);
228
+ }
229
+ /**
230
+ * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
231
+ * Omitting this keyword has the same behavior as an empty schema.
232
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9
233
+ */
234
+ items(items) {
235
+ super.set("items", (__classPrivateFieldSet(this, _JsonSchema_itemSchema, mapToJsonSchema(items), "f")));
236
+ return this;
237
+ }
238
+ /**
239
+ * Must be a non-negative integer.
240
+ * An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.
241
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11
242
+ */
243
+ maxItems(maxItems) {
244
+ super.set("maxItems", maxItems);
245
+ return this;
246
+ }
247
+ /**
248
+ * Must be a non-negative integer.
249
+ * An array instance is valid against "maxItems" if its size is greater than, or equal to, the value of this keyword.
250
+ * Omitting this keyword has the same behavior as a value of 0.
251
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12
252
+ */
253
+ minItems(minItems) {
254
+ super.set("minItems", minItems);
255
+ return this;
256
+ }
257
+ /**
258
+ * If this keyword has boolean value false, the instance validates successfully.
259
+ * If it has boolean value true, the instance validates successfully if all of its elements are unique.
260
+ * Omitting this keyword has the same behavior as a value of false.
261
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13
262
+ */
263
+ uniqueItems(uniqueItems) {
264
+ super.set("uniqueItems", uniqueItems);
265
+ return this;
266
+ }
267
+ /**
268
+ * Must be a non-negative integer.
269
+ * An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword.
270
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15
271
+ */
272
+ maxProperties(maxProperties) {
273
+ super.set("maxProperties", maxProperties);
274
+ return this;
275
+ }
276
+ /**
277
+ * Must be a non-negative integer.
278
+ * An object instance is valid against "maxProperties" if its number of properties is greater than,
279
+ * or equal to, the value of this keyword.
280
+ * Omitting this keyword has the same behavior as a value of 0.
281
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16
282
+ */
283
+ minProperties(minProperties) {
284
+ super.set("minProperties", minProperties);
285
+ return this;
286
+ }
287
+ allow(...allow) {
288
+ this.$allow.push(...allow);
289
+ return this;
290
+ }
291
+ /**
292
+ * Elements of this array must be unique.
293
+ * An object instance is valid against this keyword if every item in the array is the name of a property in the instance.
294
+ * Omitting this keyword has the same behavior as an empty array.
295
+ *
296
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17
297
+ */
298
+ required(required = true) {
299
+ if (isArray(required)) {
300
+ this.$required.clear();
301
+ required.forEach((value) => this.$required.add(value));
302
+ }
303
+ else {
304
+ const schema = this.clone();
305
+ schema.$selfRequired = required;
306
+ return schema;
307
+ }
308
+ return this;
309
+ }
310
+ addRequired(property) {
311
+ this.$required.add(property);
312
+ return this;
313
+ }
314
+ removeRequired(property) {
315
+ this.$required.delete(property);
316
+ return this;
317
+ }
318
+ isRequired(property) {
319
+ return this.$required.has(property);
320
+ }
321
+ /**
322
+ * This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.
323
+ * Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value,
324
+ * the child instance for that name successfully validates against the corresponding schema.
325
+ * Omitting this keyword has the same behavior as an empty object.
326
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18
327
+ */
328
+ properties(properties) {
329
+ super.set("properties", mapProperties(properties));
330
+ return this;
331
+ }
332
+ addProperty(key, schema) {
333
+ const properties = this.get("properties") || {};
334
+ properties[key] = schema;
335
+ super.set("properties", mapProperties(properties));
336
+ return this;
337
+ }
338
+ /**
339
+ * This attribute is an object that defines the schema for a set of property names of an object instance.
340
+ * The name of each property of this attribute's object is a regular expression pattern in the ECMA 262, while the value is a schema.
341
+ * If the pattern matches the name of a property on the instance object, the value of the instance's property
342
+ * MUST be valid against the pattern name's schema value.
343
+ * Omitting this keyword has the same behavior as an empty object.
344
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19
345
+ */
346
+ patternProperties(patternProperties) {
347
+ super.set("patternProperties", mapProperties(patternProperties));
348
+ return this;
349
+ }
350
+ /**
351
+ * This attribute defines a schema for all properties that are not explicitly defined in an object type definition.
352
+ * If specified, the value MUST be a schema or a boolean.
353
+ * If false is provided, no additional properties are allowed beyond the properties defined in the schema.
354
+ * The default value is an empty schema which allows any value for additional properties.
355
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20
356
+ */
357
+ additionalProperties(additionalProperties) {
358
+ super.set("additionalProperties", mapToJsonSchema(additionalProperties));
359
+ return this;
360
+ }
361
+ /**
362
+ * This attribute defines a schema for all properties that are not explicitly defined in an object type definition.
363
+ * If specified, the value MUST be a schema or a boolean.
364
+ * If false is provided, no additional properties are allowed beyond the properties defined in the schema.
365
+ * The default value is an empty schema which allows any value for additional properties.
366
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20
367
+ * @alias additionalProperties
368
+ * @param unknown
369
+ */
370
+ unknown(unknown = true) {
371
+ return this.additionalProperties(unknown);
372
+ }
373
+ /**
374
+ * This keyword specifies rules that are evaluated if the instance is an object and contains a certain property.
375
+ * Each property specifies a dependency.
376
+ * If the dependency value is an array, each element in the array must be unique.
377
+ * Omitting this keyword has the same behavior as an empty object.
378
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21
379
+ */
380
+ dependencies(dependencies) {
381
+ super.set("dependencies", mapProperties(dependencies));
382
+ return this;
383
+ }
384
+ /**
385
+ * Takes a schema which validates the names of all properties rather than their values.
386
+ * Note the property name that the schema is testing will always be a string.
387
+ * Omitting this keyword has the same behavior as an empty schema.
388
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22
389
+ */
390
+ propertyNames(propertyNames) {
391
+ super.set("propertyNames", mapToJsonSchema(propertyNames));
392
+ return this;
393
+ }
394
+ /**
395
+ * This provides an enumeration of all possible values that are valid
396
+ * for the instance property. This MUST be an array, and each item in
397
+ * the array represents a possible value for the instance value. If
398
+ * this attribute is defined, the instance value MUST be one of the
399
+ * values in the array in order for the schema to be valid.
400
+ *
401
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23
402
+ */
403
+ enum(enumValues) {
404
+ super.set("enum", uniq(enumValues));
405
+ return this;
406
+ }
407
+ /**
408
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1
409
+ */
410
+ definitions(definitions) {
411
+ super.set("definitions", mapProperties(definitions));
412
+ return this;
413
+ }
414
+ /**
415
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26
416
+ */
417
+ allOf(allOf) {
418
+ super.set("allOf", allOf.map(mapToJsonSchema));
419
+ return this;
420
+ }
421
+ /**
422
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
423
+ */
424
+ anyOf(anyOf) {
425
+ super.set("anyOf", anyOf.map(mapToJsonSchema));
426
+ return this;
427
+ }
428
+ /**
429
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
430
+ */
431
+ oneOf(oneOf) {
432
+ super.set("oneOf", oneOf.map(mapToJsonSchema));
433
+ return this;
434
+ }
435
+ /**
436
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29
437
+ */
438
+ not(not) {
439
+ super.set("not", mapToJsonSchema(not));
440
+ return this;
441
+ }
442
+ /**
443
+ * Must be strictly greater than 0.
444
+ * A numeric instance is valid only if division by this keyword's value results in an integer.
445
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1
446
+ */
447
+ multipleOf(multipleOf) {
448
+ super.set("multipleOf", multipleOf);
449
+ return this;
450
+ }
451
+ /**
452
+ * Representing an inclusive upper limit for a numeric instance.
453
+ * This keyword validates only if the instance is less than or exactly equal to "maximum".
454
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2
455
+ */
456
+ maximum(maximum) {
457
+ super.set("maximum", maximum);
458
+ return this;
459
+ }
460
+ /**
461
+ * Representing an exclusive upper limit for a numeric instance.
462
+ * This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum".
463
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3
464
+ */
465
+ exclusiveMaximum(exclusiveMaximum) {
466
+ super.set("exclusiveMaximum", exclusiveMaximum);
467
+ return this;
468
+ }
469
+ /**
470
+ * Representing an inclusive lower limit for a numeric instance.
471
+ * This keyword validates only if the instance is greater than or exactly equal to "minimum".
472
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4
473
+ */
474
+ minimum(minimum) {
475
+ super.set("minimum", minimum);
476
+ return this;
477
+ }
478
+ /**
479
+ * Representing an exclusive lower limit for a numeric instance.
480
+ * This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum".
481
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5
482
+ */
483
+ exclusiveMinimum(exclusiveMinimum) {
484
+ super.set("exclusiveMinimum", exclusiveMinimum);
485
+ return this;
486
+ }
487
+ /**
488
+ * Must be a non-negative integer.
489
+ * A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.
490
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6
491
+ */
492
+ maxLength(maxLength) {
493
+ super.set("maxLength", maxLength);
494
+ return this;
495
+ }
496
+ /**
497
+ * Must be a non-negative integer.
498
+ * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
499
+ * Omitting this keyword has the same behavior as a value of 0.
500
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7
501
+ */
502
+ minLength(minLength) {
503
+ super.set("minLength", minLength);
504
+ return this;
505
+ }
506
+ /**
507
+ * Should be a valid regular expression, according to the ECMA 262 regular expression dialect.
508
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8
509
+ */
510
+ pattern(pattern) {
511
+ super.set("pattern", toJsonRegex(pattern));
512
+ return this;
513
+ }
514
+ /**
515
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8
516
+ */
517
+ format(format) {
518
+ super.set("format", format);
519
+ return this;
520
+ }
521
+ /**
522
+ * A single type, or a union of simple types
523
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25
524
+ */
525
+ type(type) {
526
+ switch (type) {
527
+ case Map:
528
+ super.set("type", getJsonType(type));
529
+ __classPrivateFieldSet(this, _JsonSchema_target, type, "f");
530
+ __classPrivateFieldSet(this, _JsonSchema_isCollection, true, "f");
531
+ if (!this.has("additionalProperties")) {
532
+ super.set("additionalProperties", this.itemSchema({}));
533
+ }
534
+ break;
535
+ case Array:
536
+ super.set("type", getJsonType(type));
537
+ __classPrivateFieldSet(this, _JsonSchema_target, type, "f");
538
+ __classPrivateFieldSet(this, _JsonSchema_isCollection, true, "f");
539
+ if (!this.has("items")) {
540
+ super.set("items", this.itemSchema({}));
541
+ }
542
+ break;
543
+ case Set:
544
+ super.set("type", getJsonType(type));
545
+ __classPrivateFieldSet(this, _JsonSchema_target, type, "f");
546
+ __classPrivateFieldSet(this, _JsonSchema_isCollection, true, "f");
547
+ this.uniqueItems(true);
548
+ if (!this.has("items")) {
549
+ super.set("items", this.itemSchema({}));
550
+ }
551
+ break;
552
+ case "integer":
553
+ super.set("type", getJsonType(type));
554
+ this.integer();
555
+ break;
556
+ case Object:
557
+ case Date:
558
+ case Boolean:
559
+ case Number:
560
+ case String:
561
+ super.set("type", getJsonType(type));
562
+ __classPrivateFieldSet(this, _JsonSchema_target, type, "f");
563
+ if (!this.has("properties")) {
564
+ super.set("properties", {});
565
+ }
566
+ break;
567
+ default:
568
+ if (isClass(type) || isFunction(type)) {
569
+ super.set("type", undefined);
570
+ __classPrivateFieldSet(this, _JsonSchema_target, type, "f");
571
+ if (!this.has("properties")) {
572
+ super.set("properties", {});
573
+ }
574
+ }
575
+ else {
576
+ const jsonType = getJsonType(type);
577
+ if (jsonType === "generic") {
578
+ __classPrivateFieldSet(this, _JsonSchema_isGeneric, true, "f");
579
+ super.set("$ref", type);
580
+ }
581
+ else {
582
+ super.set("type", jsonType);
583
+ }
584
+ }
585
+ }
586
+ return this;
587
+ }
588
+ any(...types) {
589
+ const hasClasses = types.filter((type) => isClass(type));
590
+ if (hasClasses.length >= 2) {
591
+ this.oneOf(types.filter((value) => {
592
+ if (value !== null) {
593
+ this.nullable(true);
594
+ return true;
595
+ }
596
+ return false;
597
+ }));
598
+ }
599
+ else {
600
+ // TODO when OS3 will the only minimal supported version, we'll can remove this code
601
+ if (types.length) {
602
+ types = uniq(types).map(getJsonType);
603
+ if (types.includes("null")) {
604
+ this.nullable(true);
605
+ types = types.filter((o) => o !== "null");
606
+ }
607
+ }
608
+ else {
609
+ types = ["integer", "number", "string", "boolean", "array", "object"];
610
+ this.nullable(true);
611
+ }
612
+ this.type(types.length === 1 ? types[0] : types);
613
+ }
614
+ return this;
615
+ }
616
+ integer() {
617
+ super.set("type", "integer");
618
+ super.set("multipleOf", 1.0);
619
+ return this;
620
+ }
621
+ /**
622
+ * This attribute is a string that provides a short description of the instance property.
623
+ *
624
+ * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
625
+ */
626
+ title(title) {
627
+ super.set("title", title);
628
+ return this;
629
+ }
630
+ readOnly(readOnly) {
631
+ super.set("readOnly", readOnly);
632
+ return this;
633
+ }
634
+ writeOnly(readOnly) {
635
+ super.set("writeOnly", readOnly);
636
+ return this;
637
+ }
638
+ customKey(key, value) {
639
+ super.set(`#${key}`, value);
640
+ return this;
641
+ }
642
+ toObject(options) {
643
+ return this.toJSON(options);
644
+ }
645
+ toJSON(options) {
646
+ let addDef = false;
647
+ if (!options) {
648
+ addDef = true;
649
+ options = { schemas: {} };
650
+ }
651
+ const schema = execMapper("schema", this, options);
652
+ if (addDef && options.schemas && Object.keys(options.schemas).length) {
653
+ schema.definitions = options.schemas;
654
+ }
655
+ return schema;
656
+ }
657
+ assign(obj = {}) {
658
+ const entries = obj instanceof JsonSchema ? [...obj.entries()] : Object.entries(obj);
659
+ entries.forEach(([key, value]) => {
660
+ this.set(key, value);
661
+ });
662
+ if (obj instanceof JsonSchema) {
663
+ this.$selfRequired = obj.$selfRequired;
664
+ obj.$required.forEach((key) => {
665
+ this.$required.add(key);
666
+ });
667
+ __classPrivateFieldSet(this, _JsonSchema_ref, __classPrivateFieldGet(obj, _JsonSchema_ref, "f"), "f");
668
+ __classPrivateFieldSet(this, _JsonSchema_alias, new Map(__classPrivateFieldGet(this, _JsonSchema_alias, "f").entries()), "f");
669
+ __classPrivateFieldGet(obj, _JsonSchema_genericLabels, "f") && (__classPrivateFieldSet(this, _JsonSchema_genericLabels, [...__classPrivateFieldGet(obj, _JsonSchema_genericLabels, "f")], "f"));
670
+ __classPrivateFieldSet(this, _JsonSchema_nestedGenerics, __classPrivateFieldGet(obj, _JsonSchema_nestedGenerics, "f").map((item) => [...item]), "f");
671
+ __classPrivateFieldSet(this, _JsonSchema_target, __classPrivateFieldGet(obj, _JsonSchema_target, "f"), "f");
672
+ __classPrivateFieldSet(this, _JsonSchema_isGeneric, __classPrivateFieldGet(obj, _JsonSchema_isGeneric, "f"), "f");
673
+ __classPrivateFieldSet(this, _JsonSchema_isCollection, __classPrivateFieldGet(obj, _JsonSchema_isCollection, "f"), "f");
674
+ __classPrivateFieldSet(this, _JsonSchema_ref, __classPrivateFieldGet(obj, _JsonSchema_ref, "f"), "f");
675
+ super.set("type", obj.get("type"));
676
+ }
677
+ return this;
678
+ }
679
+ set(key, value) {
680
+ if (key in this) {
681
+ isFunction(this[key]) && this[key](value);
682
+ }
683
+ else {
684
+ super.set(key, value);
685
+ }
686
+ return this;
687
+ }
688
+ /**
689
+ * Return the itemSchema computed type.
690
+ * If the type is a function used for recursive model,
691
+ * the function will be called to get the right type.
692
+ */
693
+ getComputedType() {
694
+ return getComputedType(__classPrivateFieldGet(this, _JsonSchema_target, "f"));
695
+ }
696
+ getComputedItemType() {
697
+ return __classPrivateFieldGet(this, _JsonSchema_itemSchema, "f") ? __classPrivateFieldGet(this, _JsonSchema_itemSchema, "f").getComputedType() : this.getComputedType();
698
+ }
699
+ /**
700
+ * Return the Json type as string
701
+ */
702
+ getJsonType() {
703
+ return this.get("type") || getJsonType(this.getComputedType());
704
+ }
705
+ getTarget() {
706
+ return __classPrivateFieldGet(this, _JsonSchema_target, "f");
707
+ }
708
+ /**
709
+ * Get the symbolic name of the entity
710
+ */
711
+ getName() {
712
+ return this.get("name") || (__classPrivateFieldGet(this, _JsonSchema_target, "f") ? nameOf(classOf(this.getComputedType())) : "");
713
+ }
714
+ clone() {
715
+ return new JsonSchema(this);
716
+ }
717
+ }
718
+ _JsonSchema_nullable = new WeakMap(), _JsonSchema_genericLabels = new WeakMap(), _JsonSchema_nestedGenerics = new WeakMap(), _JsonSchema_alias = new WeakMap(), _JsonSchema_itemSchema = new WeakMap(), _JsonSchema_target = new WeakMap(), _JsonSchema_isGeneric = new WeakMap(), _JsonSchema_isCollection = new WeakMap(), _JsonSchema_ref = new WeakMap();
719
+ //# sourceMappingURL=JsonSchema.js.map