@tsed/schema 6.87.2 → 6.90.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,34 @@
1
+ /**
2
+ * @ignore
3
+ * @param genericLabels
4
+ * @param genericTypes
5
+ */
6
+ export function getGenericsMap(genericLabels, genericTypes) {
7
+ return genericLabels.reduce((map, item, index) => map.set(item, genericTypes[index]), new Map());
8
+ }
9
+ /**
10
+ * @ignore
11
+ * @param options
12
+ */
13
+ export function mapGenericsOptions(options) {
14
+ if (options.genericLabels && options.genericTypes) {
15
+ const { genericLabels, genericTypes, ...ops } = options;
16
+ return {
17
+ ...ops,
18
+ generics: getGenericsMap(genericLabels, genericTypes)
19
+ };
20
+ }
21
+ return options;
22
+ }
23
+ /**
24
+ * @ignore
25
+ * @param value
26
+ */
27
+ export function popGenerics(value) {
28
+ const [genericTypes, ...out] = value.nestedGenerics;
29
+ return {
30
+ genericTypes,
31
+ nestedGenerics: out
32
+ };
33
+ }
34
+ //# sourceMappingURL=generics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generics.js","sourceRoot":"","sources":["../../../src/utils/generics.ts"],"names":[],"mappings":"AA4CA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,aAAuB,EAAE,YAA4B;IAClF,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,GAAqB,EAAE,IAAY,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACrI,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA8C;IAC/E,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,YAAY,EAAE;QACjD,MAAM,EAAC,aAAa,EAAE,YAAY,EAAE,GAAG,GAAG,EAAC,GAAG,OAAO,CAAC;QAEtD,OAAO;YACL,GAAG,GAAG;YACN,QAAQ,EAAE,cAAc,CAAC,aAAa,EAAE,YAAY,CAAC;SACtD,CAAC;KACH;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAqB;IAC/C,MAAM,CAAC,YAAY,EAAE,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC;IAEpD,OAAO;QACL,YAAY;QACZ,cAAc,EAAE,GAAG;KACpB,CAAC;AACJ,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {JsonSchema} from \"../domain\";\n\nexport type GenericValue = Type<any> | JsonSchema | any;\n\n/**\n * @ignore\n */\nexport type GenericsMap = Map<string, GenericValue>;\n\n/**\n * @ignore\n */\nexport interface GenericTypes {\n genericTypes: Type<any>[];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface GenericLabels {\n genericLabels: string[];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface NestedGenerics {\n nestedGenerics: GenericValue[][];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface GenericsContext extends GenericTypes, GenericLabels, NestedGenerics {\n generics: GenericsMap;\n}\n\n/**\n * @ignore\n * @param genericLabels\n * @param genericTypes\n */\nexport function getGenericsMap(genericLabels: string[], genericTypes: GenericValue[]): GenericsMap {\n return genericLabels.reduce((map: Map<string, any>, item: string, index: number) => map.set(item, genericTypes[index]), new Map());\n}\n\n/**\n * @ignore\n * @param options\n */\nexport function mapGenericsOptions(options: Partial<GenericTypes & GenericLabels>) {\n if (options.genericLabels && options.genericTypes) {\n const {genericLabels, genericTypes, ...ops} = options;\n\n return {\n ...ops,\n generics: getGenericsMap(genericLabels, genericTypes)\n };\n }\n\n return options;\n}\n\n/**\n * @ignore\n * @param value\n */\nexport function popGenerics(value: NestedGenerics): NestedGenerics & GenericTypes {\n const [genericTypes, ...out] = value.nestedGenerics;\n\n return {\n genericTypes,\n nestedGenerics: out\n };\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { classOf, isArrowFn, isClass, isClassObject, isCollection, isDate, isPrimitiveOrPrimitiveClass, isPromise, isSymbol } from "@tsed/core";
2
+ /**
3
+ * @ignore
4
+ */
5
+ export function getComputedType(target) {
6
+ if (isPromise(target)) {
7
+ return Object;
8
+ }
9
+ if (isClass(target) ||
10
+ isSymbol(target) ||
11
+ isPrimitiveOrPrimitiveClass(target) ||
12
+ isClassObject(target) ||
13
+ isDate(target) ||
14
+ isCollection(target)) {
15
+ return classOf(target);
16
+ }
17
+ if (isArrowFn(target)) {
18
+ return target();
19
+ }
20
+ return target;
21
+ }
22
+ //# sourceMappingURL=getComputedType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getComputedType.js","sourceRoot":"","sources":["../../../src/utils/getComputedType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,SAAS,EACT,OAAO,EACP,aAAa,EACb,YAAY,EACZ,MAAM,EACN,2BAA2B,EAC3B,SAAS,EACT,QAAQ,EAET,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAW;IACzC,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE;QACrB,OAAO,MAAM,CAAC;KACf;IAED,IACE,OAAO,CAAC,MAAM,CAAC;QACf,QAAQ,CAAC,MAAM,CAAC;QAChB,2BAA2B,CAAC,MAAM,CAAC;QACnC,aAAa,CAAC,MAAM,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC;QACd,YAAY,CAAC,MAAM,CAAC,EACpB;QACA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;KACxB;IAED,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE;QACrB,OAAQ,MAAc,EAAE,CAAC;KAC1B;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n classOf,\n isArrowFn,\n isClass,\n isClassObject,\n isCollection,\n isDate,\n isPrimitiveOrPrimitiveClass,\n isPromise,\n isSymbol,\n Type\n} from \"@tsed/core\";\n\n/**\n * @ignore\n */\nexport function getComputedType(target: any): Type<any> {\n if (isPromise(target)) {\n return Object;\n }\n\n if (\n isClass(target) ||\n isSymbol(target) ||\n isPrimitiveOrPrimitiveClass(target) ||\n isClassObject(target) ||\n isDate(target) ||\n isCollection(target)\n ) {\n return classOf(target);\n }\n\n if (isArrowFn(target)) {\n return (target as any)();\n }\n\n return target;\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { ancestorsOf } from "@tsed/core";
2
+ import { getJsonEntityStore } from "./getJsonEntityStore";
3
+ /**
4
+ * Return store and his inherited stores
5
+ * @param target
6
+ * @ignore
7
+ */
8
+ export function getInheritedStores(target) {
9
+ const store = target.isStore ? target : getJsonEntityStore(target);
10
+ if (!store.$inherited) {
11
+ store.$inherited = ancestorsOf(store.target)
12
+ .reverse()
13
+ .reduce((context, model) => {
14
+ return context.set(model, getJsonEntityStore(model));
15
+ }, new Map());
16
+ }
17
+ return store.$inherited;
18
+ }
19
+ //# sourceMappingURL=getInheritedStores.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getInheritedStores.js","sourceRoot":"","sources":["../../../src/utils/getInheritedStores.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAO,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAuB;IACxD,MAAM,KAAK,GAAmB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAiB,MAAM,CAAC,CAAC;IAEnG,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;QACrB,KAAK,CAAC,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC;aACzC,OAAO,EAAE;aACT,MAAM,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YACzB,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;KACjB;IAED,OAAO,KAAK,CAAC,UAAU,CAAC;AAC1B,CAAC","sourcesContent":["import {ancestorsOf, Type} from \"@tsed/core\";\nimport type {JsonClassStore} from \"../domain/JsonClassStore\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\n/**\n * Return store and his inherited stores\n * @param target\n * @ignore\n */\nexport function getInheritedStores(target: Type<any> | any): Map<Type<any>, JsonClassStore> {\n const store: JsonClassStore = target.isStore ? target : getJsonEntityStore<JsonClassStore>(target);\n\n if (!store.$inherited) {\n store.$inherited = ancestorsOf(store.target)\n .reverse()\n .reduce((context, model) => {\n return context.set(model, getJsonEntityStore(model));\n }, new Map());\n }\n\n return store.$inherited;\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import { DecoratorTypes } from "@tsed/core";
2
+ import { JsonEntitiesContainer, JsonEntityStore } from "../domain/JsonEntityStore";
3
+ import { JsonClassStore } from "../domain/JsonClassStore";
4
+ import { JsonPropertyStore } from "../domain/JsonPropertyStore";
5
+ import { JsonParameterStore } from "../domain/JsonParameterStore";
6
+ import { JsonMethodStore } from "../domain/JsonMethodStore";
7
+ JsonEntitiesContainer.set(DecoratorTypes.CLASS, JsonClassStore);
8
+ JsonEntitiesContainer.set(DecoratorTypes.PROP, JsonPropertyStore);
9
+ JsonEntitiesContainer.set(DecoratorTypes.PARAM, JsonParameterStore);
10
+ JsonEntitiesContainer.set(DecoratorTypes.METHOD, JsonMethodStore);
11
+ /**
12
+ * @ignore
13
+ */
14
+ export function isJsonEntityStore(model) {
15
+ return model.isStore;
16
+ }
17
+ export function getJsonEntityStore(...args) {
18
+ return JsonEntityStore.from(...args);
19
+ }
20
+ //# sourceMappingURL=getJsonEntityStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getJsonEntityStore.js","sourceRoot":"","sources":["../../../src/utils/getJsonEntityStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAO,MAAM,YAAY,CAAC;AAChD,OAAO,EAAC,qBAAqB,EAAE,eAAe,EAAC,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE1D,qBAAqB,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AAChE,qBAAqB,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;AAClE,qBAAqB,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;AACpE,qBAAqB,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAU;IAC1C,OAAO,KAAK,CAAC,OAAO,CAAC;AACvB,CAAC;AAsBD,MAAM,UAAU,kBAAkB,CAA8C,GAAG,IAAW;IAC5F,OAAO,eAAe,CAAC,IAAI,CAAI,GAAG,IAAI,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import {DecoratorTypes, Type} from \"@tsed/core\";\nimport {JsonEntitiesContainer, JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {JsonClassStore} from \"../domain/JsonClassStore\";\nimport {JsonPropertyStore} from \"../domain/JsonPropertyStore\";\nimport {JsonParameterStore} from \"../domain/JsonParameterStore\";\nimport {JsonMethodStore} from \"../domain/JsonMethodStore\";\n\nJsonEntitiesContainer.set(DecoratorTypes.CLASS, JsonClassStore);\nJsonEntitiesContainer.set(DecoratorTypes.PROP, JsonPropertyStore);\nJsonEntitiesContainer.set(DecoratorTypes.PARAM, JsonParameterStore);\nJsonEntitiesContainer.set(DecoratorTypes.METHOD, JsonMethodStore);\n\n/**\n * @ignore\n */\nexport function isJsonEntityStore(model: any): model is JsonEntityStore {\n return model.isStore;\n}\n\n/**\n * Get entity store from decorator args\n * @param target\n */\nexport function getJsonEntityStore<T extends JsonClassStore = JsonClassStore>(target: Type<any>): T;\nexport function getJsonEntityStore<T extends JsonPropertyStore = JsonPropertyStore>(\n target: Type<any> | any,\n propertyKey: string | symbol\n): T;\nexport function getJsonEntityStore<T extends JsonParameterStore = JsonParameterStore>(\n target: Type<any> | any,\n propertyKey: string | symbol,\n index: number\n): T;\nexport function getJsonEntityStore<T extends JsonMethodStore = JsonMethodStore>(\n target: Type<any> | any,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor\n): T;\nexport function getJsonEntityStore<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T;\nexport function getJsonEntityStore<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T {\n return JsonEntityStore.from<T>(...args);\n}\n"]}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @ignore
3
+ */
4
+ function getVariable(subpath) {
5
+ const [prefix, right] = subpath.split("=");
6
+ const splited = (right || prefix).split(".");
7
+ const name = splited.splice(0, 1)[0];
8
+ return {
9
+ prefix: right && prefix ? `${prefix}=` : "",
10
+ name,
11
+ postfix: splited.length ? `.${splited.join(".")}` : ""
12
+ };
13
+ }
14
+ /**
15
+ * @ignore
16
+ */
17
+ export function getJsonPathParameters(base, path = "") {
18
+ if (path instanceof RegExp) {
19
+ path = path.toString().replace(/^\//, "").replace(/\/$/, "").replace(/\\/, "");
20
+ }
21
+ const params = [];
22
+ const paths = [];
23
+ let isOptional = false;
24
+ let current = "";
25
+ `${base}${path}`
26
+ .replace(/\((.*)\)/gi, "")
27
+ .split("/")
28
+ .filter((o) => !!o)
29
+ .map((key) => {
30
+ const subpath = key.replace(":", "").replace("?", "");
31
+ if (key.includes(":")) {
32
+ const optional = key.includes("?");
33
+ // Append previous config
34
+ if (optional && !isOptional) {
35
+ isOptional = true;
36
+ paths.push({
37
+ path: current,
38
+ parameters: [].concat(params)
39
+ });
40
+ }
41
+ const { prefix, name, postfix } = getVariable(subpath);
42
+ current += `/${prefix}{${name}}${postfix}`;
43
+ params.push({
44
+ in: "path",
45
+ name,
46
+ type: "string",
47
+ required: true
48
+ });
49
+ if (optional && isOptional) {
50
+ paths.push({
51
+ path: current,
52
+ parameters: [].concat(params)
53
+ });
54
+ }
55
+ }
56
+ else {
57
+ current += `/${key}`;
58
+ }
59
+ });
60
+ return paths.length
61
+ ? paths
62
+ : [
63
+ {
64
+ path: current,
65
+ parameters: [].concat(params)
66
+ }
67
+ ];
68
+ }
69
+ //# sourceMappingURL=getJsonPathParameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getJsonPathParameters.js","sourceRoot":"","sources":["../../../src/utils/getJsonPathParameters.ts"],"names":[],"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ignore\n */\nfunction getVariable(subpath: string) {\n const [prefix, right] = subpath.split(\"=\");\n const splited = (right || prefix).split(\".\");\n const name = splited.splice(0, 1)[0];\n\n return {\n prefix: right && prefix ? `${prefix}=` : \"\",\n name,\n postfix: splited.length ? `.${splited.join(\".\")}` : \"\"\n };\n}\n\n/**\n * @ignore\n */\nexport function getJsonPathParameters(base: string, path: string | RegExp | (string | RegExp)[] = \"\"): {path: string; parameters: any[]}[] {\n if (path instanceof RegExp) {\n path = path.toString().replace(/^\\//, \"\").replace(/\\/$/, \"\").replace(/\\\\/, \"\");\n }\n\n const params: any[] = [];\n const paths: any[] = [];\n let isOptional = false;\n let current = \"\";\n\n `${base}${path}`\n .replace(/\\((.*)\\)/gi, \"\")\n .split(\"/\")\n .filter((o) => !!o)\n .map((key) => {\n const subpath = key.replace(\":\", \"\").replace(\"?\", \"\");\n\n if (key.includes(\":\")) {\n const optional = key.includes(\"?\");\n\n // Append previous config\n if (optional && !isOptional) {\n isOptional = true;\n\n paths.push({\n path: current,\n parameters: [].concat(params as any)\n });\n }\n\n const {prefix, name, postfix} = getVariable(subpath);\n current += `/${prefix}{${name}}${postfix}`;\n\n params.push({\n in: \"path\",\n name,\n type: \"string\",\n required: true\n });\n\n if (optional && isOptional) {\n paths.push({\n path: current,\n parameters: [].concat(params as any)\n });\n }\n } else {\n current += `/${key}`;\n }\n });\n\n return paths.length\n ? paths\n : [\n {\n path: current,\n parameters: [].concat(params as any)\n }\n ];\n}\n"]}
@@ -0,0 +1,51 @@
1
+ import "../components";
2
+ import { SpecTypes } from "../domain/SpecTypes";
3
+ import { execMapper } from "../registries/JsonSchemaMapperContainer";
4
+ import { getJsonEntityStore } from "./getJsonEntityStore";
5
+ /**
6
+ * @ignore
7
+ */
8
+ const CACHE_KEY = "$cache:schemes";
9
+ /**
10
+ * @ignore
11
+ */
12
+ function getKey(options) {
13
+ return JSON.stringify(options);
14
+ }
15
+ /**
16
+ * @ignore
17
+ */
18
+ function get(entity, options) {
19
+ const cache = entity.store.get(CACHE_KEY) || new Map();
20
+ const key = getKey(options);
21
+ if (!cache.has(key)) {
22
+ const schema = execMapper("schema", entity.schema, options);
23
+ if (Object.keys(options.schemas).length) {
24
+ schema.definitions = options.schemas;
25
+ }
26
+ cache.set(key, schema);
27
+ }
28
+ entity.store.set(CACHE_KEY, cache);
29
+ return cache.get(key);
30
+ }
31
+ export function getJsonSchema(model, options = {}) {
32
+ var _a;
33
+ const entity = getJsonEntityStore(model);
34
+ options = {
35
+ endpoint: true,
36
+ groups: [],
37
+ ...options,
38
+ specType: options.specType || SpecTypes.JSON,
39
+ schemas: {}
40
+ };
41
+ if (entity.decoratorType === "parameter") {
42
+ options = {
43
+ ...options,
44
+ genericTypes: entity.nestedGenerics[0],
45
+ nestedGenerics: entity.nestedGenerics,
46
+ groups: (_a = entity.parameter) === null || _a === void 0 ? void 0 : _a.groups
47
+ };
48
+ }
49
+ return get(entity, options);
50
+ }
51
+ //# sourceMappingURL=getJsonSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/utils/getJsonSchema.ts"],"names":[],"mappings":"AACA,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAC,UAAU,EAAC,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD;;GAEG;AACH,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAEnC;;GAEG;AACH,SAAS,MAAM,CAAC,OAAY;IAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,SAAS,GAAG,CAAC,MAAuB,EAAE,OAAY;IAChD,MAAM,KAAK,GAAqB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;IACzE,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAE5B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACnB,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAE5D,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE;YACvC,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;SACtC;QAED,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;KACxB;IAED,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAEnC,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAsB,EAAE,UAA6B,EAAE;;IACnF,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAEzC,OAAO,GAAG;QACR,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE;QACV,GAAG,OAAO;QACV,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,SAAS,CAAC,IAAI;QAC5C,OAAO,EAAE,EAAE;KACZ,CAAC;IAEF,IAAI,MAAM,CAAC,aAAa,KAAK,WAAW,EAAE;QACxC,OAAO,GAAG;YACR,GAAG,OAAO;YACV,YAAY,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;YACtC,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,MAAM,EAAE,MAAA,MAAM,CAAC,SAAS,0CAAE,MAAM;SACjC,CAAC;KACH;IAED,OAAO,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport \"../components\";\nimport type {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces\";\nimport {execMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\n/**\n * @ignore\n */\nconst CACHE_KEY = \"$cache:schemes\";\n\n/**\n * @ignore\n */\nfunction getKey(options: any) {\n return JSON.stringify(options);\n}\n\n/**\n * @ignore\n */\nfunction get(entity: JsonEntityStore, options: any) {\n const cache: Map<string, any> = entity.store.get(CACHE_KEY) || new Map();\n const key = getKey(options);\n\n if (!cache.has(key)) {\n const schema = execMapper(\"schema\", entity.schema, options);\n\n if (Object.keys(options.schemas).length) {\n schema.definitions = options.schemas;\n }\n\n cache.set(key, schema);\n }\n\n entity.store.set(CACHE_KEY, cache);\n\n return cache.get(key);\n}\n\nexport function getJsonSchema(model: Type<any> | any, options: JsonSchemaOptions = {}) {\n const entity = getJsonEntityStore(model);\n\n options = {\n endpoint: true,\n groups: [],\n ...options,\n specType: options.specType || SpecTypes.JSON,\n schemas: {}\n };\n\n if (entity.decoratorType === \"parameter\") {\n options = {\n ...options,\n genericTypes: entity.nestedGenerics[0],\n nestedGenerics: entity.nestedGenerics,\n groups: entity.parameter?.groups\n };\n }\n\n return get(entity, options);\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import { isArray, isDate, isPrimitiveOrPrimitiveClass, primitiveOf } from "@tsed/core";
2
+ /**
3
+ * @ignore
4
+ */
5
+ export const JSON_TYPES = ["string", "number", "integer", "boolean", "object", "array", "null", "any"];
6
+ export function getJsonType(value) {
7
+ if (value === null) {
8
+ return "null";
9
+ }
10
+ if (isPrimitiveOrPrimitiveClass(value)) {
11
+ if (JSON_TYPES.indexOf(value) > -1) {
12
+ return value;
13
+ }
14
+ if (typeof value === "string") {
15
+ if (value === "file") {
16
+ return "file";
17
+ }
18
+ return "generic";
19
+ }
20
+ return primitiveOf(value);
21
+ }
22
+ if (value === Array) {
23
+ return "array";
24
+ }
25
+ if (isArray(value)) {
26
+ return value.map(getJsonType);
27
+ }
28
+ if (value === Set) {
29
+ return "array";
30
+ }
31
+ if (isDate(value)) {
32
+ return "string";
33
+ }
34
+ return "object";
35
+ }
36
+ //# sourceMappingURL=getJsonType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getJsonType.js","sourceRoot":"","sources":["../../../src/utils/getJsonType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,2BAA2B,EAAE,WAAW,EAAC,MAAM,YAAY,CAAC;AAErF;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAEvG,MAAM,UAAU,WAAW,CAAC,KAAU;IACpC,IAAI,KAAK,KAAK,IAAI,EAAE;QAClB,OAAO,MAAM,CAAC;KACf;IAED,IAAI,2BAA2B,CAAC,KAAK,CAAC,EAAE;QACtC,IAAI,UAAU,CAAC,OAAO,CAAC,KAAe,CAAC,GAAG,CAAC,CAAC,EAAE;YAC5C,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,IAAI,KAAK,KAAK,MAAM,EAAE;gBACpB,OAAO,MAAM,CAAC;aACf;YAED,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;KAC3B;IAED,IAAI,KAAK,KAAK,KAAK,EAAE;QACnB,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;QAClB,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,CAAQ,CAAC;KACtC;IAED,IAAI,KAAK,KAAK,GAAG,EAAE;QACjB,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE;QACjB,OAAO,QAAQ,CAAC;KACjB;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import {isArray, isDate, isPrimitiveOrPrimitiveClass, primitiveOf} from \"@tsed/core\";\n\n/**\n * @ignore\n */\nexport const JSON_TYPES = [\"string\", \"number\", \"integer\", \"boolean\", \"object\", \"array\", \"null\", \"any\"];\n\nexport function getJsonType(value: any): string {\n if (value === null) {\n return \"null\";\n }\n\n if (isPrimitiveOrPrimitiveClass(value)) {\n if (JSON_TYPES.indexOf(value as string) > -1) {\n return value;\n }\n\n if (typeof value === \"string\") {\n if (value === \"file\") {\n return \"file\";\n }\n\n return \"generic\";\n }\n\n return primitiveOf(value);\n }\n\n if (value === Array) {\n return \"array\";\n }\n\n if (isArray(value)) {\n return value.map(getJsonType) as any;\n }\n\n if (value === Set) {\n return \"array\";\n }\n\n if (isDate(value)) {\n return \"string\";\n }\n\n return \"object\";\n}\n"]}
@@ -0,0 +1,32 @@
1
+ import { getOperationsStores } from "./getOperationsStores";
2
+ import { JsonOperationRoute } from "../domain/JsonOperationRoute";
3
+ import { getJsonEntityStore } from "./getJsonEntityStore";
4
+ export function getOperationsRoutes(token, options = {}) {
5
+ const store = token.isStore ? token : getJsonEntityStore(token);
6
+ const basePath = ((options.basePath || "") + (store.path || "")).replace(/\/\//gi, "/");
7
+ let operationsRoutes = [];
8
+ if (options.withChildren) {
9
+ const children = store.get("childrenControllers", []);
10
+ operationsRoutes = children.reduce((operationsRoutes, token) => {
11
+ return operationsRoutes.concat(getOperationsRoutes(token, {
12
+ ...options,
13
+ basePath
14
+ }));
15
+ }, operationsRoutes);
16
+ }
17
+ return [...getOperationsStores(token).values()].reduce((routes, endpoint) => {
18
+ const { operation } = endpoint;
19
+ if (operation) {
20
+ operation.operationPaths.forEach((operationPath) => {
21
+ routes.push(new JsonOperationRoute({
22
+ basePath,
23
+ token,
24
+ endpoint,
25
+ operationPath
26
+ }));
27
+ });
28
+ }
29
+ return routes;
30
+ }, operationsRoutes);
31
+ }
32
+ //# sourceMappingURL=getOperationsRoutes.js.map
@@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ACb,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;gBACjD,MAAM,CAAC,IAAI,CACT,IAAI,kBAAkB,CAAS;oBAC7B,QAAQ;oBACR,KAAK;oBACL,QAAQ;oBACR,aAAa;iBACd,CAAC,CACH,CAAC;YACJ,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {getOperationsStores} from \"./getOperationsStores\";\nimport {JsonOperationRoute} from \"../domain/JsonOperationRoute\";\nimport {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\nexport interface GetOperationsRoutesOptions {\n withChildren?: boolean;\n basePath?: string;\n}\n\nexport function getOperationsRoutes<Entity extends JsonEntityStore = JsonEntityStore>(\n token: Type<any> | any,\n options: GetOperationsRoutesOptions = {}\n): JsonOperationRoute<Entity>[] {\n const store: JsonEntityStore = token.isStore ? token : getJsonEntityStore(token);\n const basePath = ((options.basePath || \"\") + (store.path || \"\")).replace(/\\/\\//gi, \"/\");\n let operationsRoutes: JsonOperationRoute<Entity>[] = [];\n\n if (options.withChildren) {\n const children = store.get<Type[]>(\"childrenControllers\", []);\n\n operationsRoutes = children.reduce((operationsRoutes, token) => {\n return operationsRoutes.concat(\n getOperationsRoutes(token, {\n ...options,\n basePath\n })\n );\n }, operationsRoutes);\n }\n\n return [...getOperationsStores(token).values()].reduce((routes, endpoint) => {\n const {operation} = endpoint;\n\n if (operation) {\n operation.operationPaths.forEach((operationPath) => {\n routes.push(\n new JsonOperationRoute<Entity>({\n basePath,\n token,\n endpoint,\n operationPath\n })\n );\n });\n }\n\n return routes;\n }, operationsRoutes);\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import { JsonMethodStore } from "../domain/JsonMethodStore";
2
+ import { JsonOperationPathsMap } from "../domain/JsonOperationPathsMap";
3
+ import { getInheritedStores } from "./getInheritedStores";
4
+ import { getJsonEntityStore } from "./getJsonEntityStore";
5
+ /**
6
+ * @ignore
7
+ */
8
+ export function getOperationsStores(target) {
9
+ const store = target.isStore ? target : getJsonEntityStore(target);
10
+ if (!store.$operations) {
11
+ const operationPaths = new JsonOperationPathsMap();
12
+ store.$operations = new Map();
13
+ getInheritedStores(store).forEach((currentStore) => {
14
+ currentStore.children.forEach((propStore) => {
15
+ if (propStore instanceof JsonMethodStore && !store.$operations.has(propStore.propertyKey)) {
16
+ store.$operations.set(propStore.propertyKey, propStore);
17
+ }
18
+ });
19
+ });
20
+ store.$operations.forEach((store) => {
21
+ store.operation.operationPaths.forEach((operationPath) => {
22
+ operationPaths.setOperationPath(operationPath);
23
+ });
24
+ });
25
+ operationPaths.clear();
26
+ }
27
+ return store.$operations;
28
+ }
29
+ //# sourceMappingURL=getOperationsStores.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOperationsStores.js","sourceRoot":"","sources":["../../../src/utils/getOperationsStores.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAC,qBAAqB,EAAC,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAA8C,MAAuB;IACtG,MAAM,KAAK,GAAmB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAEnF,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;QACtB,MAAM,cAAc,GAAG,IAAI,qBAAqB,EAAE,CAAC;QACnD,KAAK,CAAC,WAAW,GAAG,IAAI,GAAG,EAAa,CAAC;QAEzC,kBAAkB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;YACjD,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;gBAC1C,IAAI,SAAS,YAAY,eAAe,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE;oBACzF,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;iBACzD;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,KAAsB,EAAE,EAAE;YACnD,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;gBACvD,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,cAAc,CAAC,KAAK,EAAE,CAAC;KACxB;IAED,OAAO,KAAK,CAAC,WAAW,CAAC;AAC3B,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {JsonMethodStore} from \"../domain/JsonMethodStore\";\nimport type {JsonClassStore} from \"../domain/JsonClassStore\";\nimport {JsonOperationPathsMap} from \"../domain/JsonOperationPathsMap\";\nimport {getInheritedStores} from \"./getInheritedStores\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\n/**\n * @ignore\n */\nexport function getOperationsStores<T extends JsonMethodStore = JsonMethodStore>(target: Type<any> | any): Map<string, T> {\n const store: JsonClassStore = target.isStore ? target : getJsonEntityStore(target);\n\n if (!store.$operations) {\n const operationPaths = new JsonOperationPathsMap();\n store.$operations = new Map<string, T>();\n\n getInheritedStores(store).forEach((currentStore) => {\n currentStore.children.forEach((propStore) => {\n if (propStore instanceof JsonMethodStore && !store.$operations.has(propStore.propertyKey)) {\n store.$operations.set(propStore.propertyKey, propStore);\n }\n });\n });\n\n store.$operations.forEach((store: JsonMethodStore) => {\n store.operation.operationPaths.forEach((operationPath) => {\n operationPaths.setOperationPath(operationPath);\n });\n });\n\n operationPaths.clear();\n }\n\n return store.$operations;\n}\n"]}
@@ -0,0 +1,40 @@
1
+ import { alterIgnore } from "../hooks/alterIgnore";
2
+ import { getInheritedStores } from "./getInheritedStores";
3
+ import { getJsonEntityStore } from "./getJsonEntityStore";
4
+ /**
5
+ * Return the list of properties including properties from inherited classes
6
+ * @param target
7
+ * @ignore
8
+ */
9
+ export function getPropertiesStores(target) {
10
+ const store = target.isStore ? target : getJsonEntityStore(target);
11
+ if (!store.$properties) {
12
+ const stores = getInheritedStores(store);
13
+ store.$properties = new Map();
14
+ stores.forEach((currentStore) => {
15
+ currentStore.children.forEach((propStore) => {
16
+ if (!store.$properties.has(propStore.propertyKey)) {
17
+ store.$properties.set(propStore.propertyKey, propStore);
18
+ }
19
+ });
20
+ });
21
+ }
22
+ return store.$properties;
23
+ }
24
+ /**
25
+ * @ignore
26
+ */
27
+ export function getProperties(target, options = {}) {
28
+ const stores = getPropertiesStores(target);
29
+ const map = new Map();
30
+ stores.forEach((store, key) => {
31
+ if (!options.withIgnoredProps) {
32
+ if (alterIgnore(store.itemSchema, options)) {
33
+ return;
34
+ }
35
+ }
36
+ map.set(key, store);
37
+ });
38
+ return map;
39
+ }
40
+ //# sourceMappingURL=getPropertiesStores.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPropertiesStores.js","sourceRoot":"","sources":["../../../src/utils/getPropertiesStores.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAuB;IAEvB,MAAM,KAAK,GAAmB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAEnF,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;QACtB,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACzC,KAAK,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;QAE9B,MAAM,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;YAC9B,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;gBAC1C,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE;oBACjD,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;iBACzD;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,KAAK,CAAC,WAAW,CAAC;AAC3B,CAAC;AAYD;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAuB,EACvB,UAAgC,EAAE;IAElC,MAAM,MAAM,GAAG,mBAAmB,CAAI,MAAM,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAqC,IAAI,GAAG,EAAE,CAAC;IAExD,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAC5B,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE;YAC7B,IAAI,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE;gBAC1C,OAAO;aACR;SACF;QAED,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport type {JsonClassStore} from \"../domain/JsonClassStore\";\nimport type {JsonPropertyStore} from \"../domain/JsonPropertyStore\";\nimport {alterIgnore} from \"../hooks/alterIgnore\";\nimport {getInheritedStores} from \"./getInheritedStores\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\n/**\n * Return the list of properties including properties from inherited classes\n * @param target\n * @ignore\n */\nexport function getPropertiesStores<T extends JsonPropertyStore = JsonPropertyStore>(\n target: Type<any> | any\n): Map<string | symbol | number, T> {\n const store: JsonClassStore = target.isStore ? target : getJsonEntityStore(target);\n\n if (!store.$properties) {\n const stores = getInheritedStores(store);\n store.$properties = new Map();\n\n stores.forEach((currentStore) => {\n currentStore.children.forEach((propStore) => {\n if (!store.$properties.has(propStore.propertyKey)) {\n store.$properties.set(propStore.propertyKey, propStore);\n }\n });\n });\n }\n\n return store.$properties;\n}\n\n/**\n * @ignore\n */\nexport interface GetPropertiesOptions {\n withIgnoredProps?: boolean;\n groups?: string[] | false;\n\n [type: string]: any;\n}\n\n/**\n * @ignore\n */\nexport function getProperties<T extends JsonPropertyStore = JsonPropertyStore>(\n target: Type<any> | any,\n options: GetPropertiesOptions = {}\n) {\n const stores = getPropertiesStores<T>(target);\n const map: Map<string | symbol | number, T> = new Map();\n\n stores.forEach((store, key) => {\n if (!options.withIgnoredProps) {\n if (alterIgnore(store.itemSchema, options)) {\n return;\n }\n }\n\n map.set(key, store);\n });\n\n return map;\n}\n"]}
@@ -0,0 +1,63 @@
1
+ import { uniq } from "@tsed/core";
2
+ import { alterRequiredGroups } from "../hooks/alterRequiredGroups";
3
+ function applyStringRule(obj, propSchema) {
4
+ if (!(propSchema === null || propSchema === void 0 ? void 0 : propSchema.$allow.includes(""))) {
5
+ if ([].concat(propSchema === null || propSchema === void 0 ? void 0 : propSchema.get("type")).includes("string")) {
6
+ const minLength = obj === null || obj === void 0 ? void 0 : obj.minLength;
7
+ // Disallow empty string
8
+ if (minLength === undefined) {
9
+ return {
10
+ ...obj,
11
+ minLength: 1
12
+ };
13
+ }
14
+ }
15
+ }
16
+ return obj;
17
+ }
18
+ function mapRequiredProps(obj, schema, options = {}) {
19
+ const { useAlias } = options;
20
+ const props = Object.keys(obj.properties || {});
21
+ return (keys, key) => {
22
+ const aliasedKey = useAlias ? schema.alias.get(key) || key : key;
23
+ if (props.includes(aliasedKey)) {
24
+ const propSchema = schema.get("properties")[key];
25
+ const serializeSchema = obj.properties[aliasedKey];
26
+ obj.properties[aliasedKey] = applyStringRule(serializeSchema, propSchema); // applyNullRule(applyStringRule(serializeSchema, propSchema), propSchema);
27
+ // obj.properties[aliasedKey] = mapNullableType(obj.properties[aliasedKey]);
28
+ return keys.concat(aliasedKey);
29
+ }
30
+ return keys;
31
+ };
32
+ }
33
+ function extractRequiredProps(obj, schema, options) {
34
+ let required = obj.required || [];
35
+ required = [...required, ...schema.$required];
36
+ if (schema.get("properties")) {
37
+ required = Object.entries(schema.get("properties")).reduce((required, [key, prop]) => {
38
+ if (prop && prop.$selfRequired !== undefined) {
39
+ return prop.$selfRequired ? required.concat(key) : required.filter((k) => k === key);
40
+ }
41
+ return required;
42
+ }, required);
43
+ }
44
+ return alterRequiredGroups(uniq(required), schema, options);
45
+ }
46
+ /**
47
+ * @ignore
48
+ */
49
+ export function getRequiredProperties(obj, schema, options) {
50
+ if (options.groups && options.groups.includes("partial")) {
51
+ return obj;
52
+ }
53
+ let required = extractRequiredProps(obj, schema, options);
54
+ required = uniq(required).reduce(mapRequiredProps(obj, schema, options), []);
55
+ if (required.length) {
56
+ return {
57
+ ...obj,
58
+ required
59
+ };
60
+ }
61
+ return obj;
62
+ }
63
+ //# sourceMappingURL=getRequiredProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRequiredProperties.js","sourceRoot":"","sources":["../../../src/utils/getRequiredProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAC,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AAGjE,SAAS,eAAe,CAAC,GAAQ,EAAE,UAAsB;IACvD,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,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CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IAE7E,IAAI,QAAQ,CAAC,MAAM,EAAE;QACnB,OAAO;YACL,GAAG,GAAG;YACN,QAAQ;SACT,CAAC;KACH;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import {uniq} from \"@tsed/core\";\nimport type {JsonSchema} from \"../domain/JsonSchema\";\nimport {alterRequiredGroups} from \"../hooks/alterRequiredGroups\";\nimport type {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\n\nfunction applyStringRule(obj: any, propSchema: JsonSchema) {\n if (!propSchema?.$allow.includes(\"\")) {\n if (([] as string[]).concat(propSchema?.get(\"type\")).includes(\"string\")) {\n const minLength = obj?.minLength;\n // Disallow empty string\n if (minLength === undefined) {\n return {\n ...obj,\n minLength: 1\n };\n }\n }\n }\n\n return obj;\n}\n\nfunction mapRequiredProps(obj: any, schema: JsonSchema, options: JsonSchemaOptions = {}) {\n const {useAlias} = options;\n const props = Object.keys(obj.properties || {});\n\n return (keys: string[], key: string) => {\n const aliasedKey = useAlias ? (schema.alias.get(key) as string) || key : key;\n\n if (props.includes(aliasedKey)) {\n const propSchema = schema.get(\"properties\")[key];\n const serializeSchema = obj.properties[aliasedKey];\n\n obj.properties[aliasedKey] = applyStringRule(serializeSchema, propSchema); // applyNullRule(applyStringRule(serializeSchema, propSchema), propSchema);\n // obj.properties[aliasedKey] = mapNullableType(obj.properties[aliasedKey]);\n\n return keys.concat(aliasedKey);\n }\n\n return keys;\n };\n}\n\nfunction extractRequiredProps(obj: any, schema: JsonSchema, options: JsonSchemaOptions): string[] {\n let required: string[] = obj.required || [];\n\n required = [...required, ...schema.$required];\n\n if (schema.get(\"properties\")) {\n required = Object.entries(schema.get(\"properties\")).reduce((required, [key, prop]: [string, any]) => {\n if (prop && prop.$selfRequired !== undefined) {\n return prop.$selfRequired ? required.concat(key) : required.filter((k) => k === key);\n }\n\n return required;\n }, required);\n }\n\n return alterRequiredGroups(uniq(required), schema, options);\n}\n\n/**\n * @ignore\n */\nexport function getRequiredProperties(obj: any, schema: JsonSchema, options: JsonSchemaOptions) {\n if (options.groups && options.groups.includes(\"partial\")) {\n return obj;\n }\n\n let required = extractRequiredProps(obj, schema, options);\n\n required = uniq(required).reduce(mapRequiredProps(obj, schema, options), []);\n\n if (required.length) {\n return {\n ...obj,\n required\n };\n }\n\n return obj;\n}\n"]}
@@ -0,0 +1,83 @@
1
+ import { cleanObject, uniqBy } from "@tsed/core";
2
+ import { SpecTypes } from "../domain/SpecTypes";
3
+ import { buildPath } from "./buildPath";
4
+ import { getJsonEntityStore } from "./getJsonEntityStore";
5
+ import { getOperationsStores } from "./getOperationsStores";
6
+ import { mergeOperation } from "./mergeOperation";
7
+ import { operationIdFormatter } from "./operationIdFormatter";
8
+ /**
9
+ * @ignore
10
+ */
11
+ const caches = new Map();
12
+ /**
13
+ * @ignore
14
+ */
15
+ function get(model, options, cb) {
16
+ if (!caches.has(model)) {
17
+ caches.set(model, new Map());
18
+ }
19
+ const cache = caches.get(model);
20
+ const key = JSON.stringify(options);
21
+ if (!cache.has(key)) {
22
+ cache.set(key, cb());
23
+ }
24
+ return cache.get(key);
25
+ }
26
+ /**
27
+ * Return the swagger or open spec for the given class.
28
+ * @param model
29
+ * @param options
30
+ */
31
+ export function getSpec(model, options = { specType: SpecTypes.SWAGGER }) {
32
+ if (!options.specType) {
33
+ options.specType = SpecTypes.SWAGGER;
34
+ }
35
+ options = {
36
+ ...options,
37
+ operationIdFormatter: options.operationIdFormatter || operationIdFormatter(options.operationIdPattern),
38
+ root: false,
39
+ specType: options.specType
40
+ };
41
+ return get(model, options, () => {
42
+ const store = getJsonEntityStore(model);
43
+ const { specType = SpecTypes.SWAGGER, schemas = {}, paths = {}, rootPath = "/", tags = [] } = options;
44
+ const ctrlPath = store.path;
45
+ const defaultTags = cleanObject({
46
+ name: store.schema.getName(),
47
+ description: store.schema.get("description")
48
+ });
49
+ const specJson = { paths };
50
+ getOperationsStores(model).forEach((operationStore) => {
51
+ if (operationStore.store.get("hidden")) {
52
+ return;
53
+ }
54
+ const operation = operationStore.operation.toJSON({ ...options, specType, schemas });
55
+ operationStore.operation.operationPaths.forEach(({ path, method }) => {
56
+ if (method) {
57
+ mergeOperation(specJson, operation, {
58
+ rootPath: buildPath(rootPath + ctrlPath),
59
+ path,
60
+ method,
61
+ defaultTags,
62
+ tags,
63
+ specType,
64
+ operationId: (path) => options.operationIdFormatter(operationStore.parent.schema.get("name") || operationStore.parent.targetName, operationStore.propertyName, path)
65
+ });
66
+ }
67
+ });
68
+ });
69
+ specJson.tags = uniqBy(tags, "name");
70
+ if (Object.keys(schemas).length) {
71
+ if (specType === SpecTypes.OPENAPI) {
72
+ specJson.components = {
73
+ schemas
74
+ };
75
+ }
76
+ else {
77
+ specJson.definitions = schemas;
78
+ }
79
+ }
80
+ return specJson;
81
+ });
82
+ }
83
+ //# sourceMappingURL=getSpec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSpec.js","sourceRoot":"","sources":["../../../src/utils/getSpec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAQ,MAAM,EAAC,MAAM,YAAY,CAAC;AAErD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAoC5D;;GAEG;AACH,MAAM,MAAM,GAAqC,IAAI,GAAG,EAAE,CAAC;AAE3D;;GAEG;AACH,SAAS,GAAG,CAAC,KAAgB,EAAE,OAAY,EAAE,EAAO;IAClD,IAAI,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AK,SAAS,CAAC,OAAO,EAAE;gBAClC,QAAQ,CAAC,UAAU,GAAG;oBACpB,OAAO;iBACR,CAAC;aACH;iBAAM;gBACL,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;aAChC;SACF;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {cleanObject, Type, uniqBy} from \"@tsed/core\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces\";\nimport {buildPath} from \"./buildPath\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\nimport {getOperationsStores} from \"./getOperationsStores\";\nimport {mergeOperation} from \"./mergeOperation\";\nimport {operationIdFormatter} from \"./operationIdFormatter\";\n\nexport interface SpecSerializerOptions extends JsonSchemaOptions {\n specType?: SpecTypes.SWAGGER | SpecTypes.OPENAPI;\n /**\n * Paths\n */\n paths?: any;\n /**\n * Root path. This paths will be added to all generated paths Object.\n */\n rootPath?: string;\n /**\n * A function to generate the operationId.\n */\n operationIdFormatter?: (name: string, propertyKey: string, path: string) => string;\n /**\n * A pattern to generate the operationId.\n */\n operationIdPattern?: string;\n}\n\nexport interface OS3SpecSerializerOptions extends SpecSerializerOptions {\n /**\n * Define Spec types level\n */\n specType: SpecTypes.OPENAPI;\n}\n\nexport interface OS2SpecSerializerOptions extends SpecSerializerOptions {\n /**\n * Define Spec types level\n */\n specType: SpecTypes.SWAGGER;\n}\n\n/**\n * @ignore\n */\nconst caches: Map<Type<any>, Map<string, any>> = new Map();\n\n/**\n * @ignore\n */\nfunction get(model: Type<any>, options: any, cb: any) {\n if (!caches.has(model)) {\n caches.set(model, new Map());\n }\n\n const cache = caches.get(model)!;\n const key = JSON.stringify(options);\n\n if (!cache.has(key)) {\n cache.set(key, cb());\n }\n\n return cache.get(key);\n}\n\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: OS2SpecSerializerOptions): Partial<OpenSpec2>;\nexport function getSpec(model: Type<any>): Partial<OpenSpec2>;\nexport function getSpec(model: Type<any>, options: SpecSerializerOptions): Partial<OpenSpec2>;\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: OS3SpecSerializerOptions): Partial<OpenSpec3>;\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: SpecSerializerOptions = {specType: SpecTypes.SWAGGER}): Partial<OpenSpec2 | OpenSpec3> {\n if (!options.specType) {\n options.specType = SpecTypes.SWAGGER;\n }\n\n options = {\n ...options,\n operationIdFormatter: options.operationIdFormatter || operationIdFormatter(options.operationIdPattern),\n root: false,\n specType: options.specType\n };\n\n return get(model, options, () => {\n const store = getJsonEntityStore(model);\n const {specType = SpecTypes.SWAGGER, schemas = {}, paths = {}, rootPath = \"/\", tags = []} = options;\n const ctrlPath = store.path;\n const defaultTags = cleanObject({\n name: store.schema.getName(),\n description: store.schema.get(\"description\")\n });\n\n const specJson: any = {paths};\n\n getOperationsStores(model).forEach((operationStore) => {\n if (operationStore.store.get(\"hidden\")) {\n return;\n }\n\n const operation = operationStore.operation!.toJSON({...options, specType, schemas});\n\n operationStore.operation!.operationPaths.forEach(({path, method}: {path: string; method: string}) => {\n if (method) {\n mergeOperation(specJson, operation, {\n rootPath: buildPath(rootPath + ctrlPath),\n path,\n method,\n defaultTags,\n tags,\n specType,\n operationId: (path: string) =>\n options.operationIdFormatter!(\n operationStore.parent.schema.get(\"name\") || operationStore.parent.targetName,\n operationStore.propertyName,\n path\n )\n });\n }\n });\n });\n\n specJson.tags = uniqBy(tags, \"name\");\n\n if (Object.keys(schemas).length) {\n if (specType === SpecTypes.OPENAPI) {\n specJson.components = {\n schemas\n };\n } else {\n specJson.definitions = schemas;\n }\n }\n\n return specJson;\n });\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { isClass } from "@tsed/core";
2
+ /**
3
+ * @ignore
4
+ */
5
+ export function isJsonClass(type) {
6
+ return isClass(type) && ![Map, Array, Set, Object, Date, Boolean, Number, String].includes(this._target);
7
+ }
8
+ //# sourceMappingURL=isJsonClass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isJsonClass.js","sourceRoot":"","sources":["../../../src/utils/isJsonClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAS;IACnC,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAc,CAAC,CAAC;AAClH,CAAC","sourcesContent":["import {isClass} from \"@tsed/core\";\n\n/**\n * @ignore\n */\nexport function isJsonClass(type: any) {\n return isClass(type) && ![Map, Array, Set, Object, Date, Boolean, Number, String].includes(this._target as any);\n}\n"]}