@tsed/schema 6.88.1 → 6.92.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 (835) hide show
  1. package/lib/{components → cjs/components}/anyMapper.d.ts +0 -0
  2. package/lib/cjs/components/anyMapper.js +24 -0
  3. package/lib/cjs/components/anyMapper.js.map +1 -0
  4. package/lib/{components → cjs/components}/classMapper.d.ts +0 -0
  5. package/lib/cjs/components/classMapper.js +41 -0
  6. package/lib/cjs/components/classMapper.js.map +1 -0
  7. package/lib/{components → cjs/components}/genericsMapper.d.ts +0 -0
  8. package/lib/cjs/components/genericsMapper.js +62 -0
  9. package/lib/cjs/components/genericsMapper.js.map +1 -0
  10. package/lib/{components → cjs/components}/index.d.ts +0 -0
  11. package/lib/cjs/components/index.js +13 -0
  12. package/lib/cjs/components/index.js.map +1 -0
  13. package/lib/{components → cjs/components}/inheritedClassMapper.d.ts +0 -0
  14. package/lib/cjs/components/inheritedClassMapper.js +22 -0
  15. package/lib/cjs/components/inheritedClassMapper.js.map +1 -0
  16. package/lib/{components → cjs/components}/itemMapper.d.ts +0 -0
  17. package/lib/cjs/components/itemMapper.js +10 -0
  18. package/lib/cjs/components/itemMapper.js.map +1 -0
  19. package/lib/{components → cjs/components}/lazyRefMapper.d.ts +0 -0
  20. package/lib/cjs/components/lazyRefMapper.js +19 -0
  21. package/lib/cjs/components/lazyRefMapper.js.map +1 -0
  22. package/lib/{components → cjs/components}/mapMapper.d.ts +0 -0
  23. package/lib/cjs/components/mapMapper.js +25 -0
  24. package/lib/cjs/components/mapMapper.js.map +1 -0
  25. package/lib/{components → cjs/components}/objectMapper.d.ts +0 -0
  26. package/lib/cjs/components/objectMapper.js +25 -0
  27. package/lib/cjs/components/objectMapper.js.map +1 -0
  28. package/lib/{components → cjs/components}/schemaMapper.d.ts +0 -0
  29. package/lib/cjs/components/schemaMapper.js +100 -0
  30. package/lib/cjs/components/schemaMapper.js.map +1 -0
  31. package/lib/{constants → cjs/constants}/httpMethods.d.ts +0 -0
  32. package/lib/cjs/constants/httpMethods.js +46 -0
  33. package/lib/cjs/constants/httpMethods.js.map +1 -0
  34. package/lib/{constants → cjs/constants}/httpStatusMessages.d.ts +0 -0
  35. package/lib/cjs/constants/httpStatusMessages.js +110 -0
  36. package/lib/cjs/constants/httpStatusMessages.js.map +1 -0
  37. package/lib/{decorators → cjs/decorators}/class/children.d.ts +0 -0
  38. package/lib/cjs/decorators/class/children.js +24 -0
  39. package/lib/cjs/decorators/class/children.js.map +1 -0
  40. package/lib/{decorators → cjs/decorators}/collections/collectionContains.d.ts +0 -0
  41. package/lib/cjs/decorators/collections/collectionContains.js +29 -0
  42. package/lib/cjs/decorators/collections/collectionContains.js.map +1 -0
  43. package/lib/{decorators → cjs/decorators}/collections/collectionOf.d.ts +0 -0
  44. package/lib/cjs/decorators/collections/collectionOf.js +103 -0
  45. package/lib/cjs/decorators/collections/collectionOf.js.map +1 -0
  46. package/lib/{decorators → cjs/decorators}/collections/maxItems.d.ts +0 -0
  47. package/lib/cjs/decorators/collections/maxItems.js +60 -0
  48. package/lib/cjs/decorators/collections/maxItems.js.map +1 -0
  49. package/lib/{decorators → cjs/decorators}/collections/maxProperties.d.ts +0 -0
  50. package/lib/cjs/decorators/collections/maxProperties.js +83 -0
  51. package/lib/cjs/decorators/collections/maxProperties.js.map +1 -0
  52. package/lib/{decorators → cjs/decorators}/collections/minItems.d.ts +0 -0
  53. package/lib/cjs/decorators/collections/minItems.js +64 -0
  54. package/lib/cjs/decorators/collections/minItems.js.map +1 -0
  55. package/lib/{decorators → cjs/decorators}/collections/minProperties.d.ts +0 -0
  56. package/lib/cjs/decorators/collections/minProperties.js +82 -0
  57. package/lib/cjs/decorators/collections/minProperties.js.map +1 -0
  58. package/lib/{decorators → cjs/decorators}/collections/uniqueItems.d.ts +0 -0
  59. package/lib/cjs/decorators/collections/uniqueItems.js +60 -0
  60. package/lib/cjs/decorators/collections/uniqueItems.js.map +1 -0
  61. package/lib/{decorators → cjs/decorators}/common/additionalProperties.d.ts +0 -0
  62. package/lib/cjs/decorators/common/additionalProperties.js +20 -0
  63. package/lib/cjs/decorators/common/additionalProperties.js.map +1 -0
  64. package/lib/{decorators → cjs/decorators}/common/allOf.d.ts +0 -0
  65. package/lib/cjs/decorators/common/allOf.js +22 -0
  66. package/lib/cjs/decorators/common/allOf.js.map +1 -0
  67. package/lib/{decorators → cjs/decorators}/common/allow.d.ts +0 -0
  68. package/lib/cjs/decorators/common/allow.js +47 -0
  69. package/lib/cjs/decorators/common/allow.js.map +1 -0
  70. package/lib/{decorators → cjs/decorators}/common/any.d.ts +1 -1
  71. package/lib/cjs/decorators/common/any.js +46 -0
  72. package/lib/cjs/decorators/common/any.js.map +1 -0
  73. package/lib/{decorators → cjs/decorators}/common/anyOf.d.ts +0 -0
  74. package/lib/cjs/decorators/common/anyOf.js +26 -0
  75. package/lib/cjs/decorators/common/anyOf.js.map +1 -0
  76. package/lib/{decorators → cjs/decorators}/common/const.d.ts +1 -1
  77. package/lib/cjs/decorators/common/const.js +70 -0
  78. package/lib/cjs/decorators/common/const.js.map +1 -0
  79. package/lib/{decorators → cjs/decorators}/common/customKey.d.ts +0 -0
  80. package/lib/cjs/decorators/common/customKey.js +43 -0
  81. package/lib/cjs/decorators/common/customKey.js.map +1 -0
  82. package/lib/{decorators → cjs/decorators}/common/default.d.ts +0 -0
  83. package/lib/cjs/decorators/common/default.js +51 -0
  84. package/lib/cjs/decorators/common/default.js.map +1 -0
  85. package/lib/{decorators → cjs/decorators}/common/description.d.ts +0 -0
  86. package/lib/cjs/decorators/common/description.js +76 -0
  87. package/lib/cjs/decorators/common/description.js.map +1 -0
  88. package/lib/{decorators → cjs/decorators}/common/enum.d.ts +1 -1
  89. package/lib/cjs/decorators/common/enum.js +30 -0
  90. package/lib/cjs/decorators/common/enum.js.map +1 -0
  91. package/lib/{decorators → cjs/decorators}/common/example.d.ts +0 -0
  92. package/lib/cjs/decorators/common/example.js +21 -0
  93. package/lib/cjs/decorators/common/example.js.map +1 -0
  94. package/lib/{decorators → cjs/decorators}/common/examples.d.ts +0 -0
  95. package/lib/cjs/decorators/common/examples.js +21 -0
  96. package/lib/cjs/decorators/common/examples.js.map +1 -0
  97. package/lib/{decorators → cjs/decorators}/common/exclusiveMaximum.d.ts +0 -0
  98. package/lib/cjs/decorators/common/exclusiveMaximum.js +77 -0
  99. package/lib/cjs/decorators/common/exclusiveMaximum.js.map +1 -0
  100. package/lib/{decorators → cjs/decorators}/common/exclusiveMinimum.d.ts +0 -0
  101. package/lib/cjs/decorators/common/exclusiveMinimum.js +77 -0
  102. package/lib/cjs/decorators/common/exclusiveMinimum.js.map +1 -0
  103. package/lib/{decorators → cjs/decorators}/common/format.d.ts +0 -0
  104. package/lib/cjs/decorators/common/format.js +486 -0
  105. package/lib/cjs/decorators/common/format.js.map +1 -0
  106. package/lib/{decorators → cjs/decorators}/common/forwardGroups.d.ts +0 -0
  107. package/lib/cjs/decorators/common/forwardGroups.js +20 -0
  108. package/lib/cjs/decorators/common/forwardGroups.js.map +1 -0
  109. package/lib/{decorators → cjs/decorators}/common/groups.d.ts +0 -0
  110. package/lib/cjs/decorators/common/groups.js +41 -0
  111. package/lib/cjs/decorators/common/groups.js.map +1 -0
  112. package/lib/{decorators → cjs/decorators}/common/hidden.d.ts +0 -0
  113. package/lib/cjs/decorators/common/hidden.js +40 -0
  114. package/lib/cjs/decorators/common/hidden.js.map +1 -0
  115. package/lib/{decorators → cjs/decorators}/common/ignore.d.ts +0 -0
  116. package/lib/cjs/decorators/common/ignore.js +71 -0
  117. package/lib/cjs/decorators/common/ignore.js.map +1 -0
  118. package/lib/{decorators → cjs/decorators}/common/integer.d.ts +0 -0
  119. package/lib/cjs/decorators/common/integer.js +71 -0
  120. package/lib/cjs/decorators/common/integer.js.map +1 -0
  121. package/lib/{decorators → cjs/decorators}/common/jsonEntityFn.d.ts +0 -0
  122. package/lib/cjs/decorators/common/jsonEntityFn.js +32 -0
  123. package/lib/cjs/decorators/common/jsonEntityFn.js.map +1 -0
  124. package/lib/{decorators → cjs/decorators}/common/maxLength.d.ts +0 -0
  125. package/lib/cjs/decorators/common/maxLength.js +89 -0
  126. package/lib/cjs/decorators/common/maxLength.js.map +1 -0
  127. package/lib/{decorators → cjs/decorators}/common/maximum.d.ts +0 -0
  128. package/lib/cjs/decorators/common/maximum.js +151 -0
  129. package/lib/cjs/decorators/common/maximum.js.map +1 -0
  130. package/lib/{decorators → cjs/decorators}/common/minLength.d.ts +0 -0
  131. package/lib/cjs/decorators/common/minLength.js +90 -0
  132. package/lib/cjs/decorators/common/minLength.js.map +1 -0
  133. package/lib/{decorators → cjs/decorators}/common/minimum.d.ts +0 -0
  134. package/lib/cjs/decorators/common/minimum.js +149 -0
  135. package/lib/cjs/decorators/common/minimum.js.map +1 -0
  136. package/lib/{decorators → cjs/decorators}/common/multipleOf.d.ts +0 -0
  137. package/lib/cjs/decorators/common/multipleOf.js +81 -0
  138. package/lib/cjs/decorators/common/multipleOf.js.map +1 -0
  139. package/lib/{decorators → cjs/decorators}/common/name.d.ts +0 -0
  140. package/lib/cjs/decorators/common/name.js +52 -0
  141. package/lib/cjs/decorators/common/name.js.map +1 -0
  142. package/lib/{decorators → cjs/decorators}/common/nullable.d.ts +1 -1
  143. package/lib/cjs/decorators/common/nullable.js +34 -0
  144. package/lib/cjs/decorators/common/nullable.js.map +1 -0
  145. package/lib/{decorators → cjs/decorators}/common/oneOf.d.ts +0 -0
  146. package/lib/cjs/decorators/common/oneOf.js +26 -0
  147. package/lib/cjs/decorators/common/oneOf.js.map +1 -0
  148. package/lib/{decorators → cjs/decorators}/common/optional.d.ts +0 -0
  149. package/lib/cjs/decorators/common/optional.js +28 -0
  150. package/lib/cjs/decorators/common/optional.js.map +1 -0
  151. package/lib/{decorators → cjs/decorators}/common/pattern.d.ts +0 -0
  152. package/lib/cjs/decorators/common/pattern.js +103 -0
  153. package/lib/cjs/decorators/common/pattern.js.map +1 -0
  154. package/lib/{decorators → cjs/decorators}/common/property.d.ts +0 -0
  155. package/lib/cjs/decorators/common/property.js +27 -0
  156. package/lib/cjs/decorators/common/property.js.map +1 -0
  157. package/lib/{decorators → cjs/decorators}/common/readOnly.d.ts +0 -0
  158. package/lib/cjs/decorators/common/readOnly.js +21 -0
  159. package/lib/cjs/decorators/common/readOnly.js.map +1 -0
  160. package/lib/{decorators → cjs/decorators}/common/required.d.ts +0 -0
  161. package/lib/cjs/decorators/common/required.js +53 -0
  162. package/lib/cjs/decorators/common/required.js.map +1 -0
  163. package/lib/{decorators → cjs/decorators}/common/requiredGroups.d.ts +0 -0
  164. package/lib/cjs/decorators/common/requiredGroups.js +29 -0
  165. package/lib/cjs/decorators/common/requiredGroups.js.map +1 -0
  166. package/lib/{decorators → cjs/decorators}/common/schema.d.ts +0 -0
  167. package/lib/cjs/decorators/common/schema.js +68 -0
  168. package/lib/cjs/decorators/common/schema.js.map +1 -0
  169. package/lib/{decorators → cjs/decorators}/common/title.d.ts +0 -0
  170. package/lib/cjs/decorators/common/title.js +49 -0
  171. package/lib/cjs/decorators/common/title.js.map +1 -0
  172. package/lib/{decorators → cjs/decorators}/common/writeOnly.d.ts +0 -0
  173. package/lib/cjs/decorators/common/writeOnly.js +21 -0
  174. package/lib/cjs/decorators/common/writeOnly.js.map +1 -0
  175. package/lib/{decorators → cjs/decorators}/config/jsonEntityComponent.d.ts +0 -0
  176. package/lib/cjs/decorators/config/jsonEntityComponent.js +18 -0
  177. package/lib/cjs/decorators/config/jsonEntityComponent.js.map +1 -0
  178. package/lib/{decorators → cjs/decorators}/generics/genericOf.d.ts +0 -0
  179. package/lib/cjs/decorators/generics/genericOf.js +99 -0
  180. package/lib/cjs/decorators/generics/genericOf.js.map +1 -0
  181. package/lib/{decorators → cjs/decorators}/generics/generics.d.ts +0 -0
  182. package/lib/cjs/decorators/generics/generics.js +25 -0
  183. package/lib/cjs/decorators/generics/generics.js.map +1 -0
  184. package/lib/{decorators → cjs/decorators}/index.d.ts +0 -0
  185. package/lib/cjs/decorators/index.js +76 -0
  186. package/lib/cjs/decorators/index.js.map +1 -0
  187. package/lib/{decorators → cjs/decorators}/operations/consumes.d.ts +0 -0
  188. package/lib/cjs/decorators/operations/consumes.js +39 -0
  189. package/lib/cjs/decorators/operations/consumes.js.map +1 -0
  190. package/lib/{decorators → cjs/decorators}/operations/contentType.d.ts +0 -0
  191. package/lib/cjs/decorators/operations/contentType.js +28 -0
  192. package/lib/cjs/decorators/operations/contentType.js.map +1 -0
  193. package/lib/{decorators → cjs/decorators}/operations/deprecated.d.ts +0 -0
  194. package/lib/cjs/decorators/operations/deprecated.js +43 -0
  195. package/lib/cjs/decorators/operations/deprecated.js.map +1 -0
  196. package/lib/{decorators → cjs/decorators}/operations/header.d.ts +0 -0
  197. package/lib/cjs/decorators/operations/header.js +59 -0
  198. package/lib/cjs/decorators/operations/header.js.map +1 -0
  199. package/lib/{decorators → cjs/decorators}/operations/in.d.ts +0 -0
  200. package/lib/cjs/decorators/operations/in.js +78 -0
  201. package/lib/cjs/decorators/operations/in.js.map +1 -0
  202. package/lib/{decorators → cjs/decorators}/operations/location.d.ts +0 -0
  203. package/lib/cjs/decorators/operations/location.js +29 -0
  204. package/lib/cjs/decorators/operations/location.js.map +1 -0
  205. package/lib/{decorators → cjs/decorators}/operations/operationId.d.ts +0 -0
  206. package/lib/cjs/decorators/operations/operationId.js +24 -0
  207. package/lib/cjs/decorators/operations/operationId.js.map +1 -0
  208. package/lib/{decorators → cjs/decorators}/operations/operationPath.d.ts +0 -0
  209. package/lib/cjs/decorators/operations/operationPath.js +34 -0
  210. package/lib/cjs/decorators/operations/operationPath.js.map +1 -0
  211. package/lib/{decorators → cjs/decorators}/operations/partial.d.ts +0 -0
  212. package/lib/cjs/decorators/operations/partial.js +18 -0
  213. package/lib/cjs/decorators/operations/partial.js.map +1 -0
  214. package/lib/{decorators → cjs/decorators}/operations/path.d.ts +0 -0
  215. package/lib/cjs/decorators/operations/path.js +29 -0
  216. package/lib/cjs/decorators/operations/path.js.map +1 -0
  217. package/lib/{decorators → cjs/decorators}/operations/produces.d.ts +0 -0
  218. package/lib/cjs/decorators/operations/produces.js +46 -0
  219. package/lib/cjs/decorators/operations/produces.js.map +1 -0
  220. package/lib/{decorators → cjs/decorators}/operations/redirect.d.ts +0 -0
  221. package/lib/cjs/decorators/operations/redirect.js +26 -0
  222. package/lib/cjs/decorators/operations/redirect.js.map +1 -0
  223. package/lib/{decorators → cjs/decorators}/operations/returns.d.ts +0 -0
  224. package/lib/cjs/decorators/operations/returns.js +215 -0
  225. package/lib/cjs/decorators/operations/returns.js.map +1 -0
  226. package/lib/{decorators → cjs/decorators}/operations/route.d.ts +0 -0
  227. package/lib/cjs/decorators/operations/route.js +198 -0
  228. package/lib/cjs/decorators/operations/route.js.map +1 -0
  229. package/lib/{decorators → cjs/decorators}/operations/security.d.ts +0 -0
  230. package/lib/cjs/decorators/operations/security.js +43 -0
  231. package/lib/cjs/decorators/operations/security.js.map +1 -0
  232. package/lib/{decorators → cjs/decorators}/operations/status.d.ts +0 -0
  233. package/lib/cjs/decorators/operations/status.js +133 -0
  234. package/lib/cjs/decorators/operations/status.js.map +1 -0
  235. package/lib/{decorators → cjs/decorators}/operations/summary.d.ts +0 -0
  236. package/lib/cjs/decorators/operations/summary.js +34 -0
  237. package/lib/cjs/decorators/operations/summary.js.map +1 -0
  238. package/lib/{decorators → cjs/decorators}/operations/tags.d.ts +0 -0
  239. package/lib/cjs/decorators/operations/tags.js +52 -0
  240. package/lib/cjs/decorators/operations/tags.js.map +1 -0
  241. package/lib/{domain → cjs/domain}/DecoratorContext.d.ts +0 -0
  242. package/lib/cjs/domain/DecoratorContext.js +88 -0
  243. package/lib/cjs/domain/DecoratorContext.js.map +1 -0
  244. package/lib/{domain → cjs/domain}/JsonAliasMap.d.ts +0 -0
  245. package/lib/cjs/domain/JsonAliasMap.js +15 -0
  246. package/lib/cjs/domain/JsonAliasMap.js.map +1 -0
  247. package/lib/{domain → cjs/domain}/JsonClassStore.d.ts +0 -0
  248. package/lib/cjs/domain/JsonClassStore.js +37 -0
  249. package/lib/cjs/domain/JsonClassStore.js.map +1 -0
  250. package/lib/{domain → cjs/domain}/JsonEntityStore.d.ts +0 -0
  251. package/lib/cjs/domain/JsonEntityStore.js +163 -0
  252. package/lib/cjs/domain/JsonEntityStore.js.map +1 -0
  253. package/lib/{domain → cjs/domain}/JsonFormatTypes.d.ts +0 -0
  254. package/lib/cjs/domain/JsonFormatTypes.js +22 -0
  255. package/lib/cjs/domain/JsonFormatTypes.js.map +1 -0
  256. package/lib/{domain → cjs/domain}/JsonLazyRef.d.ts +0 -0
  257. package/lib/cjs/domain/JsonLazyRef.js +26 -0
  258. package/lib/cjs/domain/JsonLazyRef.js.map +1 -0
  259. package/lib/{domain → cjs/domain}/JsonMap.d.ts +0 -0
  260. package/lib/cjs/domain/JsonMap.js +27 -0
  261. package/lib/cjs/domain/JsonMap.js.map +1 -0
  262. package/lib/{domain → cjs/domain}/JsonMethodStore.d.ts +0 -0
  263. package/lib/cjs/domain/JsonMethodStore.js +64 -0
  264. package/lib/cjs/domain/JsonMethodStore.js.map +1 -0
  265. package/lib/{domain → cjs/domain}/JsonOperation.d.ts +0 -0
  266. package/lib/cjs/domain/JsonOperation.js +254 -0
  267. package/lib/cjs/domain/JsonOperation.js.map +1 -0
  268. package/lib/{domain → cjs/domain}/JsonOperationPathsMap.d.ts +0 -0
  269. package/lib/cjs/domain/JsonOperationPathsMap.js +29 -0
  270. package/lib/cjs/domain/JsonOperationPathsMap.js.map +1 -0
  271. package/lib/{domain → cjs/domain}/JsonOperationRoute.d.ts +0 -0
  272. package/lib/cjs/domain/JsonOperationRoute.js +56 -0
  273. package/lib/cjs/domain/JsonOperationRoute.js.map +1 -0
  274. package/lib/{domain → cjs/domain}/JsonParameter.d.ts +0 -0
  275. package/lib/cjs/domain/JsonParameter.js +157 -0
  276. package/lib/cjs/domain/JsonParameter.js.map +1 -0
  277. package/lib/{domain → cjs/domain}/JsonParameterStore.d.ts +0 -0
  278. package/lib/cjs/domain/JsonParameterStore.js +90 -0
  279. package/lib/cjs/domain/JsonParameterStore.js.map +1 -0
  280. package/lib/{domain → cjs/domain}/JsonParameterTypes.d.ts +0 -0
  281. package/lib/cjs/domain/JsonParameterTypes.js +27 -0
  282. package/lib/cjs/domain/JsonParameterTypes.js.map +1 -0
  283. package/lib/{domain → cjs/domain}/JsonPropertyStore.d.ts +0 -0
  284. package/lib/cjs/domain/JsonPropertyStore.js +68 -0
  285. package/lib/cjs/domain/JsonPropertyStore.js.map +1 -0
  286. package/lib/{domain → cjs/domain}/JsonRequestBody.d.ts +0 -0
  287. package/lib/cjs/domain/JsonRequestBody.js +32 -0
  288. package/lib/cjs/domain/JsonRequestBody.js.map +1 -0
  289. package/lib/{domain → cjs/domain}/JsonResponse.d.ts +0 -0
  290. package/lib/cjs/domain/JsonResponse.js +86 -0
  291. package/lib/cjs/domain/JsonResponse.js.map +1 -0
  292. package/lib/{domain → cjs/domain}/JsonSchema.d.ts +1 -1
  293. package/lib/cjs/domain/JsonSchema.js +692 -0
  294. package/lib/cjs/domain/JsonSchema.js.map +1 -0
  295. package/lib/{domain → cjs/domain}/SpecTypes.d.ts +0 -0
  296. package/lib/cjs/domain/SpecTypes.js +10 -0
  297. package/lib/cjs/domain/SpecTypes.js.map +1 -0
  298. package/lib/{domain → cjs/domain}/index.d.ts +0 -0
  299. package/lib/cjs/domain/index.js +20 -0
  300. package/lib/cjs/domain/index.js.map +1 -0
  301. package/lib/{hooks → cjs/hooks}/alterIgnore.d.ts +0 -0
  302. package/lib/cjs/hooks/alterIgnore.js +21 -0
  303. package/lib/cjs/hooks/alterIgnore.js.map +1 -0
  304. package/lib/{hooks → cjs/hooks}/alterRequiredGroups.d.ts +0 -0
  305. package/lib/cjs/hooks/alterRequiredGroups.js +15 -0
  306. package/lib/cjs/hooks/alterRequiredGroups.js.map +1 -0
  307. package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
  308. package/lib/cjs/index.js +23 -0
  309. package/lib/cjs/index.js.map +1 -0
  310. package/lib/{interfaces → cjs/interfaces}/IgnoreCallback.d.ts +0 -0
  311. package/lib/cjs/interfaces/IgnoreCallback.js +3 -0
  312. package/lib/cjs/interfaces/IgnoreCallback.js.map +1 -0
  313. package/lib/{interfaces → cjs/interfaces}/JsonHookContext.d.ts +0 -0
  314. package/lib/cjs/interfaces/JsonHookContext.js +3 -0
  315. package/lib/cjs/interfaces/JsonHookContext.js.map +1 -0
  316. package/lib/{interfaces → cjs/interfaces}/JsonOpenSpec.d.ts +0 -0
  317. package/lib/cjs/interfaces/JsonOpenSpec.js +3 -0
  318. package/lib/cjs/interfaces/JsonOpenSpec.js.map +1 -0
  319. package/lib/{interfaces → cjs/interfaces}/JsonSchemaOptions.d.ts +0 -0
  320. package/lib/cjs/interfaces/JsonSchemaOptions.js +3 -0
  321. package/lib/cjs/interfaces/JsonSchemaOptions.js.map +1 -0
  322. package/lib/{interfaces → cjs/interfaces}/index.d.ts +0 -0
  323. package/lib/cjs/interfaces/index.js +8 -0
  324. package/lib/cjs/interfaces/index.js.map +1 -0
  325. package/lib/{registries → cjs/registries}/JsonSchemaMapperContainer.d.ts +0 -0
  326. package/lib/cjs/registries/JsonSchemaMapperContainer.js +33 -0
  327. package/lib/cjs/registries/JsonSchemaMapperContainer.js.map +1 -0
  328. package/lib/{utils → cjs/utils}/buildPath.d.ts +0 -0
  329. package/lib/cjs/utils/buildPath.js +13 -0
  330. package/lib/cjs/utils/buildPath.js.map +1 -0
  331. package/lib/{utils → cjs/utils}/concatParameters.d.ts +0 -0
  332. package/lib/cjs/utils/concatParameters.js +16 -0
  333. package/lib/cjs/utils/concatParameters.js.map +1 -0
  334. package/lib/{utils → cjs/utils}/concatPath.d.ts +0 -0
  335. package/lib/cjs/utils/concatPath.js +8 -0
  336. package/lib/cjs/utils/concatPath.js.map +1 -0
  337. package/lib/{utils → cjs/utils}/defineStatusModel.d.ts +0 -0
  338. package/lib/cjs/utils/defineStatusModel.js +13 -0
  339. package/lib/cjs/utils/defineStatusModel.js.map +1 -0
  340. package/lib/{utils → cjs/utils}/from.d.ts +0 -0
  341. package/lib/cjs/utils/from.js +272 -0
  342. package/lib/cjs/utils/from.js.map +1 -0
  343. package/lib/{utils → cjs/utils}/generics.d.ts +0 -0
  344. package/lib/cjs/utils/generics.js +40 -0
  345. package/lib/cjs/utils/generics.js.map +1 -0
  346. package/lib/{utils → cjs/utils}/getComputedType.d.ts +0 -0
  347. package/lib/cjs/utils/getComputedType.js +26 -0
  348. package/lib/cjs/utils/getComputedType.js.map +1 -0
  349. package/lib/{utils → cjs/utils}/getInheritedStores.d.ts +0 -0
  350. package/lib/cjs/utils/getInheritedStores.js +23 -0
  351. package/lib/cjs/utils/getInheritedStores.js.map +1 -0
  352. package/lib/{utils → cjs/utils}/getJsonEntityStore.d.ts +0 -0
  353. package/lib/cjs/utils/getJsonEntityStore.js +25 -0
  354. package/lib/cjs/utils/getJsonEntityStore.js.map +1 -0
  355. package/lib/{utils → cjs/utils}/getJsonPathParameters.d.ts +0 -0
  356. package/lib/cjs/utils/getJsonPathParameters.js +73 -0
  357. package/lib/cjs/utils/getJsonPathParameters.js.map +1 -0
  358. package/lib/{utils → cjs/utils}/getJsonSchema.d.ts +0 -0
  359. package/lib/cjs/utils/getJsonSchema.js +55 -0
  360. package/lib/cjs/utils/getJsonSchema.js.map +1 -0
  361. package/lib/{utils → cjs/utils}/getJsonType.d.ts +0 -0
  362. package/lib/cjs/utils/getJsonType.js +40 -0
  363. package/lib/cjs/utils/getJsonType.js.map +1 -0
  364. package/lib/{utils → cjs/utils}/getOperationsRoutes.d.ts +0 -0
  365. package/lib/cjs/utils/getOperationsRoutes.js +36 -0
  366. package/lib/cjs/utils/getOperationsRoutes.js.map +1 -0
  367. package/lib/{utils → cjs/utils}/getOperationsStores.d.ts +0 -0
  368. package/lib/cjs/utils/getOperationsStores.js +33 -0
  369. package/lib/cjs/utils/getOperationsStores.js.map +1 -0
  370. package/lib/{utils → cjs/utils}/getPropertiesStores.d.ts +0 -0
  371. package/lib/cjs/utils/getPropertiesStores.js +45 -0
  372. package/lib/cjs/utils/getPropertiesStores.js.map +1 -0
  373. package/lib/{utils → cjs/utils}/getRequiredProperties.d.ts +0 -0
  374. package/lib/cjs/utils/getRequiredProperties.js +67 -0
  375. package/lib/cjs/utils/getRequiredProperties.js.map +1 -0
  376. package/lib/{utils → cjs/utils}/getSpec.d.ts +0 -0
  377. package/lib/cjs/utils/getSpec.js +87 -0
  378. package/lib/cjs/utils/getSpec.js.map +1 -0
  379. package/lib/{utils → cjs/utils}/isJsonClass.d.ts +0 -0
  380. package/lib/cjs/utils/isJsonClass.js +12 -0
  381. package/lib/cjs/utils/isJsonClass.js.map +1 -0
  382. package/lib/{utils → cjs/utils}/isSuccessStatus.d.ts +0 -0
  383. package/lib/cjs/utils/isSuccessStatus.js +8 -0
  384. package/lib/cjs/utils/isSuccessStatus.js.map +1 -0
  385. package/lib/{utils → cjs/utils}/mapHeaders.d.ts +0 -0
  386. package/lib/cjs/utils/mapHeaders.js +29 -0
  387. package/lib/cjs/utils/mapHeaders.js.map +1 -0
  388. package/lib/{utils → cjs/utils}/mapNullableType.d.ts +0 -0
  389. package/lib/cjs/utils/mapNullableType.js +30 -0
  390. package/lib/cjs/utils/mapNullableType.js.map +1 -0
  391. package/lib/{utils → cjs/utils}/mapRouteOptions.d.ts +0 -0
  392. package/lib/cjs/utils/mapRouteOptions.js +26 -0
  393. package/lib/cjs/utils/mapRouteOptions.js.map +1 -0
  394. package/lib/{utils → cjs/utils}/matchGroups.d.ts +0 -0
  395. package/lib/cjs/utils/matchGroups.js +23 -0
  396. package/lib/cjs/utils/matchGroups.js.map +1 -0
  397. package/lib/{utils → cjs/utils}/mergeOperation.d.ts +0 -0
  398. package/lib/cjs/utils/mergeOperation.js +44 -0
  399. package/lib/cjs/utils/mergeOperation.js.map +1 -0
  400. package/lib/{utils → cjs/utils}/mergeSpec.d.ts +0 -0
  401. package/lib/cjs/utils/mergeSpec.js +46 -0
  402. package/lib/cjs/utils/mergeSpec.js.map +1 -0
  403. package/lib/{utils → cjs/utils}/operationIdFormatter.d.ts +0 -0
  404. package/lib/cjs/utils/operationIdFormatter.js +37 -0
  405. package/lib/cjs/utils/operationIdFormatter.js.map +1 -0
  406. package/lib/{utils → cjs/utils}/ref.d.ts +0 -0
  407. package/lib/cjs/utils/ref.js +70 -0
  408. package/lib/cjs/utils/ref.js.map +1 -0
  409. package/lib/{utils → cjs/utils}/toJsonMapCollection.d.ts +0 -0
  410. package/lib/cjs/utils/toJsonMapCollection.js +15 -0
  411. package/lib/cjs/utils/toJsonMapCollection.js.map +1 -0
  412. package/lib/{utils → cjs/utils}/toJsonRegex.d.ts +0 -0
  413. package/lib/cjs/utils/toJsonRegex.js +12 -0
  414. package/lib/cjs/utils/toJsonRegex.js.map +1 -0
  415. package/lib/esm/components/anyMapper.js +20 -0
  416. package/lib/esm/components/anyMapper.js.map +1 -0
  417. package/lib/esm/components/classMapper.js +37 -0
  418. package/lib/esm/components/classMapper.js.map +1 -0
  419. package/lib/esm/components/genericsMapper.js +58 -0
  420. package/lib/esm/components/genericsMapper.js.map +1 -0
  421. package/lib/esm/components/index.js +10 -0
  422. package/lib/esm/components/index.js.map +1 -0
  423. package/lib/esm/components/inheritedClassMapper.js +18 -0
  424. package/lib/esm/components/inheritedClassMapper.js.map +1 -0
  425. package/lib/esm/components/itemMapper.js +6 -0
  426. package/lib/esm/components/itemMapper.js.map +1 -0
  427. package/lib/esm/components/lazyRefMapper.js +15 -0
  428. package/lib/esm/components/lazyRefMapper.js.map +1 -0
  429. package/lib/esm/components/mapMapper.js +21 -0
  430. package/lib/esm/components/mapMapper.js.map +1 -0
  431. package/lib/esm/components/objectMapper.js +21 -0
  432. package/lib/esm/components/objectMapper.js.map +1 -0
  433. package/lib/esm/components/schemaMapper.js +96 -0
  434. package/lib/esm/components/schemaMapper.js.map +1 -0
  435. package/lib/esm/constants/httpMethods.js +43 -0
  436. package/lib/esm/constants/httpMethods.js.map +1 -0
  437. package/lib/esm/constants/httpStatusMessages.js +105 -0
  438. package/lib/esm/constants/httpStatusMessages.js.map +1 -0
  439. package/lib/esm/decorators/class/children.js +20 -0
  440. package/lib/esm/decorators/class/children.js.map +1 -0
  441. package/lib/esm/decorators/collections/collectionContains.js +25 -0
  442. package/lib/esm/decorators/collections/collectionContains.js.map +1 -0
  443. package/lib/esm/decorators/collections/collectionOf.js +97 -0
  444. package/lib/esm/decorators/collections/collectionOf.js.map +1 -0
  445. package/lib/esm/decorators/collections/maxItems.js +56 -0
  446. package/lib/esm/decorators/collections/maxItems.js.map +1 -0
  447. package/lib/esm/decorators/collections/maxProperties.js +79 -0
  448. package/lib/esm/decorators/collections/maxProperties.js.map +1 -0
  449. package/lib/esm/decorators/collections/minItems.js +60 -0
  450. package/lib/esm/decorators/collections/minItems.js.map +1 -0
  451. package/lib/esm/decorators/collections/minProperties.js +78 -0
  452. package/lib/esm/decorators/collections/minProperties.js.map +1 -0
  453. package/lib/esm/decorators/collections/uniqueItems.js +56 -0
  454. package/lib/esm/decorators/collections/uniqueItems.js.map +1 -0
  455. package/lib/esm/decorators/common/additionalProperties.js +16 -0
  456. package/lib/esm/decorators/common/additionalProperties.js.map +1 -0
  457. package/lib/esm/decorators/common/allOf.js +18 -0
  458. package/lib/esm/decorators/common/allOf.js.map +1 -0
  459. package/lib/esm/decorators/common/allow.js +43 -0
  460. package/lib/esm/decorators/common/allow.js.map +1 -0
  461. package/lib/esm/decorators/common/any.js +42 -0
  462. package/lib/esm/decorators/common/any.js.map +1 -0
  463. package/lib/esm/decorators/common/anyOf.js +22 -0
  464. package/lib/esm/decorators/common/anyOf.js.map +1 -0
  465. package/lib/esm/decorators/common/const.js +66 -0
  466. package/lib/esm/decorators/common/const.js.map +1 -0
  467. package/lib/esm/decorators/common/customKey.js +38 -0
  468. package/lib/esm/decorators/common/customKey.js.map +1 -0
  469. package/lib/esm/decorators/common/default.js +47 -0
  470. package/lib/esm/decorators/common/default.js.map +1 -0
  471. package/lib/esm/decorators/common/description.js +72 -0
  472. package/lib/esm/decorators/common/description.js.map +1 -0
  473. package/lib/esm/decorators/common/enum.js +26 -0
  474. package/lib/esm/decorators/common/enum.js.map +1 -0
  475. package/lib/esm/decorators/common/example.js +17 -0
  476. package/lib/esm/decorators/common/example.js.map +1 -0
  477. package/lib/esm/decorators/common/examples.js +17 -0
  478. package/lib/esm/decorators/common/examples.js.map +1 -0
  479. package/lib/esm/decorators/common/exclusiveMaximum.js +73 -0
  480. package/lib/esm/decorators/common/exclusiveMaximum.js.map +1 -0
  481. package/lib/esm/decorators/common/exclusiveMinimum.js +73 -0
  482. package/lib/esm/decorators/common/exclusiveMinimum.js.map +1 -0
  483. package/lib/esm/decorators/common/format.js +476 -0
  484. package/lib/esm/decorators/common/format.js.map +1 -0
  485. package/lib/esm/decorators/common/forwardGroups.js +16 -0
  486. package/lib/esm/decorators/common/forwardGroups.js.map +1 -0
  487. package/lib/esm/decorators/common/groups.js +37 -0
  488. package/lib/esm/decorators/common/groups.js.map +1 -0
  489. package/lib/esm/decorators/common/hidden.js +36 -0
  490. package/lib/esm/decorators/common/hidden.js.map +1 -0
  491. package/lib/esm/decorators/common/ignore.js +67 -0
  492. package/lib/esm/decorators/common/ignore.js.map +1 -0
  493. package/lib/esm/decorators/common/integer.js +67 -0
  494. package/lib/esm/decorators/common/integer.js.map +1 -0
  495. package/lib/esm/decorators/common/jsonEntityFn.js +28 -0
  496. package/lib/esm/decorators/common/jsonEntityFn.js.map +1 -0
  497. package/lib/esm/decorators/common/maxLength.js +85 -0
  498. package/lib/esm/decorators/common/maxLength.js.map +1 -0
  499. package/lib/esm/decorators/common/maximum.js +146 -0
  500. package/lib/esm/decorators/common/maximum.js.map +1 -0
  501. package/lib/esm/decorators/common/minLength.js +86 -0
  502. package/lib/esm/decorators/common/minLength.js.map +1 -0
  503. package/lib/esm/decorators/common/minimum.js +144 -0
  504. package/lib/esm/decorators/common/minimum.js.map +1 -0
  505. package/lib/esm/decorators/common/multipleOf.js +77 -0
  506. package/lib/esm/decorators/common/multipleOf.js.map +1 -0
  507. package/lib/esm/decorators/common/name.js +48 -0
  508. package/lib/esm/decorators/common/name.js.map +1 -0
  509. package/lib/esm/decorators/common/nullable.js +30 -0
  510. package/lib/esm/decorators/common/nullable.js.map +1 -0
  511. package/lib/esm/decorators/common/oneOf.js +22 -0
  512. package/lib/esm/decorators/common/oneOf.js.map +1 -0
  513. package/lib/esm/decorators/common/optional.js +24 -0
  514. package/lib/esm/decorators/common/optional.js.map +1 -0
  515. package/lib/esm/decorators/common/pattern.js +99 -0
  516. package/lib/esm/decorators/common/pattern.js.map +1 -0
  517. package/lib/esm/decorators/common/property.js +23 -0
  518. package/lib/esm/decorators/common/property.js.map +1 -0
  519. package/lib/esm/decorators/common/readOnly.js +17 -0
  520. package/lib/esm/decorators/common/readOnly.js.map +1 -0
  521. package/lib/esm/decorators/common/required.js +49 -0
  522. package/lib/esm/decorators/common/required.js.map +1 -0
  523. package/lib/esm/decorators/common/requiredGroups.js +25 -0
  524. package/lib/esm/decorators/common/requiredGroups.js.map +1 -0
  525. package/lib/esm/decorators/common/schema.js +63 -0
  526. package/lib/esm/decorators/common/schema.js.map +1 -0
  527. package/lib/esm/decorators/common/title.js +45 -0
  528. package/lib/esm/decorators/common/title.js.map +1 -0
  529. package/lib/esm/decorators/common/writeOnly.js +17 -0
  530. package/lib/esm/decorators/common/writeOnly.js.map +1 -0
  531. package/lib/esm/decorators/config/jsonEntityComponent.js +14 -0
  532. package/lib/esm/decorators/config/jsonEntityComponent.js.map +1 -0
  533. package/lib/esm/decorators/generics/genericOf.js +95 -0
  534. package/lib/esm/decorators/generics/genericOf.js.map +1 -0
  535. package/lib/esm/decorators/generics/generics.js +21 -0
  536. package/lib/esm/decorators/generics/generics.js.map +1 -0
  537. package/lib/esm/decorators/index.js +73 -0
  538. package/lib/esm/decorators/index.js.map +1 -0
  539. package/lib/esm/decorators/operations/consumes.js +35 -0
  540. package/lib/esm/decorators/operations/consumes.js.map +1 -0
  541. package/lib/esm/decorators/operations/contentType.js +24 -0
  542. package/lib/esm/decorators/operations/contentType.js.map +1 -0
  543. package/lib/esm/decorators/operations/deprecated.js +39 -0
  544. package/lib/esm/decorators/operations/deprecated.js.map +1 -0
  545. package/lib/esm/decorators/operations/header.js +55 -0
  546. package/lib/esm/decorators/operations/header.js.map +1 -0
  547. package/lib/esm/decorators/operations/in.js +74 -0
  548. package/lib/esm/decorators/operations/in.js.map +1 -0
  549. package/lib/esm/decorators/operations/location.js +25 -0
  550. package/lib/esm/decorators/operations/location.js.map +1 -0
  551. package/lib/esm/decorators/operations/operationId.js +20 -0
  552. package/lib/esm/decorators/operations/operationId.js.map +1 -0
  553. package/lib/esm/decorators/operations/operationPath.js +30 -0
  554. package/lib/esm/decorators/operations/operationPath.js.map +1 -0
  555. package/lib/esm/decorators/operations/partial.js +14 -0
  556. package/lib/esm/decorators/operations/partial.js.map +1 -0
  557. package/lib/esm/decorators/operations/path.js +25 -0
  558. package/lib/esm/decorators/operations/path.js.map +1 -0
  559. package/lib/esm/decorators/operations/produces.js +42 -0
  560. package/lib/esm/decorators/operations/produces.js.map +1 -0
  561. package/lib/esm/decorators/operations/redirect.js +22 -0
  562. package/lib/esm/decorators/operations/redirect.js.map +1 -0
  563. package/lib/esm/decorators/operations/returns.js +211 -0
  564. package/lib/esm/decorators/operations/returns.js.map +1 -0
  565. package/lib/esm/decorators/operations/route.js +186 -0
  566. package/lib/esm/decorators/operations/route.js.map +1 -0
  567. package/lib/esm/decorators/operations/security.js +39 -0
  568. package/lib/esm/decorators/operations/security.js.map +1 -0
  569. package/lib/esm/decorators/operations/status.js +129 -0
  570. package/lib/esm/decorators/operations/status.js.map +1 -0
  571. package/lib/esm/decorators/operations/summary.js +30 -0
  572. package/lib/esm/decorators/operations/summary.js.map +1 -0
  573. package/lib/esm/decorators/operations/tags.js +48 -0
  574. package/lib/esm/decorators/operations/tags.js.map +1 -0
  575. package/lib/esm/domain/DecoratorContext.js +84 -0
  576. package/lib/esm/domain/DecoratorContext.js.map +1 -0
  577. package/lib/esm/domain/JsonAliasMap.js +11 -0
  578. package/lib/esm/domain/JsonAliasMap.js.map +1 -0
  579. package/lib/esm/domain/JsonClassStore.js +34 -0
  580. package/lib/esm/domain/JsonClassStore.js.map +1 -0
  581. package/lib/esm/domain/JsonEntityStore.js +159 -0
  582. package/lib/esm/domain/JsonEntityStore.js.map +1 -0
  583. package/lib/esm/domain/JsonFormatTypes.js +19 -0
  584. package/lib/esm/domain/JsonFormatTypes.js.map +1 -0
  585. package/lib/esm/domain/JsonLazyRef.js +22 -0
  586. package/lib/esm/domain/JsonLazyRef.js.map +1 -0
  587. package/lib/esm/domain/JsonMap.js +23 -0
  588. package/lib/esm/domain/JsonMap.js.map +1 -0
  589. package/lib/esm/domain/JsonMethodStore.js +61 -0
  590. package/lib/esm/domain/JsonMethodStore.js.map +1 -0
  591. package/lib/esm/domain/JsonOperation.js +250 -0
  592. package/lib/esm/domain/JsonOperation.js.map +1 -0
  593. package/lib/esm/domain/JsonOperationPathsMap.js +25 -0
  594. package/lib/esm/domain/JsonOperationPathsMap.js.map +1 -0
  595. package/lib/esm/domain/JsonOperationRoute.js +52 -0
  596. package/lib/esm/domain/JsonOperationRoute.js.map +1 -0
  597. package/lib/esm/domain/JsonParameter.js +153 -0
  598. package/lib/esm/domain/JsonParameter.js.map +1 -0
  599. package/lib/esm/domain/JsonParameterStore.js +87 -0
  600. package/lib/esm/domain/JsonParameterStore.js.map +1 -0
  601. package/lib/esm/domain/JsonParameterTypes.js +22 -0
  602. package/lib/esm/domain/JsonParameterTypes.js.map +1 -0
  603. package/lib/esm/domain/JsonPropertyStore.js +65 -0
  604. package/lib/esm/domain/JsonPropertyStore.js.map +1 -0
  605. package/lib/esm/domain/JsonRequestBody.js +28 -0
  606. package/lib/esm/domain/JsonRequestBody.js.map +1 -0
  607. package/lib/esm/domain/JsonResponse.js +81 -0
  608. package/lib/esm/domain/JsonResponse.js.map +1 -0
  609. package/lib/esm/domain/JsonSchema.js +688 -0
  610. package/lib/esm/domain/JsonSchema.js.map +1 -0
  611. package/lib/esm/domain/SpecTypes.js +7 -0
  612. package/lib/esm/domain/SpecTypes.js.map +1 -0
  613. package/lib/esm/domain/index.js +17 -0
  614. package/lib/esm/domain/index.js.map +1 -0
  615. package/lib/esm/hooks/alterIgnore.js +17 -0
  616. package/lib/esm/hooks/alterIgnore.js.map +1 -0
  617. package/lib/esm/hooks/alterRequiredGroups.js +11 -0
  618. package/lib/esm/hooks/alterRequiredGroups.js.map +1 -0
  619. package/lib/esm/index.js +20 -0
  620. package/lib/esm/index.js.map +1 -0
  621. package/lib/esm/interfaces/IgnoreCallback.js +2 -0
  622. package/lib/esm/interfaces/IgnoreCallback.js.map +1 -0
  623. package/lib/esm/interfaces/JsonHookContext.js +2 -0
  624. package/lib/esm/interfaces/JsonHookContext.js.map +1 -0
  625. package/lib/esm/interfaces/JsonOpenSpec.js +2 -0
  626. package/lib/esm/interfaces/JsonOpenSpec.js.map +1 -0
  627. package/lib/esm/interfaces/JsonSchemaOptions.js +2 -0
  628. package/lib/esm/interfaces/JsonSchemaOptions.js.map +1 -0
  629. package/lib/esm/interfaces/index.js +5 -0
  630. package/lib/esm/interfaces/index.js.map +1 -0
  631. package/lib/esm/registries/JsonSchemaMapperContainer.js +27 -0
  632. package/lib/esm/registries/JsonSchemaMapperContainer.js.map +1 -0
  633. package/lib/esm/utils/buildPath.js +9 -0
  634. package/lib/esm/utils/buildPath.js.map +1 -0
  635. package/lib/esm/utils/concatParameters.js +12 -0
  636. package/lib/esm/utils/concatParameters.js.map +1 -0
  637. package/lib/esm/utils/concatPath.js +4 -0
  638. package/lib/esm/utils/concatPath.js.map +1 -0
  639. package/lib/esm/utils/defineStatusModel.js +8 -0
  640. package/lib/esm/utils/defineStatusModel.js.map +1 -0
  641. package/lib/esm/utils/from.js +249 -0
  642. package/lib/esm/utils/from.js.map +1 -0
  643. package/lib/esm/utils/generics.js +34 -0
  644. package/lib/esm/utils/generics.js.map +1 -0
  645. package/lib/esm/utils/getComputedType.js +22 -0
  646. package/lib/esm/utils/getComputedType.js.map +1 -0
  647. package/lib/esm/utils/getInheritedStores.js +19 -0
  648. package/lib/esm/utils/getInheritedStores.js.map +1 -0
  649. package/lib/esm/utils/getJsonEntityStore.js +20 -0
  650. package/lib/esm/utils/getJsonEntityStore.js.map +1 -0
  651. package/lib/esm/utils/getJsonPathParameters.js +69 -0
  652. package/lib/esm/utils/getJsonPathParameters.js.map +1 -0
  653. package/lib/esm/utils/getJsonSchema.js +51 -0
  654. package/lib/esm/utils/getJsonSchema.js.map +1 -0
  655. package/lib/esm/utils/getJsonType.js +36 -0
  656. package/lib/esm/utils/getJsonType.js.map +1 -0
  657. package/lib/esm/utils/getOperationsRoutes.js +32 -0
  658. package/lib/esm/utils/getOperationsRoutes.js.map +1 -0
  659. package/lib/esm/utils/getOperationsStores.js +29 -0
  660. package/lib/esm/utils/getOperationsStores.js.map +1 -0
  661. package/lib/esm/utils/getPropertiesStores.js +40 -0
  662. package/lib/esm/utils/getPropertiesStores.js.map +1 -0
  663. package/lib/esm/utils/getRequiredProperties.js +63 -0
  664. package/lib/esm/utils/getRequiredProperties.js.map +1 -0
  665. package/lib/esm/utils/getSpec.js +83 -0
  666. package/lib/esm/utils/getSpec.js.map +1 -0
  667. package/lib/esm/utils/isJsonClass.js +8 -0
  668. package/lib/esm/utils/isJsonClass.js.map +1 -0
  669. package/lib/esm/utils/isSuccessStatus.js +3 -0
  670. package/lib/esm/utils/isSuccessStatus.js.map +1 -0
  671. package/lib/esm/utils/mapHeaders.js +25 -0
  672. package/lib/esm/utils/mapHeaders.js.map +1 -0
  673. package/lib/esm/utils/mapNullableType.js +26 -0
  674. package/lib/esm/utils/mapNullableType.js.map +1 -0
  675. package/lib/esm/utils/mapRouteOptions.js +22 -0
  676. package/lib/esm/utils/mapRouteOptions.js.map +1 -0
  677. package/lib/esm/utils/matchGroups.js +18 -0
  678. package/lib/esm/utils/matchGroups.js.map +1 -0
  679. package/lib/esm/utils/mergeOperation.js +40 -0
  680. package/lib/esm/utils/mergeOperation.js.map +1 -0
  681. package/lib/esm/utils/mergeSpec.js +42 -0
  682. package/lib/esm/utils/mergeSpec.js.map +1 -0
  683. package/lib/esm/utils/operationIdFormatter.js +33 -0
  684. package/lib/esm/utils/operationIdFormatter.js.map +1 -0
  685. package/lib/esm/utils/ref.js +64 -0
  686. package/lib/esm/utils/ref.js.map +1 -0
  687. package/lib/esm/utils/toJsonMapCollection.js +11 -0
  688. package/lib/esm/utils/toJsonMapCollection.js.map +1 -0
  689. package/lib/esm/utils/toJsonRegex.js +8 -0
  690. package/lib/esm/utils/toJsonRegex.js.map +1 -0
  691. package/lib/types/components/anyMapper.d.ts +2 -0
  692. package/lib/types/components/classMapper.d.ts +3 -0
  693. package/lib/types/components/genericsMapper.d.ts +5 -0
  694. package/lib/types/components/index.d.ts +9 -0
  695. package/lib/types/components/inheritedClassMapper.d.ts +5 -0
  696. package/lib/types/components/itemMapper.d.ts +2 -0
  697. package/lib/types/components/lazyRefMapper.d.ts +3 -0
  698. package/lib/types/components/mapMapper.d.ts +9 -0
  699. package/lib/types/components/objectMapper.d.ts +8 -0
  700. package/lib/types/components/schemaMapper.d.ts +3 -0
  701. package/lib/types/constants/httpMethods.d.ts +12 -0
  702. package/lib/types/constants/httpStatusMessages.d.ts +272 -0
  703. package/lib/types/decorators/class/children.d.ts +11 -0
  704. package/lib/types/decorators/collections/collectionContains.d.ts +21 -0
  705. package/lib/types/decorators/collections/collectionOf.d.ts +101 -0
  706. package/lib/types/decorators/collections/maxItems.d.ts +47 -0
  707. package/lib/types/decorators/collections/maxProperties.d.ts +70 -0
  708. package/lib/types/decorators/collections/minItems.d.ts +51 -0
  709. package/lib/types/decorators/collections/minProperties.d.ts +69 -0
  710. package/lib/types/decorators/collections/uniqueItems.d.ts +50 -0
  711. package/lib/types/decorators/common/additionalProperties.d.ts +11 -0
  712. package/lib/types/decorators/common/allOf.d.ts +13 -0
  713. package/lib/types/decorators/common/allow.d.ts +28 -0
  714. package/lib/types/decorators/common/any.d.ts +38 -0
  715. package/lib/types/decorators/common/anyOf.d.ts +17 -0
  716. package/lib/types/decorators/common/const.d.ts +61 -0
  717. package/lib/types/decorators/common/customKey.d.ts +26 -0
  718. package/lib/types/decorators/common/default.d.ts +41 -0
  719. package/lib/types/decorators/common/description.d.ts +53 -0
  720. package/lib/types/decorators/common/enum.d.ts +98 -0
  721. package/lib/types/decorators/common/example.d.ts +11 -0
  722. package/lib/types/decorators/common/examples.d.ts +12 -0
  723. package/lib/types/decorators/common/exclusiveMaximum.d.ts +69 -0
  724. package/lib/types/decorators/common/exclusiveMinimum.d.ts +69 -0
  725. package/lib/types/decorators/common/format.d.ts +459 -0
  726. package/lib/types/decorators/common/forwardGroups.d.ts +10 -0
  727. package/lib/types/decorators/common/groups.d.ts +11 -0
  728. package/lib/types/decorators/common/hidden.d.ts +32 -0
  729. package/lib/types/decorators/common/ignore.d.ts +58 -0
  730. package/lib/types/decorators/common/integer.d.ts +61 -0
  731. package/lib/types/decorators/common/jsonEntityFn.d.ts +21 -0
  732. package/lib/types/decorators/common/maxLength.d.ts +76 -0
  733. package/lib/types/decorators/common/maximum.d.ts +138 -0
  734. package/lib/types/decorators/common/minLength.d.ts +77 -0
  735. package/lib/types/decorators/common/minimum.d.ts +136 -0
  736. package/lib/types/decorators/common/multipleOf.d.ts +68 -0
  737. package/lib/types/decorators/common/name.d.ts +32 -0
  738. package/lib/types/decorators/common/nullable.d.ts +25 -0
  739. package/lib/types/decorators/common/oneOf.d.ts +17 -0
  740. package/lib/types/decorators/common/optional.d.ts +10 -0
  741. package/lib/types/decorators/common/pattern.d.ts +93 -0
  742. package/lib/types/decorators/common/property.d.ts +11 -0
  743. package/lib/types/decorators/common/readOnly.d.ts +11 -0
  744. package/lib/types/decorators/common/required.d.ts +44 -0
  745. package/lib/types/decorators/common/requiredGroups.d.ts +10 -0
  746. package/lib/types/decorators/common/schema.d.ts +53 -0
  747. package/lib/types/decorators/common/title.d.ts +39 -0
  748. package/lib/types/decorators/common/writeOnly.d.ts +11 -0
  749. package/lib/types/decorators/config/jsonEntityComponent.d.ts +10 -0
  750. package/lib/types/decorators/generics/genericOf.d.ts +76 -0
  751. package/lib/types/decorators/generics/generics.d.ts +14 -0
  752. package/lib/types/decorators/index.d.ts +67 -0
  753. package/lib/types/decorators/operations/consumes.d.ts +19 -0
  754. package/lib/types/decorators/operations/contentType.d.ts +20 -0
  755. package/lib/types/decorators/operations/deprecated.d.ts +23 -0
  756. package/lib/types/decorators/operations/header.d.ts +49 -0
  757. package/lib/types/decorators/operations/in.d.ts +64 -0
  758. package/lib/types/decorators/operations/location.d.ts +22 -0
  759. package/lib/types/decorators/operations/operationId.d.ts +10 -0
  760. package/lib/types/decorators/operations/operationPath.d.ts +21 -0
  761. package/lib/types/decorators/operations/partial.d.ts +10 -0
  762. package/lib/types/decorators/operations/path.d.ts +15 -0
  763. package/lib/types/decorators/operations/produces.d.ts +26 -0
  764. package/lib/types/decorators/operations/redirect.d.ts +52 -0
  765. package/lib/types/decorators/operations/returns.d.ts +238 -0
  766. package/lib/types/decorators/operations/route.d.ts +185 -0
  767. package/lib/types/decorators/operations/security.d.ts +23 -0
  768. package/lib/types/decorators/operations/status.d.ts +127 -0
  769. package/lib/types/decorators/operations/summary.d.ts +20 -0
  770. package/lib/types/decorators/operations/tags.d.ts +23 -0
  771. package/lib/types/domain/DecoratorContext.d.ts +28 -0
  772. package/lib/types/domain/JsonAliasMap.d.ts +12 -0
  773. package/lib/types/domain/JsonClassStore.d.ts +12 -0
  774. package/lib/types/domain/JsonEntityStore.d.ts +132 -0
  775. package/lib/types/domain/JsonFormatTypes.d.ts +17 -0
  776. package/lib/types/domain/JsonLazyRef.d.ts +11 -0
  777. package/lib/types/domain/JsonMap.d.ts +7 -0
  778. package/lib/types/domain/JsonMethodStore.d.ts +19 -0
  779. package/lib/types/domain/JsonOperation.d.ts +51 -0
  780. package/lib/types/domain/JsonOperationPathsMap.d.ts +7 -0
  781. package/lib/types/domain/JsonOperationRoute.d.ts +24 -0
  782. package/lib/types/domain/JsonParameter.d.ts +22 -0
  783. package/lib/types/domain/JsonParameterStore.d.ts +30 -0
  784. package/lib/types/domain/JsonParameterTypes.d.ts +16 -0
  785. package/lib/types/domain/JsonPropertyStore.d.ts +23 -0
  786. package/lib/types/domain/JsonRequestBody.d.ts +11 -0
  787. package/lib/types/domain/JsonResponse.d.ts +22 -0
  788. package/lib/types/domain/JsonSchema.d.ts +337 -0
  789. package/lib/types/domain/SpecTypes.d.ts +5 -0
  790. package/lib/types/domain/index.d.ts +16 -0
  791. package/lib/types/hooks/alterIgnore.d.ts +9 -0
  792. package/lib/types/hooks/alterRequiredGroups.d.ts +6 -0
  793. package/lib/types/index.d.ts +19 -0
  794. package/lib/types/interfaces/IgnoreCallback.d.ts +4 -0
  795. package/lib/types/interfaces/JsonHookContext.d.ts +17 -0
  796. package/lib/types/interfaces/JsonOpenSpec.d.ts +9 -0
  797. package/lib/types/interfaces/JsonSchemaOptions.d.ts +26 -0
  798. package/lib/types/interfaces/index.d.ts +4 -0
  799. package/lib/types/registries/JsonSchemaMapperContainer.d.ts +18 -0
  800. package/lib/types/utils/buildPath.d.ts +6 -0
  801. package/lib/types/utils/concatParameters.d.ts +4 -0
  802. package/lib/types/utils/concatPath.d.ts +1 -0
  803. package/lib/types/utils/defineStatusModel.d.ts +3 -0
  804. package/lib/types/utils/from.d.ts +189 -0
  805. package/lib/types/utils/generics.d.ts +50 -0
  806. package/lib/types/utils/getComputedType.d.ts +5 -0
  807. package/lib/types/utils/getInheritedStores.d.ts +8 -0
  808. package/lib/types/utils/getJsonEntityStore.d.ts +19 -0
  809. package/lib/types/utils/getJsonPathParameters.d.ts +7 -0
  810. package/lib/types/utils/getJsonSchema.d.ts +4 -0
  811. package/lib/types/utils/getJsonType.d.ts +5 -0
  812. package/lib/types/utils/getOperationsRoutes.d.ts +8 -0
  813. package/lib/types/utils/getOperationsStores.d.ts +6 -0
  814. package/lib/types/utils/getPropertiesStores.d.ts +20 -0
  815. package/lib/types/utils/getRequiredProperties.d.ts +6 -0
  816. package/lib/types/utils/getSpec.d.ts +49 -0
  817. package/lib/types/utils/isJsonClass.d.ts +4 -0
  818. package/lib/types/utils/isSuccessStatus.d.ts +2 -0
  819. package/lib/types/utils/mapHeaders.d.ts +9 -0
  820. package/lib/types/utils/mapNullableType.d.ts +3 -0
  821. package/lib/types/utils/mapRouteOptions.d.ts +5 -0
  822. package/lib/types/utils/matchGroups.d.ts +4 -0
  823. package/lib/types/utils/mergeOperation.d.ts +17 -0
  824. package/lib/types/utils/mergeSpec.d.ts +23 -0
  825. package/lib/types/utils/operationIdFormatter.d.ts +4 -0
  826. package/lib/types/utils/ref.d.ts +14 -0
  827. package/lib/types/utils/toJsonMapCollection.d.ts +7 -0
  828. package/lib/types/utils/toJsonRegex.d.ts +5 -0
  829. package/package.json +17 -12
  830. package/tsconfig.compile.esm.json +23 -0
  831. package/lib/index.js +0 -8379
  832. package/lib/index.js.map +0 -1
  833. package/lib/index.modern.js +0 -8230
  834. package/lib/index.modern.js.map +0 -1
  835. package/lib/utils/mergeSpec.benchmark.d.ts +0 -1
@@ -0,0 +1,129 @@
1
+ import { Returns } from "./returns";
2
+ /**
3
+ * Add responses documentation for a specific status code.
4
+ *
5
+ * ## Usage
6
+ *
7
+ * Ts.ED v6 API introducing the chaining decorator concept.
8
+ * Now a decorator like Returns can be used with another decorators like Description.
9
+ *
10
+ * ```typescript
11
+ * import {Returns} from "@tsed/schema";
12
+ *
13
+ * @Controller("/")
14
+ * class MyController {
15
+ * @Status(404, String).Description("Not Found")
16
+ * @Status(200, Model).Description("Success")
17
+ * async myMethod(): Promise<Model> {}
18
+ * }
19
+ * ```
20
+ *
21
+ * ::: tip
22
+ * TypeScript and your IDE will discover automatically the chained decorators. But for more details you can look on @@ReturnsChainedDecorators@@ interface, to know
23
+ * what chained decorators are available under Returns decorator.
24
+ * :::
25
+ *
26
+ * This example will produce this documentation in swagger:
27
+ *
28
+ * ```json
29
+ * {
30
+ * "responses": {
31
+ * "404": {
32
+ * "description": "Description",
33
+ * "schema": {"type": "string"}
34
+ * },
35
+ * "2OO": {
36
+ * "description": "Description",
37
+ * "schema": {"$ref": "..."}
38
+ * }
39
+ * }
40
+ * }
41
+ * ```
42
+ *
43
+ * ### Declaring a generic model
44
+ *
45
+ * Sometime, it might be useful to use generic models. TypeScript doesn't store the generic type in the metadata. This is why we need to
46
+ * declare explicitly the generic models with the decorators.
47
+ *
48
+ * One of the generic's usage, can be a paginated list. With Returns decorator it's now possible to declare generic type and generate the appropriate OpenSpec documentation.
49
+ *
50
+ * Starting with the pagination model, by using @@Generics@@ and @@CollectionOf@@:
51
+ *
52
+ * ```typescript
53
+ * @Generics("T")
54
+ * class Pagination<T> {
55
+ * @CollectionOf("T")
56
+ * data: T[];
57
+ *
58
+ * @Property()
59
+ * totalCount: number;
60
+ * }
61
+ * ```
62
+ *
63
+ * Now, we need a model to be used with the generic Pagination model:
64
+ *
65
+ * ```typescript
66
+ * class Product {
67
+ * @Property()
68
+ * id: string;
69
+ *
70
+ * @Property()
71
+ * title: string;
72
+ * }
73
+ * ```
74
+ *
75
+ * Finally, we can use our models on a method as following:
76
+ *
77
+ * ```typescript
78
+ * class Controller {
79
+ * @OperationPath("POST", "/")
80
+ * @Status(200, Pagination).Of(Product).Description("description")
81
+ * async method(): Promise<Pagination<Product> | null> {
82
+ * return null;
83
+ * }
84
+ * }
85
+ * ```
86
+ *
87
+ * ### Declaring a nested generics models <Badge text="6+"/>
88
+ *
89
+ * It's also possible to declare a nested generics models in order to have this type `Pagination<Submission<Product>>`:
90
+ *
91
+ * ```typescript
92
+ * import {Generics, Property, Returns} from "@tsed/schema";
93
+ * import {Post} from "@tsed/common";
94
+ *
95
+ * class Controller {
96
+ * @Post("/")
97
+ * @Status(200, Pagination).Of(Submission).Nested(Product).Description("description")
98
+ * async method(): Promise<Pagination<Submission<Product>> | null> {
99
+ * return null;
100
+ * }
101
+ * }
102
+ * ```
103
+ *
104
+ * And here is the Submission model:
105
+ *
106
+ * ```typescript
107
+ * import {Generics, Property} from "@tsed/schema";
108
+ *
109
+ * @Generics("T")
110
+ * class Submission<T> {
111
+ * @Property()
112
+ * _id: string;
113
+ * @Property("T")
114
+ * data: T;
115
+ * }
116
+ * ```
117
+ *
118
+ * @param status
119
+ * @param model
120
+ * @decorator
121
+ * @swagger
122
+ * @schema
123
+ * @response
124
+ * @operation
125
+ */
126
+ export function Status(status, model) {
127
+ return Returns(status, model);
128
+ }
129
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/decorators/operations/status.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAA2B,MAAM,WAAW,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AACH,MAAM,UAAU,MAAM,CAAC,MAAuB,EAAE,KAAuB;IACrE,OAAO,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAChC,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {Returns, ReturnsChainedDecorators} from \"./returns\";\n\n/**\n * Add responses documentation for a specific status code.\n *\n * ## Usage\n *\n * Ts.ED v6 API introducing the chaining decorator concept.\n * Now a decorator like Returns can be used with another decorators like Description.\n *\n * ```typescript\n * import {Returns} from \"@tsed/schema\";\n *\n * @Controller(\"/\")\n * class MyController {\n * @Status(404, String).Description(\"Not Found\")\n * @Status(200, Model).Description(\"Success\")\n * async myMethod(): Promise<Model> {}\n * }\n * ```\n *\n * ::: tip\n * TypeScript and your IDE will discover automatically the chained decorators. But for more details you can look on @@ReturnsChainedDecorators@@ interface, to know\n * what chained decorators are available under Returns decorator.\n * :::\n *\n * This example will produce this documentation in swagger:\n *\n * ```json\n * {\n * \"responses\": {\n * \"404\": {\n * \"description\": \"Description\",\n * \"schema\": {\"type\": \"string\"}\n * },\n * \"2OO\": {\n * \"description\": \"Description\",\n * \"schema\": {\"$ref\": \"...\"}\n * }\n * }\n * }\n * ```\n *\n * ### Declaring a generic model\n *\n * Sometime, it might be useful to use generic models. TypeScript doesn't store the generic type in the metadata. This is why we need to\n * declare explicitly the generic models with the decorators.\n *\n * One of the generic's usage, can be a paginated list. With Returns decorator it's now possible to declare generic type and generate the appropriate OpenSpec documentation.\n *\n * Starting with the pagination model, by using @@Generics@@ and @@CollectionOf@@:\n *\n * ```typescript\n * @Generics(\"T\")\n * class Pagination<T> {\n * @CollectionOf(\"T\")\n * data: T[];\n *\n * @Property()\n * totalCount: number;\n * }\n * ```\n *\n * Now, we need a model to be used with the generic Pagination model:\n *\n * ```typescript\n * class Product {\n * @Property()\n * id: string;\n *\n * @Property()\n * title: string;\n * }\n * ```\n *\n * Finally, we can use our models on a method as following:\n *\n * ```typescript\n * class Controller {\n * @OperationPath(\"POST\", \"/\")\n * @Status(200, Pagination).Of(Product).Description(\"description\")\n * async method(): Promise<Pagination<Product> | null> {\n * return null;\n * }\n * }\n * ```\n *\n * ### Declaring a nested generics models <Badge text=\"6+\"/>\n *\n * It's also possible to declare a nested generics models in order to have this type `Pagination<Submission<Product>>`:\n *\n * ```typescript\n * import {Generics, Property, Returns} from \"@tsed/schema\";\n * import {Post} from \"@tsed/common\";\n *\n * class Controller {\n * @Post(\"/\")\n * @Status(200, Pagination).Of(Submission).Nested(Product).Description(\"description\")\n * async method(): Promise<Pagination<Submission<Product>> | null> {\n * return null;\n * }\n * }\n * ```\n *\n * And here is the Submission model:\n *\n * ```typescript\n * import {Generics, Property} from \"@tsed/schema\";\n *\n * @Generics(\"T\")\n * class Submission<T> {\n * @Property()\n * _id: string;\n * @Property(\"T\")\n * data: T;\n * }\n * ```\n *\n * @param status\n * @param model\n * @decorator\n * @swagger\n * @schema\n * @response\n * @operation\n */\nexport function Status(status: string | number, model?: Type<any> | any): ReturnsChainedDecorators {\n return Returns(status, model);\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import { DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn";
3
+ /**
4
+ * Add summary metadata on the decorated element.
5
+ *
6
+ * ## Examples
7
+ * ### On method
8
+ *
9
+ * ```typescript
10
+ * class Model {
11
+ * @Summary("summary")
12
+ * id: string;
13
+ * }
14
+ * ```
15
+ *
16
+ * @param summary
17
+ * @decorator
18
+ * @swagger
19
+ * @schema
20
+ * @operation
21
+ */
22
+ export function Summary(summary) {
23
+ return JsonEntityFn((store, args) => {
24
+ if (store.decoratorType !== DecoratorTypes.METHOD) {
25
+ throw new UnsupportedDecoratorType(Summary, args);
26
+ }
27
+ store.operation.summary(summary);
28
+ });
29
+ }
30
+ //# sourceMappingURL=summary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.js","sourceRoot":"","sources":["../../../../src/decorators/operations/summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,OAAO,YAAY,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAClC,IAAI,KAAK,CAAC,aAAa,KAAK,cAAc,CAAC,MAAM,EAAE;YACjD,MAAM,IAAI,wBAAwB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SACnD;QAED,KAAK,CAAC,SAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\n\n/**\n * Add summary metadata on the decorated element.\n *\n * ## Examples\n * ### On method\n *\n * ```typescript\n * class Model {\n * @Summary(\"summary\")\n * id: string;\n * }\n * ```\n *\n * @param summary\n * @decorator\n * @swagger\n * @schema\n * @operation\n */\nexport function Summary(summary: string) {\n return JsonEntityFn((store, args) => {\n if (store.decoratorType !== DecoratorTypes.METHOD) {\n throw new UnsupportedDecoratorType(Summary, args);\n }\n\n store.operation!.summary(summary);\n });\n}\n"]}
@@ -0,0 +1,48 @@
1
+ import { decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn";
3
+ function mapTags(tags) {
4
+ return tags.map((tag) => {
5
+ if (typeof tag === "string") {
6
+ return {
7
+ name: tag
8
+ };
9
+ }
10
+ return tag;
11
+ });
12
+ }
13
+ /**
14
+ * Add tags metadata on the decorated element.
15
+ *
16
+ * ## Examples
17
+ * ### On method
18
+ *
19
+ * ```typescript
20
+ * @Controller("/")
21
+ * class MyController {
22
+ * @Tags("api")
23
+ * get() {}
24
+ * }
25
+ * ```
26
+ *
27
+ * @param tags
28
+ * @decorator
29
+ * @swagger
30
+ * @schema
31
+ * @classDecorator
32
+ * @operation
33
+ */
34
+ export function Tags(...tags) {
35
+ return JsonEntityFn((store, args) => {
36
+ switch (store.decoratorType) {
37
+ case DecoratorTypes.METHOD:
38
+ store.operation.addTags(mapTags(tags));
39
+ break;
40
+ case DecoratorTypes.CLASS:
41
+ decorateMethodsOf(args[0], Tags(...tags));
42
+ break;
43
+ default:
44
+ throw new UnsupportedDecoratorType(Tags, args);
45
+ }
46
+ });
47
+ }
48
+ //# sourceMappingURL=tags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tags.js","sourceRoot":"","sources":["../../../../src/decorators/operations/tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;AAEvF,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAEpD,SAAS,OAAO,CAAC,IAA8B;IAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACtB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,OAAO;gBACL,IAAI,EAAE,GAAG;aACV,CAAC;SACH;QAED,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,IAAI,CAAC,GAAG,IAA8B;IACpD,OAAO,YAAY,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAClC,QAAQ,KAAK,CAAC,aAAa,EAAE;YAC3B,KAAK,cAAc,CAAC,MAAM;gBACxB,KAAK,CAAC,SAAU,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACxC,MAAM;YACR,KAAK,cAAc,CAAC,KAAK;gBACvB,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;gBAC1C,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAClD;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {OpenSpecTag} from \"@tsed/openspec\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\n\nfunction mapTags(tags: (string | OpenSpecTag)[]) {\n return tags.map((tag) => {\n if (typeof tag === \"string\") {\n return {\n name: tag\n };\n }\n\n return tag;\n });\n}\n\n/**\n * Add tags metadata on the decorated element.\n *\n * ## Examples\n * ### On method\n *\n * ```typescript\n * @Controller(\"/\")\n * class MyController {\n * @Tags(\"api\")\n * get() {}\n * }\n * ```\n *\n * @param tags\n * @decorator\n * @swagger\n * @schema\n * @classDecorator\n * @operation\n */\nexport function Tags(...tags: (string | OpenSpecTag)[]) {\n return JsonEntityFn((store, args) => {\n switch (store.decoratorType) {\n case DecoratorTypes.METHOD:\n store.operation!.addTags(mapTags(tags));\n break;\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], Tags(...tags));\n break;\n\n default:\n throw new UnsupportedDecoratorType(Tags, args);\n }\n });\n}\n"]}
@@ -0,0 +1,84 @@
1
+ import { DecoratorTypes } from "@tsed/core";
2
+ import { pascalCase } from "pascal-case";
3
+ import { JsonEntityStore } from "./JsonEntityStore";
4
+ /**
5
+ * @ignore
6
+ */
7
+ export class DecoratorContext extends Map {
8
+ constructor(opts = {}) {
9
+ super();
10
+ this.actions = [];
11
+ Object.entries(opts).forEach(([key, value]) => {
12
+ this.set(key, value);
13
+ });
14
+ }
15
+ addAction(cb) {
16
+ this.actions.push(cb);
17
+ return this;
18
+ }
19
+ build() {
20
+ const decorator = (...args) => this.bind(args, decorator);
21
+ const wrap = (cb) => {
22
+ return (...args) => {
23
+ cb(...args);
24
+ return decorator;
25
+ };
26
+ };
27
+ const wrapKey = (key) => {
28
+ return wrap((...values) => {
29
+ key in this ? this[key](...values) : this.set(key, values[0]);
30
+ });
31
+ };
32
+ this.methods.forEach((name) => {
33
+ decorator[pascalCase(name)] = wrapKey(name);
34
+ });
35
+ return decorator;
36
+ }
37
+ toObject() {
38
+ return [...this.entries()].reduce((obj, [key, value]) => {
39
+ return {
40
+ ...obj,
41
+ [key]: value
42
+ };
43
+ }, {});
44
+ }
45
+ getMergedKey(key, defaultValue) {
46
+ let value = this.get(key) || defaultValue;
47
+ if (!value) {
48
+ return;
49
+ }
50
+ if (this.decoratorType === DecoratorTypes.CLASS) {
51
+ value = {
52
+ ...value,
53
+ ...(defaultValue || {})
54
+ };
55
+ }
56
+ return {
57
+ ...(defaultValue || {}),
58
+ ...value
59
+ };
60
+ }
61
+ bind(args, decorator) {
62
+ this.entity = JsonEntityStore.from(...args);
63
+ this.beforeInit();
64
+ this.onInit(args, decorator);
65
+ this.afterInit();
66
+ }
67
+ onInit(args, decorator) {
68
+ this.forEach((value, key) => {
69
+ this.onMapKey(key, value);
70
+ });
71
+ }
72
+ onMapKey(key, value) {
73
+ this.entity.set(key, value);
74
+ }
75
+ runActions() {
76
+ this.actions.forEach((action) => {
77
+ action(this);
78
+ });
79
+ return this;
80
+ }
81
+ beforeInit() { }
82
+ afterInit() { }
83
+ }
84
+ //# sourceMappingURL=DecoratorContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoratorContext.js","sourceRoot":"","sources":["../../../src/domain/DecoratorContext.ts"],"names":[],"mappings":"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","sourcesContent":["import {DecoratorParameters, DecoratorTypes} from \"@tsed/core\";\nimport {pascalCase} from \"pascal-case\";\nimport {JsonEntityStore} from \"./JsonEntityStore\";\n\n/**\n * @ignore\n */\nexport interface DecoratorActionHandler {\n (ctx: Map<string, any>): void;\n}\n\n/**\n * @ignore\n */\nexport abstract class DecoratorContext<T = any> extends Map<string, any> {\n readonly methods: string[];\n protected decoratorType: DecoratorTypes;\n protected entity: JsonEntityStore;\n protected actions: DecoratorActionHandler[] = [];\n\n constructor(opts: any = {}) {\n super();\n\n Object.entries(opts).forEach(([key, value]) => {\n this.set(key, value);\n });\n }\n\n addAction(cb: DecoratorActionHandler) {\n this.actions.push(cb);\n return this;\n }\n\n build(): T {\n const decorator: any = (...args: DecoratorParameters) => this.bind(args, decorator);\n\n const wrap = (cb: any) => {\n return (...args: any[]) => {\n cb(...args);\n return decorator;\n };\n };\n\n const wrapKey = (key: string) => {\n return wrap((...values: any[]) => {\n key in this ? (this as any)[key](...values) : this.set(key, values[0]);\n });\n };\n\n this.methods.forEach((name) => {\n decorator[pascalCase(name)] = wrapKey(name);\n });\n\n return (decorator as unknown) as T;\n }\n\n toObject(): any {\n return [...this.entries()].reduce((obj, [key, value]) => {\n return {\n ...obj,\n [key]: value\n };\n }, {});\n }\n\n getMergedKey(key: string, defaultValue: any) {\n let value = this.get(key) || defaultValue;\n\n if (!value) {\n return;\n }\n\n if (this.decoratorType === DecoratorTypes.CLASS) {\n value = {\n ...value,\n ...(defaultValue || {})\n };\n }\n\n return {\n ...(defaultValue || {}),\n ...value\n };\n }\n\n protected bind(args: DecoratorParameters, decorator: any) {\n this.entity = JsonEntityStore.from(...args);\n\n this.beforeInit();\n this.onInit(args, decorator);\n this.afterInit();\n }\n\n protected onInit(args: DecoratorParameters, decorator: any): void {\n this.forEach((value, key) => {\n this.onMapKey(key, value);\n });\n }\n\n protected onMapKey(key: string, value: any): void {\n this.entity.set(key, value);\n }\n\n protected runActions() {\n this.actions.forEach((action: any) => {\n action(this);\n });\n\n return this;\n }\n\n protected beforeInit() {}\n\n protected afterInit() {}\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @ignore
3
+ */
4
+ export function mapAliasedProperties(value, alias) {
5
+ return Object.entries(value).reduce((properties, [key, value]) => {
6
+ key = alias.get(key) || key;
7
+ properties[key] = value;
8
+ return properties;
9
+ }, {});
10
+ }
11
+ //# sourceMappingURL=JsonAliasMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonAliasMap.js","sourceRoot":"","sources":["../../../src/domain/JsonAliasMap.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAU,EAAE,KAAe;IAC9D,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAM,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpE,GAAG,GAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAY,IAAI,GAAG,CAAC;QACxC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAExB,OAAO,UAAU,CAAC;IACpB,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC","sourcesContent":["/**\n * @ignore\n */\nexport type AliasType = string | number | symbol;\n/**\n * @ignore\n */\nexport type AliasMap = Map<AliasType, AliasType>;\n/**\n * @ignore\n */\nexport function mapAliasedProperties(value: any, alias: AliasMap) {\n return Object.entries(value).reduce<any>((properties, [key, value]) => {\n key = (alias.get(key) as string) || key;\n properties[key] = value;\n\n return properties;\n }, {});\n}\n"]}
@@ -0,0 +1,34 @@
1
+ import { __decorate } from "tslib";
2
+ import { DecoratorTypes } from "@tsed/core";
3
+ import { JsonEntityStore } from "./JsonEntityStore";
4
+ import { JsonSchema } from "./JsonSchema";
5
+ import { JsonEntityComponent } from "../decorators/config/jsonEntityComponent";
6
+ let JsonClassStore = class JsonClassStore extends JsonEntityStore {
7
+ constructor() {
8
+ super(...arguments);
9
+ /**
10
+ * List of children JsonEntityStore (properties or methods or params)
11
+ */
12
+ this.children = new Map();
13
+ }
14
+ get path() {
15
+ return this.store.get("path", "/");
16
+ }
17
+ set path(path) {
18
+ this.store.set("path", path);
19
+ }
20
+ build() {
21
+ if (!this._type) {
22
+ this.buildType(this.target);
23
+ }
24
+ this._type = this._type || Object;
25
+ this._schema = JsonSchema.from({
26
+ type: this.type
27
+ });
28
+ }
29
+ };
30
+ JsonClassStore = __decorate([
31
+ JsonEntityComponent(DecoratorTypes.CLASS)
32
+ ], JsonClassStore);
33
+ export { JsonClassStore };
34
+ //# sourceMappingURL=JsonClassStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonClassStore.js","sourceRoot":"","sources":["../../../src/domain/JsonClassStore.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAC,eAAe,EAAyB,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,mBAAmB,EAAC,MAAM,0CAA0C,CAAC;AAG7E,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,eAAe;IAAnD;;QACE;;WAEG;QACM,aAAQ,GAA8D,IAAI,GAAG,EAAE,CAAC;IAqB3F,CAAC;IAnBC,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC;IAED,IAAI,IAAI,CAAC,IAAY;QACnB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAES,KAAK;QACb,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC7B;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC;QAElC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC;YAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAzBY,cAAc;IAD1B,mBAAmB,CAAC,cAAc,CAAC,KAAK,CAAC;GAC7B,cAAc,CAyB1B;SAzBY,cAAc","sourcesContent":["import {DecoratorTypes} from \"@tsed/core\";\nimport type {JsonMethodStore} from \"./JsonMethodStore\";\nimport type {JsonPropertyStore} from \"./JsonPropertyStore\";\nimport {JsonEntityStore, JsonEntityStoreOptions} from \"./JsonEntityStore\";\nimport {JsonSchema} from \"./JsonSchema\";\nimport {JsonEntityComponent} from \"../decorators/config/jsonEntityComponent\";\n\n@JsonEntityComponent(DecoratorTypes.CLASS)\nexport class JsonClassStore extends JsonEntityStore {\n /**\n * List of children JsonEntityStore (properties or methods or params)\n */\n readonly children: Map<string | number, JsonMethodStore | JsonPropertyStore> = new Map();\n\n get path() {\n return this.store.get(\"path\", \"/\");\n }\n\n set path(path: string) {\n this.store.set(\"path\", path);\n }\n\n protected build() {\n if (!this._type) {\n this.buildType(this.target);\n }\n\n this._type = this._type || Object;\n\n this._schema = JsonSchema.from({\n type: this.type\n });\n }\n}\n"]}
@@ -0,0 +1,159 @@
1
+ import { classOf, decoratorTypeOf, descriptorOf, isArrayOrArrayClass, isClass, isCollection, isDate, isObject, isPlainObject, isPrimitiveOrPrimitiveClass, nameOf, prototypeOf, Store } from "@tsed/core";
2
+ /**
3
+ * @ignore
4
+ */
5
+ export const JsonEntitiesContainer = new Map();
6
+ export class JsonEntityStore {
7
+ constructor(options) {
8
+ this.isStore = true;
9
+ const { target, propertyKey, descriptor, index, decoratorType } = options;
10
+ this.target = target;
11
+ this.propertyKey = propertyKey;
12
+ this.propertyName = String(propertyKey);
13
+ this.descriptor = descriptor;
14
+ this.index = index;
15
+ this.decoratorType = decoratorType;
16
+ this.token = target;
17
+ this.store = options.store;
18
+ this.parent = this;
19
+ }
20
+ /**
21
+ * Return the class name of the entity.
22
+ * @returns {string}
23
+ */
24
+ get targetName() {
25
+ return nameOf(this.token);
26
+ }
27
+ /**
28
+ *
29
+ * @returns {boolean}
30
+ */
31
+ get isCollection() {
32
+ return !!this.collectionType;
33
+ }
34
+ /**
35
+ *
36
+ * @returns {boolean}
37
+ */
38
+ get isArray() {
39
+ return isArrayOrArrayClass(this.collectionType);
40
+ }
41
+ /**
42
+ *
43
+ * @returns {boolean}
44
+ */
45
+ get isPrimitive() {
46
+ return isPrimitiveOrPrimitiveClass(this._type);
47
+ }
48
+ /**
49
+ *
50
+ * @returns {boolean}
51
+ */
52
+ get isDate() {
53
+ return isDate(this.computedType);
54
+ }
55
+ /**
56
+ *
57
+ * @returns {boolean}
58
+ */
59
+ get isObject() {
60
+ return isObject(this.computedType);
61
+ }
62
+ /**
63
+ *
64
+ */
65
+ get isClass() {
66
+ return isClass(this.computedType);
67
+ }
68
+ /**
69
+ * Return the JsonSchema
70
+ */
71
+ get schema() {
72
+ return this._schema;
73
+ }
74
+ get nestedGenerics() {
75
+ return this.schema.nestedGenerics;
76
+ }
77
+ set nestedGenerics(nestedGenerics) {
78
+ this.schema.nestedGenerics = nestedGenerics;
79
+ }
80
+ /**
81
+ *
82
+ * @returns {Type<any>}
83
+ */
84
+ get type() {
85
+ return this._type;
86
+ }
87
+ /**
88
+ * Get original type without transformation
89
+ * @param value
90
+ */
91
+ set type(value) {
92
+ this._type = value;
93
+ this.build();
94
+ }
95
+ /**
96
+ * Return the itemSchema computed type. if the type is a function used for recursive model, the function will be called to
97
+ * get the right type.
98
+ */
99
+ get computedType() {
100
+ return this.itemSchema.getComputedType();
101
+ }
102
+ get itemSchema() {
103
+ return this.isCollection ? this.schema.itemSchema() : this.schema;
104
+ }
105
+ get parentSchema() {
106
+ return this.parent.schema;
107
+ }
108
+ static from(...args) {
109
+ if (args[0].isStore) {
110
+ return args[0];
111
+ }
112
+ const target = args[0];
113
+ if (args.length > 1) {
114
+ args[0] = prototypeOf(args[0]);
115
+ }
116
+ const store = Store.from(...args);
117
+ if (!store.has("JsonEntityStore")) {
118
+ const decoratorType = decoratorTypeOf(args);
119
+ const entityStore = JsonEntitiesContainer.get(decoratorType);
120
+ // istanbul ignore next
121
+ if (!entityStore) {
122
+ throw Error("Unsupported json entity type");
123
+ }
124
+ const jsonSchemaStore = new entityStore({
125
+ store,
126
+ decoratorType,
127
+ target: classOf(target),
128
+ propertyKey: args[1],
129
+ index: typeof args[2] === "number" ? args[2] : undefined,
130
+ descriptor: typeof args[2] === "object" ? args[2] : undefined
131
+ });
132
+ jsonSchemaStore.build();
133
+ store.set("JsonEntityStore", jsonSchemaStore);
134
+ }
135
+ return store.get("JsonEntityStore");
136
+ }
137
+ static fromMethod(target, propertyKey) {
138
+ return this.from(target, propertyKey, descriptorOf(target, propertyKey));
139
+ }
140
+ get(key, defaultValue) {
141
+ return this.store.get(key, defaultValue);
142
+ }
143
+ set(key, value) {
144
+ return this.store.set(key, value);
145
+ }
146
+ buildType(type) {
147
+ if (isCollection(type)) {
148
+ this.collectionType = type;
149
+ }
150
+ else {
151
+ this._type = type;
152
+ // issue #1534: Enum metadata stored as plain object instead of String (see: https://github.com/tsedio/tsed/issues/1534)
153
+ if (this._type && isPlainObject(this._type)) {
154
+ this._type = String;
155
+ }
156
+ }
157
+ }
158
+ }
159
+ //# sourceMappingURL=JsonEntityStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonEntityStore.js","sourceRoot":"","sources":["../../../src/domain/JsonEntityStore.ts"],"names":[],"mappings":"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","sourcesContent":["import {\n classOf,\n decoratorTypeOf,\n DecoratorTypes,\n descriptorOf,\n isArrayOrArrayClass,\n isClass,\n isCollection,\n isDate,\n isObject,\n isPlainObject,\n isPrimitiveOrPrimitiveClass,\n nameOf,\n prototypeOf,\n Store,\n Type\n} from \"@tsed/core\";\nimport type {JsonSchema} from \"./JsonSchema\";\nimport type {JsonMethodStore} from \"./JsonMethodStore\";\nimport type {JsonClassStore} from \"./JsonClassStore\";\nimport type {JsonPropertyStore} from \"./JsonPropertyStore\";\nimport type {JsonParameterStore} from \"./JsonParameterStore\";\n\n/**\n * @ignore\n */\nexport const JsonEntitiesContainer = new Map<DecoratorTypes, Type<JsonEntityStore>>();\n\nexport interface JsonEntityStoreOptions {\n decoratorType: DecoratorTypes;\n target: Type<any>;\n propertyKey?: string | symbol;\n index?: number;\n descriptor?: any;\n type?: Type<any>;\n collectionType?: Type<any>;\n\n [key: string]: any;\n}\n\nexport abstract class JsonEntityStore implements JsonEntityStoreOptions {\n /**\n * Original property key decorated by the decorator\n */\n readonly propertyKey: string | symbol;\n /**\n * Alias of the property\n */\n readonly propertyName: string;\n /**\n * Parameter index\n */\n readonly index: number;\n /**\n * Method's descriptor\n */\n readonly descriptor: number;\n /**\n * Decorator type used to declare the JsonSchemaStore.\n */\n readonly decoratorType: DecoratorTypes;\n /**\n * Type of the collection (Array, Map, Set, etc...)\n */\n public collectionType: Type<any>;\n public token: Type<any>;\n readonly store: Store;\n readonly isStore = true;\n readonly parent: JsonEntityStore;\n readonly target: Type<any>;\n /**\n *\n */\n protected _type: Type<any>;\n /**\n * Ref to JsonSchema\n */\n protected _schema: JsonSchema;\n\n [key: string]: any;\n\n constructor(options: JsonEntityStoreOptions) {\n const {target, propertyKey, descriptor, index, decoratorType} = options;\n this.target = target;\n this.propertyKey = propertyKey!;\n this.propertyName = String(propertyKey);\n this.descriptor = descriptor;\n this.index = index!;\n this.decoratorType = decoratorType;\n this.token = target;\n this.store = options.store;\n this.parent = this;\n }\n\n /**\n * Return the class name of the entity.\n * @returns {string}\n */\n get targetName(): string {\n return nameOf(this.token);\n }\n\n /**\n *\n * @returns {boolean}\n */\n get isCollection(): boolean {\n return !!this.collectionType;\n }\n\n /**\n *\n * @returns {boolean}\n */\n get isArray() {\n return isArrayOrArrayClass(this.collectionType);\n }\n\n /**\n *\n * @returns {boolean}\n */\n get isPrimitive() {\n return isPrimitiveOrPrimitiveClass(this._type);\n }\n\n /**\n *\n * @returns {boolean}\n */\n get isDate() {\n return isDate(this.computedType);\n }\n\n /**\n *\n * @returns {boolean}\n */\n get isObject() {\n return isObject(this.computedType);\n }\n\n /**\n *\n */\n get isClass() {\n return isClass(this.computedType);\n }\n\n /**\n * Return the JsonSchema\n */\n get schema(): JsonSchema {\n return this._schema;\n }\n\n get nestedGenerics(): Type<any>[][] {\n return this.schema.nestedGenerics;\n }\n\n set nestedGenerics(nestedGenerics: Type<any>[][]) {\n this.schema.nestedGenerics = nestedGenerics;\n }\n\n /**\n *\n * @returns {Type<any>}\n */\n get type(): Type<any> | any {\n return this._type;\n }\n\n /**\n * Get original type without transformation\n * @param value\n */\n set type(value: Type<any> | any) {\n this._type = value;\n this.build();\n }\n\n /**\n * Return the itemSchema computed type. if the type is a function used for recursive model, the function will be called to\n * get the right type.\n */\n get computedType() {\n return this.itemSchema.getComputedType();\n }\n\n get itemSchema(): JsonSchema {\n return this.isCollection ? this.schema.itemSchema() : this.schema;\n }\n\n get parentSchema(): JsonSchema {\n return this.parent.schema;\n }\n\n /**\n *\n * @param target\n */\n static from<T extends JsonClassStore = JsonClassStore>(target: Type<any>): T;\n static from<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any, propertyKey: string | symbol): T;\n static from<T extends JsonParameterStore = JsonParameterStore>(target: Type<any> | any, propertyKey: string | symbol, index: number): T;\n static from<T extends JsonMethodStore = JsonMethodStore>(\n target: Type<any> | any,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor\n ): T;\n static from<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T;\n static from<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T {\n if (args[0].isStore) {\n return args[0] as T;\n }\n\n const target = args[0];\n\n if (args.length > 1) {\n args[0] = prototypeOf(args[0]);\n }\n\n const store = Store.from(...args);\n\n if (!store.has(\"JsonEntityStore\")) {\n const decoratorType = decoratorTypeOf(args);\n const entityStore = JsonEntitiesContainer.get(decoratorType);\n\n // istanbul ignore next\n if (!entityStore) {\n throw Error(\"Unsupported json entity type\");\n }\n\n const jsonSchemaStore = new entityStore({\n store,\n decoratorType,\n target: classOf(target),\n propertyKey: args[1],\n index: typeof args[2] === \"number\" ? args[2] : undefined,\n descriptor: typeof args[2] === \"object\" ? args[2] : undefined\n });\n\n jsonSchemaStore.build();\n\n store.set(\"JsonEntityStore\", jsonSchemaStore);\n }\n\n return store.get<T>(\"JsonEntityStore\")!;\n }\n\n static fromMethod<T extends JsonMethodStore = JsonMethodStore>(target: any, propertyKey: string | symbol) {\n return this.from<T>(target, propertyKey, descriptorOf(target, propertyKey));\n }\n\n get<T = any>(key: string, defaultValue?: any) {\n return this.store.get<T>(key, defaultValue);\n }\n\n set(key: string, value?: any) {\n return this.store.set(key, value);\n }\n\n protected abstract build(): void;\n\n protected buildType(type: any) {\n if (isCollection(type)) {\n this.collectionType = type;\n } else {\n this._type = type;\n\n // issue #1534: Enum metadata stored as plain object instead of String (see: https://github.com/tsedio/tsed/issues/1534)\n if (this._type && isPlainObject(this._type)) {\n this._type = String;\n }\n }\n }\n}\n"]}
@@ -0,0 +1,19 @@
1
+ export var JsonFormatTypes;
2
+ (function (JsonFormatTypes) {
3
+ JsonFormatTypes["DATE_TIME"] = "date-time";
4
+ JsonFormatTypes["DATE"] = "date";
5
+ JsonFormatTypes["TIME"] = "time";
6
+ JsonFormatTypes["EMAIL"] = "email";
7
+ JsonFormatTypes["HOSTNAME"] = "hostname";
8
+ JsonFormatTypes["IPV4"] = "ipv4";
9
+ JsonFormatTypes["IPV6"] = "ipv6";
10
+ JsonFormatTypes["URI"] = "uri";
11
+ JsonFormatTypes["URL"] = "url";
12
+ JsonFormatTypes["URI_REF"] = "uri-reference";
13
+ JsonFormatTypes["URI_TEMPLATE"] = "uri-template";
14
+ JsonFormatTypes["JSON_POINTER"] = "json-pointer";
15
+ JsonFormatTypes["RELATIVE_JSON_POINTER"] = "relative-json-pointer";
16
+ JsonFormatTypes["UUID"] = "uuid";
17
+ JsonFormatTypes["REGEX"] = "regex";
18
+ })(JsonFormatTypes || (JsonFormatTypes = {}));
19
+ //# sourceMappingURL=JsonFormatTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonFormatTypes.js","sourceRoot":"","sources":["../../../src/domain/JsonFormatTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAgBX;AAhBD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,wCAAqB,CAAA;IACrB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,8BAAW,CAAA;IACX,8BAAW,CAAA;IACX,4CAAyB,CAAA;IACzB,gDAA6B,CAAA;IAC7B,gDAA6B,CAAA;IAC7B,kEAA+C,CAAA;IAC/C,gCAAa,CAAA;IACb,kCAAe,CAAA;AACjB,CAAC,EAhBW,eAAe,KAAf,eAAe,QAgB1B","sourcesContent":["export enum JsonFormatTypes {\n DATE_TIME = \"date-time\",\n DATE = \"date\",\n TIME = \"time\",\n EMAIL = \"email\",\n HOSTNAME = \"hostname\",\n IPV4 = \"ipv4\",\n IPV6 = \"ipv6\",\n URI = \"uri\",\n URL = \"url\",\n URI_REF = \"uri-reference\",\n URI_TEMPLATE = \"uri-template\",\n JSON_POINTER = \"json-pointer\",\n RELATIVE_JSON_POINTER = \"relative-json-pointer\",\n UUID = \"uuid\",\n REGEX = \"regex\"\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { nameOf } from "@tsed/core";
2
+ import { execMapper } from "../registries/JsonSchemaMapperContainer";
3
+ import { getJsonEntityStore } from "../utils/getJsonEntityStore";
4
+ export class JsonLazyRef {
5
+ constructor(getType) {
6
+ this.getType = getType;
7
+ this.isLazyRef = true;
8
+ }
9
+ get target() {
10
+ return this.getType();
11
+ }
12
+ get schema() {
13
+ return getJsonEntityStore(this.getType()).schema;
14
+ }
15
+ get name() {
16
+ return nameOf(this.getType());
17
+ }
18
+ toJSON(options) {
19
+ return this.getType() && execMapper("schema", this.schema, options);
20
+ }
21
+ }
22
+ //# sourceMappingURL=JsonLazyRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonLazyRef.js","sourceRoot":"","sources":["../../../src/domain/JsonLazyRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAO,MAAM,YAAY,CAAC;AAExC,OAAO,EAAC,UAAU,EAAC,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,MAAM,OAAO,WAAW;IAGtB,YAAqB,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;QAFpC,cAAS,GAAG,IAAI,CAAC;IAEsB,CAAC;IAEjD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;IACnD,CAAC;IAED,IAAI,IAAI;QACN,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,OAA2B;QAChC,OAAO,IAAI,CAAC,OAAO,EAAE,IAAI,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;CACF","sourcesContent":["import {nameOf, Type} from \"@tsed/core\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {execMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {getJsonEntityStore} from \"../utils/getJsonEntityStore\";\n\nexport class JsonLazyRef {\n readonly isLazyRef = true;\n\n constructor(readonly getType: () => Type<any>) {}\n\n get target() {\n return this.getType();\n }\n\n get schema() {\n return getJsonEntityStore(this.getType()).schema;\n }\n\n get name() {\n return nameOf(this.getType());\n }\n\n toJSON(options?: JsonSchemaOptions) {\n return this.getType() && execMapper(\"schema\", this.schema, options);\n }\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import { isFunction } from "@tsed/core";
2
+ import { execMapper } from "../registries/JsonSchemaMapperContainer";
3
+ export class JsonMap extends Map {
4
+ constructor(obj = {}) {
5
+ super();
6
+ this.assign(obj);
7
+ }
8
+ assign(obj = {}) {
9
+ Object.entries(obj).forEach(([key, value]) => {
10
+ if (isFunction(this[key])) {
11
+ this[key](value);
12
+ }
13
+ else {
14
+ this.set(key, value);
15
+ }
16
+ });
17
+ return this;
18
+ }
19
+ toJSON(options = {}) {
20
+ return execMapper("map", this, options);
21
+ }
22
+ }
23
+ //# sourceMappingURL=JsonMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonMap.js","sourceRoot":"","sources":["../../../src/domain/JsonMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAC,UAAU,EAAC,MAAM,yCAAyC,CAAC;AAEnE,MAAM,OAAO,OAAW,SAAQ,GAAgB;IAG9C,YAAY,MAAkB,EAAE;QAC9B,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,MAAwB,EAAE;QAC/B,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC3C,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;gBACzB,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;aAClB;iBAAM;gBACL,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;aACtB;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,UAA6B,EAAE;QACpC,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["import {isFunction} from \"@tsed/core\";\nimport {JsonSchemaOptions} from \"../interfaces\";\nimport {execMapper} from \"../registries/JsonSchemaMapperContainer\";\n\nexport class JsonMap<T> extends Map<string, any> {\n [key: string]: any;\n\n constructor(obj: Partial<T> = {}) {\n super();\n\n this.assign(obj);\n }\n\n assign(obj: Partial<T> & any = {}) {\n Object.entries(obj).forEach(([key, value]) => {\n if (isFunction(this[key])) {\n this[key](value);\n } else {\n this.set(key, value);\n }\n });\n\n return this;\n }\n\n toJSON(options: JsonSchemaOptions = {}) {\n return execMapper(\"map\", this, options);\n }\n}\n"]}