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

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 (724) hide show
  1. package/benchmark/cold-start.js +17 -0
  2. package/jest.config.js +14 -0
  3. package/lib/cjs/components/anyMapper.js +23 -0
  4. package/lib/cjs/components/anyMapper.js.map +1 -0
  5. package/lib/cjs/components/classMapper.js +41 -0
  6. package/lib/cjs/components/classMapper.js.map +1 -0
  7. package/lib/cjs/components/genericsMapper.js +62 -0
  8. package/lib/cjs/components/genericsMapper.js.map +1 -0
  9. package/lib/cjs/components/index.js +15 -0
  10. package/lib/cjs/components/index.js.map +1 -0
  11. package/lib/cjs/components/inheritedClassMapper.js +22 -0
  12. package/lib/cjs/components/inheritedClassMapper.js.map +1 -0
  13. package/lib/cjs/components/itemMapper.js +10 -0
  14. package/lib/cjs/components/itemMapper.js.map +1 -0
  15. package/lib/cjs/components/lazyRefMapper.js +19 -0
  16. package/lib/cjs/components/lazyRefMapper.js.map +1 -0
  17. package/lib/cjs/components/mapMapper.js +25 -0
  18. package/lib/cjs/components/mapMapper.js.map +1 -0
  19. package/lib/cjs/components/objectMapper.js +31 -0
  20. package/lib/cjs/components/objectMapper.js.map +1 -0
  21. package/lib/cjs/components/ofMapper.js +17 -0
  22. package/lib/cjs/components/ofMapper.js.map +1 -0
  23. package/lib/cjs/components/propertiesMapper.js +25 -0
  24. package/lib/cjs/components/propertiesMapper.js.map +1 -0
  25. package/lib/cjs/components/schemaMapper.js +97 -0
  26. package/lib/cjs/components/schemaMapper.js.map +1 -0
  27. package/lib/cjs/constants/httpMethods.js +46 -0
  28. package/lib/cjs/constants/httpMethods.js.map +1 -0
  29. package/lib/cjs/constants/httpStatusMessages.js +110 -0
  30. package/lib/cjs/constants/httpStatusMessages.js.map +1 -0
  31. package/lib/cjs/decorators/class/children.js +24 -0
  32. package/lib/cjs/decorators/class/children.js.map +1 -0
  33. package/lib/cjs/decorators/collections/collectionContains.js +29 -0
  34. package/lib/cjs/decorators/collections/collectionContains.js.map +1 -0
  35. package/lib/cjs/decorators/collections/collectionOf.js +103 -0
  36. package/lib/cjs/decorators/collections/collectionOf.js.map +1 -0
  37. package/lib/cjs/decorators/collections/maxItems.js +60 -0
  38. package/lib/cjs/decorators/collections/maxItems.js.map +1 -0
  39. package/lib/cjs/decorators/collections/maxProperties.js +83 -0
  40. package/lib/cjs/decorators/collections/maxProperties.js.map +1 -0
  41. package/lib/cjs/decorators/collections/minItems.js +64 -0
  42. package/lib/cjs/decorators/collections/minItems.js.map +1 -0
  43. package/lib/cjs/decorators/collections/minProperties.js +82 -0
  44. package/lib/cjs/decorators/collections/minProperties.js.map +1 -0
  45. package/lib/cjs/decorators/collections/uniqueItems.js +60 -0
  46. package/lib/cjs/decorators/collections/uniqueItems.js.map +1 -0
  47. package/lib/cjs/decorators/common/additionalProperties.js +20 -0
  48. package/lib/cjs/decorators/common/additionalProperties.js.map +1 -0
  49. package/lib/cjs/decorators/common/allOf.js +22 -0
  50. package/lib/cjs/decorators/common/allOf.js.map +1 -0
  51. package/lib/cjs/decorators/common/allow.js +47 -0
  52. package/lib/cjs/decorators/common/allow.js.map +1 -0
  53. package/lib/cjs/decorators/common/any.js +46 -0
  54. package/lib/cjs/decorators/common/any.js.map +1 -0
  55. package/lib/cjs/decorators/common/anyOf.js +26 -0
  56. package/lib/cjs/decorators/common/anyOf.js.map +1 -0
  57. package/lib/cjs/decorators/common/const.js +70 -0
  58. package/lib/cjs/decorators/common/const.js.map +1 -0
  59. package/lib/cjs/decorators/common/customKey.js +43 -0
  60. package/lib/cjs/decorators/common/customKey.js.map +1 -0
  61. package/lib/cjs/decorators/common/default.js +51 -0
  62. package/lib/cjs/decorators/common/default.js.map +1 -0
  63. package/lib/cjs/decorators/common/description.js +76 -0
  64. package/lib/cjs/decorators/common/description.js.map +1 -0
  65. package/lib/cjs/decorators/common/enum.js +30 -0
  66. package/lib/cjs/decorators/common/enum.js.map +1 -0
  67. package/lib/cjs/decorators/common/example.js +21 -0
  68. package/lib/cjs/decorators/common/example.js.map +1 -0
  69. package/lib/cjs/decorators/common/examples.js +21 -0
  70. package/lib/cjs/decorators/common/examples.js.map +1 -0
  71. package/lib/cjs/decorators/common/exclusiveMaximum.js +77 -0
  72. package/lib/cjs/decorators/common/exclusiveMaximum.js.map +1 -0
  73. package/lib/cjs/decorators/common/exclusiveMinimum.js +77 -0
  74. package/lib/cjs/decorators/common/exclusiveMinimum.js.map +1 -0
  75. package/lib/cjs/decorators/common/format.js +486 -0
  76. package/lib/cjs/decorators/common/format.js.map +1 -0
  77. package/lib/cjs/decorators/common/forwardGroups.js +20 -0
  78. package/lib/cjs/decorators/common/forwardGroups.js.map +1 -0
  79. package/lib/cjs/decorators/common/groups.js +41 -0
  80. package/lib/cjs/decorators/common/groups.js.map +1 -0
  81. package/lib/cjs/decorators/common/hidden.js +40 -0
  82. package/lib/cjs/decorators/common/hidden.js.map +1 -0
  83. package/lib/cjs/decorators/common/ignore.js +71 -0
  84. package/lib/cjs/decorators/common/ignore.js.map +1 -0
  85. package/lib/cjs/decorators/common/integer.js +71 -0
  86. package/lib/cjs/decorators/common/integer.js.map +1 -0
  87. package/lib/cjs/decorators/common/jsonEntityFn.js +32 -0
  88. package/lib/cjs/decorators/common/jsonEntityFn.js.map +1 -0
  89. package/lib/cjs/decorators/common/maxLength.js +89 -0
  90. package/lib/cjs/decorators/common/maxLength.js.map +1 -0
  91. package/lib/cjs/decorators/common/maximum.js +151 -0
  92. package/lib/cjs/decorators/common/maximum.js.map +1 -0
  93. package/lib/cjs/decorators/common/minLength.js +90 -0
  94. package/lib/cjs/decorators/common/minLength.js.map +1 -0
  95. package/lib/cjs/decorators/common/minimum.js +149 -0
  96. package/lib/cjs/decorators/common/minimum.js.map +1 -0
  97. package/lib/cjs/decorators/common/multipleOf.js +81 -0
  98. package/lib/cjs/decorators/common/multipleOf.js.map +1 -0
  99. package/lib/cjs/decorators/common/name.js +52 -0
  100. package/lib/cjs/decorators/common/name.js.map +1 -0
  101. package/lib/cjs/decorators/common/nullable.js +34 -0
  102. package/lib/cjs/decorators/common/nullable.js.map +1 -0
  103. package/lib/cjs/decorators/common/oneOf.js +27 -0
  104. package/lib/cjs/decorators/common/oneOf.js.map +1 -0
  105. package/lib/cjs/decorators/common/optional.js +28 -0
  106. package/lib/cjs/decorators/common/optional.js.map +1 -0
  107. package/lib/cjs/decorators/common/pattern.js +103 -0
  108. package/lib/cjs/decorators/common/pattern.js.map +1 -0
  109. package/lib/cjs/decorators/common/property.js +27 -0
  110. package/lib/cjs/decorators/common/property.js.map +1 -0
  111. package/lib/cjs/decorators/common/readOnly.js +21 -0
  112. package/lib/cjs/decorators/common/readOnly.js.map +1 -0
  113. package/lib/cjs/decorators/common/required.js +53 -0
  114. package/lib/cjs/decorators/common/required.js.map +1 -0
  115. package/lib/cjs/decorators/common/requiredGroups.js +26 -0
  116. package/lib/cjs/decorators/common/requiredGroups.js.map +1 -0
  117. package/lib/cjs/decorators/common/schema.js +68 -0
  118. package/lib/cjs/decorators/common/schema.js.map +1 -0
  119. package/lib/cjs/decorators/common/title.js +49 -0
  120. package/lib/cjs/decorators/common/title.js.map +1 -0
  121. package/lib/cjs/decorators/common/writeOnly.js +21 -0
  122. package/lib/cjs/decorators/common/writeOnly.js.map +1 -0
  123. package/lib/cjs/decorators/config/jsonEntityComponent.js +18 -0
  124. package/lib/cjs/decorators/config/jsonEntityComponent.js.map +1 -0
  125. package/lib/cjs/decorators/generics/genericOf.js +99 -0
  126. package/lib/cjs/decorators/generics/genericOf.js.map +1 -0
  127. package/lib/cjs/decorators/generics/generics.js +25 -0
  128. package/lib/cjs/decorators/generics/generics.js.map +1 -0
  129. package/lib/cjs/decorators/index.js +77 -0
  130. package/lib/cjs/decorators/index.js.map +1 -0
  131. package/lib/cjs/decorators/operations/consumes.js +39 -0
  132. package/lib/cjs/decorators/operations/consumes.js.map +1 -0
  133. package/lib/cjs/decorators/operations/contentType.js +28 -0
  134. package/lib/cjs/decorators/operations/contentType.js.map +1 -0
  135. package/lib/cjs/decorators/operations/deprecated.js +43 -0
  136. package/lib/cjs/decorators/operations/deprecated.js.map +1 -0
  137. package/lib/cjs/decorators/operations/header.js +59 -0
  138. package/lib/cjs/decorators/operations/header.js.map +1 -0
  139. package/lib/cjs/decorators/operations/in.js +78 -0
  140. package/lib/cjs/decorators/operations/in.js.map +1 -0
  141. package/lib/cjs/decorators/operations/inFile.js +45 -0
  142. package/lib/cjs/decorators/operations/inFile.js.map +1 -0
  143. package/lib/cjs/decorators/operations/location.js +29 -0
  144. package/lib/cjs/decorators/operations/location.js.map +1 -0
  145. package/lib/cjs/decorators/operations/operationId.js +24 -0
  146. package/lib/cjs/decorators/operations/operationId.js.map +1 -0
  147. package/lib/cjs/decorators/operations/operationPath.js +34 -0
  148. package/lib/cjs/decorators/operations/operationPath.js.map +1 -0
  149. package/lib/cjs/decorators/operations/partial.js +18 -0
  150. package/lib/cjs/decorators/operations/partial.js.map +1 -0
  151. package/lib/cjs/decorators/operations/path.js +29 -0
  152. package/lib/cjs/decorators/operations/path.js.map +1 -0
  153. package/lib/cjs/decorators/operations/produces.js +46 -0
  154. package/lib/cjs/decorators/operations/produces.js.map +1 -0
  155. package/lib/cjs/decorators/operations/redirect.js +26 -0
  156. package/lib/cjs/decorators/operations/redirect.js.map +1 -0
  157. package/lib/cjs/decorators/operations/returns.js +252 -0
  158. package/lib/cjs/decorators/operations/returns.js.map +1 -0
  159. package/lib/cjs/decorators/operations/route.js +200 -0
  160. package/lib/cjs/decorators/operations/route.js.map +1 -0
  161. package/lib/cjs/decorators/operations/security.js +43 -0
  162. package/lib/cjs/decorators/operations/security.js.map +1 -0
  163. package/lib/cjs/decorators/operations/status.js +133 -0
  164. package/lib/cjs/decorators/operations/status.js.map +1 -0
  165. package/lib/cjs/decorators/operations/summary.js +34 -0
  166. package/lib/cjs/decorators/operations/summary.js.map +1 -0
  167. package/lib/cjs/decorators/operations/tags.js +52 -0
  168. package/lib/cjs/decorators/operations/tags.js.map +1 -0
  169. package/lib/cjs/domain/DecoratorContext.js +88 -0
  170. package/lib/cjs/domain/DecoratorContext.js.map +1 -0
  171. package/lib/cjs/domain/JsonAliasMap.js +15 -0
  172. package/lib/cjs/domain/JsonAliasMap.js.map +1 -0
  173. package/lib/cjs/domain/JsonClassStore.js +37 -0
  174. package/lib/cjs/domain/JsonClassStore.js.map +1 -0
  175. package/lib/cjs/domain/JsonEntityStore.js +166 -0
  176. package/lib/cjs/domain/JsonEntityStore.js.map +1 -0
  177. package/lib/cjs/domain/JsonFormatTypes.js +22 -0
  178. package/lib/cjs/domain/JsonFormatTypes.js.map +1 -0
  179. package/lib/cjs/domain/JsonLazyRef.js +26 -0
  180. package/lib/cjs/domain/JsonLazyRef.js.map +1 -0
  181. package/lib/cjs/domain/JsonMap.js +27 -0
  182. package/lib/cjs/domain/JsonMap.js.map +1 -0
  183. package/lib/cjs/domain/JsonMethodStore.js +101 -0
  184. package/lib/cjs/domain/JsonMethodStore.js.map +1 -0
  185. package/lib/cjs/domain/JsonOperation.js +250 -0
  186. package/lib/cjs/domain/JsonOperation.js.map +1 -0
  187. package/lib/cjs/domain/JsonOperationPathsMap.js +29 -0
  188. package/lib/cjs/domain/JsonOperationPathsMap.js.map +1 -0
  189. package/lib/cjs/domain/JsonOperationRoute.js +56 -0
  190. package/lib/cjs/domain/JsonOperationRoute.js.map +1 -0
  191. package/lib/cjs/domain/JsonParameter.js +157 -0
  192. package/lib/cjs/domain/JsonParameter.js.map +1 -0
  193. package/lib/cjs/domain/JsonParameterStore.js +90 -0
  194. package/lib/cjs/domain/JsonParameterStore.js.map +1 -0
  195. package/lib/cjs/domain/JsonParameterTypes.js +27 -0
  196. package/lib/cjs/domain/JsonParameterTypes.js.map +1 -0
  197. package/lib/cjs/domain/JsonPropertyStore.js +68 -0
  198. package/lib/cjs/domain/JsonPropertyStore.js.map +1 -0
  199. package/lib/cjs/domain/JsonRequestBody.js +32 -0
  200. package/lib/cjs/domain/JsonRequestBody.js.map +1 -0
  201. package/lib/cjs/domain/JsonResponse.js +86 -0
  202. package/lib/cjs/domain/JsonResponse.js.map +1 -0
  203. package/lib/cjs/domain/JsonSchema.js +723 -0
  204. package/lib/cjs/domain/JsonSchema.js.map +1 -0
  205. package/lib/cjs/domain/SpecTypes.js +13 -0
  206. package/lib/cjs/domain/SpecTypes.js.map +1 -0
  207. package/lib/cjs/domain/index.js +20 -0
  208. package/lib/cjs/domain/index.js.map +1 -0
  209. package/lib/cjs/hooks/alterIgnore.js +21 -0
  210. package/lib/cjs/hooks/alterIgnore.js.map +1 -0
  211. package/lib/cjs/hooks/alterOneOf.js +14 -0
  212. package/lib/cjs/hooks/alterOneOf.js.map +1 -0
  213. package/lib/cjs/hooks/alterRequiredGroups.js +15 -0
  214. package/lib/cjs/hooks/alterRequiredGroups.js.map +1 -0
  215. package/lib/cjs/index.js +24 -0
  216. package/lib/cjs/index.js.map +1 -0
  217. package/lib/cjs/interfaces/IgnoreCallback.js +3 -0
  218. package/lib/cjs/interfaces/IgnoreCallback.js.map +1 -0
  219. package/lib/cjs/interfaces/JsonHookContext.js +3 -0
  220. package/lib/cjs/interfaces/JsonHookContext.js.map +1 -0
  221. package/lib/cjs/interfaces/JsonOpenSpec.js +3 -0
  222. package/lib/cjs/interfaces/JsonOpenSpec.js.map +1 -0
  223. package/lib/cjs/interfaces/JsonSchemaOptions.js +3 -0
  224. package/lib/cjs/interfaces/JsonSchemaOptions.js.map +1 -0
  225. package/lib/cjs/interfaces/index.js +8 -0
  226. package/lib/cjs/interfaces/index.js.map +1 -0
  227. package/lib/cjs/registries/JsonSchemaMapperContainer.js +37 -0
  228. package/lib/cjs/registries/JsonSchemaMapperContainer.js.map +1 -0
  229. package/lib/cjs/utils/buildPath.js +13 -0
  230. package/lib/cjs/utils/buildPath.js.map +1 -0
  231. package/lib/cjs/utils/concatParameters.js +16 -0
  232. package/lib/cjs/utils/concatParameters.js.map +1 -0
  233. package/lib/cjs/utils/concatPath.js +8 -0
  234. package/lib/cjs/utils/concatPath.js.map +1 -0
  235. package/lib/cjs/utils/defineStatusModel.js +13 -0
  236. package/lib/cjs/utils/defineStatusModel.js.map +1 -0
  237. package/lib/cjs/utils/from.js +272 -0
  238. package/lib/cjs/utils/from.js.map +1 -0
  239. package/lib/cjs/utils/generics.js +40 -0
  240. package/lib/cjs/utils/generics.js.map +1 -0
  241. package/lib/cjs/utils/getComputedType.js +26 -0
  242. package/lib/cjs/utils/getComputedType.js.map +1 -0
  243. package/lib/cjs/utils/getInheritedStores.js +23 -0
  244. package/lib/cjs/utils/getInheritedStores.js.map +1 -0
  245. package/lib/cjs/utils/getJsonEntityStore.js +18 -0
  246. package/lib/cjs/utils/getJsonEntityStore.js.map +1 -0
  247. package/lib/cjs/utils/getJsonPathParameters.js +73 -0
  248. package/lib/cjs/utils/getJsonPathParameters.js.map +1 -0
  249. package/lib/cjs/utils/getJsonSchema.js +55 -0
  250. package/lib/cjs/utils/getJsonSchema.js.map +1 -0
  251. package/lib/cjs/utils/getJsonType.js +40 -0
  252. package/lib/cjs/utils/getJsonType.js.map +1 -0
  253. package/lib/cjs/utils/getOperationsRoutes.js +36 -0
  254. package/lib/cjs/utils/getOperationsRoutes.js.map +1 -0
  255. package/lib/cjs/utils/getOperationsStores.js +33 -0
  256. package/lib/cjs/utils/getOperationsStores.js.map +1 -0
  257. package/lib/cjs/utils/getPropertiesStores.js +45 -0
  258. package/lib/cjs/utils/getPropertiesStores.js.map +1 -0
  259. package/lib/cjs/utils/getRequiredProperties.js +66 -0
  260. package/lib/cjs/utils/getRequiredProperties.js.map +1 -0
  261. package/lib/cjs/utils/getSpec.js +87 -0
  262. package/lib/cjs/utils/getSpec.js.map +1 -0
  263. package/lib/cjs/utils/isSuccessStatus.js +8 -0
  264. package/lib/cjs/utils/isSuccessStatus.js.map +1 -0
  265. package/lib/cjs/utils/mapHeaders.js +29 -0
  266. package/lib/cjs/utils/mapHeaders.js.map +1 -0
  267. package/lib/cjs/utils/mapNullableType.js +49 -0
  268. package/lib/cjs/utils/mapNullableType.js.map +1 -0
  269. package/lib/cjs/utils/mapRouteOptions.js +26 -0
  270. package/lib/cjs/utils/mapRouteOptions.js.map +1 -0
  271. package/lib/cjs/utils/matchGroups.js +23 -0
  272. package/lib/cjs/utils/matchGroups.js.map +1 -0
  273. package/lib/cjs/utils/mergeOperation.js +44 -0
  274. package/lib/cjs/utils/mergeOperation.js.map +1 -0
  275. package/lib/cjs/utils/mergeSpec.js +46 -0
  276. package/lib/cjs/utils/mergeSpec.js.map +1 -0
  277. package/lib/cjs/utils/operationIdFormatter.js +37 -0
  278. package/lib/cjs/utils/operationIdFormatter.js.map +1 -0
  279. package/lib/cjs/utils/ref.js +73 -0
  280. package/lib/cjs/utils/ref.js.map +1 -0
  281. package/lib/cjs/utils/toJsonMapCollection.js +15 -0
  282. package/lib/cjs/utils/toJsonMapCollection.js.map +1 -0
  283. package/lib/cjs/utils/toJsonRegex.js +12 -0
  284. package/lib/cjs/utils/toJsonRegex.js.map +1 -0
  285. package/lib/esm/components/anyMapper.js +19 -0
  286. package/lib/esm/components/anyMapper.js.map +1 -0
  287. package/lib/esm/components/classMapper.js +37 -0
  288. package/lib/esm/components/classMapper.js.map +1 -0
  289. package/lib/esm/components/genericsMapper.js +58 -0
  290. package/lib/esm/components/genericsMapper.js.map +1 -0
  291. package/lib/esm/components/index.js +12 -0
  292. package/lib/esm/components/index.js.map +1 -0
  293. package/lib/esm/components/inheritedClassMapper.js +18 -0
  294. package/lib/esm/components/inheritedClassMapper.js.map +1 -0
  295. package/lib/esm/components/itemMapper.js +6 -0
  296. package/lib/esm/components/itemMapper.js.map +1 -0
  297. package/lib/esm/components/lazyRefMapper.js +15 -0
  298. package/lib/esm/components/lazyRefMapper.js.map +1 -0
  299. package/lib/esm/components/mapMapper.js +21 -0
  300. package/lib/esm/components/mapMapper.js.map +1 -0
  301. package/lib/esm/components/objectMapper.js +27 -0
  302. package/lib/esm/components/objectMapper.js.map +1 -0
  303. package/lib/esm/components/ofMapper.js +13 -0
  304. package/lib/esm/components/ofMapper.js.map +1 -0
  305. package/lib/esm/components/propertiesMapper.js +21 -0
  306. package/lib/esm/components/propertiesMapper.js.map +1 -0
  307. package/lib/esm/components/schemaMapper.js +93 -0
  308. package/lib/esm/components/schemaMapper.js.map +1 -0
  309. package/lib/esm/constants/httpMethods.js +43 -0
  310. package/lib/esm/constants/httpMethods.js.map +1 -0
  311. package/lib/esm/constants/httpStatusMessages.js +105 -0
  312. package/lib/esm/constants/httpStatusMessages.js.map +1 -0
  313. package/lib/esm/decorators/class/children.js +20 -0
  314. package/lib/esm/decorators/class/children.js.map +1 -0
  315. package/lib/esm/decorators/collections/collectionContains.js +25 -0
  316. package/lib/esm/decorators/collections/collectionContains.js.map +1 -0
  317. package/lib/esm/decorators/collections/collectionOf.js +97 -0
  318. package/lib/esm/decorators/collections/collectionOf.js.map +1 -0
  319. package/lib/esm/decorators/collections/maxItems.js +56 -0
  320. package/lib/esm/decorators/collections/maxItems.js.map +1 -0
  321. package/lib/esm/decorators/collections/maxProperties.js +79 -0
  322. package/lib/esm/decorators/collections/maxProperties.js.map +1 -0
  323. package/lib/esm/decorators/collections/minItems.js +60 -0
  324. package/lib/esm/decorators/collections/minItems.js.map +1 -0
  325. package/lib/esm/decorators/collections/minProperties.js +78 -0
  326. package/lib/esm/decorators/collections/minProperties.js.map +1 -0
  327. package/lib/esm/decorators/collections/uniqueItems.js +56 -0
  328. package/lib/esm/decorators/collections/uniqueItems.js.map +1 -0
  329. package/lib/esm/decorators/common/additionalProperties.js +16 -0
  330. package/lib/esm/decorators/common/additionalProperties.js.map +1 -0
  331. package/lib/esm/decorators/common/allOf.js +18 -0
  332. package/lib/esm/decorators/common/allOf.js.map +1 -0
  333. package/lib/esm/decorators/common/allow.js +43 -0
  334. package/lib/esm/decorators/common/allow.js.map +1 -0
  335. package/lib/esm/decorators/common/any.js +42 -0
  336. package/lib/esm/decorators/common/any.js.map +1 -0
  337. package/lib/esm/decorators/common/anyOf.js +22 -0
  338. package/lib/esm/decorators/common/anyOf.js.map +1 -0
  339. package/lib/esm/decorators/common/const.js +66 -0
  340. package/lib/esm/decorators/common/const.js.map +1 -0
  341. package/lib/esm/decorators/common/customKey.js +38 -0
  342. package/lib/esm/decorators/common/customKey.js.map +1 -0
  343. package/lib/esm/decorators/common/default.js +47 -0
  344. package/lib/esm/decorators/common/default.js.map +1 -0
  345. package/lib/esm/decorators/common/description.js +72 -0
  346. package/lib/esm/decorators/common/description.js.map +1 -0
  347. package/lib/esm/decorators/common/enum.js +26 -0
  348. package/lib/esm/decorators/common/enum.js.map +1 -0
  349. package/lib/esm/decorators/common/example.js +17 -0
  350. package/lib/esm/decorators/common/example.js.map +1 -0
  351. package/lib/esm/decorators/common/examples.js +17 -0
  352. package/lib/esm/decorators/common/examples.js.map +1 -0
  353. package/lib/esm/decorators/common/exclusiveMaximum.js +73 -0
  354. package/lib/esm/decorators/common/exclusiveMaximum.js.map +1 -0
  355. package/lib/esm/decorators/common/exclusiveMinimum.js +73 -0
  356. package/lib/esm/decorators/common/exclusiveMinimum.js.map +1 -0
  357. package/lib/esm/decorators/common/format.js +476 -0
  358. package/lib/esm/decorators/common/format.js.map +1 -0
  359. package/lib/esm/decorators/common/forwardGroups.js +16 -0
  360. package/lib/esm/decorators/common/forwardGroups.js.map +1 -0
  361. package/lib/esm/decorators/common/groups.js +37 -0
  362. package/lib/esm/decorators/common/groups.js.map +1 -0
  363. package/lib/esm/decorators/common/hidden.js +36 -0
  364. package/lib/esm/decorators/common/hidden.js.map +1 -0
  365. package/lib/esm/decorators/common/ignore.js +67 -0
  366. package/lib/esm/decorators/common/ignore.js.map +1 -0
  367. package/lib/esm/decorators/common/integer.js +67 -0
  368. package/lib/esm/decorators/common/integer.js.map +1 -0
  369. package/lib/esm/decorators/common/jsonEntityFn.js +28 -0
  370. package/lib/esm/decorators/common/jsonEntityFn.js.map +1 -0
  371. package/lib/esm/decorators/common/maxLength.js +85 -0
  372. package/lib/esm/decorators/common/maxLength.js.map +1 -0
  373. package/lib/esm/decorators/common/maximum.js +146 -0
  374. package/lib/esm/decorators/common/maximum.js.map +1 -0
  375. package/lib/esm/decorators/common/minLength.js +86 -0
  376. package/lib/esm/decorators/common/minLength.js.map +1 -0
  377. package/lib/esm/decorators/common/minimum.js +144 -0
  378. package/lib/esm/decorators/common/minimum.js.map +1 -0
  379. package/lib/esm/decorators/common/multipleOf.js +77 -0
  380. package/lib/esm/decorators/common/multipleOf.js.map +1 -0
  381. package/lib/esm/decorators/common/name.js +48 -0
  382. package/lib/esm/decorators/common/name.js.map +1 -0
  383. package/lib/esm/decorators/common/nullable.js +30 -0
  384. package/lib/esm/decorators/common/nullable.js.map +1 -0
  385. package/lib/esm/decorators/common/oneOf.js +23 -0
  386. package/lib/esm/decorators/common/oneOf.js.map +1 -0
  387. package/lib/esm/decorators/common/optional.js +24 -0
  388. package/lib/esm/decorators/common/optional.js.map +1 -0
  389. package/lib/esm/decorators/common/pattern.js +99 -0
  390. package/lib/esm/decorators/common/pattern.js.map +1 -0
  391. package/lib/esm/decorators/common/property.js +23 -0
  392. package/lib/esm/decorators/common/property.js.map +1 -0
  393. package/lib/esm/decorators/common/readOnly.js +17 -0
  394. package/lib/esm/decorators/common/readOnly.js.map +1 -0
  395. package/lib/esm/decorators/common/required.js +49 -0
  396. package/lib/esm/decorators/common/required.js.map +1 -0
  397. package/lib/esm/decorators/common/requiredGroups.js +22 -0
  398. package/lib/esm/decorators/common/requiredGroups.js.map +1 -0
  399. package/lib/esm/decorators/common/schema.js +63 -0
  400. package/lib/esm/decorators/common/schema.js.map +1 -0
  401. package/lib/esm/decorators/common/title.js +45 -0
  402. package/lib/esm/decorators/common/title.js.map +1 -0
  403. package/lib/esm/decorators/common/writeOnly.js +17 -0
  404. package/lib/esm/decorators/common/writeOnly.js.map +1 -0
  405. package/lib/esm/decorators/config/jsonEntityComponent.js +14 -0
  406. package/lib/esm/decorators/config/jsonEntityComponent.js.map +1 -0
  407. package/lib/esm/decorators/generics/genericOf.js +95 -0
  408. package/lib/esm/decorators/generics/genericOf.js.map +1 -0
  409. package/lib/esm/decorators/generics/generics.js +21 -0
  410. package/lib/esm/decorators/generics/generics.js.map +1 -0
  411. package/lib/esm/decorators/index.js +74 -0
  412. package/lib/esm/decorators/index.js.map +1 -0
  413. package/lib/esm/decorators/operations/consumes.js +35 -0
  414. package/lib/esm/decorators/operations/consumes.js.map +1 -0
  415. package/lib/esm/decorators/operations/contentType.js +24 -0
  416. package/lib/esm/decorators/operations/contentType.js.map +1 -0
  417. package/lib/esm/decorators/operations/deprecated.js +39 -0
  418. package/lib/esm/decorators/operations/deprecated.js.map +1 -0
  419. package/lib/esm/decorators/operations/header.js +55 -0
  420. package/lib/esm/decorators/operations/header.js.map +1 -0
  421. package/lib/esm/decorators/operations/in.js +74 -0
  422. package/lib/esm/decorators/operations/in.js.map +1 -0
  423. package/lib/esm/decorators/operations/inFile.js +41 -0
  424. package/lib/esm/decorators/operations/inFile.js.map +1 -0
  425. package/lib/esm/decorators/operations/location.js +25 -0
  426. package/lib/esm/decorators/operations/location.js.map +1 -0
  427. package/lib/esm/decorators/operations/operationId.js +20 -0
  428. package/lib/esm/decorators/operations/operationId.js.map +1 -0
  429. package/lib/esm/decorators/operations/operationPath.js +30 -0
  430. package/lib/esm/decorators/operations/operationPath.js.map +1 -0
  431. package/lib/esm/decorators/operations/partial.js +14 -0
  432. package/lib/esm/decorators/operations/partial.js.map +1 -0
  433. package/lib/esm/decorators/operations/path.js +25 -0
  434. package/lib/esm/decorators/operations/path.js.map +1 -0
  435. package/lib/esm/decorators/operations/produces.js +42 -0
  436. package/lib/esm/decorators/operations/produces.js.map +1 -0
  437. package/lib/esm/decorators/operations/redirect.js +22 -0
  438. package/lib/esm/decorators/operations/redirect.js.map +1 -0
  439. package/lib/esm/decorators/operations/returns.js +248 -0
  440. package/lib/esm/decorators/operations/returns.js.map +1 -0
  441. package/lib/esm/decorators/operations/route.js +188 -0
  442. package/lib/esm/decorators/operations/route.js.map +1 -0
  443. package/lib/esm/decorators/operations/security.js +39 -0
  444. package/lib/esm/decorators/operations/security.js.map +1 -0
  445. package/lib/esm/decorators/operations/status.js +129 -0
  446. package/lib/esm/decorators/operations/status.js.map +1 -0
  447. package/lib/esm/decorators/operations/summary.js +30 -0
  448. package/lib/esm/decorators/operations/summary.js.map +1 -0
  449. package/lib/esm/decorators/operations/tags.js +48 -0
  450. package/lib/esm/decorators/operations/tags.js.map +1 -0
  451. package/lib/esm/domain/DecoratorContext.js +84 -0
  452. package/lib/esm/domain/DecoratorContext.js.map +1 -0
  453. package/lib/esm/domain/JsonAliasMap.js +11 -0
  454. package/lib/esm/domain/JsonAliasMap.js.map +1 -0
  455. package/lib/esm/domain/JsonClassStore.js +34 -0
  456. package/lib/esm/domain/JsonClassStore.js.map +1 -0
  457. package/lib/esm/domain/JsonEntityStore.js +162 -0
  458. package/lib/esm/domain/JsonEntityStore.js.map +1 -0
  459. package/lib/esm/domain/JsonFormatTypes.js +19 -0
  460. package/lib/esm/domain/JsonFormatTypes.js.map +1 -0
  461. package/lib/esm/domain/JsonLazyRef.js +22 -0
  462. package/lib/esm/domain/JsonLazyRef.js.map +1 -0
  463. package/lib/esm/domain/JsonMap.js +23 -0
  464. package/lib/esm/domain/JsonMap.js.map +1 -0
  465. package/lib/esm/domain/JsonMethodStore.js +98 -0
  466. package/lib/esm/domain/JsonMethodStore.js.map +1 -0
  467. package/lib/esm/domain/JsonOperation.js +246 -0
  468. package/lib/esm/domain/JsonOperation.js.map +1 -0
  469. package/lib/esm/domain/JsonOperationPathsMap.js +25 -0
  470. package/lib/esm/domain/JsonOperationPathsMap.js.map +1 -0
  471. package/lib/esm/domain/JsonOperationRoute.js +52 -0
  472. package/lib/esm/domain/JsonOperationRoute.js.map +1 -0
  473. package/lib/esm/domain/JsonParameter.js +153 -0
  474. package/lib/esm/domain/JsonParameter.js.map +1 -0
  475. package/lib/esm/domain/JsonParameterStore.js +87 -0
  476. package/lib/esm/domain/JsonParameterStore.js.map +1 -0
  477. package/lib/esm/domain/JsonParameterTypes.js +22 -0
  478. package/lib/esm/domain/JsonParameterTypes.js.map +1 -0
  479. package/lib/esm/domain/JsonPropertyStore.js +65 -0
  480. package/lib/esm/domain/JsonPropertyStore.js.map +1 -0
  481. package/lib/esm/domain/JsonRequestBody.js +28 -0
  482. package/lib/esm/domain/JsonRequestBody.js.map +1 -0
  483. package/lib/esm/domain/JsonResponse.js +81 -0
  484. package/lib/esm/domain/JsonResponse.js.map +1 -0
  485. package/lib/esm/domain/JsonSchema.js +719 -0
  486. package/lib/esm/domain/JsonSchema.js.map +1 -0
  487. package/lib/esm/domain/SpecTypes.js +10 -0
  488. package/lib/esm/domain/SpecTypes.js.map +1 -0
  489. package/lib/esm/domain/index.js +17 -0
  490. package/lib/esm/domain/index.js.map +1 -0
  491. package/lib/esm/hooks/alterIgnore.js +17 -0
  492. package/lib/esm/hooks/alterIgnore.js.map +1 -0
  493. package/lib/esm/hooks/alterOneOf.js +10 -0
  494. package/lib/esm/hooks/alterOneOf.js.map +1 -0
  495. package/lib/esm/hooks/alterRequiredGroups.js +11 -0
  496. package/lib/esm/hooks/alterRequiredGroups.js.map +1 -0
  497. package/lib/esm/index.js +21 -0
  498. package/lib/esm/index.js.map +1 -0
  499. package/lib/esm/interfaces/IgnoreCallback.js +2 -0
  500. package/lib/esm/interfaces/IgnoreCallback.js.map +1 -0
  501. package/lib/esm/interfaces/JsonHookContext.js +2 -0
  502. package/lib/esm/interfaces/JsonHookContext.js.map +1 -0
  503. package/lib/esm/interfaces/JsonOpenSpec.js +2 -0
  504. package/lib/esm/interfaces/JsonOpenSpec.js.map +1 -0
  505. package/lib/esm/interfaces/JsonSchemaOptions.js +2 -0
  506. package/lib/esm/interfaces/JsonSchemaOptions.js.map +1 -0
  507. package/lib/esm/interfaces/index.js +5 -0
  508. package/lib/esm/interfaces/index.js.map +1 -0
  509. package/lib/esm/registries/JsonSchemaMapperContainer.js +30 -0
  510. package/lib/esm/registries/JsonSchemaMapperContainer.js.map +1 -0
  511. package/lib/esm/utils/buildPath.js +9 -0
  512. package/lib/esm/utils/buildPath.js.map +1 -0
  513. package/lib/esm/utils/concatParameters.js +12 -0
  514. package/lib/esm/utils/concatParameters.js.map +1 -0
  515. package/lib/esm/utils/concatPath.js +4 -0
  516. package/lib/esm/utils/concatPath.js.map +1 -0
  517. package/lib/esm/utils/defineStatusModel.js +8 -0
  518. package/lib/esm/utils/defineStatusModel.js.map +1 -0
  519. package/lib/esm/utils/from.js +249 -0
  520. package/lib/esm/utils/from.js.map +1 -0
  521. package/lib/esm/utils/generics.js +34 -0
  522. package/lib/esm/utils/generics.js.map +1 -0
  523. package/lib/esm/utils/getComputedType.js +22 -0
  524. package/lib/esm/utils/getComputedType.js.map +1 -0
  525. package/lib/esm/utils/getInheritedStores.js +19 -0
  526. package/lib/esm/utils/getInheritedStores.js.map +1 -0
  527. package/lib/esm/utils/getJsonEntityStore.js +14 -0
  528. package/lib/esm/utils/getJsonEntityStore.js.map +1 -0
  529. package/lib/esm/utils/getJsonPathParameters.js +69 -0
  530. package/lib/esm/utils/getJsonPathParameters.js.map +1 -0
  531. package/lib/esm/utils/getJsonSchema.js +51 -0
  532. package/lib/esm/utils/getJsonSchema.js.map +1 -0
  533. package/lib/esm/utils/getJsonType.js +36 -0
  534. package/lib/esm/utils/getJsonType.js.map +1 -0
  535. package/lib/esm/utils/getOperationsRoutes.js +32 -0
  536. package/lib/esm/utils/getOperationsRoutes.js.map +1 -0
  537. package/lib/esm/utils/getOperationsStores.js +29 -0
  538. package/lib/esm/utils/getOperationsStores.js.map +1 -0
  539. package/lib/esm/utils/getPropertiesStores.js +40 -0
  540. package/lib/esm/utils/getPropertiesStores.js.map +1 -0
  541. package/lib/esm/utils/getRequiredProperties.js +62 -0
  542. package/lib/esm/utils/getRequiredProperties.js.map +1 -0
  543. package/lib/esm/utils/getSpec.js +83 -0
  544. package/lib/esm/utils/getSpec.js.map +1 -0
  545. package/lib/esm/utils/isSuccessStatus.js +3 -0
  546. package/lib/esm/utils/isSuccessStatus.js.map +1 -0
  547. package/lib/esm/utils/mapHeaders.js +25 -0
  548. package/lib/esm/utils/mapHeaders.js.map +1 -0
  549. package/lib/esm/utils/mapNullableType.js +45 -0
  550. package/lib/esm/utils/mapNullableType.js.map +1 -0
  551. package/lib/esm/utils/mapRouteOptions.js +22 -0
  552. package/lib/esm/utils/mapRouteOptions.js.map +1 -0
  553. package/lib/esm/utils/matchGroups.js +18 -0
  554. package/lib/esm/utils/matchGroups.js.map +1 -0
  555. package/lib/esm/utils/mergeOperation.js +40 -0
  556. package/lib/esm/utils/mergeOperation.js.map +1 -0
  557. package/lib/esm/utils/mergeSpec.js +42 -0
  558. package/lib/esm/utils/mergeSpec.js.map +1 -0
  559. package/lib/esm/utils/operationIdFormatter.js +33 -0
  560. package/lib/esm/utils/operationIdFormatter.js.map +1 -0
  561. package/lib/esm/utils/ref.js +67 -0
  562. package/lib/esm/utils/ref.js.map +1 -0
  563. package/lib/esm/utils/toJsonMapCollection.js +11 -0
  564. package/lib/esm/utils/toJsonMapCollection.js.map +1 -0
  565. package/lib/esm/utils/toJsonRegex.js +8 -0
  566. package/lib/esm/utils/toJsonRegex.js.map +1 -0
  567. package/lib/{components → types/components}/anyMapper.d.ts +0 -0
  568. package/lib/{components → types/components}/classMapper.d.ts +1 -1
  569. package/lib/{components → types/components}/genericsMapper.d.ts +0 -0
  570. package/lib/{components → types/components}/index.d.ts +2 -0
  571. package/lib/{components → types/components}/inheritedClassMapper.d.ts +1 -1
  572. package/lib/{components → types/components}/itemMapper.d.ts +0 -0
  573. package/lib/types/components/lazyRefMapper.d.ts +3 -0
  574. package/lib/{components → types/components}/mapMapper.d.ts +1 -1
  575. package/lib/{components → types/components}/objectMapper.d.ts +0 -0
  576. package/lib/types/components/ofMapper.d.ts +3 -0
  577. package/lib/types/components/propertiesMapper.d.ts +3 -0
  578. package/lib/{components → types/components}/schemaMapper.d.ts +1 -1
  579. package/lib/{constants → types/constants}/httpMethods.d.ts +0 -0
  580. package/lib/types/constants/httpStatusMessages.d.ts +272 -0
  581. package/lib/types/decorators/class/children.d.ts +11 -0
  582. package/lib/{decorators → types/decorators}/collections/collectionContains.d.ts +0 -0
  583. package/lib/{decorators → types/decorators}/collections/collectionOf.d.ts +1 -1
  584. package/lib/{decorators → types/decorators}/collections/maxItems.d.ts +0 -0
  585. package/lib/{decorators → types/decorators}/collections/maxProperties.d.ts +0 -0
  586. package/lib/{decorators → types/decorators}/collections/minItems.d.ts +0 -0
  587. package/lib/{decorators → types/decorators}/collections/minProperties.d.ts +0 -0
  588. package/lib/{decorators → types/decorators}/collections/uniqueItems.d.ts +0 -0
  589. package/lib/{decorators → types/decorators}/common/additionalProperties.d.ts +0 -0
  590. package/lib/{decorators → types/decorators}/common/allOf.d.ts +0 -0
  591. package/lib/{decorators → types/decorators}/common/allow.d.ts +0 -0
  592. package/lib/{decorators → types/decorators}/common/any.d.ts +1 -1
  593. package/lib/{decorators → types/decorators}/common/anyOf.d.ts +0 -0
  594. package/lib/{decorators → types/decorators}/common/const.d.ts +1 -1
  595. package/lib/{decorators → types/decorators}/common/customKey.d.ts +0 -0
  596. package/lib/{decorators → types/decorators}/common/default.d.ts +0 -0
  597. package/lib/{decorators → types/decorators}/common/description.d.ts +0 -0
  598. package/lib/{decorators → types/decorators}/common/enum.d.ts +1 -1
  599. package/lib/{decorators → types/decorators}/common/example.d.ts +0 -0
  600. package/lib/types/decorators/common/examples.d.ts +12 -0
  601. package/lib/{decorators → types/decorators}/common/exclusiveMaximum.d.ts +0 -0
  602. package/lib/{decorators → types/decorators}/common/exclusiveMinimum.d.ts +0 -0
  603. package/lib/{decorators → types/decorators}/common/format.d.ts +0 -0
  604. package/lib/{decorators → types/decorators}/common/forwardGroups.d.ts +0 -0
  605. package/lib/{decorators → types/decorators}/common/groups.d.ts +0 -0
  606. package/lib/{decorators → types/decorators}/common/hidden.d.ts +0 -0
  607. package/lib/{decorators → types/decorators}/common/ignore.d.ts +0 -0
  608. package/lib/{decorators → types/decorators}/common/integer.d.ts +0 -0
  609. package/lib/{decorators → types/decorators}/common/jsonEntityFn.d.ts +2 -2
  610. package/lib/{decorators → types/decorators}/common/maxLength.d.ts +0 -0
  611. package/lib/{decorators → types/decorators}/common/maximum.d.ts +0 -0
  612. package/lib/{decorators → types/decorators}/common/minLength.d.ts +0 -0
  613. package/lib/{decorators → types/decorators}/common/minimum.d.ts +0 -0
  614. package/lib/{decorators → types/decorators}/common/multipleOf.d.ts +0 -0
  615. package/lib/{decorators → types/decorators}/common/name.d.ts +0 -0
  616. package/lib/{decorators → types/decorators}/common/nullable.d.ts +1 -1
  617. package/lib/{decorators → types/decorators}/common/oneOf.d.ts +0 -0
  618. package/lib/{decorators → types/decorators}/common/optional.d.ts +0 -0
  619. package/lib/{decorators → types/decorators}/common/pattern.d.ts +0 -0
  620. package/lib/{decorators → types/decorators}/common/property.d.ts +1 -0
  621. package/lib/{decorators → types/decorators}/common/readOnly.d.ts +0 -0
  622. package/lib/{decorators → types/decorators}/common/required.d.ts +0 -0
  623. package/lib/{decorators → types/decorators}/common/requiredGroups.d.ts +1 -1
  624. package/lib/{decorators → types/decorators}/common/schema.d.ts +0 -0
  625. package/lib/{decorators → types/decorators}/common/title.d.ts +0 -0
  626. package/lib/{decorators → types/decorators}/common/writeOnly.d.ts +0 -0
  627. package/lib/{decorators → types/decorators}/config/jsonEntityComponent.d.ts +0 -0
  628. package/lib/{decorators → types/decorators}/generics/genericOf.d.ts +0 -0
  629. package/lib/{decorators → types/decorators}/generics/generics.d.ts +0 -0
  630. package/lib/{decorators → types/decorators}/index.d.ts +3 -0
  631. package/lib/{decorators → types/decorators}/operations/consumes.d.ts +0 -0
  632. package/lib/{decorators → types/decorators}/operations/contentType.d.ts +0 -0
  633. package/lib/{decorators → types/decorators}/operations/deprecated.d.ts +0 -0
  634. package/lib/{decorators → types/decorators}/operations/header.d.ts +0 -0
  635. package/lib/{decorators → types/decorators}/operations/in.d.ts +0 -0
  636. package/lib/types/decorators/operations/inFile.d.ts +25 -0
  637. package/lib/{decorators → types/decorators}/operations/location.d.ts +0 -0
  638. package/lib/{decorators → types/decorators}/operations/operationId.d.ts +0 -0
  639. package/lib/{decorators → types/decorators}/operations/operationPath.d.ts +0 -0
  640. package/lib/{decorators → types/decorators}/operations/partial.d.ts +0 -0
  641. package/lib/{decorators → types/decorators}/operations/path.d.ts +0 -0
  642. package/lib/{decorators → types/decorators}/operations/produces.d.ts +0 -0
  643. package/lib/{decorators → types/decorators}/operations/redirect.d.ts +0 -0
  644. package/lib/{decorators → types/decorators}/operations/returns.d.ts +16 -1
  645. package/lib/{decorators → types/decorators}/operations/route.d.ts +3 -0
  646. package/lib/{decorators → types/decorators}/operations/security.d.ts +0 -0
  647. package/lib/{decorators → types/decorators}/operations/status.d.ts +0 -0
  648. package/lib/{decorators → types/decorators}/operations/summary.d.ts +0 -0
  649. package/lib/{decorators → types/decorators}/operations/tags.d.ts +0 -0
  650. package/lib/{domain → types/domain}/DecoratorContext.d.ts +0 -0
  651. package/lib/{domain → types/domain}/JsonAliasMap.d.ts +0 -0
  652. package/lib/types/domain/JsonClassStore.d.ts +12 -0
  653. package/lib/types/domain/JsonEntityStore.d.ts +136 -0
  654. package/lib/{domain → types/domain}/JsonFormatTypes.d.ts +0 -0
  655. package/lib/{domain → types/domain}/JsonLazyRef.d.ts +0 -0
  656. package/lib/{domain → types/domain}/JsonMap.d.ts +0 -0
  657. package/lib/types/domain/JsonMethodStore.d.ts +40 -0
  658. package/lib/{domain → types/domain}/JsonOperation.d.ts +1 -0
  659. package/lib/types/domain/JsonOperationPathsMap.d.ts +7 -0
  660. package/lib/types/domain/JsonOperationRoute.d.ts +24 -0
  661. package/lib/{domain → types/domain}/JsonParameter.d.ts +3 -1
  662. package/lib/types/domain/JsonParameterStore.d.ts +30 -0
  663. package/lib/{domain → types/domain}/JsonParameterTypes.d.ts +0 -0
  664. package/lib/types/domain/JsonPropertyStore.d.ts +23 -0
  665. package/lib/{domain → types/domain}/JsonRequestBody.d.ts +0 -0
  666. package/lib/{domain → types/domain}/JsonResponse.d.ts +0 -0
  667. package/lib/{domain → types/domain}/JsonSchema.d.ts +6 -12
  668. package/lib/{domain → types/domain}/SpecTypes.d.ts +3 -0
  669. package/lib/{domain → types/domain}/index.d.ts +5 -0
  670. package/lib/{hooks → types/hooks}/alterIgnore.d.ts +0 -0
  671. package/lib/types/hooks/alterOneOf.d.ts +3 -0
  672. package/lib/{hooks → types/hooks}/alterRequiredGroups.d.ts +0 -0
  673. package/lib/{index.d.ts → types/index.d.ts} +3 -0
  674. package/lib/{interfaces → types/interfaces}/IgnoreCallback.d.ts +0 -0
  675. package/lib/{interfaces → types/interfaces}/JsonHookContext.d.ts +0 -0
  676. package/lib/{interfaces → types/interfaces}/JsonOpenSpec.d.ts +0 -0
  677. package/lib/{interfaces → types/interfaces}/JsonSchemaOptions.d.ts +0 -0
  678. package/lib/{interfaces → types/interfaces}/index.d.ts +0 -0
  679. package/lib/{registries → types/registries}/JsonSchemaMapperContainer.d.ts +3 -2
  680. package/lib/{utils → types/utils}/buildPath.d.ts +0 -0
  681. package/lib/{utils → types/utils}/concatParameters.d.ts +0 -0
  682. package/lib/types/utils/concatPath.d.ts +1 -0
  683. package/lib/{utils → types/utils}/defineStatusModel.d.ts +0 -0
  684. package/lib/{utils → types/utils}/from.d.ts +0 -0
  685. package/lib/{utils → types/utils}/generics.d.ts +0 -0
  686. package/lib/{utils → types/utils}/getComputedType.d.ts +0 -0
  687. package/lib/{utils → types/utils}/getInheritedStores.d.ts +2 -2
  688. package/lib/types/utils/getJsonEntityStore.d.ts +15 -0
  689. package/lib/{utils → types/utils}/getJsonPathParameters.d.ts +0 -0
  690. package/lib/types/utils/getJsonSchema.d.ts +4 -0
  691. package/lib/{utils → types/utils}/getJsonType.d.ts +0 -0
  692. package/lib/types/utils/getOperationsRoutes.d.ts +8 -0
  693. package/lib/types/utils/getOperationsStores.d.ts +6 -0
  694. package/lib/types/utils/getPropertiesStores.d.ts +20 -0
  695. package/lib/{utils → types/utils}/getRequiredProperties.d.ts +0 -0
  696. package/lib/{utils → types/utils}/getSpec.d.ts +0 -0
  697. package/lib/{utils → types/utils}/isSuccessStatus.d.ts +0 -0
  698. package/lib/{utils → types/utils}/mapHeaders.d.ts +0 -0
  699. package/lib/{utils → types/utils}/mapNullableType.d.ts +0 -0
  700. package/lib/{utils → types/utils}/mapRouteOptions.d.ts +1 -1
  701. package/lib/{utils → types/utils}/matchGroups.d.ts +0 -0
  702. package/lib/{utils → types/utils}/mergeOperation.d.ts +0 -0
  703. package/lib/{utils → types/utils}/mergeSpec.d.ts +0 -0
  704. package/lib/{utils → types/utils}/operationIdFormatter.d.ts +0 -0
  705. package/lib/types/utils/ref.d.ts +14 -0
  706. package/lib/{utils → types/utils}/toJsonMapCollection.d.ts +0 -0
  707. package/lib/{utils → types/utils}/toJsonRegex.d.ts +0 -0
  708. package/package.json +21 -17
  709. package/tsconfig.compile.esm.json +23 -0
  710. package/lib/components/lazyRefMapper.d.ts +0 -19
  711. package/lib/constants/httpStatusMessages.d.ts +0 -5
  712. package/lib/domain/JsonEntityStore.d.ts +0 -94
  713. package/lib/index.js +0 -7894
  714. package/lib/index.js.map +0 -1
  715. package/lib/index.modern.js +0 -7751
  716. package/lib/index.modern.js.map +0 -1
  717. package/lib/registries/JsonEntitiesContainer.d.ts +0 -6
  718. package/lib/utils/getJsonEntityStore.d.ts +0 -6
  719. package/lib/utils/getJsonSchema.d.ts +0 -5
  720. package/lib/utils/getOperationsStores.d.ts +0 -6
  721. package/lib/utils/getPropertiesStores.d.ts +0 -20
  722. package/lib/utils/isJsonClass.d.ts +0 -4
  723. package/lib/utils/mergeSpec.benchmark.d.ts +0 -1
  724. package/lib/utils/ref.d.ts +0 -46
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.In = void 0;
4
+ const core_1 = require("@tsed/core");
5
+ const domain_1 = require("../../domain");
6
+ /**
7
+ * Add a input parameter.
8
+ *
9
+ * ::: warning
10
+ * Don't use decorator with Ts.ED application to decorate parameters. Use @@BodyParams@@, @@PathParams@@, etc... instead.
11
+ * But you can use this decorator on Method, to add extra in parameters like Authorization header.
12
+ *
13
+ * ```typescript
14
+ * @Controller("/")
15
+ * class MyController {
16
+ * @Get("/")
17
+ * @In("header").Type(String).Name("Authorization").Required()
18
+ * method() {
19
+ * }
20
+ * }
21
+ * ```
22
+ * :::
23
+ *
24
+ * @param inType
25
+ * @decorator
26
+ * @swagger
27
+ * @schema
28
+ * @input
29
+ * @operation
30
+ */
31
+ function In(inType) {
32
+ const jsonParameter = new domain_1.JsonParameter();
33
+ const schema = {};
34
+ const decorator = (target, propertyKey, index) => {
35
+ const store = domain_1.JsonEntityStore.from(target, propertyKey, index);
36
+ switch (store.decoratorType) {
37
+ case core_1.DecoratorTypes.PARAM:
38
+ store.parameter.in(inType);
39
+ break;
40
+ case core_1.DecoratorTypes.METHOD:
41
+ jsonParameter.in(inType);
42
+ store.operation.addParameter(-1, jsonParameter);
43
+ jsonParameter.schema(domain_1.JsonSchema.from(schema));
44
+ break;
45
+ case core_1.DecoratorTypes.CLASS:
46
+ (0, core_1.decorateMethodsOf)(target, decorator);
47
+ break;
48
+ default:
49
+ throw new core_1.UnsupportedDecoratorType(In, [target, propertyKey, index]);
50
+ }
51
+ };
52
+ decorator.Type = (type) => {
53
+ schema.type = type;
54
+ return decorator;
55
+ };
56
+ decorator.Name = (name) => {
57
+ jsonParameter.name(name);
58
+ return decorator;
59
+ };
60
+ decorator.Description = (description) => {
61
+ jsonParameter.description(description);
62
+ return decorator;
63
+ };
64
+ decorator.Required = (required = true) => {
65
+ jsonParameter.required(required);
66
+ return decorator;
67
+ };
68
+ decorator.Pattern = (pattern) => {
69
+ return decorator.Schema({ pattern: pattern.toString() });
70
+ };
71
+ decorator.Schema = (_schema) => {
72
+ Object.assign(schema, _schema);
73
+ return decorator;
74
+ };
75
+ return decorator;
76
+ }
77
+ exports.In = In;
78
+ //# sourceMappingURL=in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in.js","sourceRoot":"","sources":["../../../../src/decorators/operations/in.ts"],"names":[],"mappings":";;;AAAA,qCAA6F;AAC7F,yCAA+H;AA+C/H;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,EAAE,CAAC,MAAmC;IACpD,MAAM,aAAa,GAAG,IAAI,sBAAa,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAQ,EAAE,CAAC;IAEvB,MAAM,SAAS,GAAG,CAAC,MAAW,EAAE,WAA6B,EAAE,KAAmC,EAAE,EAAE;QACpG,MAAM,KAAK,GAAG,wBAAe,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QAE/D,QAAQ,KAAK,CAAC,aAAa,EAAE;YAC3B,KAAK,qBAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBACnD,MAAM;YACR,KAAK,qBAAc,CAAC,MAAM;gBACxB,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBACxB,KAAyB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;gBAErE,aAAa,CAAC,MAAM,CAAC,mBAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC9C,MAAM;YAER,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;gBACrC,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;SACxE;IACH,CAAC,CAAC;IAEF,SAAS,CAAC,IAAI,GAAG,CAAC,IAAe,EAAE,EAAE;QACnC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QAEnB,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE;QAChC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzB,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE;QAC9C,aAAa,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAEvC,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,QAAQ,GAAG,CAAC,WAAoB,IAAI,EAAE,EAAE;QAChD,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEjC,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,OAAO,GAAG,CAAC,OAAwB,EAAE,EAAE;QAC/C,OAAO,SAAS,CAAC,MAAM,CAAC,EAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAC,CAAC,CAAC;IACzD,CAAC,CAAC;IAEF,SAAS,CAAC,MAAM,GAAG,CAAC,OAAY,EAAE,EAAE;QAClC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAE/B,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AA9DD,gBA8DC","sourcesContent":["import {decorateMethodsOf, DecoratorTypes, Type, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityStore, JsonMethodStore, JsonParameter, JsonParameterStore, JsonSchema, JsonSchemaObject} from \"../../domain\";\nimport {JsonParameterTypes} from \"../../domain/JsonParameterTypes\";\n\nexport interface InChainedDecorators {\n <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;\n\n (target: Object, propertyKey: string | symbol, parameterIndex: number): void;\n\n (target: Function): void;\n\n /**\n * Type of this in parameter\n * @param type\n */\n Type(type: Type<any>): this;\n\n /**\n *\n * @param name\n */\n Name(name: string): this;\n\n /**\n *\n * @param description\n */\n Description(description: string): this;\n\n /**\n *\n * @param required\n */\n Required(required?: boolean): this;\n\n /**\n * Add pattern constraint. Only available for OPENAPI.\n * @param pattern\n */\n Pattern(pattern: string | RegExp): this;\n\n /**\n * Add custom schema.\n * @param schema\n */\n Schema(schema: Partial<JsonSchemaObject>): this;\n}\n\n/**\n * Add a input parameter.\n *\n * ::: warning\n * Don't use decorator with Ts.ED application to decorate parameters. Use @@BodyParams@@, @@PathParams@@, etc... instead.\n * But you can use this decorator on Method, to add extra in parameters like Authorization header.\n *\n * ```typescript\n * @Controller(\"/\")\n * class MyController {\n * @Get(\"/\")\n * @In(\"header\").Type(String).Name(\"Authorization\").Required()\n * method() {\n * }\n * }\n * ```\n * :::\n *\n * @param inType\n * @decorator\n * @swagger\n * @schema\n * @input\n * @operation\n */\nexport function In(inType: JsonParameterTypes | string): InChainedDecorators {\n const jsonParameter = new JsonParameter();\n const schema: any = {};\n\n const decorator = (target: any, propertyKey?: string | symbol, index?: PropertyDescriptor | number) => {\n const store = JsonEntityStore.from(target, propertyKey, index);\n\n switch (store.decoratorType) {\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).parameter.in(inType);\n break;\n case DecoratorTypes.METHOD:\n jsonParameter.in(inType);\n (store as JsonMethodStore).operation.addParameter(-1, jsonParameter);\n\n jsonParameter.schema(JsonSchema.from(schema));\n break;\n\n case DecoratorTypes.CLASS:\n decorateMethodsOf(target, decorator);\n break;\n\n default:\n throw new UnsupportedDecoratorType(In, [target, propertyKey, index]);\n }\n };\n\n decorator.Type = (type: Type<any>) => {\n schema.type = type;\n\n return decorator;\n };\n\n decorator.Name = (name: string) => {\n jsonParameter.name(name);\n\n return decorator;\n };\n\n decorator.Description = (description: string) => {\n jsonParameter.description(description);\n\n return decorator;\n };\n\n decorator.Required = (required: boolean = true) => {\n jsonParameter.required(required);\n\n return decorator;\n };\n\n decorator.Pattern = (pattern: string | RegExp) => {\n return decorator.Schema({pattern: pattern.toString()});\n };\n\n decorator.Schema = (_schema: any) => {\n Object.assign(schema, _schema);\n\n return decorator;\n };\n\n return decorator;\n}\n"]}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InFile = void 0;
4
+ const core_1 = require("@tsed/core");
5
+ const in_1 = require("./in");
6
+ const JsonParameterTypes_1 = require("../../domain/JsonParameterTypes");
7
+ const returns_1 = require("./returns");
8
+ const name_1 = require("../common/name");
9
+ const consumes_1 = require("./consumes");
10
+ /**
11
+ * Add a input file parameter.
12
+ *
13
+ * ::: warning
14
+ * Don't use decorator with Ts.ED application to decorate parameters. Use @@BodyParams@@, @@PathParams@@, etc... instead.
15
+ * But you can use this decorator on Method, to add extra in parameters like Authorization header.
16
+ *
17
+ * ```typescript
18
+ * @Controller("/")
19
+ * class MyController {
20
+ * @Post("/")
21
+ * method(@InFile("file1") file: any) {
22
+ * }
23
+ * }
24
+ * ```
25
+ * :::
26
+ *
27
+ * @decorator
28
+ * @swagger
29
+ * @schema
30
+ * @input
31
+ * @operation
32
+ * @param name
33
+ */
34
+ function InFile(name) {
35
+ return (...args) => {
36
+ const [target, propertyKey, index] = args;
37
+ const multiple = core_1.Metadata.getParamTypes(target, propertyKey)[index] === Array;
38
+ name = (typeof name === "object" ? undefined : name);
39
+ const expression = [name, !multiple && "0"].filter(Boolean).join(".");
40
+ const decorators = (0, core_1.useDecorators)((0, in_1.In)(JsonParameterTypes_1.JsonParameterTypes.FILES), (0, name_1.Name)(expression), (0, core_1.useMethodDecorators)((0, returns_1.Returns)(400).Description(`<File too long | Too many parts | Too many files | Field name too long | Field value too long | Too many fields | Unexpected field> [fieldName] Example: File too long file1`), (0, consumes_1.Consumes)("multipart/form-data")));
41
+ decorators(...args);
42
+ };
43
+ }
44
+ exports.InFile = InFile;
45
+ //# sourceMappingURL=inFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inFile.js","sourceRoot":"","sources":["../../../../src/decorators/operations/inFile.ts"],"names":[],"mappings":";;;AAAA,qCAA6F;AAC7F,6BAAwB;AACxB,wEAAmE;AACnE,uCAAkC;AAClC,yCAAoC;AACpC,yCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,MAAM,CAAC,IAAY;IACjC,OAAO,CAAC,GAAG,IAAyB,EAAQ,EAAE;QAC5C,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;QAC1C,MAAM,QAAQ,GAAG,eAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,KAAe,CAAC,KAAK,KAAK,CAAC;QAExF,IAAI,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAE,CAAC;QAEtD,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEtE,MAAM,UAAU,GAAG,IAAA,oBAAa,EAC9B,IAAA,OAAE,EAAC,uCAAkB,CAAC,KAAK,CAAC,EAC5B,IAAA,WAAI,EAAC,UAAU,CAAC,EAChB,IAAA,0BAAmB,EACjB,IAAA,iBAAO,EAAC,GAAG,CAAC,CAAC,WAAW,CACtB,+KAA+K,CAChL,EACD,IAAA,mBAAQ,EAAC,qBAAqB,CAAC,CAChC,CACF,CAAC;QAEF,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AAtBD,wBAsBC","sourcesContent":["import {DecoratorParameters, Metadata, useDecorators, useMethodDecorators} from \"@tsed/core\";\nimport {In} from \"./in\";\nimport {JsonParameterTypes} from \"../../domain/JsonParameterTypes\";\nimport {Returns} from \"./returns\";\nimport {Name} from \"../common/name\";\nimport {Consumes} from \"./consumes\";\n\n/**\n * Add a input file parameter.\n *\n * ::: warning\n * Don't use decorator with Ts.ED application to decorate parameters. Use @@BodyParams@@, @@PathParams@@, etc... instead.\n * But you can use this decorator on Method, to add extra in parameters like Authorization header.\n *\n * ```typescript\n * @Controller(\"/\")\n * class MyController {\n * @Post(\"/\")\n * method(@InFile(\"file1\") file: any) {\n * }\n * }\n * ```\n * :::\n *\n * @decorator\n * @swagger\n * @schema\n * @input\n * @operation\n * @param name\n */\nexport function InFile(name: string): ParameterDecorator {\n return (...args: DecoratorParameters): void => {\n const [target, propertyKey, index] = args;\n const multiple = Metadata.getParamTypes(target, propertyKey)[index as number] === Array;\n\n name = (typeof name === \"object\" ? undefined : name)!;\n\n const expression = [name, !multiple && \"0\"].filter(Boolean).join(\".\");\n\n const decorators = useDecorators(\n In(JsonParameterTypes.FILES),\n Name(expression),\n useMethodDecorators(\n Returns(400).Description(\n `<File too long | Too many parts | Too many files | Field name too long | Field value too long | Too many fields | Unexpected field> [fieldName] Example: File too long file1`\n ),\n Consumes(\"multipart/form-data\")\n )\n );\n\n decorators(...args);\n };\n}\n"]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Location = void 0;
4
+ const returns_1 = require("./returns");
5
+ /**
6
+ * Sets the response Location HTTP header to the specified path parameter.
7
+ *
8
+ * ```typescript
9
+ * @Location('/foo/bar', {description: 'Location to the next step'})
10
+ * @Location('http://example.com')
11
+ * @Location('back')
12
+ * private myMethod() {
13
+ *
14
+ * }
15
+ * ```
16
+ *
17
+ * A path value of “back” has a special meaning, it refers to the URL specified in the `Referer` header of the request. If the `Referer` header was not specified, it refers to “/”.
18
+ *
19
+ * @param location
20
+ * @param meta
21
+ * @returns {Function}
22
+ * @decorator
23
+ * @operation
24
+ */
25
+ function Location(location, meta) {
26
+ return (0, returns_1.Returns)().Location(location, meta);
27
+ }
28
+ exports.Location = Location;
29
+ //# sourceMappingURL=location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.js","sourceRoot":"","sources":["../../../../src/decorators/operations/location.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAElC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,QAAQ,CAAC,QAAgB,EAAE,IAAiB;IAC1D,OAAO,IAAA,iBAAO,GAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC;AAFD,4BAEC","sourcesContent":["import {JsonHeader} from \"../../interfaces/JsonOpenSpec\";\nimport {Returns} from \"./returns\";\n\n/**\n * Sets the response Location HTTP header to the specified path parameter.\n *\n * ```typescript\n * @Location('/foo/bar', {description: 'Location to the next step'})\n * @Location('http://example.com')\n * @Location('back')\n * private myMethod() {\n *\n * }\n * ```\n *\n * A path value of “back” has a special meaning, it refers to the URL specified in the `Referer` header of the request. If the `Referer` header was not specified, it refers to “/”.\n *\n * @param location\n * @param meta\n * @returns {Function}\n * @decorator\n * @operation\n */\nexport function Location(location: string, meta?: JsonHeader) {\n return Returns().Location(location, meta);\n}\n"]}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperationId = void 0;
4
+ const core_1 = require("@tsed/core");
5
+ const jsonEntityFn_1 = require("../common/jsonEntityFn");
6
+ /**
7
+ * Set a swagger operationId explicitly.
8
+ *
9
+ * @param operationId
10
+ * @decorator
11
+ * @swagger
12
+ * @schema
13
+ * @operation
14
+ */
15
+ function OperationId(operationId) {
16
+ return (0, jsonEntityFn_1.JsonEntityFn)((store, args) => {
17
+ if (store.decoratorType !== core_1.DecoratorTypes.METHOD) {
18
+ throw new core_1.UnsupportedDecoratorType(OperationId, args);
19
+ }
20
+ store.operation.operationId(operationId);
21
+ });
22
+ }
23
+ exports.OperationId = OperationId;
24
+ //# sourceMappingURL=operationId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operationId.js","sourceRoot":"","sources":["../../../../src/decorators/operations/operationId.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,yDAAoD;AAEpD;;;;;;;;GAQG;AACH,SAAgB,WAAW,CAAC,WAAmB;IAC7C,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAClC,IAAI,KAAK,CAAC,aAAa,KAAK,qBAAc,CAAC,MAAM,EAAE;YACjD,MAAM,IAAI,+BAAwB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SACvD;QAED,KAAK,CAAC,SAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC;AARD,kCAQC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\n\n/**\n * Set a swagger operationId explicitly.\n *\n * @param operationId\n * @decorator\n * @swagger\n * @schema\n * @operation\n */\nexport function OperationId(operationId: string) {\n return JsonEntityFn((store, args) => {\n if (store.decoratorType !== DecoratorTypes.METHOD) {\n throw new UnsupportedDecoratorType(OperationId, args);\n }\n\n store.operation!.operationId(operationId);\n });\n}\n"]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperationPath = void 0;
4
+ const core_1 = require("@tsed/core");
5
+ const jsonEntityFn_1 = require("../common/jsonEntityFn");
6
+ /**
7
+ * Declare new Operation with his path and http method.
8
+ *
9
+ * ::: warning
10
+ * Don't use decorator with Ts.ED application.
11
+ *
12
+ * Use theses decorators instead:
13
+ *
14
+ * <ApiList query="status.includes('decorator') && status.includes('httpMethod')" />
15
+ *
16
+ * :::
17
+ *
18
+ * @param method
19
+ * @param path
20
+ * @decorator
21
+ * @swagger
22
+ * @schema
23
+ * @operation
24
+ */
25
+ function OperationPath(method, path = "/") {
26
+ return (0, jsonEntityFn_1.JsonEntityFn)((store, args) => {
27
+ if (store.decoratorType !== core_1.DecoratorTypes.METHOD) {
28
+ throw new core_1.UnsupportedDecoratorType(OperationPath, args);
29
+ }
30
+ store.operation.addOperationPath(method.toUpperCase(), path);
31
+ });
32
+ }
33
+ exports.OperationPath = OperationPath;
34
+ //# sourceMappingURL=operationPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operationPath.js","sourceRoot":"","sources":["../../../../src/decorators/operations/operationPath.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,yDAAoD;AAGpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,aAAa,CAAC,MAAiC,EAAE,OAAwB,GAAG;IAC1F,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAClC,IAAI,KAAK,CAAC,aAAa,KAAK,qBAAc,CAAC,MAAM,EAAE;YACjD,MAAM,IAAI,+BAAwB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;SACzD;QAED,KAAK,CAAC,SAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC;AARD,sCAQC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\nimport {OperationMethods} from \"../../constants/httpMethods\";\n\n/**\n * Declare new Operation with his path and http method.\n *\n * ::: warning\n * Don't use decorator with Ts.ED application.\n *\n * Use theses decorators instead:\n *\n * <ApiList query=\"status.includes('decorator') && status.includes('httpMethod')\" />\n *\n * :::\n *\n * @param method\n * @param path\n * @decorator\n * @swagger\n * @schema\n * @operation\n */\nexport function OperationPath(method: OperationMethods | string, path: string | RegExp = \"/\") {\n return JsonEntityFn((store, args) => {\n if (store.decoratorType !== DecoratorTypes.METHOD) {\n throw new UnsupportedDecoratorType(OperationPath, args);\n }\n\n store.operation!.addOperationPath(method.toUpperCase(), path);\n });\n}\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Partial = void 0;
4
+ const groups_1 = require("../common/groups");
5
+ /**
6
+ * Apply Partial group strategy on the input model
7
+ *
8
+ * @decorator
9
+ * @validation
10
+ * @swagger
11
+ * @schema
12
+ * @input
13
+ */
14
+ function Partial() {
15
+ return (0, groups_1.Groups)("partial");
16
+ }
17
+ exports.Partial = Partial;
18
+ //# sourceMappingURL=partial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partial.js","sourceRoot":"","sources":["../../../../src/decorators/operations/partial.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAExC;;;;;;;;GAQG;AACH,SAAgB,OAAO;IACrB,OAAO,IAAA,eAAM,EAAC,SAAS,CAAQ,CAAC;AAClC,CAAC;AAFD,0BAEC","sourcesContent":["import {Groups} from \"../common/groups\";\n\n/**\n * Apply Partial group strategy on the input model\n *\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Partial(): ParameterDecorator {\n return Groups(\"partial\") as any;\n}\n"]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Path = void 0;
4
+ const core_1 = require("@tsed/core");
5
+ const jsonEntityFn_1 = require("../common/jsonEntityFn");
6
+ /**
7
+ * Set class path to expose all endpoints
8
+ *
9
+ * ::: warning
10
+ * Don't use this decorator to change the path if you develop your application with Ts.ED.
11
+ * :::
12
+ *
13
+ * @param path
14
+ * @decorator
15
+ * @swagger
16
+ * @schema
17
+ * @classDecorator
18
+ * @operation
19
+ */
20
+ function Path(path) {
21
+ return (0, jsonEntityFn_1.JsonEntityFn)((store, args) => {
22
+ if (store.decoratorType !== core_1.DecoratorTypes.CLASS) {
23
+ throw new core_1.UnsupportedDecoratorType(Path, args);
24
+ }
25
+ store.path = path;
26
+ });
27
+ }
28
+ exports.Path = Path;
29
+ //# sourceMappingURL=path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../src/decorators/operations/path.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,yDAAoD;AAEpD;;;;;;;;;;;;;GAaG;AACH,SAAgB,IAAI,CAAC,IAAY;IAC/B,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAClC,IAAI,KAAK,CAAC,aAAa,KAAK,qBAAc,CAAC,KAAK,EAAE;YAChD,MAAM,IAAI,+BAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAChD;QAED,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC;AARD,oBAQC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\n\n/**\n * Set class path to expose all endpoints\n *\n * ::: warning\n * Don't use this decorator to change the path if you develop your application with Ts.ED.\n * :::\n *\n * @param path\n * @decorator\n * @swagger\n * @schema\n * @classDecorator\n * @operation\n */\nexport function Path(path: string) {\n return JsonEntityFn((store, args) => {\n if (store.decoratorType !== DecoratorTypes.CLASS) {\n throw new UnsupportedDecoratorType(Path, args);\n }\n\n store.path = path;\n });\n}\n"]}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Produces = void 0;
4
+ const core_1 = require("@tsed/core");
5
+ const jsonEntityFn_1 = require("../common/jsonEntityFn");
6
+ /**
7
+ * Add produces metadata on the decorated element.
8
+ *
9
+ * ## Examples
10
+ * ### On method
11
+ *
12
+ * ```typescript
13
+ * class Model {
14
+ * @Produces("text/html")
15
+ * id: string;
16
+ * }
17
+ * ```
18
+ *
19
+ * ::: warning
20
+ * For openspec v3 prefer `@Returns().ContentType()` usage (see @@Returns@@).
21
+ * :::
22
+ *
23
+ * @param produces
24
+ * @decorator
25
+ * @swagger
26
+ * @methodDecorator
27
+ * @classDecorator
28
+ * @operation
29
+ * @response
30
+ */
31
+ function Produces(...produces) {
32
+ return (0, jsonEntityFn_1.JsonEntityFn)((store, args) => {
33
+ switch (store.decoratorType) {
34
+ case core_1.DecoratorTypes.METHOD:
35
+ store.operation.produces(produces);
36
+ break;
37
+ case core_1.DecoratorTypes.CLASS:
38
+ (0, core_1.decorateMethodsOf)(args[0], Produces(...produces));
39
+ break;
40
+ default:
41
+ throw new core_1.UnsupportedDecoratorType(Produces, args);
42
+ }
43
+ });
44
+ }
45
+ exports.Produces = Produces;
46
+ //# sourceMappingURL=produces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"produces.js","sourceRoot":"","sources":["../../../../src/decorators/operations/produces.ts"],"names":[],"mappings":";;;AAAA,qCAAuF;AACvF,yDAAoD;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,QAAQ,CAAC,GAAG,QAAkB;IAC5C,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAClC,QAAQ,KAAK,CAAC,aAAa,EAAE;YAC3B,KAAK,qBAAc,CAAC,MAAM;gBACxB,KAAK,CAAC,SAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBACpC,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;gBAClD,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAdD,4BAcC","sourcesContent":["import {decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\n\n/**\n * Add produces metadata on the decorated element.\n *\n * ## Examples\n * ### On method\n *\n * ```typescript\n * class Model {\n * @Produces(\"text/html\")\n * id: string;\n * }\n * ```\n *\n * ::: warning\n * For openspec v3 prefer `@Returns().ContentType()` usage (see @@Returns@@).\n * :::\n *\n * @param produces\n * @decorator\n * @swagger\n * @methodDecorator\n * @classDecorator\n * @operation\n * @response\n */\nexport function Produces(...produces: string[]) {\n return JsonEntityFn((store, args) => {\n switch (store.decoratorType) {\n case DecoratorTypes.METHOD:\n store.operation!.produces(produces);\n break;\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], Produces(...produces));\n break;\n\n default:\n throw new UnsupportedDecoratorType(Produces, args);\n }\n });\n}\n"]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Redirect = void 0;
4
+ const core_1 = require("@tsed/core");
5
+ const jsonEntityFn_1 = require("../common/jsonEntityFn");
6
+ const returns_1 = require("./returns");
7
+ function Redirect(...args) {
8
+ const { status, url, meta } = args.reduce((options, value) => {
9
+ if ((0, core_1.isNumber)(value)) {
10
+ options.status = value;
11
+ return options;
12
+ }
13
+ if ((0, core_1.isString)(value)) {
14
+ options.url = value;
15
+ return options;
16
+ }
17
+ options.meta = value;
18
+ return options;
19
+ }, { status: 302, url: "", meta: {} });
20
+ return (0, core_1.useDecorators)((0, returns_1.Returns)(status).Location(url, meta), (0, jsonEntityFn_1.JsonEntityFn)((entity) => {
21
+ var _a;
22
+ (_a = entity.operation) === null || _a === void 0 ? void 0 : _a.setRedirection(status);
23
+ }));
24
+ }
25
+ exports.Redirect = Redirect;
26
+ //# sourceMappingURL=redirect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../../../src/decorators/operations/redirect.ts"],"names":[],"mappings":";;;AAAA,qCAA6D;AAE7D,yDAAoD;AACpD,uCAAkC;AAqDlC,SAAgB,QAAQ,CAAC,GAAG,IAAW;IACrC,MAAM,EAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,MAAM,CACrC,CAAC,OAAY,EAAE,KAAU,EAAE,EAAE;QAC3B,IAAI,IAAA,eAAQ,EAAC,KAAK,CAAC,EAAE;YACnB,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC;YACvB,OAAO,OAAO,CAAC;SAChB;QAED,IAAI,IAAA,eAAQ,EAAC,KAAK,CAAC,EAAE;YACnB,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC;YACpB,OAAO,OAAO,CAAC;SAChB;QAED,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;QACrB,OAAO,OAAO,CAAC;IACjB,CAAC,EACD,EAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAC,CACjC,CAAC;IACF,OAAO,IAAA,oBAAa,EAClB,IAAA,iBAAO,EAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,EACnC,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;;QACtB,MAAA,MAAM,CAAC,SAAS,0CAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAxBD,4BAwBC","sourcesContent":["import {isNumber, isString, useDecorators} from \"@tsed/core\";\nimport {JsonHeader} from \"../../interfaces/JsonOpenSpec\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\nimport {Returns} from \"./returns\";\n\n/**\n * Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code . If not specified, status defaults to “302 “Found”.\n *\n * ```typescript\n * @Redirect('/foo/bar')\n * @Redirect(301, 'http://example.com').Type(Model)\n * private myMethod() {}\n * ```\n * Redirects can be a fully-qualified URL for redirecting to a different site:\n *\n * ```typescript\n * @Redirect('http://google.com');\n * private myMethod() {}\n * ```\n *\n * Redirects can be relative to the root of the host name. For example, if the application is on http://example.com/admin/post/new, the following would redirect to the URL http://example.com/admin:\n *\n * ```typescript\n * @Redirect('/admin');\n * ```\n * Redirects can be relative to the current URL. For example, from http://example.com/blog/admin/ (notice the trailing slash), the following would redirect to the URL http://example.com/blog/admin/post/new.\n *\n * ```typescript\n * @Redirect('post/new');\n * ```\n *\n * Redirecting to post/new from http://example.com/blog/admin (no trailing slash), will redirect to http://example.com/blog/post/new.\n *\n * If you found the above behavior confusing, think of path segments as directories (with trailing slashes) and files, it will start to make sense.\n *\n * Path-relative redirects are also possible. If you were on http://example.com/admin/post/new, the following would redirect to http//example.com/admin/post:\n *\n * ```typescript\n * @Redirect('..');\n * ``\n *\n * A back redirection redirects the request back to the referer, defaulting to / when the referer is missing.\n *\n * ```typescript\n * @Redirect('back');\n * ```\n *\n * @param url\n * @param meta\n * @decorator\n * @operation\n * @response\n * @headers\n */\nexport function Redirect(url: string, meta?: JsonHeader): Function;\nexport function Redirect(status: number, url: string, meta?: JsonHeader): Function;\nexport function Redirect(...args: any[]): Function {\n const {status, url, meta} = args.reduce(\n (options: any, value: any) => {\n if (isNumber(value)) {\n options.status = value;\n return options;\n }\n\n if (isString(value)) {\n options.url = value;\n return options;\n }\n\n options.meta = value;\n return options;\n },\n {status: 302, url: \"\", meta: {}}\n );\n return useDecorators(\n Returns(status).Location(url, meta),\n JsonEntityFn((entity) => {\n entity.operation?.setRedirection(status);\n })\n );\n}\n"]}
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Returns = void 0;
4
+ const core_1 = require("@tsed/core");
5
+ const httpStatusMessages_1 = require("../../constants/httpStatusMessages");
6
+ const DecoratorContext_1 = require("../../domain/DecoratorContext");
7
+ const JsonEntityStore_1 = require("../../domain/JsonEntityStore");
8
+ const JsonSchema_1 = require("../../domain/JsonSchema");
9
+ const defineStatusModel_1 = require("../../utils/defineStatusModel");
10
+ const from_1 = require("../../utils/from");
11
+ const isSuccessStatus_1 = require("../../utils/isSuccessStatus");
12
+ const mapHeaders_1 = require("../../utils/mapHeaders");
13
+ /**
14
+ * @ignore
15
+ */
16
+ function isEnum(type) {
17
+ return (0, core_1.isObject)(type) && !("toJSON" in type);
18
+ }
19
+ function mapGenerics(types) {
20
+ return types.map((type) => {
21
+ if (isEnum(type)) {
22
+ return (0, from_1.string)().enum(Object.values(type));
23
+ }
24
+ return type;
25
+ });
26
+ }
27
+ /**
28
+ * @ignore
29
+ */
30
+ class ReturnDecoratorContext extends DecoratorContext_1.DecoratorContext {
31
+ constructor({ status, model }) {
32
+ super();
33
+ this.methods = [
34
+ "contentType",
35
+ "description",
36
+ "examples",
37
+ "type",
38
+ "status",
39
+ "of",
40
+ "oneOf",
41
+ "allOf",
42
+ "anyOf",
43
+ "nested",
44
+ "header",
45
+ "headers",
46
+ "schema",
47
+ "title",
48
+ "groups",
49
+ "location"
50
+ ];
51
+ this.model(model);
52
+ this.status(status);
53
+ }
54
+ type(model) {
55
+ return this.model(model);
56
+ }
57
+ model(model) {
58
+ model && this.set("model", model);
59
+ return this;
60
+ }
61
+ status(status) {
62
+ this.set("status", status);
63
+ if (status && (0, httpStatusMessages_1.getStatusMessage)(status) && !this.get("description")) {
64
+ this.set("description", (0, httpStatusMessages_1.getStatusMessage)(status));
65
+ if (!this.get("model")) {
66
+ this.model((0, defineStatusModel_1.getStatusModel)(+status));
67
+ }
68
+ }
69
+ return this;
70
+ }
71
+ headers(headers) {
72
+ this.set("headers", {
73
+ ...(this.get("headers") || {}),
74
+ ...(0, mapHeaders_1.mapHeaders)(headers)
75
+ });
76
+ return this;
77
+ }
78
+ header(key, value) {
79
+ return this.headers({ [key]: value });
80
+ }
81
+ location(path, meta = {}) {
82
+ this.headers({
83
+ Location: {
84
+ ...meta,
85
+ value: path
86
+ }
87
+ });
88
+ return this;
89
+ }
90
+ groups(...groups) {
91
+ this.set("groups", groups);
92
+ return this;
93
+ }
94
+ nested(...generics) {
95
+ const model = this.get("model");
96
+ this.checkPrimitive(model);
97
+ this.checkCollection(model);
98
+ this.addAction((ctx) => {
99
+ this.get("schema").nestedGenerics.push(mapGenerics(generics));
100
+ });
101
+ return this;
102
+ }
103
+ of(...types) {
104
+ const model = this.get("model");
105
+ this.checkPrimitive(model);
106
+ this.addAction(() => {
107
+ const schema = this.get("schema");
108
+ if ((0, core_1.isCollection)(model)) {
109
+ schema === null || schema === void 0 ? void 0 : schema.itemSchema({ type: types[0] });
110
+ }
111
+ else {
112
+ schema === null || schema === void 0 ? void 0 : schema.nestedGenerics.push(mapGenerics(types));
113
+ }
114
+ });
115
+ return this;
116
+ }
117
+ oneOf(...types) {
118
+ const model = this.get("model");
119
+ this.addAction(() => {
120
+ const schema = this.get("schema");
121
+ schema.type(model);
122
+ schema.itemSchema({ oneOf: types.map((type) => ({ type })) });
123
+ });
124
+ return this;
125
+ }
126
+ allOf(...types) {
127
+ const model = this.get("model");
128
+ this.addAction(() => {
129
+ const schema = this.get("schema");
130
+ schema.type(model);
131
+ schema.itemSchema({ allOf: types.map((type) => ({ type })) });
132
+ });
133
+ return this;
134
+ }
135
+ anyOf(...types) {
136
+ const model = this.get("model");
137
+ this.addAction(() => {
138
+ const schema = this.get("schema");
139
+ schema.type(model);
140
+ schema.itemSchema({ anyOf: types.map((type) => ({ type })) });
141
+ });
142
+ return this;
143
+ }
144
+ schema(partial) {
145
+ this.addAction(() => {
146
+ const schema = this.get("schema");
147
+ schema.assign(partial);
148
+ });
149
+ return this;
150
+ }
151
+ examples(examples) {
152
+ this.set("examples", (0, core_1.isString)(examples) ? [examples] : examples);
153
+ return this;
154
+ }
155
+ title(title) {
156
+ return this.schema({ title });
157
+ }
158
+ checkPrimitive(model) {
159
+ if ((0, core_1.isPrimitiveOrPrimitiveClass)(model)) {
160
+ throw new Error("Returns.Of cannot be used with the following primitive classes: String, Number, Boolean");
161
+ }
162
+ }
163
+ checkCollection(model) {
164
+ if ((0, core_1.isCollection)(model)) {
165
+ throw new Error("Returns.Nested cannot be used with the following classes: Map, Set, Array, String, Number, Boolean");
166
+ }
167
+ }
168
+ getContentType() {
169
+ const model = this.get("model");
170
+ let contentType = this.get("contentType");
171
+ if (model && !(0, core_1.isPlainObject)(model) && !(0, core_1.isPrimitiveOrPrimitiveClass)(model)) {
172
+ contentType = contentType || "application/json";
173
+ }
174
+ return contentType;
175
+ }
176
+ getStatus() {
177
+ return this.get("status") || "default";
178
+ }
179
+ onInit(args, decorator) {
180
+ const type = (0, core_1.decoratorTypeOf)(args);
181
+ switch (type) {
182
+ case core_1.DecoratorTypes.METHOD:
183
+ this.entity = JsonEntityStore_1.JsonEntityStore.from(...args);
184
+ if (this.entity.operation) {
185
+ this.map();
186
+ }
187
+ break;
188
+ case core_1.DecoratorTypes.CLASS:
189
+ this.decoratorType = core_1.DecoratorTypes.CLASS;
190
+ (0, core_1.decorateMethodsOf)(args[0], decorator);
191
+ break;
192
+ }
193
+ }
194
+ map() {
195
+ const model = this.get("model");
196
+ const { entity, decoratorType } = this;
197
+ const operation = this.entity.operation;
198
+ const currentStatus = this.getStatus();
199
+ const response = operation.ensureResponseOf(currentStatus);
200
+ const contentType = this.getContentType();
201
+ let { description = response.get("description") } = this.toObject();
202
+ if (description) {
203
+ description = decoratorType === core_1.DecoratorTypes.CLASS ? response.get("description") || description : description;
204
+ response.description(description);
205
+ }
206
+ const headers = this.getMergedKey("headers", response.get("headers"));
207
+ if (headers) {
208
+ response.headers(headers);
209
+ }
210
+ this.mapMedia(response);
211
+ if ((0, isSuccessStatus_1.isSuccessStatus)(this.get("status")) || currentStatus === "default") {
212
+ if (model) {
213
+ entity.type = model;
214
+ }
215
+ }
216
+ // additional info for OS2
217
+ contentType && operation.addProduce(contentType);
218
+ // run additional actions
219
+ return this.runActions();
220
+ }
221
+ mapMedia(response) {
222
+ const contentType = this.getContentType();
223
+ const model = this.get("model");
224
+ const media = response.getMedia(contentType || "*/*");
225
+ const schema = media.get("schema") || new JsonSchema_1.JsonSchema({ type: model });
226
+ if (model) {
227
+ if ((0, core_1.isArray)(model)) {
228
+ schema.oneOf(model.map((type) => ({ type })));
229
+ }
230
+ else {
231
+ schema.type(model);
232
+ }
233
+ }
234
+ this.set("schema", schema);
235
+ media.schema(schema);
236
+ media.groups = this.get("groups");
237
+ const examples = this.get("examples");
238
+ if (examples) {
239
+ media.examples(examples);
240
+ }
241
+ return media;
242
+ }
243
+ }
244
+ function Returns(status, model) {
245
+ const context = new ReturnDecoratorContext({
246
+ status,
247
+ model
248
+ });
249
+ return context.build();
250
+ }
251
+ exports.Returns = Returns;
252
+ //# sourceMappingURL=returns.js.map