@tsed/schema 6.88.1 → 6.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (835) hide show
  1. package/lib/{components → cjs/components}/anyMapper.d.ts +0 -0
  2. package/lib/cjs/components/anyMapper.js +24 -0
  3. package/lib/cjs/components/anyMapper.js.map +1 -0
  4. package/lib/{components → cjs/components}/classMapper.d.ts +0 -0
  5. package/lib/cjs/components/classMapper.js +41 -0
  6. package/lib/cjs/components/classMapper.js.map +1 -0
  7. package/lib/{components → cjs/components}/genericsMapper.d.ts +0 -0
  8. package/lib/cjs/components/genericsMapper.js +62 -0
  9. package/lib/cjs/components/genericsMapper.js.map +1 -0
  10. package/lib/{components → cjs/components}/index.d.ts +0 -0
  11. package/lib/cjs/components/index.js +13 -0
  12. package/lib/cjs/components/index.js.map +1 -0
  13. package/lib/{components → cjs/components}/inheritedClassMapper.d.ts +0 -0
  14. package/lib/cjs/components/inheritedClassMapper.js +22 -0
  15. package/lib/cjs/components/inheritedClassMapper.js.map +1 -0
  16. package/lib/{components → cjs/components}/itemMapper.d.ts +0 -0
  17. package/lib/cjs/components/itemMapper.js +10 -0
  18. package/lib/cjs/components/itemMapper.js.map +1 -0
  19. package/lib/{components → cjs/components}/lazyRefMapper.d.ts +0 -0
  20. package/lib/cjs/components/lazyRefMapper.js +19 -0
  21. package/lib/cjs/components/lazyRefMapper.js.map +1 -0
  22. package/lib/{components → cjs/components}/mapMapper.d.ts +0 -0
  23. package/lib/cjs/components/mapMapper.js +25 -0
  24. package/lib/cjs/components/mapMapper.js.map +1 -0
  25. package/lib/{components → cjs/components}/objectMapper.d.ts +0 -0
  26. package/lib/cjs/components/objectMapper.js +25 -0
  27. package/lib/cjs/components/objectMapper.js.map +1 -0
  28. package/lib/{components → cjs/components}/schemaMapper.d.ts +0 -0
  29. package/lib/cjs/components/schemaMapper.js +100 -0
  30. package/lib/cjs/components/schemaMapper.js.map +1 -0
  31. package/lib/{constants → cjs/constants}/httpMethods.d.ts +0 -0
  32. package/lib/cjs/constants/httpMethods.js +46 -0
  33. package/lib/cjs/constants/httpMethods.js.map +1 -0
  34. package/lib/{constants → cjs/constants}/httpStatusMessages.d.ts +0 -0
  35. package/lib/cjs/constants/httpStatusMessages.js +110 -0
  36. package/lib/cjs/constants/httpStatusMessages.js.map +1 -0
  37. package/lib/{decorators → cjs/decorators}/class/children.d.ts +0 -0
  38. package/lib/cjs/decorators/class/children.js +24 -0
  39. package/lib/cjs/decorators/class/children.js.map +1 -0
  40. package/lib/{decorators → cjs/decorators}/collections/collectionContains.d.ts +0 -0
  41. package/lib/cjs/decorators/collections/collectionContains.js +29 -0
  42. package/lib/cjs/decorators/collections/collectionContains.js.map +1 -0
  43. package/lib/{decorators → cjs/decorators}/collections/collectionOf.d.ts +0 -0
  44. package/lib/cjs/decorators/collections/collectionOf.js +103 -0
  45. package/lib/cjs/decorators/collections/collectionOf.js.map +1 -0
  46. package/lib/{decorators → cjs/decorators}/collections/maxItems.d.ts +0 -0
  47. package/lib/cjs/decorators/collections/maxItems.js +60 -0
  48. package/lib/cjs/decorators/collections/maxItems.js.map +1 -0
  49. package/lib/{decorators → cjs/decorators}/collections/maxProperties.d.ts +0 -0
  50. package/lib/cjs/decorators/collections/maxProperties.js +83 -0
  51. package/lib/cjs/decorators/collections/maxProperties.js.map +1 -0
  52. package/lib/{decorators → cjs/decorators}/collections/minItems.d.ts +0 -0
  53. package/lib/cjs/decorators/collections/minItems.js +64 -0
  54. package/lib/cjs/decorators/collections/minItems.js.map +1 -0
  55. package/lib/{decorators → cjs/decorators}/collections/minProperties.d.ts +0 -0
  56. package/lib/cjs/decorators/collections/minProperties.js +82 -0
  57. package/lib/cjs/decorators/collections/minProperties.js.map +1 -0
  58. package/lib/{decorators → cjs/decorators}/collections/uniqueItems.d.ts +0 -0
  59. package/lib/cjs/decorators/collections/uniqueItems.js +60 -0
  60. package/lib/cjs/decorators/collections/uniqueItems.js.map +1 -0
  61. package/lib/{decorators → cjs/decorators}/common/additionalProperties.d.ts +0 -0
  62. package/lib/cjs/decorators/common/additionalProperties.js +20 -0
  63. package/lib/cjs/decorators/common/additionalProperties.js.map +1 -0
  64. package/lib/{decorators → cjs/decorators}/common/allOf.d.ts +0 -0
  65. package/lib/cjs/decorators/common/allOf.js +22 -0
  66. package/lib/cjs/decorators/common/allOf.js.map +1 -0
  67. package/lib/{decorators → cjs/decorators}/common/allow.d.ts +0 -0
  68. package/lib/cjs/decorators/common/allow.js +47 -0
  69. package/lib/cjs/decorators/common/allow.js.map +1 -0
  70. package/lib/{decorators → cjs/decorators}/common/any.d.ts +1 -1
  71. package/lib/cjs/decorators/common/any.js +46 -0
  72. package/lib/cjs/decorators/common/any.js.map +1 -0
  73. package/lib/{decorators → cjs/decorators}/common/anyOf.d.ts +0 -0
  74. package/lib/cjs/decorators/common/anyOf.js +26 -0
  75. package/lib/cjs/decorators/common/anyOf.js.map +1 -0
  76. package/lib/{decorators → cjs/decorators}/common/const.d.ts +1 -1
  77. package/lib/cjs/decorators/common/const.js +70 -0
  78. package/lib/cjs/decorators/common/const.js.map +1 -0
  79. package/lib/{decorators → cjs/decorators}/common/customKey.d.ts +0 -0
  80. package/lib/cjs/decorators/common/customKey.js +43 -0
  81. package/lib/cjs/decorators/common/customKey.js.map +1 -0
  82. package/lib/{decorators → cjs/decorators}/common/default.d.ts +0 -0
  83. package/lib/cjs/decorators/common/default.js +51 -0
  84. package/lib/cjs/decorators/common/default.js.map +1 -0
  85. package/lib/{decorators → cjs/decorators}/common/description.d.ts +0 -0
  86. package/lib/cjs/decorators/common/description.js +76 -0
  87. package/lib/cjs/decorators/common/description.js.map +1 -0
  88. package/lib/{decorators → cjs/decorators}/common/enum.d.ts +1 -1
  89. package/lib/cjs/decorators/common/enum.js +30 -0
  90. package/lib/cjs/decorators/common/enum.js.map +1 -0
  91. package/lib/{decorators → cjs/decorators}/common/example.d.ts +0 -0
  92. package/lib/cjs/decorators/common/example.js +21 -0
  93. package/lib/cjs/decorators/common/example.js.map +1 -0
  94. package/lib/{decorators → cjs/decorators}/common/examples.d.ts +0 -0
  95. package/lib/cjs/decorators/common/examples.js +21 -0
  96. package/lib/cjs/decorators/common/examples.js.map +1 -0
  97. package/lib/{decorators → cjs/decorators}/common/exclusiveMaximum.d.ts +0 -0
  98. package/lib/cjs/decorators/common/exclusiveMaximum.js +77 -0
  99. package/lib/cjs/decorators/common/exclusiveMaximum.js.map +1 -0
  100. package/lib/{decorators → cjs/decorators}/common/exclusiveMinimum.d.ts +0 -0
  101. package/lib/cjs/decorators/common/exclusiveMinimum.js +77 -0
  102. package/lib/cjs/decorators/common/exclusiveMinimum.js.map +1 -0
  103. package/lib/{decorators → cjs/decorators}/common/format.d.ts +0 -0
  104. package/lib/cjs/decorators/common/format.js +486 -0
  105. package/lib/cjs/decorators/common/format.js.map +1 -0
  106. package/lib/{decorators → cjs/decorators}/common/forwardGroups.d.ts +0 -0
  107. package/lib/cjs/decorators/common/forwardGroups.js +20 -0
  108. package/lib/cjs/decorators/common/forwardGroups.js.map +1 -0
  109. package/lib/{decorators → cjs/decorators}/common/groups.d.ts +0 -0
  110. package/lib/cjs/decorators/common/groups.js +41 -0
  111. package/lib/cjs/decorators/common/groups.js.map +1 -0
  112. package/lib/{decorators → cjs/decorators}/common/hidden.d.ts +0 -0
  113. package/lib/cjs/decorators/common/hidden.js +40 -0
  114. package/lib/cjs/decorators/common/hidden.js.map +1 -0
  115. package/lib/{decorators → cjs/decorators}/common/ignore.d.ts +0 -0
  116. package/lib/cjs/decorators/common/ignore.js +71 -0
  117. package/lib/cjs/decorators/common/ignore.js.map +1 -0
  118. package/lib/{decorators → cjs/decorators}/common/integer.d.ts +0 -0
  119. package/lib/cjs/decorators/common/integer.js +71 -0
  120. package/lib/cjs/decorators/common/integer.js.map +1 -0
  121. package/lib/{decorators → cjs/decorators}/common/jsonEntityFn.d.ts +0 -0
  122. package/lib/cjs/decorators/common/jsonEntityFn.js +32 -0
  123. package/lib/cjs/decorators/common/jsonEntityFn.js.map +1 -0
  124. package/lib/{decorators → cjs/decorators}/common/maxLength.d.ts +0 -0
  125. package/lib/cjs/decorators/common/maxLength.js +89 -0
  126. package/lib/cjs/decorators/common/maxLength.js.map +1 -0
  127. package/lib/{decorators → cjs/decorators}/common/maximum.d.ts +0 -0
  128. package/lib/cjs/decorators/common/maximum.js +151 -0
  129. package/lib/cjs/decorators/common/maximum.js.map +1 -0
  130. package/lib/{decorators → cjs/decorators}/common/minLength.d.ts +0 -0
  131. package/lib/cjs/decorators/common/minLength.js +90 -0
  132. package/lib/cjs/decorators/common/minLength.js.map +1 -0
  133. package/lib/{decorators → cjs/decorators}/common/minimum.d.ts +0 -0
  134. package/lib/cjs/decorators/common/minimum.js +149 -0
  135. package/lib/cjs/decorators/common/minimum.js.map +1 -0
  136. package/lib/{decorators → cjs/decorators}/common/multipleOf.d.ts +0 -0
  137. package/lib/cjs/decorators/common/multipleOf.js +81 -0
  138. package/lib/cjs/decorators/common/multipleOf.js.map +1 -0
  139. package/lib/{decorators → cjs/decorators}/common/name.d.ts +0 -0
  140. package/lib/cjs/decorators/common/name.js +52 -0
  141. package/lib/cjs/decorators/common/name.js.map +1 -0
  142. package/lib/{decorators → cjs/decorators}/common/nullable.d.ts +1 -1
  143. package/lib/cjs/decorators/common/nullable.js +34 -0
  144. package/lib/cjs/decorators/common/nullable.js.map +1 -0
  145. package/lib/{decorators → cjs/decorators}/common/oneOf.d.ts +0 -0
  146. package/lib/cjs/decorators/common/oneOf.js +26 -0
  147. package/lib/cjs/decorators/common/oneOf.js.map +1 -0
  148. package/lib/{decorators → cjs/decorators}/common/optional.d.ts +0 -0
  149. package/lib/cjs/decorators/common/optional.js +28 -0
  150. package/lib/cjs/decorators/common/optional.js.map +1 -0
  151. package/lib/{decorators → cjs/decorators}/common/pattern.d.ts +0 -0
  152. package/lib/cjs/decorators/common/pattern.js +103 -0
  153. package/lib/cjs/decorators/common/pattern.js.map +1 -0
  154. package/lib/{decorators → cjs/decorators}/common/property.d.ts +0 -0
  155. package/lib/cjs/decorators/common/property.js +27 -0
  156. package/lib/cjs/decorators/common/property.js.map +1 -0
  157. package/lib/{decorators → cjs/decorators}/common/readOnly.d.ts +0 -0
  158. package/lib/cjs/decorators/common/readOnly.js +21 -0
  159. package/lib/cjs/decorators/common/readOnly.js.map +1 -0
  160. package/lib/{decorators → cjs/decorators}/common/required.d.ts +0 -0
  161. package/lib/cjs/decorators/common/required.js +53 -0
  162. package/lib/cjs/decorators/common/required.js.map +1 -0
  163. package/lib/{decorators → cjs/decorators}/common/requiredGroups.d.ts +0 -0
  164. package/lib/cjs/decorators/common/requiredGroups.js +29 -0
  165. package/lib/cjs/decorators/common/requiredGroups.js.map +1 -0
  166. package/lib/{decorators → cjs/decorators}/common/schema.d.ts +0 -0
  167. package/lib/cjs/decorators/common/schema.js +68 -0
  168. package/lib/cjs/decorators/common/schema.js.map +1 -0
  169. package/lib/{decorators → cjs/decorators}/common/title.d.ts +0 -0
  170. package/lib/cjs/decorators/common/title.js +49 -0
  171. package/lib/cjs/decorators/common/title.js.map +1 -0
  172. package/lib/{decorators → cjs/decorators}/common/writeOnly.d.ts +0 -0
  173. package/lib/cjs/decorators/common/writeOnly.js +21 -0
  174. package/lib/cjs/decorators/common/writeOnly.js.map +1 -0
  175. package/lib/{decorators → cjs/decorators}/config/jsonEntityComponent.d.ts +0 -0
  176. package/lib/cjs/decorators/config/jsonEntityComponent.js +18 -0
  177. package/lib/cjs/decorators/config/jsonEntityComponent.js.map +1 -0
  178. package/lib/{decorators → cjs/decorators}/generics/genericOf.d.ts +0 -0
  179. package/lib/cjs/decorators/generics/genericOf.js +99 -0
  180. package/lib/cjs/decorators/generics/genericOf.js.map +1 -0
  181. package/lib/{decorators → cjs/decorators}/generics/generics.d.ts +0 -0
  182. package/lib/cjs/decorators/generics/generics.js +25 -0
  183. package/lib/cjs/decorators/generics/generics.js.map +1 -0
  184. package/lib/{decorators → cjs/decorators}/index.d.ts +0 -0
  185. package/lib/cjs/decorators/index.js +76 -0
  186. package/lib/cjs/decorators/index.js.map +1 -0
  187. package/lib/{decorators → cjs/decorators}/operations/consumes.d.ts +0 -0
  188. package/lib/cjs/decorators/operations/consumes.js +39 -0
  189. package/lib/cjs/decorators/operations/consumes.js.map +1 -0
  190. package/lib/{decorators → cjs/decorators}/operations/contentType.d.ts +0 -0
  191. package/lib/cjs/decorators/operations/contentType.js +28 -0
  192. package/lib/cjs/decorators/operations/contentType.js.map +1 -0
  193. package/lib/{decorators → cjs/decorators}/operations/deprecated.d.ts +0 -0
  194. package/lib/cjs/decorators/operations/deprecated.js +43 -0
  195. package/lib/cjs/decorators/operations/deprecated.js.map +1 -0
  196. package/lib/{decorators → cjs/decorators}/operations/header.d.ts +0 -0
  197. package/lib/cjs/decorators/operations/header.js +59 -0
  198. package/lib/cjs/decorators/operations/header.js.map +1 -0
  199. package/lib/{decorators → cjs/decorators}/operations/in.d.ts +0 -0
  200. package/lib/cjs/decorators/operations/in.js +78 -0
  201. package/lib/cjs/decorators/operations/in.js.map +1 -0
  202. package/lib/{decorators → cjs/decorators}/operations/location.d.ts +0 -0
  203. package/lib/cjs/decorators/operations/location.js +29 -0
  204. package/lib/cjs/decorators/operations/location.js.map +1 -0
  205. package/lib/{decorators → cjs/decorators}/operations/operationId.d.ts +0 -0
  206. package/lib/cjs/decorators/operations/operationId.js +24 -0
  207. package/lib/cjs/decorators/operations/operationId.js.map +1 -0
  208. package/lib/{decorators → cjs/decorators}/operations/operationPath.d.ts +0 -0
  209. package/lib/cjs/decorators/operations/operationPath.js +34 -0
  210. package/lib/cjs/decorators/operations/operationPath.js.map +1 -0
  211. package/lib/{decorators → cjs/decorators}/operations/partial.d.ts +0 -0
  212. package/lib/cjs/decorators/operations/partial.js +18 -0
  213. package/lib/cjs/decorators/operations/partial.js.map +1 -0
  214. package/lib/{decorators → cjs/decorators}/operations/path.d.ts +0 -0
  215. package/lib/cjs/decorators/operations/path.js +29 -0
  216. package/lib/cjs/decorators/operations/path.js.map +1 -0
  217. package/lib/{decorators → cjs/decorators}/operations/produces.d.ts +0 -0
  218. package/lib/cjs/decorators/operations/produces.js +46 -0
  219. package/lib/cjs/decorators/operations/produces.js.map +1 -0
  220. package/lib/{decorators → cjs/decorators}/operations/redirect.d.ts +0 -0
  221. package/lib/cjs/decorators/operations/redirect.js +26 -0
  222. package/lib/cjs/decorators/operations/redirect.js.map +1 -0
  223. package/lib/{decorators → cjs/decorators}/operations/returns.d.ts +0 -0
  224. package/lib/cjs/decorators/operations/returns.js +215 -0
  225. package/lib/cjs/decorators/operations/returns.js.map +1 -0
  226. package/lib/{decorators → cjs/decorators}/operations/route.d.ts +0 -0
  227. package/lib/cjs/decorators/operations/route.js +198 -0
  228. package/lib/cjs/decorators/operations/route.js.map +1 -0
  229. package/lib/{decorators → cjs/decorators}/operations/security.d.ts +0 -0
  230. package/lib/cjs/decorators/operations/security.js +43 -0
  231. package/lib/cjs/decorators/operations/security.js.map +1 -0
  232. package/lib/{decorators → cjs/decorators}/operations/status.d.ts +0 -0
  233. package/lib/cjs/decorators/operations/status.js +133 -0
  234. package/lib/cjs/decorators/operations/status.js.map +1 -0
  235. package/lib/{decorators → cjs/decorators}/operations/summary.d.ts +0 -0
  236. package/lib/cjs/decorators/operations/summary.js +34 -0
  237. package/lib/cjs/decorators/operations/summary.js.map +1 -0
  238. package/lib/{decorators → cjs/decorators}/operations/tags.d.ts +0 -0
  239. package/lib/cjs/decorators/operations/tags.js +52 -0
  240. package/lib/cjs/decorators/operations/tags.js.map +1 -0
  241. package/lib/{domain → cjs/domain}/DecoratorContext.d.ts +0 -0
  242. package/lib/cjs/domain/DecoratorContext.js +88 -0
  243. package/lib/cjs/domain/DecoratorContext.js.map +1 -0
  244. package/lib/{domain → cjs/domain}/JsonAliasMap.d.ts +0 -0
  245. package/lib/cjs/domain/JsonAliasMap.js +15 -0
  246. package/lib/cjs/domain/JsonAliasMap.js.map +1 -0
  247. package/lib/{domain → cjs/domain}/JsonClassStore.d.ts +0 -0
  248. package/lib/cjs/domain/JsonClassStore.js +37 -0
  249. package/lib/cjs/domain/JsonClassStore.js.map +1 -0
  250. package/lib/{domain → cjs/domain}/JsonEntityStore.d.ts +0 -0
  251. package/lib/cjs/domain/JsonEntityStore.js +163 -0
  252. package/lib/cjs/domain/JsonEntityStore.js.map +1 -0
  253. package/lib/{domain → cjs/domain}/JsonFormatTypes.d.ts +0 -0
  254. package/lib/cjs/domain/JsonFormatTypes.js +22 -0
  255. package/lib/cjs/domain/JsonFormatTypes.js.map +1 -0
  256. package/lib/{domain → cjs/domain}/JsonLazyRef.d.ts +0 -0
  257. package/lib/cjs/domain/JsonLazyRef.js +26 -0
  258. package/lib/cjs/domain/JsonLazyRef.js.map +1 -0
  259. package/lib/{domain → cjs/domain}/JsonMap.d.ts +0 -0
  260. package/lib/cjs/domain/JsonMap.js +27 -0
  261. package/lib/cjs/domain/JsonMap.js.map +1 -0
  262. package/lib/{domain → cjs/domain}/JsonMethodStore.d.ts +0 -0
  263. package/lib/cjs/domain/JsonMethodStore.js +64 -0
  264. package/lib/cjs/domain/JsonMethodStore.js.map +1 -0
  265. package/lib/{domain → cjs/domain}/JsonOperation.d.ts +0 -0
  266. package/lib/cjs/domain/JsonOperation.js +254 -0
  267. package/lib/cjs/domain/JsonOperation.js.map +1 -0
  268. package/lib/{domain → cjs/domain}/JsonOperationPathsMap.d.ts +0 -0
  269. package/lib/cjs/domain/JsonOperationPathsMap.js +29 -0
  270. package/lib/cjs/domain/JsonOperationPathsMap.js.map +1 -0
  271. package/lib/{domain → cjs/domain}/JsonOperationRoute.d.ts +0 -0
  272. package/lib/cjs/domain/JsonOperationRoute.js +56 -0
  273. package/lib/cjs/domain/JsonOperationRoute.js.map +1 -0
  274. package/lib/{domain → cjs/domain}/JsonParameter.d.ts +0 -0
  275. package/lib/cjs/domain/JsonParameter.js +157 -0
  276. package/lib/cjs/domain/JsonParameter.js.map +1 -0
  277. package/lib/{domain → cjs/domain}/JsonParameterStore.d.ts +0 -0
  278. package/lib/cjs/domain/JsonParameterStore.js +90 -0
  279. package/lib/cjs/domain/JsonParameterStore.js.map +1 -0
  280. package/lib/{domain → cjs/domain}/JsonParameterTypes.d.ts +0 -0
  281. package/lib/cjs/domain/JsonParameterTypes.js +27 -0
  282. package/lib/cjs/domain/JsonParameterTypes.js.map +1 -0
  283. package/lib/{domain → cjs/domain}/JsonPropertyStore.d.ts +0 -0
  284. package/lib/cjs/domain/JsonPropertyStore.js +68 -0
  285. package/lib/cjs/domain/JsonPropertyStore.js.map +1 -0
  286. package/lib/{domain → cjs/domain}/JsonRequestBody.d.ts +0 -0
  287. package/lib/cjs/domain/JsonRequestBody.js +32 -0
  288. package/lib/cjs/domain/JsonRequestBody.js.map +1 -0
  289. package/lib/{domain → cjs/domain}/JsonResponse.d.ts +0 -0
  290. package/lib/cjs/domain/JsonResponse.js +86 -0
  291. package/lib/cjs/domain/JsonResponse.js.map +1 -0
  292. package/lib/{domain → cjs/domain}/JsonSchema.d.ts +1 -1
  293. package/lib/cjs/domain/JsonSchema.js +692 -0
  294. package/lib/cjs/domain/JsonSchema.js.map +1 -0
  295. package/lib/{domain → cjs/domain}/SpecTypes.d.ts +0 -0
  296. package/lib/cjs/domain/SpecTypes.js +10 -0
  297. package/lib/cjs/domain/SpecTypes.js.map +1 -0
  298. package/lib/{domain → cjs/domain}/index.d.ts +0 -0
  299. package/lib/cjs/domain/index.js +20 -0
  300. package/lib/cjs/domain/index.js.map +1 -0
  301. package/lib/{hooks → cjs/hooks}/alterIgnore.d.ts +0 -0
  302. package/lib/cjs/hooks/alterIgnore.js +21 -0
  303. package/lib/cjs/hooks/alterIgnore.js.map +1 -0
  304. package/lib/{hooks → cjs/hooks}/alterRequiredGroups.d.ts +0 -0
  305. package/lib/cjs/hooks/alterRequiredGroups.js +15 -0
  306. package/lib/cjs/hooks/alterRequiredGroups.js.map +1 -0
  307. package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
  308. package/lib/cjs/index.js +23 -0
  309. package/lib/cjs/index.js.map +1 -0
  310. package/lib/{interfaces → cjs/interfaces}/IgnoreCallback.d.ts +0 -0
  311. package/lib/cjs/interfaces/IgnoreCallback.js +3 -0
  312. package/lib/cjs/interfaces/IgnoreCallback.js.map +1 -0
  313. package/lib/{interfaces → cjs/interfaces}/JsonHookContext.d.ts +0 -0
  314. package/lib/cjs/interfaces/JsonHookContext.js +3 -0
  315. package/lib/cjs/interfaces/JsonHookContext.js.map +1 -0
  316. package/lib/{interfaces → cjs/interfaces}/JsonOpenSpec.d.ts +0 -0
  317. package/lib/cjs/interfaces/JsonOpenSpec.js +3 -0
  318. package/lib/cjs/interfaces/JsonOpenSpec.js.map +1 -0
  319. package/lib/{interfaces → cjs/interfaces}/JsonSchemaOptions.d.ts +0 -0
  320. package/lib/cjs/interfaces/JsonSchemaOptions.js +3 -0
  321. package/lib/cjs/interfaces/JsonSchemaOptions.js.map +1 -0
  322. package/lib/{interfaces → cjs/interfaces}/index.d.ts +0 -0
  323. package/lib/cjs/interfaces/index.js +8 -0
  324. package/lib/cjs/interfaces/index.js.map +1 -0
  325. package/lib/{registries → cjs/registries}/JsonSchemaMapperContainer.d.ts +0 -0
  326. package/lib/cjs/registries/JsonSchemaMapperContainer.js +33 -0
  327. package/lib/cjs/registries/JsonSchemaMapperContainer.js.map +1 -0
  328. package/lib/{utils → cjs/utils}/buildPath.d.ts +0 -0
  329. package/lib/cjs/utils/buildPath.js +13 -0
  330. package/lib/cjs/utils/buildPath.js.map +1 -0
  331. package/lib/{utils → cjs/utils}/concatParameters.d.ts +0 -0
  332. package/lib/cjs/utils/concatParameters.js +16 -0
  333. package/lib/cjs/utils/concatParameters.js.map +1 -0
  334. package/lib/{utils → cjs/utils}/concatPath.d.ts +0 -0
  335. package/lib/cjs/utils/concatPath.js +8 -0
  336. package/lib/cjs/utils/concatPath.js.map +1 -0
  337. package/lib/{utils → cjs/utils}/defineStatusModel.d.ts +0 -0
  338. package/lib/cjs/utils/defineStatusModel.js +13 -0
  339. package/lib/cjs/utils/defineStatusModel.js.map +1 -0
  340. package/lib/{utils → cjs/utils}/from.d.ts +0 -0
  341. package/lib/cjs/utils/from.js +272 -0
  342. package/lib/cjs/utils/from.js.map +1 -0
  343. package/lib/{utils → cjs/utils}/generics.d.ts +0 -0
  344. package/lib/cjs/utils/generics.js +40 -0
  345. package/lib/cjs/utils/generics.js.map +1 -0
  346. package/lib/{utils → cjs/utils}/getComputedType.d.ts +0 -0
  347. package/lib/cjs/utils/getComputedType.js +26 -0
  348. package/lib/cjs/utils/getComputedType.js.map +1 -0
  349. package/lib/{utils → cjs/utils}/getInheritedStores.d.ts +0 -0
  350. package/lib/cjs/utils/getInheritedStores.js +23 -0
  351. package/lib/cjs/utils/getInheritedStores.js.map +1 -0
  352. package/lib/{utils → cjs/utils}/getJsonEntityStore.d.ts +0 -0
  353. package/lib/cjs/utils/getJsonEntityStore.js +25 -0
  354. package/lib/cjs/utils/getJsonEntityStore.js.map +1 -0
  355. package/lib/{utils → cjs/utils}/getJsonPathParameters.d.ts +0 -0
  356. package/lib/cjs/utils/getJsonPathParameters.js +73 -0
  357. package/lib/cjs/utils/getJsonPathParameters.js.map +1 -0
  358. package/lib/{utils → cjs/utils}/getJsonSchema.d.ts +0 -0
  359. package/lib/cjs/utils/getJsonSchema.js +55 -0
  360. package/lib/cjs/utils/getJsonSchema.js.map +1 -0
  361. package/lib/{utils → cjs/utils}/getJsonType.d.ts +0 -0
  362. package/lib/cjs/utils/getJsonType.js +40 -0
  363. package/lib/cjs/utils/getJsonType.js.map +1 -0
  364. package/lib/{utils → cjs/utils}/getOperationsRoutes.d.ts +0 -0
  365. package/lib/cjs/utils/getOperationsRoutes.js +36 -0
  366. package/lib/cjs/utils/getOperationsRoutes.js.map +1 -0
  367. package/lib/{utils → cjs/utils}/getOperationsStores.d.ts +0 -0
  368. package/lib/cjs/utils/getOperationsStores.js +33 -0
  369. package/lib/cjs/utils/getOperationsStores.js.map +1 -0
  370. package/lib/{utils → cjs/utils}/getPropertiesStores.d.ts +0 -0
  371. package/lib/cjs/utils/getPropertiesStores.js +45 -0
  372. package/lib/cjs/utils/getPropertiesStores.js.map +1 -0
  373. package/lib/{utils → cjs/utils}/getRequiredProperties.d.ts +0 -0
  374. package/lib/cjs/utils/getRequiredProperties.js +67 -0
  375. package/lib/cjs/utils/getRequiredProperties.js.map +1 -0
  376. package/lib/{utils → cjs/utils}/getSpec.d.ts +0 -0
  377. package/lib/cjs/utils/getSpec.js +87 -0
  378. package/lib/cjs/utils/getSpec.js.map +1 -0
  379. package/lib/{utils → cjs/utils}/isJsonClass.d.ts +0 -0
  380. package/lib/cjs/utils/isJsonClass.js +12 -0
  381. package/lib/cjs/utils/isJsonClass.js.map +1 -0
  382. package/lib/{utils → cjs/utils}/isSuccessStatus.d.ts +0 -0
  383. package/lib/cjs/utils/isSuccessStatus.js +8 -0
  384. package/lib/cjs/utils/isSuccessStatus.js.map +1 -0
  385. package/lib/{utils → cjs/utils}/mapHeaders.d.ts +0 -0
  386. package/lib/cjs/utils/mapHeaders.js +29 -0
  387. package/lib/cjs/utils/mapHeaders.js.map +1 -0
  388. package/lib/{utils → cjs/utils}/mapNullableType.d.ts +0 -0
  389. package/lib/cjs/utils/mapNullableType.js +30 -0
  390. package/lib/cjs/utils/mapNullableType.js.map +1 -0
  391. package/lib/{utils → cjs/utils}/mapRouteOptions.d.ts +0 -0
  392. package/lib/cjs/utils/mapRouteOptions.js +26 -0
  393. package/lib/cjs/utils/mapRouteOptions.js.map +1 -0
  394. package/lib/{utils → cjs/utils}/matchGroups.d.ts +0 -0
  395. package/lib/cjs/utils/matchGroups.js +23 -0
  396. package/lib/cjs/utils/matchGroups.js.map +1 -0
  397. package/lib/{utils → cjs/utils}/mergeOperation.d.ts +0 -0
  398. package/lib/cjs/utils/mergeOperation.js +44 -0
  399. package/lib/cjs/utils/mergeOperation.js.map +1 -0
  400. package/lib/{utils → cjs/utils}/mergeSpec.d.ts +0 -0
  401. package/lib/cjs/utils/mergeSpec.js +46 -0
  402. package/lib/cjs/utils/mergeSpec.js.map +1 -0
  403. package/lib/{utils → cjs/utils}/operationIdFormatter.d.ts +0 -0
  404. package/lib/cjs/utils/operationIdFormatter.js +37 -0
  405. package/lib/cjs/utils/operationIdFormatter.js.map +1 -0
  406. package/lib/{utils → cjs/utils}/ref.d.ts +0 -0
  407. package/lib/cjs/utils/ref.js +70 -0
  408. package/lib/cjs/utils/ref.js.map +1 -0
  409. package/lib/{utils → cjs/utils}/toJsonMapCollection.d.ts +0 -0
  410. package/lib/cjs/utils/toJsonMapCollection.js +15 -0
  411. package/lib/cjs/utils/toJsonMapCollection.js.map +1 -0
  412. package/lib/{utils → cjs/utils}/toJsonRegex.d.ts +0 -0
  413. package/lib/cjs/utils/toJsonRegex.js +12 -0
  414. package/lib/cjs/utils/toJsonRegex.js.map +1 -0
  415. package/lib/esm/components/anyMapper.js +20 -0
  416. package/lib/esm/components/anyMapper.js.map +1 -0
  417. package/lib/esm/components/classMapper.js +37 -0
  418. package/lib/esm/components/classMapper.js.map +1 -0
  419. package/lib/esm/components/genericsMapper.js +58 -0
  420. package/lib/esm/components/genericsMapper.js.map +1 -0
  421. package/lib/esm/components/index.js +10 -0
  422. package/lib/esm/components/index.js.map +1 -0
  423. package/lib/esm/components/inheritedClassMapper.js +18 -0
  424. package/lib/esm/components/inheritedClassMapper.js.map +1 -0
  425. package/lib/esm/components/itemMapper.js +6 -0
  426. package/lib/esm/components/itemMapper.js.map +1 -0
  427. package/lib/esm/components/lazyRefMapper.js +15 -0
  428. package/lib/esm/components/lazyRefMapper.js.map +1 -0
  429. package/lib/esm/components/mapMapper.js +21 -0
  430. package/lib/esm/components/mapMapper.js.map +1 -0
  431. package/lib/esm/components/objectMapper.js +21 -0
  432. package/lib/esm/components/objectMapper.js.map +1 -0
  433. package/lib/esm/components/schemaMapper.js +96 -0
  434. package/lib/esm/components/schemaMapper.js.map +1 -0
  435. package/lib/esm/constants/httpMethods.js +43 -0
  436. package/lib/esm/constants/httpMethods.js.map +1 -0
  437. package/lib/esm/constants/httpStatusMessages.js +105 -0
  438. package/lib/esm/constants/httpStatusMessages.js.map +1 -0
  439. package/lib/esm/decorators/class/children.js +20 -0
  440. package/lib/esm/decorators/class/children.js.map +1 -0
  441. package/lib/esm/decorators/collections/collectionContains.js +25 -0
  442. package/lib/esm/decorators/collections/collectionContains.js.map +1 -0
  443. package/lib/esm/decorators/collections/collectionOf.js +97 -0
  444. package/lib/esm/decorators/collections/collectionOf.js.map +1 -0
  445. package/lib/esm/decorators/collections/maxItems.js +56 -0
  446. package/lib/esm/decorators/collections/maxItems.js.map +1 -0
  447. package/lib/esm/decorators/collections/maxProperties.js +79 -0
  448. package/lib/esm/decorators/collections/maxProperties.js.map +1 -0
  449. package/lib/esm/decorators/collections/minItems.js +60 -0
  450. package/lib/esm/decorators/collections/minItems.js.map +1 -0
  451. package/lib/esm/decorators/collections/minProperties.js +78 -0
  452. package/lib/esm/decorators/collections/minProperties.js.map +1 -0
  453. package/lib/esm/decorators/collections/uniqueItems.js +56 -0
  454. package/lib/esm/decorators/collections/uniqueItems.js.map +1 -0
  455. package/lib/esm/decorators/common/additionalProperties.js +16 -0
  456. package/lib/esm/decorators/common/additionalProperties.js.map +1 -0
  457. package/lib/esm/decorators/common/allOf.js +18 -0
  458. package/lib/esm/decorators/common/allOf.js.map +1 -0
  459. package/lib/esm/decorators/common/allow.js +43 -0
  460. package/lib/esm/decorators/common/allow.js.map +1 -0
  461. package/lib/esm/decorators/common/any.js +42 -0
  462. package/lib/esm/decorators/common/any.js.map +1 -0
  463. package/lib/esm/decorators/common/anyOf.js +22 -0
  464. package/lib/esm/decorators/common/anyOf.js.map +1 -0
  465. package/lib/esm/decorators/common/const.js +66 -0
  466. package/lib/esm/decorators/common/const.js.map +1 -0
  467. package/lib/esm/decorators/common/customKey.js +38 -0
  468. package/lib/esm/decorators/common/customKey.js.map +1 -0
  469. package/lib/esm/decorators/common/default.js +47 -0
  470. package/lib/esm/decorators/common/default.js.map +1 -0
  471. package/lib/esm/decorators/common/description.js +72 -0
  472. package/lib/esm/decorators/common/description.js.map +1 -0
  473. package/lib/esm/decorators/common/enum.js +26 -0
  474. package/lib/esm/decorators/common/enum.js.map +1 -0
  475. package/lib/esm/decorators/common/example.js +17 -0
  476. package/lib/esm/decorators/common/example.js.map +1 -0
  477. package/lib/esm/decorators/common/examples.js +17 -0
  478. package/lib/esm/decorators/common/examples.js.map +1 -0
  479. package/lib/esm/decorators/common/exclusiveMaximum.js +73 -0
  480. package/lib/esm/decorators/common/exclusiveMaximum.js.map +1 -0
  481. package/lib/esm/decorators/common/exclusiveMinimum.js +73 -0
  482. package/lib/esm/decorators/common/exclusiveMinimum.js.map +1 -0
  483. package/lib/esm/decorators/common/format.js +476 -0
  484. package/lib/esm/decorators/common/format.js.map +1 -0
  485. package/lib/esm/decorators/common/forwardGroups.js +16 -0
  486. package/lib/esm/decorators/common/forwardGroups.js.map +1 -0
  487. package/lib/esm/decorators/common/groups.js +37 -0
  488. package/lib/esm/decorators/common/groups.js.map +1 -0
  489. package/lib/esm/decorators/common/hidden.js +36 -0
  490. package/lib/esm/decorators/common/hidden.js.map +1 -0
  491. package/lib/esm/decorators/common/ignore.js +67 -0
  492. package/lib/esm/decorators/common/ignore.js.map +1 -0
  493. package/lib/esm/decorators/common/integer.js +67 -0
  494. package/lib/esm/decorators/common/integer.js.map +1 -0
  495. package/lib/esm/decorators/common/jsonEntityFn.js +28 -0
  496. package/lib/esm/decorators/common/jsonEntityFn.js.map +1 -0
  497. package/lib/esm/decorators/common/maxLength.js +85 -0
  498. package/lib/esm/decorators/common/maxLength.js.map +1 -0
  499. package/lib/esm/decorators/common/maximum.js +146 -0
  500. package/lib/esm/decorators/common/maximum.js.map +1 -0
  501. package/lib/esm/decorators/common/minLength.js +86 -0
  502. package/lib/esm/decorators/common/minLength.js.map +1 -0
  503. package/lib/esm/decorators/common/minimum.js +144 -0
  504. package/lib/esm/decorators/common/minimum.js.map +1 -0
  505. package/lib/esm/decorators/common/multipleOf.js +77 -0
  506. package/lib/esm/decorators/common/multipleOf.js.map +1 -0
  507. package/lib/esm/decorators/common/name.js +48 -0
  508. package/lib/esm/decorators/common/name.js.map +1 -0
  509. package/lib/esm/decorators/common/nullable.js +30 -0
  510. package/lib/esm/decorators/common/nullable.js.map +1 -0
  511. package/lib/esm/decorators/common/oneOf.js +22 -0
  512. package/lib/esm/decorators/common/oneOf.js.map +1 -0
  513. package/lib/esm/decorators/common/optional.js +24 -0
  514. package/lib/esm/decorators/common/optional.js.map +1 -0
  515. package/lib/esm/decorators/common/pattern.js +99 -0
  516. package/lib/esm/decorators/common/pattern.js.map +1 -0
  517. package/lib/esm/decorators/common/property.js +23 -0
  518. package/lib/esm/decorators/common/property.js.map +1 -0
  519. package/lib/esm/decorators/common/readOnly.js +17 -0
  520. package/lib/esm/decorators/common/readOnly.js.map +1 -0
  521. package/lib/esm/decorators/common/required.js +49 -0
  522. package/lib/esm/decorators/common/required.js.map +1 -0
  523. package/lib/esm/decorators/common/requiredGroups.js +25 -0
  524. package/lib/esm/decorators/common/requiredGroups.js.map +1 -0
  525. package/lib/esm/decorators/common/schema.js +63 -0
  526. package/lib/esm/decorators/common/schema.js.map +1 -0
  527. package/lib/esm/decorators/common/title.js +45 -0
  528. package/lib/esm/decorators/common/title.js.map +1 -0
  529. package/lib/esm/decorators/common/writeOnly.js +17 -0
  530. package/lib/esm/decorators/common/writeOnly.js.map +1 -0
  531. package/lib/esm/decorators/config/jsonEntityComponent.js +14 -0
  532. package/lib/esm/decorators/config/jsonEntityComponent.js.map +1 -0
  533. package/lib/esm/decorators/generics/genericOf.js +95 -0
  534. package/lib/esm/decorators/generics/genericOf.js.map +1 -0
  535. package/lib/esm/decorators/generics/generics.js +21 -0
  536. package/lib/esm/decorators/generics/generics.js.map +1 -0
  537. package/lib/esm/decorators/index.js +73 -0
  538. package/lib/esm/decorators/index.js.map +1 -0
  539. package/lib/esm/decorators/operations/consumes.js +35 -0
  540. package/lib/esm/decorators/operations/consumes.js.map +1 -0
  541. package/lib/esm/decorators/operations/contentType.js +24 -0
  542. package/lib/esm/decorators/operations/contentType.js.map +1 -0
  543. package/lib/esm/decorators/operations/deprecated.js +39 -0
  544. package/lib/esm/decorators/operations/deprecated.js.map +1 -0
  545. package/lib/esm/decorators/operations/header.js +55 -0
  546. package/lib/esm/decorators/operations/header.js.map +1 -0
  547. package/lib/esm/decorators/operations/in.js +74 -0
  548. package/lib/esm/decorators/operations/in.js.map +1 -0
  549. package/lib/esm/decorators/operations/location.js +25 -0
  550. package/lib/esm/decorators/operations/location.js.map +1 -0
  551. package/lib/esm/decorators/operations/operationId.js +20 -0
  552. package/lib/esm/decorators/operations/operationId.js.map +1 -0
  553. package/lib/esm/decorators/operations/operationPath.js +30 -0
  554. package/lib/esm/decorators/operations/operationPath.js.map +1 -0
  555. package/lib/esm/decorators/operations/partial.js +14 -0
  556. package/lib/esm/decorators/operations/partial.js.map +1 -0
  557. package/lib/esm/decorators/operations/path.js +25 -0
  558. package/lib/esm/decorators/operations/path.js.map +1 -0
  559. package/lib/esm/decorators/operations/produces.js +42 -0
  560. package/lib/esm/decorators/operations/produces.js.map +1 -0
  561. package/lib/esm/decorators/operations/redirect.js +22 -0
  562. package/lib/esm/decorators/operations/redirect.js.map +1 -0
  563. package/lib/esm/decorators/operations/returns.js +211 -0
  564. package/lib/esm/decorators/operations/returns.js.map +1 -0
  565. package/lib/esm/decorators/operations/route.js +186 -0
  566. package/lib/esm/decorators/operations/route.js.map +1 -0
  567. package/lib/esm/decorators/operations/security.js +39 -0
  568. package/lib/esm/decorators/operations/security.js.map +1 -0
  569. package/lib/esm/decorators/operations/status.js +129 -0
  570. package/lib/esm/decorators/operations/status.js.map +1 -0
  571. package/lib/esm/decorators/operations/summary.js +30 -0
  572. package/lib/esm/decorators/operations/summary.js.map +1 -0
  573. package/lib/esm/decorators/operations/tags.js +48 -0
  574. package/lib/esm/decorators/operations/tags.js.map +1 -0
  575. package/lib/esm/domain/DecoratorContext.js +84 -0
  576. package/lib/esm/domain/DecoratorContext.js.map +1 -0
  577. package/lib/esm/domain/JsonAliasMap.js +11 -0
  578. package/lib/esm/domain/JsonAliasMap.js.map +1 -0
  579. package/lib/esm/domain/JsonClassStore.js +34 -0
  580. package/lib/esm/domain/JsonClassStore.js.map +1 -0
  581. package/lib/esm/domain/JsonEntityStore.js +159 -0
  582. package/lib/esm/domain/JsonEntityStore.js.map +1 -0
  583. package/lib/esm/domain/JsonFormatTypes.js +19 -0
  584. package/lib/esm/domain/JsonFormatTypes.js.map +1 -0
  585. package/lib/esm/domain/JsonLazyRef.js +22 -0
  586. package/lib/esm/domain/JsonLazyRef.js.map +1 -0
  587. package/lib/esm/domain/JsonMap.js +23 -0
  588. package/lib/esm/domain/JsonMap.js.map +1 -0
  589. package/lib/esm/domain/JsonMethodStore.js +61 -0
  590. package/lib/esm/domain/JsonMethodStore.js.map +1 -0
  591. package/lib/esm/domain/JsonOperation.js +250 -0
  592. package/lib/esm/domain/JsonOperation.js.map +1 -0
  593. package/lib/esm/domain/JsonOperationPathsMap.js +25 -0
  594. package/lib/esm/domain/JsonOperationPathsMap.js.map +1 -0
  595. package/lib/esm/domain/JsonOperationRoute.js +52 -0
  596. package/lib/esm/domain/JsonOperationRoute.js.map +1 -0
  597. package/lib/esm/domain/JsonParameter.js +153 -0
  598. package/lib/esm/domain/JsonParameter.js.map +1 -0
  599. package/lib/esm/domain/JsonParameterStore.js +87 -0
  600. package/lib/esm/domain/JsonParameterStore.js.map +1 -0
  601. package/lib/esm/domain/JsonParameterTypes.js +22 -0
  602. package/lib/esm/domain/JsonParameterTypes.js.map +1 -0
  603. package/lib/esm/domain/JsonPropertyStore.js +65 -0
  604. package/lib/esm/domain/JsonPropertyStore.js.map +1 -0
  605. package/lib/esm/domain/JsonRequestBody.js +28 -0
  606. package/lib/esm/domain/JsonRequestBody.js.map +1 -0
  607. package/lib/esm/domain/JsonResponse.js +81 -0
  608. package/lib/esm/domain/JsonResponse.js.map +1 -0
  609. package/lib/esm/domain/JsonSchema.js +688 -0
  610. package/lib/esm/domain/JsonSchema.js.map +1 -0
  611. package/lib/esm/domain/SpecTypes.js +7 -0
  612. package/lib/esm/domain/SpecTypes.js.map +1 -0
  613. package/lib/esm/domain/index.js +17 -0
  614. package/lib/esm/domain/index.js.map +1 -0
  615. package/lib/esm/hooks/alterIgnore.js +17 -0
  616. package/lib/esm/hooks/alterIgnore.js.map +1 -0
  617. package/lib/esm/hooks/alterRequiredGroups.js +11 -0
  618. package/lib/esm/hooks/alterRequiredGroups.js.map +1 -0
  619. package/lib/esm/index.js +20 -0
  620. package/lib/esm/index.js.map +1 -0
  621. package/lib/esm/interfaces/IgnoreCallback.js +2 -0
  622. package/lib/esm/interfaces/IgnoreCallback.js.map +1 -0
  623. package/lib/esm/interfaces/JsonHookContext.js +2 -0
  624. package/lib/esm/interfaces/JsonHookContext.js.map +1 -0
  625. package/lib/esm/interfaces/JsonOpenSpec.js +2 -0
  626. package/lib/esm/interfaces/JsonOpenSpec.js.map +1 -0
  627. package/lib/esm/interfaces/JsonSchemaOptions.js +2 -0
  628. package/lib/esm/interfaces/JsonSchemaOptions.js.map +1 -0
  629. package/lib/esm/interfaces/index.js +5 -0
  630. package/lib/esm/interfaces/index.js.map +1 -0
  631. package/lib/esm/registries/JsonSchemaMapperContainer.js +27 -0
  632. package/lib/esm/registries/JsonSchemaMapperContainer.js.map +1 -0
  633. package/lib/esm/utils/buildPath.js +9 -0
  634. package/lib/esm/utils/buildPath.js.map +1 -0
  635. package/lib/esm/utils/concatParameters.js +12 -0
  636. package/lib/esm/utils/concatParameters.js.map +1 -0
  637. package/lib/esm/utils/concatPath.js +4 -0
  638. package/lib/esm/utils/concatPath.js.map +1 -0
  639. package/lib/esm/utils/defineStatusModel.js +8 -0
  640. package/lib/esm/utils/defineStatusModel.js.map +1 -0
  641. package/lib/esm/utils/from.js +249 -0
  642. package/lib/esm/utils/from.js.map +1 -0
  643. package/lib/esm/utils/generics.js +34 -0
  644. package/lib/esm/utils/generics.js.map +1 -0
  645. package/lib/esm/utils/getComputedType.js +22 -0
  646. package/lib/esm/utils/getComputedType.js.map +1 -0
  647. package/lib/esm/utils/getInheritedStores.js +19 -0
  648. package/lib/esm/utils/getInheritedStores.js.map +1 -0
  649. package/lib/esm/utils/getJsonEntityStore.js +20 -0
  650. package/lib/esm/utils/getJsonEntityStore.js.map +1 -0
  651. package/lib/esm/utils/getJsonPathParameters.js +69 -0
  652. package/lib/esm/utils/getJsonPathParameters.js.map +1 -0
  653. package/lib/esm/utils/getJsonSchema.js +51 -0
  654. package/lib/esm/utils/getJsonSchema.js.map +1 -0
  655. package/lib/esm/utils/getJsonType.js +36 -0
  656. package/lib/esm/utils/getJsonType.js.map +1 -0
  657. package/lib/esm/utils/getOperationsRoutes.js +32 -0
  658. package/lib/esm/utils/getOperationsRoutes.js.map +1 -0
  659. package/lib/esm/utils/getOperationsStores.js +29 -0
  660. package/lib/esm/utils/getOperationsStores.js.map +1 -0
  661. package/lib/esm/utils/getPropertiesStores.js +40 -0
  662. package/lib/esm/utils/getPropertiesStores.js.map +1 -0
  663. package/lib/esm/utils/getRequiredProperties.js +63 -0
  664. package/lib/esm/utils/getRequiredProperties.js.map +1 -0
  665. package/lib/esm/utils/getSpec.js +83 -0
  666. package/lib/esm/utils/getSpec.js.map +1 -0
  667. package/lib/esm/utils/isJsonClass.js +8 -0
  668. package/lib/esm/utils/isJsonClass.js.map +1 -0
  669. package/lib/esm/utils/isSuccessStatus.js +3 -0
  670. package/lib/esm/utils/isSuccessStatus.js.map +1 -0
  671. package/lib/esm/utils/mapHeaders.js +25 -0
  672. package/lib/esm/utils/mapHeaders.js.map +1 -0
  673. package/lib/esm/utils/mapNullableType.js +26 -0
  674. package/lib/esm/utils/mapNullableType.js.map +1 -0
  675. package/lib/esm/utils/mapRouteOptions.js +22 -0
  676. package/lib/esm/utils/mapRouteOptions.js.map +1 -0
  677. package/lib/esm/utils/matchGroups.js +18 -0
  678. package/lib/esm/utils/matchGroups.js.map +1 -0
  679. package/lib/esm/utils/mergeOperation.js +40 -0
  680. package/lib/esm/utils/mergeOperation.js.map +1 -0
  681. package/lib/esm/utils/mergeSpec.js +42 -0
  682. package/lib/esm/utils/mergeSpec.js.map +1 -0
  683. package/lib/esm/utils/operationIdFormatter.js +33 -0
  684. package/lib/esm/utils/operationIdFormatter.js.map +1 -0
  685. package/lib/esm/utils/ref.js +64 -0
  686. package/lib/esm/utils/ref.js.map +1 -0
  687. package/lib/esm/utils/toJsonMapCollection.js +11 -0
  688. package/lib/esm/utils/toJsonMapCollection.js.map +1 -0
  689. package/lib/esm/utils/toJsonRegex.js +8 -0
  690. package/lib/esm/utils/toJsonRegex.js.map +1 -0
  691. package/lib/types/components/anyMapper.d.ts +2 -0
  692. package/lib/types/components/classMapper.d.ts +3 -0
  693. package/lib/types/components/genericsMapper.d.ts +5 -0
  694. package/lib/types/components/index.d.ts +9 -0
  695. package/lib/types/components/inheritedClassMapper.d.ts +5 -0
  696. package/lib/types/components/itemMapper.d.ts +2 -0
  697. package/lib/types/components/lazyRefMapper.d.ts +3 -0
  698. package/lib/types/components/mapMapper.d.ts +9 -0
  699. package/lib/types/components/objectMapper.d.ts +8 -0
  700. package/lib/types/components/schemaMapper.d.ts +3 -0
  701. package/lib/types/constants/httpMethods.d.ts +12 -0
  702. package/lib/types/constants/httpStatusMessages.d.ts +272 -0
  703. package/lib/types/decorators/class/children.d.ts +11 -0
  704. package/lib/types/decorators/collections/collectionContains.d.ts +21 -0
  705. package/lib/types/decorators/collections/collectionOf.d.ts +101 -0
  706. package/lib/types/decorators/collections/maxItems.d.ts +47 -0
  707. package/lib/types/decorators/collections/maxProperties.d.ts +70 -0
  708. package/lib/types/decorators/collections/minItems.d.ts +51 -0
  709. package/lib/types/decorators/collections/minProperties.d.ts +69 -0
  710. package/lib/types/decorators/collections/uniqueItems.d.ts +50 -0
  711. package/lib/types/decorators/common/additionalProperties.d.ts +11 -0
  712. package/lib/types/decorators/common/allOf.d.ts +13 -0
  713. package/lib/types/decorators/common/allow.d.ts +28 -0
  714. package/lib/types/decorators/common/any.d.ts +38 -0
  715. package/lib/types/decorators/common/anyOf.d.ts +17 -0
  716. package/lib/types/decorators/common/const.d.ts +61 -0
  717. package/lib/types/decorators/common/customKey.d.ts +26 -0
  718. package/lib/types/decorators/common/default.d.ts +41 -0
  719. package/lib/types/decorators/common/description.d.ts +53 -0
  720. package/lib/types/decorators/common/enum.d.ts +98 -0
  721. package/lib/types/decorators/common/example.d.ts +11 -0
  722. package/lib/types/decorators/common/examples.d.ts +12 -0
  723. package/lib/types/decorators/common/exclusiveMaximum.d.ts +69 -0
  724. package/lib/types/decorators/common/exclusiveMinimum.d.ts +69 -0
  725. package/lib/types/decorators/common/format.d.ts +459 -0
  726. package/lib/types/decorators/common/forwardGroups.d.ts +10 -0
  727. package/lib/types/decorators/common/groups.d.ts +11 -0
  728. package/lib/types/decorators/common/hidden.d.ts +32 -0
  729. package/lib/types/decorators/common/ignore.d.ts +58 -0
  730. package/lib/types/decorators/common/integer.d.ts +61 -0
  731. package/lib/types/decorators/common/jsonEntityFn.d.ts +21 -0
  732. package/lib/types/decorators/common/maxLength.d.ts +76 -0
  733. package/lib/types/decorators/common/maximum.d.ts +138 -0
  734. package/lib/types/decorators/common/minLength.d.ts +77 -0
  735. package/lib/types/decorators/common/minimum.d.ts +136 -0
  736. package/lib/types/decorators/common/multipleOf.d.ts +68 -0
  737. package/lib/types/decorators/common/name.d.ts +32 -0
  738. package/lib/types/decorators/common/nullable.d.ts +25 -0
  739. package/lib/types/decorators/common/oneOf.d.ts +17 -0
  740. package/lib/types/decorators/common/optional.d.ts +10 -0
  741. package/lib/types/decorators/common/pattern.d.ts +93 -0
  742. package/lib/types/decorators/common/property.d.ts +11 -0
  743. package/lib/types/decorators/common/readOnly.d.ts +11 -0
  744. package/lib/types/decorators/common/required.d.ts +44 -0
  745. package/lib/types/decorators/common/requiredGroups.d.ts +10 -0
  746. package/lib/types/decorators/common/schema.d.ts +53 -0
  747. package/lib/types/decorators/common/title.d.ts +39 -0
  748. package/lib/types/decorators/common/writeOnly.d.ts +11 -0
  749. package/lib/types/decorators/config/jsonEntityComponent.d.ts +10 -0
  750. package/lib/types/decorators/generics/genericOf.d.ts +76 -0
  751. package/lib/types/decorators/generics/generics.d.ts +14 -0
  752. package/lib/types/decorators/index.d.ts +67 -0
  753. package/lib/types/decorators/operations/consumes.d.ts +19 -0
  754. package/lib/types/decorators/operations/contentType.d.ts +20 -0
  755. package/lib/types/decorators/operations/deprecated.d.ts +23 -0
  756. package/lib/types/decorators/operations/header.d.ts +49 -0
  757. package/lib/types/decorators/operations/in.d.ts +64 -0
  758. package/lib/types/decorators/operations/location.d.ts +22 -0
  759. package/lib/types/decorators/operations/operationId.d.ts +10 -0
  760. package/lib/types/decorators/operations/operationPath.d.ts +21 -0
  761. package/lib/types/decorators/operations/partial.d.ts +10 -0
  762. package/lib/types/decorators/operations/path.d.ts +15 -0
  763. package/lib/types/decorators/operations/produces.d.ts +26 -0
  764. package/lib/types/decorators/operations/redirect.d.ts +52 -0
  765. package/lib/types/decorators/operations/returns.d.ts +238 -0
  766. package/lib/types/decorators/operations/route.d.ts +185 -0
  767. package/lib/types/decorators/operations/security.d.ts +23 -0
  768. package/lib/types/decorators/operations/status.d.ts +127 -0
  769. package/lib/types/decorators/operations/summary.d.ts +20 -0
  770. package/lib/types/decorators/operations/tags.d.ts +23 -0
  771. package/lib/types/domain/DecoratorContext.d.ts +28 -0
  772. package/lib/types/domain/JsonAliasMap.d.ts +12 -0
  773. package/lib/types/domain/JsonClassStore.d.ts +12 -0
  774. package/lib/types/domain/JsonEntityStore.d.ts +132 -0
  775. package/lib/types/domain/JsonFormatTypes.d.ts +17 -0
  776. package/lib/types/domain/JsonLazyRef.d.ts +11 -0
  777. package/lib/types/domain/JsonMap.d.ts +7 -0
  778. package/lib/types/domain/JsonMethodStore.d.ts +19 -0
  779. package/lib/types/domain/JsonOperation.d.ts +51 -0
  780. package/lib/types/domain/JsonOperationPathsMap.d.ts +7 -0
  781. package/lib/types/domain/JsonOperationRoute.d.ts +24 -0
  782. package/lib/types/domain/JsonParameter.d.ts +22 -0
  783. package/lib/types/domain/JsonParameterStore.d.ts +30 -0
  784. package/lib/types/domain/JsonParameterTypes.d.ts +16 -0
  785. package/lib/types/domain/JsonPropertyStore.d.ts +23 -0
  786. package/lib/types/domain/JsonRequestBody.d.ts +11 -0
  787. package/lib/types/domain/JsonResponse.d.ts +22 -0
  788. package/lib/types/domain/JsonSchema.d.ts +337 -0
  789. package/lib/types/domain/SpecTypes.d.ts +5 -0
  790. package/lib/types/domain/index.d.ts +16 -0
  791. package/lib/types/hooks/alterIgnore.d.ts +9 -0
  792. package/lib/types/hooks/alterRequiredGroups.d.ts +6 -0
  793. package/lib/types/index.d.ts +19 -0
  794. package/lib/types/interfaces/IgnoreCallback.d.ts +4 -0
  795. package/lib/types/interfaces/JsonHookContext.d.ts +17 -0
  796. package/lib/types/interfaces/JsonOpenSpec.d.ts +9 -0
  797. package/lib/types/interfaces/JsonSchemaOptions.d.ts +26 -0
  798. package/lib/types/interfaces/index.d.ts +4 -0
  799. package/lib/types/registries/JsonSchemaMapperContainer.d.ts +18 -0
  800. package/lib/types/utils/buildPath.d.ts +6 -0
  801. package/lib/types/utils/concatParameters.d.ts +4 -0
  802. package/lib/types/utils/concatPath.d.ts +1 -0
  803. package/lib/types/utils/defineStatusModel.d.ts +3 -0
  804. package/lib/types/utils/from.d.ts +189 -0
  805. package/lib/types/utils/generics.d.ts +50 -0
  806. package/lib/types/utils/getComputedType.d.ts +5 -0
  807. package/lib/types/utils/getInheritedStores.d.ts +8 -0
  808. package/lib/types/utils/getJsonEntityStore.d.ts +19 -0
  809. package/lib/types/utils/getJsonPathParameters.d.ts +7 -0
  810. package/lib/types/utils/getJsonSchema.d.ts +4 -0
  811. package/lib/types/utils/getJsonType.d.ts +5 -0
  812. package/lib/types/utils/getOperationsRoutes.d.ts +8 -0
  813. package/lib/types/utils/getOperationsStores.d.ts +6 -0
  814. package/lib/types/utils/getPropertiesStores.d.ts +20 -0
  815. package/lib/types/utils/getRequiredProperties.d.ts +6 -0
  816. package/lib/types/utils/getSpec.d.ts +49 -0
  817. package/lib/types/utils/isJsonClass.d.ts +4 -0
  818. package/lib/types/utils/isSuccessStatus.d.ts +2 -0
  819. package/lib/types/utils/mapHeaders.d.ts +9 -0
  820. package/lib/types/utils/mapNullableType.d.ts +3 -0
  821. package/lib/types/utils/mapRouteOptions.d.ts +5 -0
  822. package/lib/types/utils/matchGroups.d.ts +4 -0
  823. package/lib/types/utils/mergeOperation.d.ts +17 -0
  824. package/lib/types/utils/mergeSpec.d.ts +23 -0
  825. package/lib/types/utils/operationIdFormatter.d.ts +4 -0
  826. package/lib/types/utils/ref.d.ts +14 -0
  827. package/lib/types/utils/toJsonMapCollection.d.ts +7 -0
  828. package/lib/types/utils/toJsonRegex.d.ts +5 -0
  829. package/package.json +17 -12
  830. package/tsconfig.compile.esm.json +23 -0
  831. package/lib/index.js +0 -8379
  832. package/lib/index.js.map +0 -1
  833. package/lib/index.modern.js +0 -8230
  834. package/lib/index.modern.js.map +0 -1
  835. package/lib/utils/mergeSpec.benchmark.d.ts +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeSpec.js","sourceRoot":"","sources":["../../../src/utils/mergeSpec.ts"],"names":[],"mappings":";;;AAAA,qCAAuE;AAGvE;;GAEG;AACU,QAAA,cAAc,GAAG,IAAA,0BAAmB,EAC/C,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,CACnH,CAAC;AAEF;;GAEG;AACU,QAAA,UAAU,GAAG,IAAA,0BAAmB,EAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC;AAE1H;;GAEG;AACU,QAAA,QAAQ,GAAG,IAAA,0BAAmB,EAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;IAC7D,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,WAAW,GAAG,IAAA,0BAAmB,EAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC;AAEhG;;GAEG;AACH,MAAM,aAAa,GAAG;IACpB,QAAQ,EAAR,gBAAQ;IACR,UAAU,EAAV,kBAAU;IACV,KAAK,EAAE,sBAAc;IACrB,KAAK,EAAE,sBAAc;IACrB,KAAK,EAAE,sBAAc;IACrB,IAAI,EAAE,mBAAW;CAClB,CAAC;AAEF;;;;GAIG;AACH,SAAgB,SAAS,CAA+B,IAAmB,EAAE,KAAoB;IAC/F,OAAO,IAAA,gBAAS,EAAC,IAAI,EAAE,KAAK,EAAE;QAC5B,QAAQ,EAAE,aAAa;QACvB,mBAAmB,EAAE,IAAI;KAC1B,CAAC,CAAC;AACL,CAAC;AALD,8BAKC","sourcesContent":["import {cleanObject, deepMerge, mergeReducerBuilder} from \"@tsed/core\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\n\n/**\n * @ignore\n */\nexport const schemesReducer = mergeReducerBuilder(\n (current, value) => (current.type && current.type === value.type) || (current.$ref && current.$ref === value.$ref)\n);\n\n/**\n * @ignore\n */\nexport const parameters = mergeReducerBuilder((current, value) => current.in === value.in && current.name === value.name);\n\n/**\n * @ignore\n */\nexport const security = mergeReducerBuilder((current, value) => {\n return !!Object.keys(value).find((key) => !!current[key]);\n});\n\n/**\n * @ignore\n */\nexport const tagsReducer = mergeReducerBuilder((current, value) => current.name === value.name);\n\n/**\n * @ignore\n */\nconst SPEC_REDUCERS = {\n security,\n parameters,\n oneOf: schemesReducer,\n anyOf: schemesReducer,\n allOf: schemesReducer,\n tags: tagsReducer\n};\n\n/**\n * Merge two spec\n * @param spec\n * @param input\n */\nexport function mergeSpec<Spec = OpenSpec2 | OpenSpec3>(spec: Partial<Spec>, input: Partial<Spec>): Partial<Spec> {\n return deepMerge(spec, input, {\n reducers: SPEC_REDUCERS,\n cleanUndefinedProps: true\n });\n}\n"]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.operationIdFormatter = void 0;
4
+ const camel_case_1 = require("camel-case");
5
+ const DEFAULT_PATTERN = "%c.%m";
6
+ /**
7
+ * @ignore
8
+ */
9
+ function operationIdFormatter(pattern = "") {
10
+ const OPERATION_IDS = new Map();
11
+ const transform = (name, propertyKey) => {
12
+ const str = (pattern || DEFAULT_PATTERN).replace(/%c/, name).replace(/%m/, propertyKey);
13
+ return pattern === "" ? (0, camel_case_1.camelCase)(str) : str;
14
+ };
15
+ return (name, propertyKey, path = "") => {
16
+ const operationId = transform(name, propertyKey);
17
+ const operationKey = name + propertyKey;
18
+ if (!OPERATION_IDS.has(operationKey)) {
19
+ OPERATION_IDS.set(operationKey, 0);
20
+ return operationId;
21
+ }
22
+ // try with paths
23
+ const result = path.match(/{(\w+)}/gi);
24
+ if (result) {
25
+ const operationKey = name + propertyKey + result[0];
26
+ if (!OPERATION_IDS.has(operationKey)) {
27
+ OPERATION_IDS.set(operationKey, 0);
28
+ return (0, camel_case_1.camelCase)(`${operationId} By ${result}`);
29
+ }
30
+ }
31
+ const id = OPERATION_IDS.get(operationKey) + 1;
32
+ OPERATION_IDS.set(operationKey, id);
33
+ return `${operationId}_${id}`;
34
+ };
35
+ }
36
+ exports.operationIdFormatter = operationIdFormatter;
37
+ //# sourceMappingURL=operationIdFormatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operationIdFormatter.js","sourceRoot":"","sources":["../../../src/utils/operationIdFormatter.ts"],"names":[],"mappings":";;;AAAA,2CAAqC;AAErC,MAAM,eAAe,GAAG,OAAO,CAAC;AAEhC;;GAEG;AACH,SAAgB,oBAAoB,CAAC,UAAkB,EAAE;IACvD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEhD,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,WAAmB,EAAE,EAAE;QACtD,MAAM,GAAG,GAAG,CAAC,OAAO,IAAI,eAAe,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACxF,OAAO,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAA,sBAAS,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAC/C,CAAC,CAAC;IAEF,OAAO,CAAC,IAAY,EAAE,WAAmB,EAAE,OAAe,EAAE,EAAE,EAAE;QAC9D,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACjD,MAAM,YAAY,GAAG,IAAI,GAAG,WAAW,CAAC;QAExC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YACpC,aAAa,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;YAEnC,OAAO,WAAW,CAAC;SACpB;QAED,iBAAiB;QACjB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACvC,IAAI,MAAM,EAAE;YACV,MAAM,YAAY,GAAG,IAAI,GAAG,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAEpD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;gBACpC,aAAa,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;gBAEnC,OAAO,IAAA,sBAAS,EAAC,GAAG,WAAW,OAAO,MAAM,EAAE,CAAC,CAAC;aACjD;SACF;QAED,MAAM,EAAE,GAAG,aAAa,CAAC,GAAG,CAAC,YAAY,CAAE,GAAG,CAAC,CAAC;QAChD,aAAa,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAEpC,OAAO,GAAG,WAAW,IAAI,EAAE,EAAE,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC;AAnCD,oDAmCC","sourcesContent":["import {camelCase} from \"camel-case\";\n\nconst DEFAULT_PATTERN = \"%c.%m\";\n\n/**\n * @ignore\n */\nexport function operationIdFormatter(pattern: string = \"\") {\n const OPERATION_IDS = new Map<string, number>();\n\n const transform = (name: string, propertyKey: string) => {\n const str = (pattern || DEFAULT_PATTERN).replace(/%c/, name).replace(/%m/, propertyKey);\n return pattern === \"\" ? camelCase(str) : str;\n };\n\n return (name: string, propertyKey: string, path: string = \"\") => {\n const operationId = transform(name, propertyKey);\n const operationKey = name + propertyKey;\n\n if (!OPERATION_IDS.has(operationKey)) {\n OPERATION_IDS.set(operationKey, 0);\n\n return operationId;\n }\n\n // try with paths\n const result = path.match(/{(\\w+)}/gi);\n if (result) {\n const operationKey = name + propertyKey + result[0];\n\n if (!OPERATION_IDS.has(operationKey)) {\n OPERATION_IDS.set(operationKey, 0);\n\n return camelCase(`${operationId} By ${result}`);\n }\n }\n\n const id = OPERATION_IDS.get(operationKey)! + 1;\n OPERATION_IDS.set(operationKey, id);\n\n return `${operationId}_${id}`;\n };\n}\n"]}
File without changes
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toRef = exports.createRef = exports.createRefName = void 0;
4
+ const pascal_case_1 = require("pascal-case");
5
+ const SpecTypes_1 = require("../domain/SpecTypes");
6
+ const core_1 = require("@tsed/core");
7
+ /**
8
+ * ignore
9
+ * @param options
10
+ */
11
+ function getHost(options) {
12
+ const { host = `#/${options.specType === "openapi3" ? "components/schemas" : "definitions"}` } = options;
13
+ return host;
14
+ }
15
+ /**
16
+ * @ignore
17
+ */
18
+ function createRefName(name, options) {
19
+ if (options.groups && options.groups.length) {
20
+ return (0, pascal_case_1.pascalCase)(`${name} ${options.groups.join(" ")}`);
21
+ }
22
+ return name;
23
+ }
24
+ exports.createRefName = createRefName;
25
+ /**
26
+ * @ignore
27
+ */
28
+ function createRef(name, schema, options) {
29
+ const host = getHost(options);
30
+ const ref = {
31
+ $ref: `${host}/${name}`
32
+ };
33
+ const nullable = schema.nullable;
34
+ const readOnly = schema.get ? schema.get("readOnly") : undefined;
35
+ if (nullable || readOnly) {
36
+ switch (options.specType) {
37
+ case SpecTypes_1.SpecTypes.OPENAPI:
38
+ return (0, core_1.cleanObject)({
39
+ nullable: nullable ? true : undefined,
40
+ readOnly: readOnly ? true : undefined,
41
+ allOf: [ref]
42
+ });
43
+ case SpecTypes_1.SpecTypes.JSON:
44
+ return (0, core_1.cleanObject)({
45
+ readOnly,
46
+ oneOf: [nullable && { type: "null" }, ref].filter(Boolean)
47
+ });
48
+ case SpecTypes_1.SpecTypes.SWAGGER: // unsupported
49
+ if (readOnly) {
50
+ return {
51
+ readOnly,
52
+ allOf: [ref]
53
+ };
54
+ }
55
+ break;
56
+ }
57
+ }
58
+ return ref;
59
+ }
60
+ exports.createRef = createRef;
61
+ /**
62
+ * @ignore
63
+ */
64
+ function toRef(value, schema, options) {
65
+ const name = createRefName(value.getName(), options);
66
+ options.schemas[value.getName()] = schema;
67
+ return createRef(name, value, options);
68
+ }
69
+ exports.toRef = toRef;
70
+ //# sourceMappingURL=ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../src/utils/ref.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AAEvC,mDAA8C;AAE9C,qCAAuC;AAEvC;;;GAGG;AACH,SAAS,OAAO,CAAC,OAA0B;IACzC,MAAM,EAAC,IAAI,GAAG,KAAK,OAAO,CAAC,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,aAAa,EAAE,EAAC,GAAG,OAAO,CAAC;IAEvG,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,IAAY,EAAE,OAA0B;IACpE,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;QAC3C,OAAO,IAAA,wBAAU,EAAC,GAAG,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;KAC1D;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAND,sCAMC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,MAAkB,EAAE,OAA0B;IACpF,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG;QACV,IAAI,EAAE,GAAG,IAAI,IAAI,IAAI,EAAE;KACxB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjE,IAAI,QAAQ,IAAI,QAAQ,EAAE;QACxB,QAAQ,OAAO,CAAC,QAAQ,EAAE;YACxB,KAAK,qBAAS,CAAC,OAAO;gBACpB,OAAO,IAAA,kBAAW,EAAC;oBACjB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;oBACrC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;oBACrC,KAAK,EAAE,CAAC,GAAG,CAAC;iBACb,CAAC,CAAC;YACL,KAAK,qBAAS,CAAC,IAAI;gBACjB,OAAO,IAAA,kBAAW,EAAC;oBACjB,QAAQ;oBACR,KAAK,EAAE,CAAC,QAAQ,IAAI,EAAC,IAAI,EAAE,MAAM,EAAC,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;iBACzD,CAAC,CAAC;YACL,KAAK,qBAAS,CAAC,OAAO,EAAE,cAAc;gBACpC,IAAI,QAAQ,EAAE;oBACZ,OAAO;wBACL,QAAQ;wBACR,KAAK,EAAE,CAAC,GAAG,CAAC;qBACb,CAAC;iBACH;gBACD,MAAM;SACT;KACF;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAlCD,8BAkCC;AAED;;GAEG;AACH,SAAgB,KAAK,CAAC,KAAiB,EAAE,MAAW,EAAE,OAA0B;IAC9E,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAErD,OAAO,CAAC,OAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC;IAE3C,OAAO,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAND,sBAMC","sourcesContent":["import {pascalCase} from \"pascal-case\";\nimport type {JsonSchema} from \"../domain/JsonSchema\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {cleanObject} from \"@tsed/core\";\n\n/**\n * ignore\n * @param options\n */\nfunction getHost(options: JsonSchemaOptions) {\n const {host = `#/${options.specType === \"openapi3\" ? \"components/schemas\" : \"definitions\"}`} = options;\n\n return host;\n}\n\n/**\n * @ignore\n */\nexport function createRefName(name: string, options: JsonSchemaOptions) {\n if (options.groups && options.groups.length) {\n return pascalCase(`${name} ${options.groups.join(\" \")}`);\n }\n\n return name;\n}\n\n/**\n * @ignore\n */\nexport function createRef(name: string, schema: JsonSchema, options: JsonSchemaOptions) {\n const host = getHost(options);\n const ref = {\n $ref: `${host}/${name}`\n };\n\n const nullable = schema.nullable;\n const readOnly = schema.get ? schema.get(\"readOnly\") : undefined;\n\n if (nullable || readOnly) {\n switch (options.specType) {\n case SpecTypes.OPENAPI:\n return cleanObject({\n nullable: nullable ? true : undefined,\n readOnly: readOnly ? true : undefined,\n allOf: [ref]\n });\n case SpecTypes.JSON:\n return cleanObject({\n readOnly,\n oneOf: [nullable && {type: \"null\"}, ref].filter(Boolean)\n });\n case SpecTypes.SWAGGER: // unsupported\n if (readOnly) {\n return {\n readOnly,\n allOf: [ref]\n };\n }\n break;\n }\n }\n\n return ref;\n}\n\n/**\n * @ignore\n */\nexport function toRef(value: JsonSchema, schema: any, options: JsonSchemaOptions) {\n const name = createRefName(value.getName(), options);\n\n options.schemas![value.getName()] = schema;\n\n return createRef(name, value, options);\n}\n"]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toJsonMapCollection = void 0;
4
+ const JsonMap_1 = require("../domain/JsonMap");
5
+ /**
6
+ * @ignore
7
+ */
8
+ function toJsonMapCollection(content, klass = JsonMap_1.JsonMap) {
9
+ return Object.entries(content).reduce((content, [key, value]) => {
10
+ content.set(key, new klass(value));
11
+ return content;
12
+ }, new JsonMap_1.JsonMap());
13
+ }
14
+ exports.toJsonMapCollection = toJsonMapCollection;
15
+ //# sourceMappingURL=toJsonMapCollection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toJsonMapCollection.js","sourceRoot":"","sources":["../../../src/utils/toJsonMapCollection.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAE1C;;GAEG;AACH,SAAgB,mBAAmB,CAAC,OAA6B,EAAE,KAAK,GAAG,iBAAO;IAChF,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC9D,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAEnC,OAAO,OAAO,CAAC;IACjB,CAAC,EAAE,IAAI,iBAAO,EAAO,CAAC,CAAC;AACzB,CAAC;AAND,kDAMC","sourcesContent":["import {JsonMap} from \"../domain/JsonMap\";\n\n/**\n * @ignore\n */\nexport function toJsonMapCollection(content: {[key: string]: any}, klass = JsonMap) {\n return Object.entries(content).reduce((content, [key, value]) => {\n content.set(key, new klass(value));\n\n return content;\n }, new JsonMap<any>());\n}\n"]}
File without changes
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toJsonRegex = void 0;
4
+ /**
5
+ * @ignore
6
+ * @param pattern
7
+ */
8
+ function toJsonRegex(pattern) {
9
+ return String(pattern).replace(/^(\/)(.*)(\/)$/, "$2");
10
+ }
11
+ exports.toJsonRegex = toJsonRegex;
12
+ //# sourceMappingURL=toJsonRegex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toJsonRegex.js","sourceRoot":"","sources":["../../../src/utils/toJsonRegex.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,WAAW,CAAC,OAAwB;IAClD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AACzD,CAAC;AAFD,kCAEC","sourcesContent":["/**\n * @ignore\n * @param pattern\n */\nexport function toJsonRegex(pattern: string | RegExp) {\n return String(pattern).replace(/^(\\/)(.*)(\\/)$/, \"$2\");\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import { JsonLazyRef } from "../domain/JsonLazyRef";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
3
+ import { mapGenericsOptions } from "../utils/generics";
4
+ import { toRef } from "../utils/ref";
5
+ export function anyMapper(input, options = {}) {
6
+ options.schemas = options.schemas || {};
7
+ if (typeof input !== "object" || input === null) {
8
+ return input;
9
+ }
10
+ if (input instanceof JsonLazyRef) {
11
+ return execMapper("lazyRef", input, options);
12
+ }
13
+ if ("toJSON" in input) {
14
+ const schema = input.toJSON(mapGenericsOptions(options));
15
+ return input.canRef ? toRef(input, schema, options) : schema;
16
+ }
17
+ return execMapper("object", input, options);
18
+ }
19
+ registerJsonSchemaMapper("any", anyMapper);
20
+ //# sourceMappingURL=anyMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anyMapper.js","sourceRoot":"","sources":["../../../src/components/anyMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAC,UAAU,EAAE,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAEnC,MAAM,UAAU,SAAS,CAAC,KAAU,EAAE,UAA6B,EAAE;IACnE,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;IAExC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;QAC/C,OAAO,KAAK,CAAC;KACd;IAED,IAAI,KAAK,YAAY,WAAW,EAAE;QAChC,OAAO,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;KAC9C;IAED,IAAI,QAAQ,IAAI,KAAK,EAAE;QACrB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;QAEzD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;KAC9D;IAED,OAAO,UAAU,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,wBAAwB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import {JsonLazyRef} from \"../domain/JsonLazyRef\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {execMapper, registerJsonSchemaMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {mapGenericsOptions} from \"../utils/generics\";\nimport {toRef} from \"../utils/ref\";\n\nexport function anyMapper(input: any, options: JsonSchemaOptions = {}): any {\n options.schemas = options.schemas || {};\n\n if (typeof input !== \"object\" || input === null) {\n return input;\n }\n\n if (input instanceof JsonLazyRef) {\n return execMapper(\"lazyRef\", input, options);\n }\n\n if (\"toJSON\" in input) {\n const schema = input.toJSON(mapGenericsOptions(options));\n\n return input.canRef ? toRef(input, schema, options) : schema;\n }\n\n return execMapper(\"object\", input, options);\n}\n\nregisterJsonSchemaMapper(\"any\", anyMapper);\n"]}
@@ -0,0 +1,37 @@
1
+ import { JsonEntityStore } from "../domain/JsonEntityStore";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
3
+ import { mapGenericsOptions, popGenerics } from "../utils/generics";
4
+ import { createRef, createRefName } from "../utils/ref";
5
+ export function classMapper(value, options = {}) {
6
+ const store = JsonEntityStore.from(value.class);
7
+ const name = createRefName(store.schema.getName() || value.getName(), options);
8
+ if (value.hasGenerics) {
9
+ // Inline generic
10
+ const { type, properties, additionalProperties, items, ...props } = value.toJSON(options);
11
+ const schema = {
12
+ ...execMapper("any", store.schema, {
13
+ ...options,
14
+ ...popGenerics(value),
15
+ root: false
16
+ }),
17
+ ...props
18
+ };
19
+ if (schema.title) {
20
+ const name = createRefName(schema.title, options);
21
+ options.schemas[name] = schema;
22
+ delete schema.title;
23
+ return createRef(name, value, options);
24
+ }
25
+ return schema;
26
+ }
27
+ if (options.schemas && !options.schemas[name]) {
28
+ options.schemas[name] = {}; // avoid infinite calls
29
+ options.schemas[name] = execMapper("any", store.schema, mapGenericsOptions({
30
+ ...options,
31
+ root: false
32
+ }));
33
+ }
34
+ return createRef(name, value, options);
35
+ }
36
+ registerJsonSchemaMapper("class", classMapper);
37
+ //# sourceMappingURL=classMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classMapper.js","sourceRoot":"","sources":["../../../src/components/classMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAG1D,OAAO,EAAC,UAAU,EAAE,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAC,kBAAkB,EAAE,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAC,SAAS,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AAEtD,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,UAA6B,EAAE;IAC5E,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAE/E,IAAI,KAAK,CAAC,WAAW,EAAE;QACrB,iBAAiB;QACjB,MAAM,EAAC,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,KAAK,EAAE,GAAG,KAAK,EAAC,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACxF,MAAM,MAAM,GAAG;YACb,GAAG,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;gBACjC,GAAG,OAAO;gBACV,GAAG,WAAW,CAAC,KAAK,CAAC;gBACrB,IAAI,EAAE,KAAK;aACZ,CAAC;YACF,GAAG,KAAK;SACT,CAAC;QAEF,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAClD,OAAO,CAAC,OAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;YAChC,OAAO,MAAM,CAAC,KAAK,CAAC;YAEpB,OAAO,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;SACxC;QAED,OAAO,MAAM,CAAC;KACf;IAED,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAC7C,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,uBAAuB;QACnD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAU,CAChC,KAAK,EACL,KAAK,CAAC,MAAM,EACZ,kBAAkB,CAAC;YACjB,GAAG,OAAO;YACV,IAAI,EAAE,KAAK;SACZ,CAAC,CACH,CAAC;KACH;IAED,OAAO,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,wBAAwB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {JsonSchema} from \"../domain/JsonSchema\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {execMapper, registerJsonSchemaMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {mapGenericsOptions, popGenerics} from \"../utils/generics\";\nimport {createRef, createRefName} from \"../utils/ref\";\n\nexport function classMapper(value: JsonSchema, options: JsonSchemaOptions = {}) {\n const store = JsonEntityStore.from(value.class);\n const name = createRefName(store.schema.getName() || value.getName(), options);\n\n if (value.hasGenerics) {\n // Inline generic\n const {type, properties, additionalProperties, items, ...props} = value.toJSON(options);\n const schema = {\n ...execMapper(\"any\", store.schema, {\n ...options,\n ...popGenerics(value),\n root: false\n }),\n ...props\n };\n\n if (schema.title) {\n const name = createRefName(schema.title, options);\n options.schemas![name] = schema;\n delete schema.title;\n\n return createRef(name, value, options);\n }\n\n return schema;\n }\n\n if (options.schemas && !options.schemas[name]) {\n options.schemas[name] = {}; // avoid infinite calls\n options.schemas[name] = execMapper(\n \"any\",\n store.schema,\n mapGenericsOptions({\n ...options,\n root: false\n })\n );\n }\n\n return createRef(name, value, options);\n}\n\nregisterJsonSchemaMapper(\"class\", classMapper);\n"]}
@@ -0,0 +1,58 @@
1
+ import { isClass, isPrimitiveClass } from "@tsed/core";
2
+ import { JsonEntityStore } from "../domain/JsonEntityStore";
3
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
4
+ import { popGenerics } from "../utils/generics";
5
+ import { getJsonType } from "../utils/getJsonType";
6
+ /**
7
+ * @ignore
8
+ */
9
+ export function genericsMapper(obj, options) {
10
+ const { generics } = options;
11
+ if (generics && obj.$ref) {
12
+ if (generics.has(obj.$ref)) {
13
+ let type = generics.get(obj.$ref);
14
+ if (isPrimitiveClass(type)) {
15
+ return {
16
+ type: getJsonType(type)
17
+ };
18
+ }
19
+ if (type === Date) {
20
+ return {
21
+ type: "string",
22
+ format: "date-time"
23
+ };
24
+ }
25
+ if (type.toJSON) {
26
+ return type.toJSON({
27
+ ...options,
28
+ generics: undefined
29
+ });
30
+ }
31
+ if (type === Object) {
32
+ return {
33
+ type: "object"
34
+ };
35
+ }
36
+ if (isClass(type)) {
37
+ const model = {
38
+ class: type
39
+ };
40
+ if (options.nestedGenerics.length === 0) {
41
+ return execMapper("class", model, {
42
+ ...options,
43
+ generics: undefined
44
+ });
45
+ }
46
+ const store = JsonEntityStore.from(model.class);
47
+ return execMapper("schema", store.schema, {
48
+ ...options,
49
+ ...popGenerics(options),
50
+ root: false
51
+ });
52
+ }
53
+ }
54
+ }
55
+ return obj;
56
+ }
57
+ registerJsonSchemaMapper("generics", genericsMapper);
58
+ //# sourceMappingURL=genericsMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genericsMapper.js","sourceRoot":"","sources":["../../../src/components/genericsMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,gBAAgB,EAAC,MAAM,YAAY,CAAC;AACrD,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAC,UAAU,EAAE,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAkB,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,GAAQ,EAAE,OAAwB;IAC/D,MAAM,EAAC,QAAQ,EAAC,GAAG,OAAO,CAAC;IAE3B,IAAI,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE;QACxB,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC1B,IAAI,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAElC,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;gBAC1B,OAAO;oBACL,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;iBACxB,CAAC;aACH;YAED,IAAI,IAAI,KAAK,IAAI,EAAE;gBACjB,OAAO;oBACL,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,WAAW;iBACpB,CAAC;aACH;YAED,IAAI,IAAI,CAAC,MAAM,EAAE;gBACf,OAAO,IAAI,CAAC,MAAM,CAAC;oBACjB,GAAG,OAAO;oBACV,QAAQ,EAAE,SAAS;iBACpB,CAAC,CAAC;aACJ;YAED,IAAI,IAAI,KAAK,MAAM,EAAE;gBACnB,OAAO;oBACL,IAAI,EAAE,QAAQ;iBACf,CAAC;aACH;YAED,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;gBACjB,MAAM,KAAK,GAAG;oBACZ,KAAK,EAAE,IAAI;iBACZ,CAAC;gBAEF,IAAI,OAAO,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;oBACvC,OAAO,UAAU,CAAC,OAAO,EAAE,KAAY,EAAE;wBACvC,GAAG,OAAO;wBACV,QAAQ,EAAE,SAAS;qBACpB,CAAC,CAAC;iBACJ;gBAED,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAEhD,OAAO,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE;oBACxC,GAAG,OAAO;oBACV,GAAG,WAAW,CAAC,OAAO,CAAC;oBACvB,IAAI,EAAE,KAAK;iBACZ,CAAC,CAAC;aACJ;SACF;KACF;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,wBAAwB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import {isClass, isPrimitiveClass} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {execMapper, registerJsonSchemaMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {GenericsContext, popGenerics} from \"../utils/generics\";\nimport {getJsonType} from \"../utils/getJsonType\";\n\n/**\n * @ignore\n */\nexport function genericsMapper(obj: any, options: GenericsContext) {\n const {generics} = options;\n\n if (generics && obj.$ref) {\n if (generics.has(obj.$ref)) {\n let type = generics.get(obj.$ref);\n\n if (isPrimitiveClass(type)) {\n return {\n type: getJsonType(type)\n };\n }\n\n if (type === Date) {\n return {\n type: \"string\",\n format: \"date-time\"\n };\n }\n\n if (type.toJSON) {\n return type.toJSON({\n ...options,\n generics: undefined\n });\n }\n\n if (type === Object) {\n return {\n type: \"object\"\n };\n }\n\n if (isClass(type)) {\n const model = {\n class: type\n };\n\n if (options.nestedGenerics.length === 0) {\n return execMapper(\"class\", model as any, {\n ...options,\n generics: undefined\n });\n }\n\n const store = JsonEntityStore.from(model.class);\n\n return execMapper(\"schema\", store.schema, {\n ...options,\n ...popGenerics(options),\n root: false\n });\n }\n }\n }\n\n return obj;\n}\n\nregisterJsonSchemaMapper(\"generics\", genericsMapper);\n"]}
@@ -0,0 +1,10 @@
1
+ export * from "./anyMapper";
2
+ export * from "./classMapper";
3
+ export * from "./genericsMapper";
4
+ export * from "./inheritedClassMapper";
5
+ export * from "./itemMapper";
6
+ export * from "./lazyRefMapper";
7
+ export * from "./mapMapper";
8
+ export * from "./objectMapper";
9
+ export * from "./schemaMapper";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC","sourcesContent":["export * from \"./anyMapper\";\nexport * from \"./classMapper\";\nexport * from \"./genericsMapper\";\nexport * from \"./inheritedClassMapper\";\nexport * from \"./itemMapper\";\nexport * from \"./lazyRefMapper\";\nexport * from \"./mapMapper\";\nexport * from \"./objectMapper\";\nexport * from \"./schemaMapper\";\n"]}
@@ -0,0 +1,18 @@
1
+ import { classOf, deepMerge } from "@tsed/core";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
3
+ import { getInheritedStores } from "../utils/getInheritedStores";
4
+ /**
5
+ * @ignore
6
+ */
7
+ export function inheritedClassMapper(obj, { target, ...options } = {}) {
8
+ const stores = Array.from(getInheritedStores(target).entries()).filter(([model]) => classOf(model) !== classOf(target));
9
+ if (stores.length) {
10
+ const schema = stores.reduce((obj, [, store]) => {
11
+ return deepMerge(obj, execMapper("schema", store.schema, options));
12
+ }, {});
13
+ obj = deepMerge(schema, obj);
14
+ }
15
+ return obj;
16
+ }
17
+ registerJsonSchemaMapper("inheritedClass", inheritedClassMapper);
18
+ //# sourceMappingURL=inheritedClassMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inheritedClassMapper.js","sourceRoot":"","sources":["../../../src/components/inheritedClassMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAC,UAAU,EAAE,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAQ,EAAE,EAAC,MAAM,EAAE,GAAG,OAAO,KAAuB,EAAE;IACzF,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAExH,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE;YAC9C,OAAO,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACrE,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,GAAG,GAAG,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC9B;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,wBAAwB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import {classOf, deepMerge} from \"@tsed/core\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {execMapper, registerJsonSchemaMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {getInheritedStores} from \"../utils/getInheritedStores\";\n\n/**\n * @ignore\n */\nexport function inheritedClassMapper(obj: any, {target, ...options}: JsonSchemaOptions = {}) {\n const stores = Array.from(getInheritedStores(target).entries()).filter(([model]) => classOf(model) !== classOf(target));\n\n if (stores.length) {\n const schema = stores.reduce((obj, [, store]) => {\n return deepMerge(obj, execMapper(\"schema\", store.schema, options));\n }, {});\n\n obj = deepMerge(schema, obj);\n }\n\n return obj;\n}\n\nregisterJsonSchemaMapper(\"inheritedClass\", inheritedClassMapper);\n"]}
@@ -0,0 +1,6 @@
1
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
2
+ export function itemMapper(value, options) {
3
+ return value && value.isClass ? execMapper("class", value, options) : execMapper("any", value, options);
4
+ }
5
+ registerJsonSchemaMapper("item", itemMapper);
6
+ //# sourceMappingURL=itemMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itemMapper.js","sourceRoot":"","sources":["../../../src/components/itemMapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAE,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AAE7F,MAAM,UAAU,UAAU,CAAC,KAAU,EAAE,OAA0B;IAC/D,OAAO,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC1G,CAAC;AAED,wBAAwB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {execMapper, registerJsonSchemaMapper} from \"../registries/JsonSchemaMapperContainer\";\n\nexport function itemMapper(value: any, options: JsonSchemaOptions) {\n return value && value.isClass ? execMapper(\"class\", value, options) : execMapper(\"any\", value, options);\n}\n\nregisterJsonSchemaMapper(\"item\", itemMapper);\n"]}
@@ -0,0 +1,15 @@
1
+ import { registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
2
+ import { mapGenericsOptions } from "../utils/generics";
3
+ import { createRef, toRef } from "../utils/ref";
4
+ export function lazyRefMapper(input, options) {
5
+ var _a;
6
+ const name = input.name;
7
+ if ((_a = options.$refs) === null || _a === void 0 ? void 0 : _a.find((t) => t === input.target)) {
8
+ return createRef(name, input.schema, options);
9
+ }
10
+ options.$refs = [...(options.$refs || []), input.target];
11
+ const schema = input.toJSON(mapGenericsOptions(options));
12
+ return toRef(input.schema, schema, options);
13
+ }
14
+ registerJsonSchemaMapper("lazyRef", lazyRefMapper);
15
+ //# sourceMappingURL=lazyRefMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazyRefMapper.js","sourceRoot":"","sources":["../../../src/components/lazyRefMapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAC,SAAS,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AAE9C,MAAM,UAAU,aAAa,CAAC,KAAkB,EAAE,OAA0B;;IAC1E,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAExB,IAAI,MAAA,OAAO,CAAC,KAAK,0CAAE,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC,EAAE;QACvD,OAAO,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;IAEzD,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,wBAAwB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import {JsonLazyRef} from \"../domain/JsonLazyRef\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {registerJsonSchemaMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {mapGenericsOptions} from \"../utils/generics\";\nimport {createRef, toRef} from \"../utils/ref\";\n\nexport function lazyRefMapper(input: JsonLazyRef, options: JsonSchemaOptions) {\n const name = input.name;\n\n if (options.$refs?.find((t: any) => t === input.target)) {\n return createRef(name, input.schema, options);\n }\n\n options.$refs = [...(options.$refs || []), input.target];\n\n const schema = input.toJSON(mapGenericsOptions(options));\n\n return toRef(input.schema, schema, options);\n}\n\nregisterJsonSchemaMapper(\"lazyRef\", lazyRefMapper);\n"]}
@@ -0,0 +1,21 @@
1
+ import { mapGenericsOptions } from "../utils/generics";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
3
+ /**
4
+ * Serialize class which inherit from Map like JsonMap, JsonOperation, JsonParameter.
5
+ * @param input
6
+ * @param ignore
7
+ * @param options
8
+ * @ignore
9
+ */
10
+ export function mapMapper(input, { ignore = [], ...options } = {}) {
11
+ options = mapGenericsOptions(options);
12
+ return Array.from(input.entries()).reduce((obj, [key, value]) => {
13
+ if (ignore.includes(key)) {
14
+ return obj;
15
+ }
16
+ obj[key] = execMapper("item", value, options);
17
+ return obj;
18
+ }, {});
19
+ }
20
+ registerJsonSchemaMapper("map", mapMapper);
21
+ //# sourceMappingURL=mapMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapMapper.js","sourceRoot":"","sources":["../../../src/components/mapMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAC,UAAU,EAAE,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AAE7F;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,KAAuB,EAAE,EAAC,MAAM,GAAG,EAAE,EAAE,GAAG,OAAO,KAAuB,EAAE;IAClG,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAEtC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACnE,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACxB,OAAO,GAAG,CAAC;SACZ;QAED,GAAG,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAC9C,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAED,wBAAwB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import {mapGenericsOptions} from \"../utils/generics\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {execMapper, registerJsonSchemaMapper} from \"../registries/JsonSchemaMapperContainer\";\n\n/**\n * Serialize class which inherit from Map like JsonMap, JsonOperation, JsonParameter.\n * @param input\n * @param ignore\n * @param options\n * @ignore\n */\nexport function mapMapper(input: Map<string, any>, {ignore = [], ...options}: JsonSchemaOptions = {}): any {\n options = mapGenericsOptions(options);\n\n return Array.from(input.entries()).reduce((obj: any, [key, value]) => {\n if (ignore.includes(key)) {\n return obj;\n }\n\n obj[key] = execMapper(\"item\", value, options);\n return obj;\n }, {});\n}\n\nregisterJsonSchemaMapper(\"map\", mapMapper);\n"]}
@@ -0,0 +1,21 @@
1
+ import { isArray } from "@tsed/core";
2
+ import { alterIgnore } from "../hooks/alterIgnore";
3
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
4
+ /**
5
+ * Serialize Any object to a json schema
6
+ * @param input
7
+ * @param options
8
+ * @ignore
9
+ */
10
+ export function objectMapper(input, options) {
11
+ const { specType, operationIdFormatter, root, schemas, genericTypes, nestedGenerics, useAlias, genericLabels, ...ctx } = options;
12
+ return Object.entries(input).reduce((obj, [key, value]) => {
13
+ if (options.withIgnoredProps !== false && !alterIgnore(value, ctx)) {
14
+ // remove groups to avoid bad schema generation over children models
15
+ obj[key] = execMapper("item", value, { ...options, groups: (value === null || value === void 0 ? void 0 : value.$forwardGroups) ? options.groups : undefined });
16
+ }
17
+ return obj;
18
+ }, isArray(input) ? [] : {});
19
+ }
20
+ registerJsonSchemaMapper("object", objectMapper);
21
+ //# sourceMappingURL=objectMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectMapper.js","sourceRoot":"","sources":["../../../src/components/objectMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAC,UAAU,EAAE,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AAE7F;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAU,EAAE,OAA0B;IACjE,MAAM,EAAC,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,GAAG,EAAC,GAAG,OAAO,CAAC;IAE/H,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CACjC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAA6B,EAAE,EAAE;QAChD,IAAI,OAAO,CAAC,gBAAgB,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE;YAClE,oEAAoE;YACpE,GAAG,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,EAAC,GAAG,OAAO,EAAE,MAAM,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,cAAc,EAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAC,CAAC,CAAC;SAChH;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EACD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CACzB,CAAC;AACJ,CAAC;AAED,wBAAwB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import {isArray} from \"@tsed/core\";\nimport {JsonSchema} from \"../domain/JsonSchema\";\nimport {alterIgnore} from \"../hooks/alterIgnore\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {execMapper, registerJsonSchemaMapper} from \"../registries/JsonSchemaMapperContainer\";\n\n/**\n * Serialize Any object to a json schema\n * @param input\n * @param options\n * @ignore\n */\nexport function objectMapper(input: any, options: JsonSchemaOptions) {\n const {specType, operationIdFormatter, root, schemas, genericTypes, nestedGenerics, useAlias, genericLabels, ...ctx} = options;\n\n return Object.entries(input).reduce<any>(\n (obj, [key, value]: [string, any | JsonSchema]) => {\n if (options.withIgnoredProps !== false && !alterIgnore(value, ctx)) {\n // remove groups to avoid bad schema generation over children models\n obj[key] = execMapper(\"item\", value, {...options, groups: value?.$forwardGroups ? options.groups : undefined});\n }\n\n return obj;\n },\n isArray(input) ? [] : {}\n );\n}\n\nregisterJsonSchemaMapper(\"object\", objectMapper);\n"]}
@@ -0,0 +1,96 @@
1
+ import { isObject } from "@tsed/core";
2
+ import { mapAliasedProperties } from "../domain/JsonAliasMap";
3
+ import { SpecTypes } from "../domain/SpecTypes";
4
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
5
+ import { getRequiredProperties } from "../utils/getRequiredProperties";
6
+ import { mapNullableType } from "../utils/mapNullableType";
7
+ /**
8
+ * @ignore
9
+ */
10
+ const IGNORES = ["name", "$required", "$hooks", "_nestedGenerics", SpecTypes.OPENAPI, SpecTypes.SWAGGER, SpecTypes.JSON];
11
+ /**
12
+ * @ignore
13
+ */
14
+ const IGNORES_OPENSPEC = ["const"];
15
+ const IGNORES_OS2 = ["writeOnly", "readOnly"];
16
+ /**
17
+ * @ignore
18
+ */
19
+ function isEmptyProperties(key, value) {
20
+ return typeof value === "object" && ["items", "properties", "additionalProperties"].includes(key) && Object.keys(value).length === 0;
21
+ }
22
+ /**
23
+ * @ignore
24
+ */
25
+ function shouldMapAlias(key, value, useAlias) {
26
+ return typeof value === "object" && useAlias && ["properties", "additionalProperties"].includes(key);
27
+ }
28
+ /**
29
+ * @ignore
30
+ */
31
+ function shouldSkipKey(key, { specType = SpecTypes.JSON, customKeys = false }) {
32
+ return (IGNORES.includes(key) ||
33
+ (key.startsWith("#") && (customKeys === false || specType !== SpecTypes.JSON)) ||
34
+ (specType === SpecTypes.SWAGGER && IGNORES_OS2.includes(key)) ||
35
+ (specType !== SpecTypes.JSON && IGNORES_OPENSPEC.includes(key)));
36
+ }
37
+ export function schemaMapper(schema, options = {}) {
38
+ const { useAlias = true, schemas = {}, genericTypes } = options;
39
+ let obj = [...schema.entries()].reduce((item, [key, value]) => {
40
+ if (shouldSkipKey(key, options)) {
41
+ return item;
42
+ }
43
+ key = key.replace(/^#/, "");
44
+ if (key === "type") {
45
+ value = schema.getJsonType();
46
+ }
47
+ if (key === "examples" && isObject(value) && [SpecTypes.OPENAPI, SpecTypes.SWAGGER].includes(options.specType)) {
48
+ key = "example";
49
+ value = Object.values(value)[0];
50
+ }
51
+ if (value) {
52
+ if (value.isClass) {
53
+ value = execMapper("class", value, {
54
+ ...options,
55
+ useAlias,
56
+ schemas
57
+ });
58
+ }
59
+ else {
60
+ value = execMapper("any", value, {
61
+ ...options,
62
+ useAlias,
63
+ schemas,
64
+ genericTypes,
65
+ genericLabels: schema.genericLabels
66
+ });
67
+ }
68
+ }
69
+ if (isEmptyProperties(key, value)) {
70
+ return item;
71
+ }
72
+ if (shouldMapAlias(key, value, useAlias)) {
73
+ value = mapAliasedProperties(value, schema.alias);
74
+ }
75
+ item[key] = value;
76
+ return item;
77
+ }, {});
78
+ if (schema.isClass) {
79
+ obj = execMapper("inheritedClass", obj, { ...options, root: false, schemas, target: schema.getComputedType() });
80
+ }
81
+ obj = execMapper("generics", obj, { ...options, root: false, schemas });
82
+ if (schema.has(options.specType)) {
83
+ obj = {
84
+ ...obj,
85
+ ...schema.get(options.specType).toJSON(options)
86
+ };
87
+ }
88
+ obj = getRequiredProperties(obj, schema, { ...options, useAlias });
89
+ obj = mapNullableType(obj, schema, options);
90
+ if ((obj.oneOf || obj.allOf || obj.anyOf) && !(obj.items || obj.properties)) {
91
+ delete obj.type;
92
+ }
93
+ return obj;
94
+ }
95
+ registerJsonSchemaMapper("schema", schemaMapper);
96
+ //# sourceMappingURL=schemaMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaMapper.js","sourceRoot":"","sources":["../../../src/components/schemaMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAC,UAAU,EAAE,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAC,qBAAqB,EAAC,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAE,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;AACzH;;GAEG;AACH,MAAM,gBAAgB,GAAG,CAAC,OAAO,CAAC,CAAC;AACnC,MAAM,WAAW,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAE9C;;GAEG;AACH,SAAS,iBAAiB,CAAC,GAAW,EAAE,KAAU;IAChD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACvI,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,GAAW,EAAE,KAAU,EAAE,QAAiB;IAChE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,IAAI,CAAC,YAAY,EAAE,sBAAsB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACvG,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,GAAW,EAAE,EAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,KAAK,EAAoB;IACpG,OAAO,CACL,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;QACrB,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,KAAK,KAAK,IAAI,QAAQ,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC;QAC9E,CAAC,QAAQ,KAAK,SAAS,CAAC,OAAO,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC7D,CAAC,QAAQ,KAAK,SAAS,CAAC,IAAI,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAChE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAkB,EAAE,UAA6B,EAAE;IAC9E,MAAM,EAAC,QAAQ,GAAG,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,YAAY,EAAC,GAAG,OAAO,CAAC;IAE9D,IAAI,GAAG,GAAQ,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACtE,IAAI,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE;YAC/B,OAAO,IAAI,CAAC;SACb;QAED,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAE5B,IAAI,GAAG,KAAK,MAAM,EAAE;YAClB,KAAK,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;SAC9B;QAED,IAAI,GAAG,KAAK,UAAU,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAS,CAAC,EAAE;YAC/G,GAAG,GAAG,SAAS,CAAC;YAChB,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACjC;QAED,IAAI,KAAK,EAAE;YACT,IAAI,KAAK,CAAC,OAAO,EAAE;gBACjB,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE;oBACjC,GAAG,OAAO;oBACV,QAAQ;oBACR,OAAO;iBACR,CAAC,CAAC;aACJ;iBAAM;gBACL,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE;oBAC/B,GAAG,OAAO;oBACV,QAAQ;oBACR,OAAO;oBACP,YAAY;oBACZ,aAAa,EAAE,MAAM,CAAC,aAAa;iBACpC,CAAC,CAAC;aACJ;SACF;QAED,IAAI,iBAAiB,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;YACjC,OAAO,IAAI,CAAC;SACb;QAED,IAAI,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE;YACxC,KAAK,GAAG,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAElB,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,MAAM,CAAC,OAAO,EAAE;QAClB,GAAG,GAAG,UAAU,CAAC,gBAAgB,EAAE,GAAG,EAAE,EAAC,GAAG,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,eAAe,EAAE,EAAC,CAAC,CAAC;KAC/G;IAED,GAAG,GAAG,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE,EAAC,GAAG,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAQ,CAAC,CAAC;IAE7E,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,QAAkB,CAAC,EAAE;QAC1C,GAAG,GAAG;YACJ,GAAG,GAAG;YACN,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,QAAkB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;SAC1D,CAAC;KACH;IAED,GAAG,GAAG,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAC,GAAG,OAAO,EAAE,QAAQ,EAAC,CAAC,CAAC;IACjE,GAAG,GAAG,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAE5C,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,UAAU,CAAC,EAAE;QAC3E,OAAO,GAAG,CAAC,IAAI,CAAC;KACjB;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,wBAAwB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import {isObject} from \"@tsed/core\";\nimport {mapAliasedProperties} from \"../domain/JsonAliasMap\";\nimport {JsonSchema} from \"../domain/JsonSchema\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {execMapper, registerJsonSchemaMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {getRequiredProperties} from \"../utils/getRequiredProperties\";\nimport {mapNullableType} from \"../utils/mapNullableType\";\n\n/**\n * @ignore\n */\nconst IGNORES = [\"name\", \"$required\", \"$hooks\", \"_nestedGenerics\", SpecTypes.OPENAPI, SpecTypes.SWAGGER, SpecTypes.JSON];\n/**\n * @ignore\n */\nconst IGNORES_OPENSPEC = [\"const\"];\nconst IGNORES_OS2 = [\"writeOnly\", \"readOnly\"];\n\n/**\n * @ignore\n */\nfunction isEmptyProperties(key: string, value: any) {\n return typeof value === \"object\" && [\"items\", \"properties\", \"additionalProperties\"].includes(key) && Object.keys(value).length === 0;\n}\n\n/**\n * @ignore\n */\nfunction shouldMapAlias(key: string, value: any, useAlias: boolean) {\n return typeof value === \"object\" && useAlias && [\"properties\", \"additionalProperties\"].includes(key);\n}\n\n/**\n * @ignore\n */\nfunction shouldSkipKey(key: string, {specType = SpecTypes.JSON, customKeys = false}: JsonSchemaOptions) {\n return (\n IGNORES.includes(key) ||\n (key.startsWith(\"#\") && (customKeys === false || specType !== SpecTypes.JSON)) ||\n (specType === SpecTypes.SWAGGER && IGNORES_OS2.includes(key)) ||\n (specType !== SpecTypes.JSON && IGNORES_OPENSPEC.includes(key))\n );\n}\n\nexport function schemaMapper(schema: JsonSchema, options: JsonSchemaOptions = {}): any {\n const {useAlias = true, schemas = {}, genericTypes} = options;\n\n let obj: any = [...schema.entries()].reduce((item: any, [key, value]) => {\n if (shouldSkipKey(key, options)) {\n return item;\n }\n\n key = key.replace(/^#/, \"\");\n\n if (key === \"type\") {\n value = schema.getJsonType();\n }\n\n if (key === \"examples\" && isObject(value) && [SpecTypes.OPENAPI, SpecTypes.SWAGGER].includes(options.specType!)) {\n key = \"example\";\n value = Object.values(value)[0];\n }\n\n if (value) {\n if (value.isClass) {\n value = execMapper(\"class\", value, {\n ...options,\n useAlias,\n schemas\n });\n } else {\n value = execMapper(\"any\", value, {\n ...options,\n useAlias,\n schemas,\n genericTypes,\n genericLabels: schema.genericLabels\n });\n }\n }\n\n if (isEmptyProperties(key, value)) {\n return item;\n }\n\n if (shouldMapAlias(key, value, useAlias)) {\n value = mapAliasedProperties(value, schema.alias);\n }\n\n item[key] = value;\n\n return item;\n }, {});\n\n if (schema.isClass) {\n obj = execMapper(\"inheritedClass\", obj, {...options, root: false, schemas, target: schema.getComputedType()});\n }\n\n obj = execMapper(\"generics\", obj, {...options, root: false, schemas} as any);\n\n if (schema.has(options.specType as string)) {\n obj = {\n ...obj,\n ...schema.get(options.specType as string).toJSON(options)\n };\n }\n\n obj = getRequiredProperties(obj, schema, {...options, useAlias});\n obj = mapNullableType(obj, schema, options);\n\n if ((obj.oneOf || obj.allOf || obj.anyOf) && !(obj.items || obj.properties)) {\n delete obj.type;\n }\n\n return obj;\n}\n\nregisterJsonSchemaMapper(\"schema\", schemaMapper);\n"]}
@@ -0,0 +1,43 @@
1
+ export const HTTP_METHODS = [
2
+ "all",
3
+ "checkout",
4
+ "connect",
5
+ "copy",
6
+ "delete",
7
+ "get",
8
+ "head",
9
+ "lock",
10
+ "merge",
11
+ "mkactivity",
12
+ "mkcol",
13
+ "move",
14
+ "m-search",
15
+ "notify",
16
+ "options",
17
+ "param",
18
+ "patch",
19
+ "post",
20
+ "propfind",
21
+ "propatch",
22
+ "purge",
23
+ "put",
24
+ "report",
25
+ "search",
26
+ "subscribe",
27
+ "trace",
28
+ "unlock",
29
+ "unsuscribe"
30
+ ];
31
+ export var OperationMethods;
32
+ (function (OperationMethods) {
33
+ OperationMethods["ALL"] = "ALL";
34
+ OperationMethods["GET"] = "GET";
35
+ OperationMethods["POST"] = "POST";
36
+ OperationMethods["PUT"] = "PUT";
37
+ OperationMethods["PATCH"] = "PATCH";
38
+ OperationMethods["HEAD"] = "HEAD";
39
+ OperationMethods["DELETE"] = "DELETE";
40
+ OperationMethods["OPTIONS"] = "OPTIONS";
41
+ OperationMethods["CUSTOM"] = "CUSTOM";
42
+ })(OperationMethods || (OperationMethods = {}));
43
+ //# sourceMappingURL=httpMethods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"httpMethods.js","sourceRoot":"","sources":["../../../src/constants/httpMethods.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK;IACL,UAAU;IACV,SAAS;IACT,MAAM;IACN,QAAQ;IACR,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,YAAY;IACZ,OAAO;IACP,MAAM;IACN,UAAU;IACV,QAAQ;IACR,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;IACP,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,OAAO;IACP,QAAQ;IACR,YAAY;CACb,CAAC;AAEF,MAAM,CAAN,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,+BAAW,CAAA;IACX,iCAAa,CAAA;IACb,+BAAW,CAAA;IACX,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;AACnB,CAAC,EAVW,gBAAgB,KAAhB,gBAAgB,QAU3B","sourcesContent":["export const HTTP_METHODS = [\n \"all\",\n \"checkout\",\n \"connect\",\n \"copy\",\n \"delete\",\n \"get\",\n \"head\",\n \"lock\",\n \"merge\",\n \"mkactivity\",\n \"mkcol\",\n \"move\",\n \"m-search\",\n \"notify\",\n \"options\",\n \"param\",\n \"patch\",\n \"post\",\n \"propfind\",\n \"propatch\",\n \"purge\",\n \"put\",\n \"report\",\n \"search\",\n \"subscribe\",\n \"trace\",\n \"unlock\",\n \"unsuscribe\"\n];\n\nexport enum OperationMethods {\n ALL = \"ALL\", // special key\n GET = \"GET\",\n POST = \"POST\",\n PUT = \"PUT\",\n PATCH = \"PATCH\",\n HEAD = \"HEAD\",\n DELETE = \"DELETE\",\n OPTIONS = \"OPTIONS\",\n CUSTOM = \"CUSTOM\"\n}\n"]}