@tsed/schema 7.18.2 → 7.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/.eslintignore +13 -0
  2. package/.eslintrc.js +1 -0
  3. package/jest.config.js +13 -3
  4. package/lib/browser/schema.umd.min.js +1 -1
  5. package/lib/browser/schema.umd.min.js.map +1 -1
  6. package/lib/cjs/components/anyMapper.js.map +1 -1
  7. package/lib/cjs/components/classMapper.js.map +1 -1
  8. package/lib/cjs/components/genericsMapper.js.map +1 -1
  9. package/lib/cjs/components/inheritedClassMapper.js.map +1 -1
  10. package/lib/cjs/components/itemMapper.js.map +1 -1
  11. package/lib/cjs/components/lazyRefMapper.js.map +1 -1
  12. package/lib/cjs/components/mapMapper.js.map +1 -1
  13. package/lib/cjs/components/objectMapper.js.map +1 -1
  14. package/lib/cjs/components/ofMapper.js.map +1 -1
  15. package/lib/cjs/components/propertiesMapper.js.map +1 -1
  16. package/lib/cjs/components/schemaMapper.js.map +1 -1
  17. package/lib/cjs/constants/httpMethods.js.map +1 -1
  18. package/lib/cjs/constants/httpStatusMessages.js.map +1 -1
  19. package/lib/cjs/decorators/class/children.js.map +1 -1
  20. package/lib/cjs/decorators/class/discriminatorValue.js.map +1 -1
  21. package/lib/cjs/decorators/collections/collectionContains.js.map +1 -1
  22. package/lib/cjs/decorators/collections/collectionOf.js.map +1 -1
  23. package/lib/cjs/decorators/collections/maxItems.js.map +1 -1
  24. package/lib/cjs/decorators/collections/maxProperties.js.map +1 -1
  25. package/lib/cjs/decorators/collections/minItems.js.map +1 -1
  26. package/lib/cjs/decorators/collections/minProperties.js.map +1 -1
  27. package/lib/cjs/decorators/collections/uniqueItems.js.map +1 -1
  28. package/lib/cjs/decorators/common/additionalProperties.js.map +1 -1
  29. package/lib/cjs/decorators/common/allOf.js.map +1 -1
  30. package/lib/cjs/decorators/common/allow.js.map +1 -1
  31. package/lib/cjs/decorators/common/any.js.map +1 -1
  32. package/lib/cjs/decorators/common/anyOf.js.map +1 -1
  33. package/lib/cjs/decorators/common/const.js.map +1 -1
  34. package/lib/cjs/decorators/common/customKey.js.map +1 -1
  35. package/lib/cjs/decorators/common/default.js.map +1 -1
  36. package/lib/cjs/decorators/common/defaultMsg.js.map +1 -1
  37. package/lib/cjs/decorators/common/description.js.map +1 -1
  38. package/lib/cjs/decorators/common/discriminatorKey.js.map +1 -1
  39. package/lib/cjs/decorators/common/enum.js.map +1 -1
  40. package/lib/cjs/decorators/common/errorMsg.js.map +1 -1
  41. package/lib/cjs/decorators/common/example.js.map +1 -1
  42. package/lib/cjs/decorators/common/examples.js.map +1 -1
  43. package/lib/cjs/decorators/common/exclusiveMaximum.js.map +1 -1
  44. package/lib/cjs/decorators/common/exclusiveMinimum.js.map +1 -1
  45. package/lib/cjs/decorators/common/format.js.map +1 -1
  46. package/lib/cjs/decorators/common/forwardGroups.js.map +1 -1
  47. package/lib/cjs/decorators/common/groups.js.map +1 -1
  48. package/lib/cjs/decorators/common/hidden.js.map +1 -1
  49. package/lib/cjs/decorators/common/ignore.js.map +1 -1
  50. package/lib/cjs/decorators/common/integer.js.map +1 -1
  51. package/lib/cjs/decorators/common/jsonEntityFn.js.map +1 -1
  52. package/lib/cjs/decorators/common/maxLength.js.map +1 -1
  53. package/lib/cjs/decorators/common/maximum.js.map +1 -1
  54. package/lib/cjs/decorators/common/minLength.js.map +1 -1
  55. package/lib/cjs/decorators/common/minimum.js.map +1 -1
  56. package/lib/cjs/decorators/common/multipleOf.js.map +1 -1
  57. package/lib/cjs/decorators/common/name.js.map +1 -1
  58. package/lib/cjs/decorators/common/nullable.js.map +1 -1
  59. package/lib/cjs/decorators/common/oneOf.js.map +1 -1
  60. package/lib/cjs/decorators/common/optional.js.map +1 -1
  61. package/lib/cjs/decorators/common/pattern.js.map +1 -1
  62. package/lib/cjs/decorators/common/property.js.map +1 -1
  63. package/lib/cjs/decorators/common/readOnly.js.map +1 -1
  64. package/lib/cjs/decorators/common/recordOf.js.map +1 -1
  65. package/lib/cjs/decorators/common/required.js.map +1 -1
  66. package/lib/cjs/decorators/common/requiredGroups.js.map +1 -1
  67. package/lib/cjs/decorators/common/schema.js.map +1 -1
  68. package/lib/cjs/decorators/common/title.js.map +1 -1
  69. package/lib/cjs/decorators/common/typeError.js.map +1 -1
  70. package/lib/cjs/decorators/common/writeOnly.js.map +1 -1
  71. package/lib/cjs/decorators/config/jsonEntityComponent.js.map +1 -1
  72. package/lib/cjs/decorators/generics/genericOf.js.map +1 -1
  73. package/lib/cjs/decorators/generics/generics.js.map +1 -1
  74. package/lib/cjs/decorators/operations/acceptMime.js.map +1 -1
  75. package/lib/cjs/decorators/operations/consumes.js.map +1 -1
  76. package/lib/cjs/decorators/operations/contentType.js.map +1 -1
  77. package/lib/cjs/decorators/operations/deprecated.js.map +1 -1
  78. package/lib/cjs/decorators/operations/header.js.map +1 -1
  79. package/lib/cjs/decorators/operations/in.js.map +1 -1
  80. package/lib/cjs/decorators/operations/inFile.js.map +1 -1
  81. package/lib/cjs/decorators/operations/location.js.map +1 -1
  82. package/lib/cjs/decorators/operations/operationId.js.map +1 -1
  83. package/lib/cjs/decorators/operations/operationPath.js.map +1 -1
  84. package/lib/cjs/decorators/operations/partial.js.map +1 -1
  85. package/lib/cjs/decorators/operations/path.js.map +1 -1
  86. package/lib/cjs/decorators/operations/produces.js.map +1 -1
  87. package/lib/cjs/decorators/operations/redirect.js.map +1 -1
  88. package/lib/cjs/decorators/operations/returns.js.map +1 -1
  89. package/lib/cjs/decorators/operations/route.js.map +1 -1
  90. package/lib/cjs/decorators/operations/security.js.map +1 -1
  91. package/lib/cjs/decorators/operations/status.js.map +1 -1
  92. package/lib/cjs/decorators/operations/summary.js.map +1 -1
  93. package/lib/cjs/decorators/operations/tags.js.map +1 -1
  94. package/lib/cjs/decorators/operations/view.js.map +1 -1
  95. package/lib/cjs/domain/DecoratorContext.js.map +1 -1
  96. package/lib/cjs/domain/JsonAliasMap.js.map +1 -1
  97. package/lib/cjs/domain/JsonClassStore.js.map +1 -1
  98. package/lib/cjs/domain/JsonDiscriminator.js.map +1 -1
  99. package/lib/cjs/domain/JsonEntityStore.js.map +1 -1
  100. package/lib/cjs/domain/JsonFormatTypes.js.map +1 -1
  101. package/lib/cjs/domain/JsonLazyRef.js.map +1 -1
  102. package/lib/cjs/domain/JsonMap.js.map +1 -1
  103. package/lib/cjs/domain/JsonMethodStore.js.map +1 -1
  104. package/lib/cjs/domain/JsonOperation.js.map +1 -1
  105. package/lib/cjs/domain/JsonOperationPathsMap.js.map +1 -1
  106. package/lib/cjs/domain/JsonOperationRoute.js.map +1 -1
  107. package/lib/cjs/domain/JsonParameter.js.map +1 -1
  108. package/lib/cjs/domain/JsonParameterStore.js.map +1 -1
  109. package/lib/cjs/domain/JsonParameterTypes.js.map +1 -1
  110. package/lib/cjs/domain/JsonPropertyStore.js.map +1 -1
  111. package/lib/cjs/domain/JsonRequestBody.js.map +1 -1
  112. package/lib/cjs/domain/JsonResponse.js.map +1 -1
  113. package/lib/cjs/domain/JsonSchema.js.map +1 -1
  114. package/lib/cjs/domain/SpecTypes.js.map +1 -1
  115. package/lib/cjs/hooks/alterIgnore.js.map +1 -1
  116. package/lib/cjs/hooks/alterOneOf.js.map +1 -1
  117. package/lib/cjs/hooks/alterRequiredGroups.js.map +1 -1
  118. package/lib/cjs/index.js.map +1 -1
  119. package/lib/cjs/interfaces/IgnoreCallback.js.map +1 -1
  120. package/lib/cjs/interfaces/JsonHookContext.js.map +1 -1
  121. package/lib/cjs/interfaces/JsonOpenSpec.js.map +1 -1
  122. package/lib/cjs/interfaces/JsonSchemaOptions.js.map +1 -1
  123. package/lib/cjs/registries/JsonSchemaMapperContainer.js.map +1 -1
  124. package/lib/cjs/registries/enumRegistries.js.map +1 -1
  125. package/lib/cjs/utils/buildPath.js.map +1 -1
  126. package/lib/cjs/utils/concatParameters.js.map +1 -1
  127. package/lib/cjs/utils/concatPath.js.map +1 -1
  128. package/lib/cjs/utils/defineStatusModel.js.map +1 -1
  129. package/lib/cjs/utils/from.js.map +1 -1
  130. package/lib/cjs/utils/generateSpec.js.map +1 -1
  131. package/lib/cjs/utils/generics.js.map +1 -1
  132. package/lib/cjs/utils/getComputedType.js +1 -1
  133. package/lib/cjs/utils/getComputedType.js.map +1 -1
  134. package/lib/cjs/utils/getInheritedStores.js.map +1 -1
  135. package/lib/cjs/utils/getJsonEntityStore.js.map +1 -1
  136. package/lib/cjs/utils/getJsonPathParameters.js.map +1 -1
  137. package/lib/cjs/utils/getJsonSchema.js.map +1 -1
  138. package/lib/cjs/utils/getJsonType.js.map +1 -1
  139. package/lib/cjs/utils/getOperationsRoutes.js.map +1 -1
  140. package/lib/cjs/utils/getOperationsStores.js.map +1 -1
  141. package/lib/cjs/utils/getPropertiesStores.js.map +1 -1
  142. package/lib/cjs/utils/getRequiredProperties.js.map +1 -1
  143. package/lib/cjs/utils/getSpec.js.map +1 -1
  144. package/lib/cjs/utils/getSpecType.js.map +1 -1
  145. package/lib/cjs/utils/isSuccessStatus.js.map +1 -1
  146. package/lib/cjs/utils/mapHeaders.js.map +1 -1
  147. package/lib/cjs/utils/mapNullableType.js.map +1 -1
  148. package/lib/cjs/utils/mapOpenSpec.js.map +1 -1
  149. package/lib/cjs/utils/mapOpenSpec2.js.map +1 -1
  150. package/lib/cjs/utils/mapOpenSpec3.js.map +1 -1
  151. package/lib/cjs/utils/mapOpenSpecInfo.js.map +1 -1
  152. package/lib/cjs/utils/mapRouteOptions.js.map +1 -1
  153. package/lib/cjs/utils/matchGroups.js.map +1 -1
  154. package/lib/cjs/utils/mergeOperation.js.map +1 -1
  155. package/lib/cjs/utils/mergeSpec.js.map +1 -1
  156. package/lib/cjs/utils/operationIdFormatter.js.map +1 -1
  157. package/lib/cjs/utils/ref.js.map +1 -1
  158. package/lib/cjs/utils/serializeEnumValues.js.map +1 -1
  159. package/lib/cjs/utils/toJsonMapCollection.js.map +1 -1
  160. package/lib/cjs/utils/toJsonRegex.js.map +1 -1
  161. package/lib/cjs/utils/transformToOS2.js.map +1 -1
  162. package/lib/cjs/utils/withErrorMsg.js.map +1 -1
  163. package/lib/esm/components/anyMapper.js.map +1 -1
  164. package/lib/esm/components/classMapper.js.map +1 -1
  165. package/lib/esm/components/genericsMapper.js.map +1 -1
  166. package/lib/esm/components/inheritedClassMapper.js.map +1 -1
  167. package/lib/esm/components/itemMapper.js.map +1 -1
  168. package/lib/esm/components/lazyRefMapper.js.map +1 -1
  169. package/lib/esm/components/mapMapper.js.map +1 -1
  170. package/lib/esm/components/objectMapper.js.map +1 -1
  171. package/lib/esm/components/ofMapper.js.map +1 -1
  172. package/lib/esm/components/propertiesMapper.js.map +1 -1
  173. package/lib/esm/components/schemaMapper.js.map +1 -1
  174. package/lib/esm/constants/httpMethods.js.map +1 -1
  175. package/lib/esm/constants/httpStatusMessages.js.map +1 -1
  176. package/lib/esm/decorators/class/children.js.map +1 -1
  177. package/lib/esm/decorators/class/discriminatorValue.js.map +1 -1
  178. package/lib/esm/decorators/collections/collectionContains.js.map +1 -1
  179. package/lib/esm/decorators/collections/collectionOf.js.map +1 -1
  180. package/lib/esm/decorators/collections/maxItems.js.map +1 -1
  181. package/lib/esm/decorators/collections/maxProperties.js.map +1 -1
  182. package/lib/esm/decorators/collections/minItems.js.map +1 -1
  183. package/lib/esm/decorators/collections/minProperties.js.map +1 -1
  184. package/lib/esm/decorators/collections/uniqueItems.js.map +1 -1
  185. package/lib/esm/decorators/common/additionalProperties.js.map +1 -1
  186. package/lib/esm/decorators/common/allOf.js.map +1 -1
  187. package/lib/esm/decorators/common/allow.js.map +1 -1
  188. package/lib/esm/decorators/common/any.js.map +1 -1
  189. package/lib/esm/decorators/common/anyOf.js.map +1 -1
  190. package/lib/esm/decorators/common/const.js.map +1 -1
  191. package/lib/esm/decorators/common/customKey.js.map +1 -1
  192. package/lib/esm/decorators/common/default.js.map +1 -1
  193. package/lib/esm/decorators/common/defaultMsg.js.map +1 -1
  194. package/lib/esm/decorators/common/description.js.map +1 -1
  195. package/lib/esm/decorators/common/discriminatorKey.js.map +1 -1
  196. package/lib/esm/decorators/common/enum.js.map +1 -1
  197. package/lib/esm/decorators/common/errorMsg.js.map +1 -1
  198. package/lib/esm/decorators/common/example.js.map +1 -1
  199. package/lib/esm/decorators/common/examples.js.map +1 -1
  200. package/lib/esm/decorators/common/exclusiveMaximum.js.map +1 -1
  201. package/lib/esm/decorators/common/exclusiveMinimum.js.map +1 -1
  202. package/lib/esm/decorators/common/format.js.map +1 -1
  203. package/lib/esm/decorators/common/forwardGroups.js.map +1 -1
  204. package/lib/esm/decorators/common/groups.js.map +1 -1
  205. package/lib/esm/decorators/common/hidden.js.map +1 -1
  206. package/lib/esm/decorators/common/ignore.js.map +1 -1
  207. package/lib/esm/decorators/common/integer.js.map +1 -1
  208. package/lib/esm/decorators/common/jsonEntityFn.js.map +1 -1
  209. package/lib/esm/decorators/common/maxLength.js.map +1 -1
  210. package/lib/esm/decorators/common/maximum.js.map +1 -1
  211. package/lib/esm/decorators/common/minLength.js.map +1 -1
  212. package/lib/esm/decorators/common/minimum.js.map +1 -1
  213. package/lib/esm/decorators/common/multipleOf.js.map +1 -1
  214. package/lib/esm/decorators/common/name.js.map +1 -1
  215. package/lib/esm/decorators/common/nullable.js.map +1 -1
  216. package/lib/esm/decorators/common/oneOf.js.map +1 -1
  217. package/lib/esm/decorators/common/optional.js.map +1 -1
  218. package/lib/esm/decorators/common/pattern.js.map +1 -1
  219. package/lib/esm/decorators/common/property.js.map +1 -1
  220. package/lib/esm/decorators/common/readOnly.js.map +1 -1
  221. package/lib/esm/decorators/common/recordOf.js.map +1 -1
  222. package/lib/esm/decorators/common/required.js.map +1 -1
  223. package/lib/esm/decorators/common/requiredGroups.js.map +1 -1
  224. package/lib/esm/decorators/common/schema.js.map +1 -1
  225. package/lib/esm/decorators/common/title.js.map +1 -1
  226. package/lib/esm/decorators/common/typeError.js.map +1 -1
  227. package/lib/esm/decorators/common/writeOnly.js.map +1 -1
  228. package/lib/esm/decorators/config/jsonEntityComponent.js.map +1 -1
  229. package/lib/esm/decorators/generics/genericOf.js.map +1 -1
  230. package/lib/esm/decorators/generics/generics.js.map +1 -1
  231. package/lib/esm/decorators/operations/acceptMime.js.map +1 -1
  232. package/lib/esm/decorators/operations/consumes.js.map +1 -1
  233. package/lib/esm/decorators/operations/contentType.js.map +1 -1
  234. package/lib/esm/decorators/operations/deprecated.js.map +1 -1
  235. package/lib/esm/decorators/operations/header.js.map +1 -1
  236. package/lib/esm/decorators/operations/in.js.map +1 -1
  237. package/lib/esm/decorators/operations/inFile.js.map +1 -1
  238. package/lib/esm/decorators/operations/location.js.map +1 -1
  239. package/lib/esm/decorators/operations/operationId.js.map +1 -1
  240. package/lib/esm/decorators/operations/operationPath.js.map +1 -1
  241. package/lib/esm/decorators/operations/partial.js.map +1 -1
  242. package/lib/esm/decorators/operations/path.js.map +1 -1
  243. package/lib/esm/decorators/operations/produces.js.map +1 -1
  244. package/lib/esm/decorators/operations/redirect.js.map +1 -1
  245. package/lib/esm/decorators/operations/returns.js.map +1 -1
  246. package/lib/esm/decorators/operations/route.js.map +1 -1
  247. package/lib/esm/decorators/operations/security.js.map +1 -1
  248. package/lib/esm/decorators/operations/status.js.map +1 -1
  249. package/lib/esm/decorators/operations/summary.js.map +1 -1
  250. package/lib/esm/decorators/operations/tags.js.map +1 -1
  251. package/lib/esm/decorators/operations/view.js.map +1 -1
  252. package/lib/esm/domain/DecoratorContext.js.map +1 -1
  253. package/lib/esm/domain/JsonAliasMap.js.map +1 -1
  254. package/lib/esm/domain/JsonClassStore.js.map +1 -1
  255. package/lib/esm/domain/JsonDiscriminator.js.map +1 -1
  256. package/lib/esm/domain/JsonEntityStore.js.map +1 -1
  257. package/lib/esm/domain/JsonFormatTypes.js.map +1 -1
  258. package/lib/esm/domain/JsonLazyRef.js.map +1 -1
  259. package/lib/esm/domain/JsonMap.js.map +1 -1
  260. package/lib/esm/domain/JsonMethodStore.js.map +1 -1
  261. package/lib/esm/domain/JsonOperation.js.map +1 -1
  262. package/lib/esm/domain/JsonOperationPathsMap.js.map +1 -1
  263. package/lib/esm/domain/JsonOperationRoute.js.map +1 -1
  264. package/lib/esm/domain/JsonParameter.js.map +1 -1
  265. package/lib/esm/domain/JsonParameterStore.js.map +1 -1
  266. package/lib/esm/domain/JsonParameterTypes.js.map +1 -1
  267. package/lib/esm/domain/JsonPropertyStore.js.map +1 -1
  268. package/lib/esm/domain/JsonRequestBody.js.map +1 -1
  269. package/lib/esm/domain/JsonResponse.js.map +1 -1
  270. package/lib/esm/domain/JsonSchema.js.map +1 -1
  271. package/lib/esm/domain/SpecTypes.js.map +1 -1
  272. package/lib/esm/hooks/alterIgnore.js.map +1 -1
  273. package/lib/esm/hooks/alterOneOf.js.map +1 -1
  274. package/lib/esm/hooks/alterRequiredGroups.js.map +1 -1
  275. package/lib/esm/index.js.map +1 -1
  276. package/lib/esm/interfaces/IgnoreCallback.js.map +1 -1
  277. package/lib/esm/interfaces/JsonHookContext.js.map +1 -1
  278. package/lib/esm/interfaces/JsonOpenSpec.js.map +1 -1
  279. package/lib/esm/interfaces/JsonSchemaOptions.js.map +1 -1
  280. package/lib/esm/registries/JsonSchemaMapperContainer.js.map +1 -1
  281. package/lib/esm/registries/enumRegistries.js.map +1 -1
  282. package/lib/esm/utils/buildPath.js.map +1 -1
  283. package/lib/esm/utils/concatParameters.js.map +1 -1
  284. package/lib/esm/utils/concatPath.js.map +1 -1
  285. package/lib/esm/utils/defineStatusModel.js.map +1 -1
  286. package/lib/esm/utils/from.js.map +1 -1
  287. package/lib/esm/utils/generateSpec.js.map +1 -1
  288. package/lib/esm/utils/generics.js.map +1 -1
  289. package/lib/esm/utils/getComputedType.js +1 -1
  290. package/lib/esm/utils/getComputedType.js.map +1 -1
  291. package/lib/esm/utils/getInheritedStores.js.map +1 -1
  292. package/lib/esm/utils/getJsonEntityStore.js.map +1 -1
  293. package/lib/esm/utils/getJsonPathParameters.js.map +1 -1
  294. package/lib/esm/utils/getJsonSchema.js.map +1 -1
  295. package/lib/esm/utils/getJsonType.js.map +1 -1
  296. package/lib/esm/utils/getOperationsRoutes.js.map +1 -1
  297. package/lib/esm/utils/getOperationsStores.js.map +1 -1
  298. package/lib/esm/utils/getPropertiesStores.js.map +1 -1
  299. package/lib/esm/utils/getRequiredProperties.js.map +1 -1
  300. package/lib/esm/utils/getSpec.js.map +1 -1
  301. package/lib/esm/utils/getSpecType.js.map +1 -1
  302. package/lib/esm/utils/isSuccessStatus.js.map +1 -1
  303. package/lib/esm/utils/mapHeaders.js.map +1 -1
  304. package/lib/esm/utils/mapNullableType.js.map +1 -1
  305. package/lib/esm/utils/mapOpenSpec.js.map +1 -1
  306. package/lib/esm/utils/mapOpenSpec2.js.map +1 -1
  307. package/lib/esm/utils/mapOpenSpec3.js.map +1 -1
  308. package/lib/esm/utils/mapOpenSpecInfo.js.map +1 -1
  309. package/lib/esm/utils/mapRouteOptions.js.map +1 -1
  310. package/lib/esm/utils/matchGroups.js.map +1 -1
  311. package/lib/esm/utils/mergeOperation.js.map +1 -1
  312. package/lib/esm/utils/mergeSpec.js.map +1 -1
  313. package/lib/esm/utils/operationIdFormatter.js.map +1 -1
  314. package/lib/esm/utils/ref.js.map +1 -1
  315. package/lib/esm/utils/serializeEnumValues.js.map +1 -1
  316. package/lib/esm/utils/toJsonMapCollection.js.map +1 -1
  317. package/lib/esm/utils/toJsonRegex.js.map +1 -1
  318. package/lib/esm/utils/transformToOS2.js.map +1 -1
  319. package/lib/esm/utils/withErrorMsg.js.map +1 -1
  320. package/lib/tsconfig.esm.tsbuildinfo +1 -0
  321. package/lib/tsconfig.tsbuildinfo +1 -0
  322. package/lib/types/domain/JsonAliasMap.d.ts +2 -2
  323. package/lib/types/domain/JsonMethodStore.d.ts +1 -1
  324. package/lib/types/domain/JsonParameterStore.d.ts +1 -1
  325. package/lib/types/domain/JsonPropertyStore.d.ts +1 -1
  326. package/lib/types/domain/JsonRequestBody.d.ts +1 -1
  327. package/lib/types/domain/JsonResponse.d.ts +1 -1
  328. package/lib/types/domain/JsonSchema.d.ts +1 -1
  329. package/lib/types/utils/generics.d.ts +2 -2
  330. package/lib/types/utils/getSpec.d.ts +1 -1
  331. package/lib/types/utils/withErrorMsg.d.ts +1 -1
  332. package/package.json +15 -11
  333. package/{tsconfig.compile.esm.json → tsconfig.esm.json} +15 -5
  334. package/coverage.json +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"minimum.js","sourceRoot":"","sources":["../../../../src/decorators/common/minimum.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AACtD,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACU,QAAA,OAAO,GAAG,IAAA,2BAAY,EAAC,SAAS,EAAE,CAAC,OAAe,EAAE,YAAqB,KAAK,EAAE,EAAE;IAC7F,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACU,QAAA,GAAG,GAAG,eAAO,CAAC","sourcesContent":["import {withErrorMsg} from \"../../utils/withErrorMsg\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * The value of `minimum` MUST be a number, representing an inclusive upper limit for a numeric instance.\n *\n * If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to `minimum`.\n *\n * ::: warning\n * This decorator will be removed in v7.\n * For v6 user, use @@Minimum@@ from @tsed/schema instead of @tsed/common.\n * :::\n *\n * ## Example\n * ### With primitive type\n *\n * ```typescript\n * class Model {\n * @Minimum(10)\n * property: number;\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"number\",\n * \"minimum\": 10\n * }\n * }\n * }\n * ```\n *\n * ### With array type\n *\n * ```typescript\n * class Model {\n * @Minimum(10)\n * @CollectionOf(Number)\n * property: number[];\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"array\",\n * \"items\": {\n * \"type\": \"number\",\n * \"minimum\": 10\n * }\n * }\n * }\n * }\n * ```\n *\n * @param {number} minimum The minimum value allowed\n * @param {boolean} exclusive\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @ajv-errors\n */\nexport const Minimum = withErrorMsg(\"minimum\", (minimum: number, exclusive: boolean = false) => {\n return JsonEntityFn((store) => {\n exclusive ? store.itemSchema.exclusiveMinimum(minimum) : store.itemSchema.minimum(minimum);\n });\n});\n\n/**\n * The value of `minimum` MUST be a number, representing an inclusive upper limit for a numeric instance.\n *\n * If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to `minimum`.\n *\n * ## Example\n * ### With primitive type\n *\n * ```typescript\n * class Model {\n * @Min(10)\n * property: number;\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"number\",\n * \"minimum\": 10\n * }\n * }\n * }\n * ```\n *\n * ### With array type\n *\n * ```typescript\n * class Model {\n * @Min(10)\n * @CollectionOf(Number)\n * property: number[];\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"array\",\n * \"items\": {\n * \"type\": \"number\",\n * \"minimum\": 10\n * }\n * }\n * }\n * }\n * ```\n *\n * @alias Minimum\n * @param minimum The minimum value allowed\n * @param exclusive\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport const Min = Minimum;\n"]}
1
+ {"version":3,"file":"minimum.js","sourceRoot":"","sources":["../../../../src/decorators/common/minimum.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AACtD,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACU,QAAA,OAAO,GAAG,IAAA,2BAAY,EAAC,SAAS,EAAE,CAAC,OAAe,EAAE,YAAqB,KAAK,EAAE,EAAE;IAC7F,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACU,QAAA,GAAG,GAAG,eAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"multipleOf.js","sourceRoot":"","sources":["../../../../src/decorators/common/multipleOf.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AACtD,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACU,QAAA,UAAU,GAAG,IAAA,2BAAY,EAAC,YAAY,EAAE,CAAC,UAAkB,EAAE,EAAE;IAC1E,IAAI,UAAU,IAAI,CAAC,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;KACvF;IAED,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {withErrorMsg} from \"../../utils/withErrorMsg\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * A numeric instance is valid only if division by this keyword's value results in an integer.\n *\n * ::: warning\n * The value of `multipleOf` MUST be a number, strictly greater than 0.\n * :::\n *\n * ::: warning\n * For v6 user, use @@MultipleOf@@ from @tsed/schema instead of @tsed/common.\n * :::\n *\n * ## Example\n * ### With primitive type\n *\n * ```typescript\n * class Model {\n * @MultipleOf(2)\n * property: Number;\n * }\n * ```\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"number\",\n * \"multipleOf\": 2\n * }\n * }\n * }\n * ```\n *\n * ### With array type\n *\n * ```typescript\n * class Model {\n * @CollectionOf(number)\n * @MultipleOf(2)\n * property: number[];\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"array\",\n * \"items\": {\n * \"type\": \"number\",\n * \"multipleOf\": 2\n * }\n * }\n * }\n * }\n * ```\n *\n * @param {number} multipleOf The multiple value allowed\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @ajv-errors\n */\nexport const MultipleOf = withErrorMsg(\"multipleOf\", (multipleOf: number) => {\n if (multipleOf <= 0) {\n throw new Error(\"The value of multipleOf MUST be a number, strictly greater than 0.\");\n }\n\n return JsonEntityFn((store) => {\n store.itemSchema.multipleOf(multipleOf);\n });\n});\n"]}
1
+ {"version":3,"file":"multipleOf.js","sourceRoot":"","sources":["../../../../src/decorators/common/multipleOf.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AACtD,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACU,QAAA,UAAU,GAAG,IAAA,2BAAY,EAAC,YAAY,EAAE,CAAC,UAAkB,EAAE,EAAE;IAC1E,IAAI,UAAU,IAAI,CAAC,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;KACvF;IAED,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"name.js","sourceRoot":"","sources":["../../../../src/decorators/common/name.ts"],"names":[],"mappings":";;;AAAA,qCAAgF;AAEhF,yDAAoD;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAgB,IAAI,CAAC,IAAS;IAC5B,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,IAAyB,EAAE,EAAE;QACxE,QAAQ,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,qBAAc,CAAC,KAAK;gBACvB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACxB,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,KAAK,CAAC,SAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5B,MAAM;YACR;gBACE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;SAC/C;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAbD,oBAaC","sourcesContent":["import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\n\n/**\n * Add a name metadata on the decorated element.\n *\n * ## Examples\n * ### On parameters\n *\n * ```typescript\n * async myMethod(@Name(\"nameOf\") @PathParams(\"id\") id: string): Promise<Model> {\n *\n * }\n * ```\n *\n * ### On parameters\n *\n * ```typescript\n * @Name(\"AliasName\")\n * @Controller(\"/\")\n * class ModelCtrl {\n *\n * }\n * ```\n *\n * @param name\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @classDecorator\n * @operation\n */\nexport function Name(name: any) {\n return JsonEntityFn((store: JsonEntityStore, args: DecoratorParameters) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.CLASS:\n store.schema.name(name);\n break;\n case DecoratorTypes.PARAM:\n store.parameter!.name(name);\n break;\n default:\n store.parent.schema.addAlias(args[1], name);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"name.js","sourceRoot":"","sources":["../../../../src/decorators/common/name.ts"],"names":[],"mappings":";;;AAAA,qCAAgF;AAEhF,yDAAoD;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAgB,IAAI,CAAC,IAAS;IAC5B,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,IAAyB,EAAE,EAAE;QACxE,QAAQ,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,qBAAc,CAAC,KAAK;gBACvB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACxB,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,KAAK,CAAC,SAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5B,MAAM;YACR;gBACE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;SAC/C;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAbD,oBAaC"}
@@ -1 +1 @@
1
- {"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../../src/decorators/common/nullable.ts"],"names":[],"mappings":";;;AAAA,qCAA+C;AAE/C,+BAA0B;AAC1B,yCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,QAAQ,CAAC,IAA2C,EAAE,GAAG,KAAgD;IACvH,KAAK,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;IACzB,OAAO,IAAA,oBAAa,EAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAA,SAAG,EAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;AACtF,CAAC;AAHD,4BAGC","sourcesContent":["import {Type, useDecorators} from \"@tsed/core\";\nimport type {JSONSchema6TypeName} from \"json-schema\";\nimport {Any} from \"./any\";\nimport {Property} from \"./property\";\n\n/**\n * Set field as nullable.\n *\n * ## Example\n *\n * ```typescript\n * class Model {\n * @Nullable(Date)\n * property: Date | null;\n *\n * @Nullable(String, Number, Boolean)\n * property: string | number | boolean | null;\n * }\n * ```\n *\n * @returns {Function}\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Nullable(type: JSONSchema6TypeName | Type<any> | any, ...types: (JSONSchema6TypeName | Type<any> | any)[]) {\n types = [type, ...types];\n return useDecorators(types.length === 1 && Property(types[0]), Any(null, ...types));\n}\n"]}
1
+ {"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../../src/decorators/common/nullable.ts"],"names":[],"mappings":";;;AAAA,qCAA+C;AAE/C,+BAA0B;AAC1B,yCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,QAAQ,CAAC,IAA2C,EAAE,GAAG,KAAgD;IACvH,KAAK,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;IACzB,OAAO,IAAA,oBAAa,EAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAA,SAAG,EAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;AACtF,CAAC;AAHD,4BAGC"}
@@ -1 +1 @@
1
- {"version":3,"file":"oneOf.js","sourceRoot":"","sources":["../../../../src/decorators/common/oneOf.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAE5C;;;;;;;;;;;;;;GAcG;AACH,SAAgB,KAAK,CAAC,GAAG,KAAsB;IAC7C,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC;AALD,sBAKC","sourcesContent":["import {AnyJsonSchema} from \"../../domain/JsonSchema\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28\n *\n * ::: warning\n * OneOf isn't supported by OS2\n * :::\n *\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @classDecorator\n * @input\n * @param oneOf\n */\nexport function OneOf(...oneOf: AnyJsonSchema[]) {\n return JsonEntityFn((entity) => {\n entity.itemSchema.oneOf(oneOf);\n entity.type = Object;\n });\n}\n"]}
1
+ {"version":3,"file":"oneOf.js","sourceRoot":"","sources":["../../../../src/decorators/common/oneOf.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAE5C;;;;;;;;;;;;;;GAcG;AACH,SAAgB,KAAK,CAAC,GAAG,KAAsB;IAC7C,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC;AALD,sBAKC"}
@@ -1 +1 @@
1
- {"version":3,"file":"optional.js","sourceRoot":"","sources":["../../../../src/decorators/common/optional.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,iDAA4C;AAG5C;;;;;;;;GAQG;AACH,SAAgB,QAAQ;IACtB,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,QAAQ,KAAK,CAAC,aAAa,EAAE;YAC3B,KAAK,qBAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,QAAQ,GAAG,KAAK,CAAC;gBAC/C,MAAM;YACR,KAAK,qBAAc,CAAC,IAAI;gBACtB,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBACtD,MAAM;SACT;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAXD,4BAWC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\nimport type {JsonParameterStore} from \"../../domain/JsonParameterStore\";\n\n/**\n * Add optional annotation on Property or Parameter.\n *\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Optional() {\n return JsonEntityFn((store) => {\n switch (store.decoratorType) {\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).required = false;\n break;\n case DecoratorTypes.PROP:\n store.parentSchema.removeRequired(store.propertyName);\n break;\n }\n });\n}\n"]}
1
+ {"version":3,"file":"optional.js","sourceRoot":"","sources":["../../../../src/decorators/common/optional.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,iDAA4C;AAG5C;;;;;;;;GAQG;AACH,SAAgB,QAAQ;IACtB,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,QAAQ,KAAK,CAAC,aAAa,EAAE;YAC3B,KAAK,qBAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,QAAQ,GAAG,KAAK,CAAC;gBAC/C,MAAM;YACR,KAAK,qBAAc,CAAC,IAAI;gBACtB,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBACtD,MAAM;SACT;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAXD,4BAWC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../../../src/decorators/common/pattern.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AACtD,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FG;AACU,QAAA,OAAO,GAAG,IAAA,2BAAY,EAAC,SAAS,EAAE,CAAC,OAAwB,EAAE,EAAE;IAC1E,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,EAAE;QAC7C,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {withErrorMsg} from \"../../utils/withErrorMsg\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * The pattern and Pattern Properties keywords use regular expressions to express constraints.\n * The regular expression syntax used is from JavaScript (ECMA 262, specifically). However, that complete syntax is not widely supported, therefore it is recommended that you stick to the subset of that syntax described below.\n *\n * ::: warning\n * For v6 user, use @@Pattern@@ from @tsed/schema instead of @tsed/common.\n * :::\n *\n * A single unicode character (other than the special characters below) matches itself.\n *\n * * `^`: Matches only at the beginning of the string.\n * * `$`: Matches only at the end of the string.\n * * `(...)`: Group a series of regular expressions into a single regular expression.\n * * `|`: Matches either the regular expression preceding or following the | symbol.\n * * `[abc]`: Matches any of the characters inside the square brackets.\n * * `[a-z]`: Matches the range of characters.\n * * `[^abc]`: Matches any character not listed.\n * * `[^a-z]`: Matches any character outside of the range.\n * * `+`: Matches one or more repetitions of the preceding regular expression.\n * * `*`: Matches zero or more repetitions of the preceding regular expression.\n * * `?`: Matches zero or one repetitions of the preceding regular expression.\n * * `+?`, *?`, ??`: The `*`, `+`, and `?` qualifiers are all greedy; they match as much text as possible. Sometimes this behavior isn’t desired and you want to match as few characters as possible.\n * * `{x}`: Match exactly x occurrences of the preceding regular expression.\n * * `{x,y}`: Match at least x and at most y occurrences of the preceding regular expression.\n * * `{x,}`: Match x occurrences or more of the preceding regular expression.\n * * `{x}?`, {x,y}?, {x,}?`: Lazy versions of the above expressions.\n *\n * ## Example\n *\n * ```typescript\n * class Model {\n * @Pattern(\"^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$\")\n * @Pattern(/^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$/)\n * property: string;\n * }\n * ```\n *\n * ### With primitive type\n *\n * ```typescript\n * class Model {\n * @Pattern(/^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$/)\n * property: string;\n * }\n * ```\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"string\",\n * \"pattern\": \"^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$\"\n * }\n * }\n * }\n * ```\n *\n * ### With array type\n *\n * ```typescript\n * class Model {\n * @CollectionOf(string)\n * @Pattern(/^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$/)\n * property: string[];\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"property\": {\n * \"type\": \"array\",\n * \"items\": {\n * \"type\": \"string\",\n * \"pattern\": \"^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$\"\n * }\n * }\n * }\n * }\n * ```\n *\n * @param {string} pattern\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @ajv-errors\n */\nexport const Pattern = withErrorMsg(\"pattern\", (pattern: string | RegExp) => {\n return JsonEntityFn((store: JsonEntityStore) => {\n store.itemSchema.pattern(pattern);\n });\n});\n"]}
1
+ {"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../../../src/decorators/common/pattern.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AACtD,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FG;AACU,QAAA,OAAO,GAAG,IAAA,2BAAY,EAAC,SAAS,EAAE,CAAC,OAAwB,EAAE,EAAE;IAC1E,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,EAAE;QAC7C,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"property.js","sourceRoot":"","sources":["../../../../src/decorators/common/property.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AACnC,iDAA4C;AAE5C;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CAAC,IAAU;IACjC,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,IAAI,IAAI,EAAE;YACR,IAAI,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE;gBACjB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;aACnB;YACD,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC7B;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AATD,4BASC","sourcesContent":["import {isClass} from \"@tsed/core\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * Declare a new property on a model.\n *\n * @param type\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function Property(type?: any) {\n return JsonEntityFn((store) => {\n if (type) {\n if (isClass(type)) {\n store.type = type;\n }\n store.itemSchema.type(type);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"property.js","sourceRoot":"","sources":["../../../../src/decorators/common/property.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AACnC,iDAA4C;AAE5C;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CAAC,IAAU;IACjC,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,IAAI,IAAI,EAAE;YACR,IAAI,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE;gBACjB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;aACnB;YACD,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC7B;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AATD,4BASC"}
@@ -1 +1 @@
1
- {"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../../src/decorators/common/readOnly.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAC5C;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CAAC,WAAoB,IAAI;IAC/C,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,EAAE;QAC7C,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,4BAIC","sourcesContent":["import {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n/**\n * Set the property as readOnly.\n *\n * @returns {Function}\n * @decorator\n * @validation\n * @property\n * @parameter\n * @schema\n */\nexport function ReadOnly(readOnly: boolean = true) {\n return JsonEntityFn((store: JsonEntityStore) => {\n store.itemSchema.readOnly(readOnly);\n });\n}\n"]}
1
+ {"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../../src/decorators/common/readOnly.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAC5C;;;;;;;;;GASG;AACH,SAAgB,QAAQ,CAAC,WAAoB,IAAI;IAC/C,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,EAAE;QAC7C,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,4BAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"recordOf.js","sourceRoot":"","sources":["../../../../src/decorators/common/recordOf.ts"],"names":[],"mappings":";;;AAAA,qCAAgC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,SAAgB,QAAQ,CAAC,KAAU,EAAE,GAAG,IAAc;IACpD,OAAO,IAAA,eAAM,EAAC;QACZ,UAAU,EAAE;YACV,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;gBAC9B,OAAO;oBACL,GAAG,OAAO;oBACV,CAAC,GAAG,CAAC,EAAE,KAAK;iBACb,CAAC;YACJ,CAAC,EAAE,EAAE,CAAC;SACP;KACF,CAAC,CAAC;AACL,CAAC;AAXD,4BAWC","sourcesContent":["import {Schema} from \"./schema\";\n\n/**\n * Constructs a json schema object type whose property keys are keys and whose property values are type.\n *\n * ## Example\n *\n * ```typescript\n * type keys = 'one' | 'two';\n *\n * class Part {\n * prop: string;\n * }\n *\n * type Parts = Record<keys, Part>;\n *\n * class Test {\n * @RecordOf(Part, 'one', 'two')\n * parts: Parts;\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"one\": {\n * \"$ref\": \"#/components/schemas/Part\"\n * },\n * \"two\": {\n * \"$ref\": \"#/components/schemas/Part\"\n * },\n * },\n * }\n * ```\n *\n * @param model\n * @param keys\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @classDecorator\n * @input\n */\nexport function RecordOf(model: any, ...keys: string[]) {\n return Schema({\n properties: {\n ...keys.reduce((initial, key) => {\n return {\n ...initial,\n [key]: model\n };\n }, {})\n }\n });\n}\n"]}
1
+ {"version":3,"file":"recordOf.js","sourceRoot":"","sources":["../../../../src/decorators/common/recordOf.ts"],"names":[],"mappings":";;;AAAA,qCAAgC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,SAAgB,QAAQ,CAAC,KAAU,EAAE,GAAG,IAAc;IACpD,OAAO,IAAA,eAAM,EAAC;QACZ,UAAU,EAAE;YACV,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;gBAC9B,OAAO;oBACL,GAAG,OAAO;oBACV,CAAC,GAAG,CAAC,EAAE,KAAK;iBACb,CAAC;YACJ,CAAC,EAAE,EAAE,CAAC;SACP;KACF,CAAC,CAAC;AACL,CAAC;AAXD,4BAWC"}
@@ -1 +1 @@
1
- {"version":3,"file":"required.js","sourceRoot":"","sources":["../../../../src/decorators/common/required.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AACtD,mCAA8B;AAC9B,yCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACU,QAAA,QAAQ,GAAG,IAAA,2BAAY,EAAC,UAAU,EAAE,CAAC,WAAoB,IAAI,EAAE,GAAG,qBAA4B,EAAE,EAAE;IAC7G,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAA,aAAK,EAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAQ,GAAE,CAAC;AACjE,CAAC,CAAC,CAAC","sourcesContent":["import {withErrorMsg} from \"../../utils/withErrorMsg\";\nimport {Allow} from \"./allow\";\nimport {Optional} from \"./optional\";\n\n/**\n * Add required annotation on Property or Parameter.\n *\n * The @@Required@@ decorator can be used on two cases.\n *\n * To decorate a parameters:\n *\n * ```typescript\n * @Post(\"/\")\n * async method(@Required() @BodyParams(\"field\") field: string) {}\n * ```\n *\n * To decorate a model:\n *\n * ```typescript\n * class Model {\n * @Required()\n * field: string;\n * }\n * ```\n *\n * ::: tip\n * Required will throw a BadRequest when the given value is `null`, an empty string or `undefined`.\n * :::\n *\n * ### Allow values\n *\n * In some case, you didn't want trigger a BadRequest when the value is an empty string for example.\n * The decorator `@Allow()`, allow you to configure a value list for which there will be no exception.\n *\n * ```typescript\n * class Model {\n * @Allow(\"\") // add automatically required flag\n * field: string;\n * }\n * ```\n *\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport const Required = withErrorMsg(\"required\", (required: boolean = true, ...allowedRequiredValues: any[]) => {\n return required ? Allow(...allowedRequiredValues) : Optional();\n});\n"]}
1
+ {"version":3,"file":"required.js","sourceRoot":"","sources":["../../../../src/decorators/common/required.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AACtD,mCAA8B;AAC9B,yCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACU,QAAA,QAAQ,GAAG,IAAA,2BAAY,EAAC,UAAU,EAAE,CAAC,WAAoB,IAAI,EAAE,GAAG,qBAA4B,EAAE,EAAE;IAC7G,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAA,aAAK,EAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAQ,GAAE,CAAC;AACjE,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"requiredGroups.js","sourceRoot":"","sources":["../../../../src/decorators/common/requiredGroups.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AACpD,iDAA4C;AAE5C;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAAC,GAAG,MAAgB;IAChD,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC,QAAkB,EAAE,WAAqB,EAAE,EAAE;YAC7F,IAAI,IAAA,yBAAW,EAAC,MAAM,EAAE,WAAW,CAAC,EAAE;gBACpC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,KAAK,MAAM,CAAC,WAAW,CAAC,CAAC;aACrE;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAVD,wCAUC","sourcesContent":["import {matchGroups} from \"../../utils/matchGroups\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * Apply groups validation strategy for required property.\n *\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n */\nexport function RequiredGroups(...groups: string[]): PropertyDecorator {\n return JsonEntityFn((entity) => {\n entity.parent.schema.$hooks.on(\"requiredGroups\", (required: string[], givenGroups: string[]) => {\n if (matchGroups(groups, givenGroups)) {\n return required.filter((key: string) => key !== entity.propertyKey);\n }\n\n return required;\n });\n });\n}\n"]}
1
+ {"version":3,"file":"requiredGroups.js","sourceRoot":"","sources":["../../../../src/decorators/common/requiredGroups.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AACpD,iDAA4C;AAE5C;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAAC,GAAG,MAAgB;IAChD,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC,QAAkB,EAAE,WAAqB,EAAE,EAAE;YAC7F,IAAI,IAAA,yBAAW,EAAC,MAAM,EAAE,WAAW,CAAC,EAAE;gBACpC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,KAAK,MAAM,CAAC,WAAW,CAAC,CAAC;aACrE;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAVD,wCAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/decorators/common/schema.ts"],"names":[],"mappings":";;;AAEA,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,SAAgB,MAAM,CAAC,aAAqD;IAC1E,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YACrD,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAND,wBAMC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,GAAG,CAAC,QAAmB,EAAE,MAAW;IAClD,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,kBAIC","sourcesContent":["import {JsonSchema, JsonSchemaObject} from \"../../domain/JsonSchema\";\nimport {SpecTypes} from \"../../domain/SpecTypes\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * Write data formatted to JsonSchema.\n *\n * ## Example\n *\n * ```typescript\n * @Schema({title: \"test\"})\n * class Model {\n * @Schema({formatMinimum: \"1987-10-24\"})\n * @Format(\"date\")\n * birthDate: Date\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"title\": \"test\",\n * \"properties\": {\n * \"birthdate\": {\n * \"type\": \"string\",\n * \"format\": \"date\",\n * \"formatMinimum\": \"1987-10-24\"\n * }\n * }\n * }\n * ```\n *\n * @param partialSchema\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @classDecorator\n * @input\n */\nexport function Schema(partialSchema: Partial<JsonSchemaObject> | JsonSchema) {\n return JsonEntityFn((entity) => {\n Object.entries(partialSchema).forEach(([key, value]) => {\n entity.schema.set(key, value);\n });\n });\n}\n\n/**\n * Apply specific schema depending on the spec version\n * @param specType\n * @param schema\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @classDecorator\n * @input\n */\nexport function For(specType: SpecTypes, schema: any) {\n return JsonEntityFn((entity) => {\n entity.schema.set(specType, schema);\n });\n}\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/decorators/common/schema.ts"],"names":[],"mappings":";;;AAEA,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,SAAgB,MAAM,CAAC,aAAqD;IAC1E,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YACrD,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAND,wBAMC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,GAAG,CAAC,QAAmB,EAAE,MAAW;IAClD,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,kBAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"title.js","sourceRoot":"","sources":["../../../../src/decorators/common/title.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,SAAgB,KAAK,CAAC,KAAa;IACjC,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,sBAIC","sourcesContent":["import {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * Add title metadata on the decorated element.\n *\n * ::: warning\n * For v6 user, use @@Title@@ from @tsed/schema instead of @tsed/common.\n * :::\n *\n * ## Example\n *\n * ```typescript\n * class Model {\n * @Title(\"title\")\n * id: string;\n * }\n * ```\n *\n * Will produce:\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"properties\": {\n * \"id\": {\n * \"type\": \"string\",\n * \"title\": \"title\"\n * }\n * }\n * }\n * ```\n *\n * @param {string} title\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @classDecorator\n * @input\n */\nexport function Title(title: string) {\n return JsonEntityFn((entity) => {\n entity.schema.title(title);\n });\n}\n"]}
1
+ {"version":3,"file":"title.js","sourceRoot":"","sources":["../../../../src/decorators/common/title.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,SAAgB,KAAK,CAAC,KAAa;IACjC,OAAO,IAAA,2BAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,sBAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"typeError.js","sourceRoot":"","sources":["../../../../src/decorators/common/typeError.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AACzC,yCAAoC;AACpC,iDAA4C;AAE5C;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,GAAW;IACnC,OAAO,IAAA,2BAAY,EAAC,GAAG,EAAE,CAAC,IAAA,oBAAa,EAAC,IAAA,mBAAQ,EAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAFD,8BAEC","sourcesContent":["import {useDecorators} from \"@tsed/core\";\nimport {ErrorMsg} from \"./errorMsg\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * Create a new custom formats validator\n * @param name\n * @param options\n * @decorator\n * @ajv\n */\nexport function TypeError(msg: string): ClassDecorator {\n return JsonEntityFn(() => useDecorators(ErrorMsg({type: msg})));\n}\n"]}
1
+ {"version":3,"file":"typeError.js","sourceRoot":"","sources":["../../../../src/decorators/common/typeError.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AACzC,yCAAoC;AACpC,iDAA4C;AAE5C;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,GAAW;IACnC,OAAO,IAAA,2BAAY,EAAC,GAAG,EAAE,CAAC,IAAA,oBAAa,EAAC,IAAA,mBAAQ,EAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAFD,8BAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"writeOnly.js","sourceRoot":"","sources":["../../../../src/decorators/common/writeOnly.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAC5C;;;;;;;;;GASG;AACH,SAAgB,SAAS,CAAC,YAAqB,IAAI;IACjD,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,EAAE;QAC7C,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,8BAIC","sourcesContent":["import {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n/**\n * Set the property as WriteOnly.\n *\n * @returns {Function}\n * @decorator\n * @validation\n * @property\n * @parameter\n * @schema\n */\nexport function WriteOnly(writeOnly: boolean = true) {\n return JsonEntityFn((store: JsonEntityStore) => {\n store.itemSchema.writeOnly(writeOnly);\n });\n}\n"]}
1
+ {"version":3,"file":"writeOnly.js","sourceRoot":"","sources":["../../../../src/decorators/common/writeOnly.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAC5C;;;;;;;;;GASG;AACH,SAAgB,SAAS,CAAC,YAAqB,IAAI;IACjD,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAsB,EAAE,EAAE;QAC7C,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,8BAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"jsonEntityComponent.js","sourceRoot":"","sources":["../../../../src/decorators/config/jsonEntityComponent.ts"],"names":[],"mappings":";;;AACA,kEAAoF;AAEpF;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,IAAoB;IACtD,OAAO,CAAC,MAA6B,EAAE,EAAE;QACvC,uCAAqB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC,CAAC;AACJ,CAAC;AAJD,kDAIC","sourcesContent":["import {DecoratorTypes, Type} from \"@tsed/core\";\nimport {JsonEntityStore, JsonEntitiesContainer} from \"../../domain/JsonEntityStore\";\n\n/**\n * Declare a new JsonEntityStore class for a specific decorator type.\n *\n * @ignore\n * @param type\n * @decorator\n */\nexport function JsonEntityComponent(type: DecoratorTypes) {\n return (target: Type<JsonEntityStore>) => {\n JsonEntitiesContainer.set(type, target);\n };\n}\n"]}
1
+ {"version":3,"file":"jsonEntityComponent.js","sourceRoot":"","sources":["../../../../src/decorators/config/jsonEntityComponent.ts"],"names":[],"mappings":";;;AACA,kEAAoF;AAEpF;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,IAAoB;IACtD,OAAO,CAAC,MAA6B,EAAE,EAAE;QACvC,uCAAqB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC,CAAC;AACJ,CAAC;AAJD,kDAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"genericOf.js","sourceRoot":"","sources":["../../../../src/decorators/generics/genericOf.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAC1C,kEAA6D;AAC7D,2CAAwC;AAGxC;;GAEG;AACH,SAAS,MAAM,CAAC,IAAS;IACvB,OAAO,IAAA,eAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC;AAC/C,CAAC;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,SAAgB,SAAS,CAAC,GAAG,QAAwB;IACnD,MAAM,cAAc,GAAqB;QACvC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACpB,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE;gBAChB,OAAO,IAAA,aAAM,GAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;aAC3C;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;KACH,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,GAAG,IAAS,EAAE,EAAE;QACjC,MAAM,KAAK,GAAG,iCAAe,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QAC5C,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;IACxC,CAAC,CAAC;IAEF,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,QAAa,EAAE,EAAE;QACtC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE9B,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAtBD,8BAsBC","sourcesContent":["import {isObject, Type} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {string} from \"../../utils/from\";\nimport {GenericValue} from \"../../utils/generics\";\n\n/**\n * @ignore\n */\nfunction isEnum(type: any) {\n return isObject(type) && !(\"toJSON\" in type);\n}\n\nexport interface GenericOfChainedDecorators {\n (...args: any): any;\n\n /**\n * Declare a nested generic models\n * @param generics\n */\n Nested(...generics: GenericValue[]): this;\n}\n\n/**\n * Set the types of a Generic class.\n *\n * ## Example\n *\n * ```typescript\n * class Product {\n * @Property()\n * label: string;\n * }\n *\n * @Generics(\"T\")\n * class Paginated<T> {\n * @CollectionOf(\"T\")\n * data: T[];\n *\n * @Property()\n * totalCount: number;\n * }\n *\n * class Payload {\n * @GenericOf(Product)\n * products: Paginated<Product>;\n * }\n * ```\n *\n * ## Example with nested generics\n *\n * ```typescript\n * class Product {\n * @Property()\n * label: string;\n * }\n *\n * @Generics(\"T\")\n * class Paginated<T> {\n * @CollectionOf(\"T\")\n * data: T[];\n *\n * @Property()\n * totalCount: number;\n * }\n *\n * @Generics(\"D\")\n * class Submission<D> {\n * @Property()\n * _id: string;\n *\n * @Property(\"D\")\n * data: D;\n * }\n *\n * class Payload {\n * @GenericOf(Submissions).Nested(Product)\n * submissions: Paginated<Submission<Product>>;\n * }\n * ```\n *\n * @param {Type<any>[]} generics\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @generics\n */\nexport function GenericOf(...generics: GenericValue[]): GenericOfChainedDecorators {\n const nestedGenerics: GenericValue[][] = [\n generics.map((type) => {\n if (isEnum(type)) {\n return string().enum(Object.values(type));\n }\n return type;\n })\n ];\n\n const decorator = (...args: any) => {\n const store = JsonEntityStore.from(...args);\n store.nestedGenerics = nestedGenerics;\n };\n\n decorator.Nested = (...generics: any) => {\n nestedGenerics.push(generics);\n\n return decorator;\n };\n\n return decorator;\n}\n"]}
1
+ {"version":3,"file":"genericOf.js","sourceRoot":"","sources":["../../../../src/decorators/generics/genericOf.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAC1C,kEAA6D;AAC7D,2CAAwC;AAGxC;;GAEG;AACH,SAAS,MAAM,CAAC,IAAS;IACvB,OAAO,IAAA,eAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC;AAC/C,CAAC;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,SAAgB,SAAS,CAAC,GAAG,QAAwB;IACnD,MAAM,cAAc,GAAqB;QACvC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACpB,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE;gBAChB,OAAO,IAAA,aAAM,GAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;aAC3C;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;KACH,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,GAAG,IAAS,EAAE,EAAE;QACjC,MAAM,KAAK,GAAG,iCAAe,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QAC5C,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;IACxC,CAAC,CAAC;IAEF,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,QAAa,EAAE,EAAE;QACtC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE9B,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAtBD,8BAsBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"generics.js","sourceRoot":"","sources":["../../../../src/decorators/generics/generics.ts"],"names":[],"mappings":";;;AAAA,kEAA6D;AAE7D;;;;;;;;;;;;GAYG;AACH,SAAgB,QAAQ,CAAC,GAAG,QAAkB;IAC5C,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,MAAM,YAAY,GAAG,iCAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAElD,YAAY,CAAC,MAAM,CAAC,aAAa,GAAG,QAAQ,CAAC;IAC/C,CAAC,CAAC;AACJ,CAAC;AAND,4BAMC","sourcesContent":["import {JsonEntityStore} from \"../../domain/JsonEntityStore\";\n\n/**\n * Define generics list. This list is used by @@GenericOf@@ and the @@getJsonSchema@@ function to build the correct JsonSchema.\n *\n * See @@GenericOf@@ decorator for more details.\n *\n * @param generics\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @generics\n */\nexport function Generics(...generics: string[]) {\n return (target: any) => {\n const storedSchema = JsonEntityStore.from(target);\n\n storedSchema.schema.genericLabels = generics;\n };\n}\n"]}
1
+ {"version":3,"file":"generics.js","sourceRoot":"","sources":["../../../../src/decorators/generics/generics.ts"],"names":[],"mappings":";;;AAAA,kEAA6D;AAE7D;;;;;;;;;;;;GAYG;AACH,SAAgB,QAAQ,CAAC,GAAG,QAAkB;IAC5C,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,MAAM,YAAY,GAAG,iCAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAElD,YAAY,CAAC,MAAM,CAAC,aAAa,GAAG,QAAQ,CAAC;IAC/C,CAAC,CAAC;AACJ,CAAC;AAND,4BAMC"}
@@ -1 +1 @@
1
- {"version":3,"file":"acceptMime.js","sourceRoot":"","sources":["../../../../src/decorators/operations/acceptMime.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAoC;AAEpC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,UAAU,CAAC,GAAG,KAAe;IAC3C,OAAO,IAAA,oBAAa,EAAC,IAAA,mBAAQ,EAAC,GAAG,KAAK,CAAC,EAAE,IAAA,eAAQ,EAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;AAC3E,CAAC;AAFD,gCAEC","sourcesContent":["import {StoreSet, useDecorators} from \"@tsed/core\";\nimport {Produces} from \"./produces\";\n\n/**\n * Set a mime list which are acceptable and checks if the specified content types are acceptable, based on the request’s Accept HTTP header field.\n *\n * ```typescript\n * @Controller('/mypath')\n * export class MyCtrl {\n *\n * @Get('/')\n * @AcceptMime('application/json')\n * public getResource(){}\n * }\n * ```\n *\n * @param mimes\n * @decorator\n * @operation\n * @response\n */\nexport function AcceptMime(...mimes: string[]): Function {\n return useDecorators(Produces(...mimes), StoreSet(\"acceptMimes\", mimes));\n}\n"]}
1
+ {"version":3,"file":"acceptMime.js","sourceRoot":"","sources":["../../../../src/decorators/operations/acceptMime.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAoC;AAEpC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,UAAU,CAAC,GAAG,KAAe;IAC3C,OAAO,IAAA,oBAAa,EAAC,IAAA,mBAAQ,EAAC,GAAG,KAAK,CAAC,EAAE,IAAA,eAAQ,EAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;AAC3E,CAAC;AAFD,gCAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"consumes.js","sourceRoot":"","sources":["../../../../src/decorators/operations/consumes.ts"],"names":[],"mappings":";;;AAAA,qCAAuF;AACvF,yDAAoD;AAEpD;;;;;;;;;;;;;;;;;GAiBG;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 consumes metadata on the decorated element.\n *\n * ## Examples\n *\n * ```typescript\n * class Model {\n * @Consumes(\"application/x-www-form-urlencoded\")\n * id: string;\n * }\n * ```\n *\n * @param consumes\n * @decorator\n * @swagger\n * @classDecorator\n * @operation\n */\nexport function Consumes(...consumes: string[]) {\n return JsonEntityFn((store, args) => {\n switch (store.decoratorType) {\n case DecoratorTypes.METHOD:\n store.operation!.consumes(consumes);\n break;\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], Consumes(...consumes));\n break;\n\n default:\n throw new UnsupportedDecoratorType(Consumes, args);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"consumes.js","sourceRoot":"","sources":["../../../../src/decorators/operations/consumes.ts"],"names":[],"mappings":";;;AAAA,qCAAuF;AACvF,yDAAoD;AAEpD;;;;;;;;;;;;;;;;;GAiBG;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"}
@@ -1 +1 @@
1
- {"version":3,"file":"contentType.js","sourceRoot":"","sources":["../../../../src/decorators/operations/contentType.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,WAAW,CAAC,IAAY;IACtC,OAAO,IAAA,iBAAO,GAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAFD,kCAEC","sourcesContent":["import {Returns} from \"./returns\";\n\n/**\n * Sets the Content-Type HTTP header to the MIME type as determined by mime.lookup() for the specified type.\n * If type contains the “/” character, then it sets the `Content-Type` to type.\n *\n * ```typescript\n * @ContentType('.html'); // => 'text/html'\n * @ContentType('html'); // => 'text/html'\n * @ContentType('json'); // => 'application/json'\n * @ContentType('application/json'); // => 'application/json'\n * @ContentType('png'); // => image/png\n * private myMethod() {}\n * ```\n *\n * @param type\n * @decorator\n * @operation\n * @response\n * @headers\n */\nexport function ContentType(type: string) {\n return Returns().ContentType(type);\n}\n"]}
1
+ {"version":3,"file":"contentType.js","sourceRoot":"","sources":["../../../../src/decorators/operations/contentType.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,WAAW,CAAC,IAAY;IACtC,OAAO,IAAA,iBAAO,GAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAFD,kCAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../../src/decorators/operations/deprecated.ts"],"names":[],"mappings":";;;AAAA,qCAAwG;AACxG,yDAAoD;AAIpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,UAAU,CAAC,aAAsB,IAAI;IACnD,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAClC,QAAQ,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,qBAAc,CAAC,MAAM;gBACxB,KAAK,CAAC,SAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;gBACxC,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;gBACnD,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;gBACtE,MAAM;YACR,KAAK,qBAAc,CAAC,IAAI;gBACrB,KAA2B,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;gBAClE,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;SACxD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AApBD,gCAoBC","sourcesContent":["import {decorateMethodsOf, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\nimport {JsonPropertyStore} from \"../../domain/JsonPropertyStore\";\nimport {JsonParameterStore} from \"../../domain/JsonParameterStore\";\n\n/**\n * Add deprecated metadata on the decorated element.\n *\n * ## Examples\n *\n * ```typescript\n *\n * @Deprecated()\n * class MyCtrl {\n * @Deprecated()\n * @Get(\"/\")\n * method(){\n * }\n * }\n * ```\n *\n * @param deprecated\n * @decorator\n * @swagger\n * @schema\n * @operation\n */\nexport function Deprecated(deprecated: boolean = true) {\n return JsonEntityFn((store, args) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.METHOD:\n store.operation!.deprecated(deprecated);\n break;\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], Deprecated(deprecated));\n break;\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).parameter.set(\"deprecated\", deprecated);\n break;\n case DecoratorTypes.PROP:\n (store as JsonPropertyStore).schema.set(\"deprecated\", deprecated);\n break;\n\n default:\n throw new UnsupportedDecoratorType(Deprecated, args);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../../src/decorators/operations/deprecated.ts"],"names":[],"mappings":";;;AAAA,qCAAwG;AACxG,yDAAoD;AAIpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,UAAU,CAAC,aAAsB,IAAI;IACnD,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAClC,QAAQ,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,qBAAc,CAAC,MAAM;gBACxB,KAAK,CAAC,SAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;gBACxC,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;gBACnD,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;gBACtE,MAAM;YACR,KAAK,qBAAc,CAAC,IAAI;gBACrB,KAA2B,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;gBAClE,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;SACxD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AApBD,gCAoBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"header.js","sourceRoot":"","sources":["../../../../src/decorators/operations/header.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,SAAgB,MAAM,CAAC,OAAsC,EAAE,KAAoC;IACjG,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAO,GAAG,EAAC,CAAC,OAAiB,CAAC,EAAE,KAAK,EAAC,CAAC;KACxC;IAED,OAAO,IAAA,iBAAO,GAAE,CAAC,OAAO,CAAC,OAAsB,CAAC,CAAC;AACnD,CAAC;AAND,wBAMC","sourcesContent":["import {JsonHeader, JsonHeaders} from \"../../interfaces/JsonOpenSpec\";\nimport {Returns} from \"./returns\";\n\n/**\n * Sets the response’s HTTP header field to value. To set multiple fields at once, pass an object as the parameter.\n *\n * ```typescript\n * @Header('Content-Type', 'text/plain');\n * private myMethod() {}\n *\n * @Status(204)\n * @Header({\n * \"Content-Type\": \"text/plain\",\n * \"Content-Length\": 123,\n * \"ETag\": {\n * \"value\": \"12345\",\n * \"description\": \"header description\"\n * }\n * })\n * private myMethod() {}\n * ```\n *\n * This example will produce the swagger responses object:\n *\n * ```json\n * {\n * \"responses\": {\n * \"204\": {\n * \"description\": \"Description\",\n * \"headers\": {\n * \"Content-Type\": {\n * \"type\": \"string\"\n * },\n * \"Content-Length\": {\n * \"type\": \"number\"\n * },\n * \"ETag\": {\n * \"type\": \"string\",\n * \"description\": \"header description\"\n * }\n * }\n * }\n * }\n * }\n * ```\n *\n * @decorator\n * @operation\n * @response\n */\nexport function Header(headers: string | number | JsonHeaders, value?: string | number | JsonHeader): Function {\n if (value !== undefined) {\n headers = {[headers as string]: value};\n }\n\n return Returns().Headers(headers as JsonHeaders);\n}\n"]}
1
+ {"version":3,"file":"header.js","sourceRoot":"","sources":["../../../../src/decorators/operations/header.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,SAAgB,MAAM,CAAC,OAAsC,EAAE,KAAoC;IACjG,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAO,GAAG,EAAC,CAAC,OAAiB,CAAC,EAAE,KAAK,EAAC,CAAC;KACxC;IAED,OAAO,IAAA,iBAAO,GAAE,CAAC,OAAO,CAAC,OAAsB,CAAC,CAAC;AACnD,CAAC;AAND,wBAMC"}
@@ -1 +1 @@
1
- {"version":3,"file":"in.js","sourceRoot":"","sources":["../../../../src/decorators/operations/in.ts"],"names":[],"mappings":";;;AAAA,qCAA6F;AAC7F,kEAA6D;AAE7D,8DAAyD;AAGzD,wDAAqE;AA8CrE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,EAAE,CAAC,MAAmC;IACpD,MAAM,aAAa,GAAG,IAAI,6BAAa,EAAE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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} from \"../../domain/JsonEntityStore\";\nimport {JsonMethodStore} from \"../../domain/JsonMethodStore\";\nimport {JsonParameter} from \"../../domain/JsonParameter\";\nimport {JsonParameterStore} from \"../../domain/JsonParameterStore\";\nimport {JsonParameterTypes} from \"../../domain/JsonParameterTypes\";\nimport {JsonSchema, JsonSchemaObject} from \"../../domain/JsonSchema\";\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"]}
1
+ {"version":3,"file":"in.js","sourceRoot":"","s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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"]}
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"}
@@ -1 +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"]}
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"}
@@ -1 +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"]}
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"}
@@ -1 +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"]}
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"}
@@ -1 +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"]}
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"}
@@ -1 +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"]}
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"}
@@ -1 +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"]}
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,QA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AC,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"]}
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,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAxBD,4BAwBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"returns.js","sourceRoot":"","sources":["../../../../src/decorators/operations/returns.ts"],"names":[],"mappings":";;;AAAA,qCAWoB;AAEpB,2EAAoE;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Object,\n isPrimitiveOrPrimitiveClass,\n isString,\n Type\n} from \"@tsed/core\";\nimport {OS3Example} from \"@tsed/openspec\";\nimport {getStatusMessage} from \"../../constants/httpStatusMessages\";\nimport {DecoratorContext} from \"../../domain/DecoratorContext\";\nimport {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonParameter} from \"../../domain/JsonParameter\";\nimport {JsonResponse} from \"../../domain/JsonResponse\";\nimport {JsonSchema, JsonSchemaObject} from \"../../domain/JsonSchema\";\nimport {JsonHeader, JsonHeaders} from \"../../interfaces/JsonOpenSpec\";\nimport {getStatusModel} from \"../../utils/defineStatusModel\";\nimport {string} from \"../../utils/from\";\nimport {GenericValue} from \"../../utils/generics\";\nimport {isSuccessStatus} from \"../../utils/isSuccessStatus\";\nimport {mapHeaders} from \"../../utils/mapHeaders\";\n\nexport interface ReturnsChainedDecorators {\n <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;\n\n (target: Function): void;\n\n /**\n * Set a Content-Type for the current response\n * @param value\n * @constructor\n */\n ContentType(value: string): this;\n\n /**\n * Add a description\n * @param description\n */\n Description(description: string): this;\n\n /**\n * Add examples\n * @param examples\n */\n Examples(examples: Record<string, OS3Example>): this;\n\n Examples(examples: Record<string, any>): this;\n\n Examples(examples: any): this;\n\n /**\n * Change the model type\n * @param type\n */\n Type(type: Type<any> | any): this;\n\n /**\n * Change the status\n * @param status\n * @constructor\n */\n Status(status: string | number): this;\n\n /**\n * Add the nested types\n * @param types\n */\n Of(...types: GenericValue[]): this;\n\n /**\n * For the integer type\n */\n OfInteger(): this;\n\n /**\n * Add the nested types\n * @param types\n */\n OneOf(...types: GenericValue[]): this;\n\n /**\n * Add the nested types\n * @param types\n */\n AllOf(...types: GenericValue[]): this;\n\n /**\n * Add the nested types\n * @param types\n */\n AnyOf(...types: GenericValue[]): this;\n\n /**\n * Declare a nested generic models\n * @param generics\n */\n Nested(...generics: GenericValue[]): this;\n\n /**\n * Add header.\n * @param key\n * @param value\n */\n Header(key: string, value: number | string | (JsonHeader & {value?: string | number | boolean})): this;\n\n /**\n * Add headers\n */\n Headers(headers: JsonHeaders): this;\n\n /**\n * Add location hea\n */\n Location(location: string, meta?: JsonHeader): this;\n\n /**\n * Assign partial schema\n * @param schema\n */\n Schema(schema: Partial<JsonSchemaObject> | JsonSchema): this;\n\n /**\n * Add an inline title for the return model.\n * @param title\n */\n Title(title: string): this;\n\n /**\n * Use group to filter model\n * @param groups\n */\n Groups(...groups: string[]): this;\n\n Groups(groupName: string, groups: string[]): this;\n\n /**\n * Add a list of allowed groups to filter dynamically fields. Listed groups can be used by the consumer to change\n * the mapped response.\n * @param allowedGroups\n */\n AllowedGroups(...allowedGroups: string[]): this;\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nfunction isEnum(type: any) {\n return isObject(type) && !(\"toJSON\" in type);\n}\n\nfunction mapGenerics(types: GenericValue[]) {\n return types.map((type) => {\n if (isEnum(type)) {\n return string().enum(Object.values(type));\n }\n return type;\n });\n}\n\n/**\n * @ignore\n */\nclass ReturnDecoratorContext extends DecoratorContext<ReturnsChainedDecorators> {\n readonly methods: string[] = [\n \"contentType\",\n \"description\",\n \"examples\",\n \"type\",\n \"status\",\n \"of\",\n \"ofInteger\",\n \"oneOf\",\n \"allOf\",\n \"anyOf\",\n \"nested\",\n \"header\",\n \"headers\",\n \"schema\",\n \"title\",\n \"groups\",\n \"allowedGroups\",\n \"location\"\n ];\n\n constructor({status, model}: any) {\n super();\n\n this.model(model);\n this.status(status);\n }\n\n type(model: any) {\n return this.model(model);\n }\n\n model(model: any) {\n model && this.set(\"model\", model);\n return this;\n }\n\n status(status: number | string) {\n this.set(\"status\", status);\n\n if (status && getStatusMessage(status) && !this.get(\"description\")) {\n this.set(\"description\", getStatusMessage(status));\n\n if (!this.get(\"model\")) {\n this.model(getStatusModel(+status));\n }\n }\n\n return this;\n }\n\n headers(headers: JsonHeaders) {\n this.set(\"headers\", {\n ...(this.get(\"headers\") || {}),\n ...mapHeaders(headers)\n });\n\n return this;\n }\n\n header(key: string, value: string | JsonHeader) {\n return this.headers({[key]: value});\n }\n\n location(path: string, meta: JsonHeaders = {}) {\n this.headers({\n Location: {\n ...meta,\n value: path\n }\n });\n\n return this;\n }\n\n groups(groupName: string, groups: string[]): this;\n groups(...groups: string[]): this;\n groups(...groups: string[] | [string, string[]]) {\n if (groups.length === 2 && isArray(groups[1])) {\n this.set(\"groupsName\", groups[0]);\n this.set(\"groups\", groups[1]);\n } else {\n this.set(\"groups\", groups);\n }\n\n return this;\n }\n\n allowedGroups(...allowedGroups: string[]) {\n this.set(\"allowedGroups\", new Set(allowedGroups));\n return this;\n }\n\n nested(...generics: GenericValue[]) {\n const model = this.get(\"model\");\n this.checkPrimitive(model);\n this.checkCollection(model);\n\n this.addAction((ctx) => {\n (this.get(\"schema\") as JsonSchema).nestedGenerics.push(mapGenerics(generics));\n });\n\n return this;\n }\n\n of(...types: (Type<any> | any)[]) {\n const model = this.get(\"model\");\n this.checkPrimitive(model);\n\n this.addAction(() => {\n const schema = this.get(\"schema\") as JsonSchema;\n\n if (isCollection(model)) {\n schema?.itemSchema({type: types[0]});\n } else {\n schema?.nestedGenerics.push(mapGenerics(types));\n }\n });\n\n return this;\n }\n\n ofInteger() {\n return this.of(\"integer\");\n }\n\n oneOf(...types: (Type<any> | any)[]) {\n return this.manyOf(\"oneOf\", types);\n }\n\n allOf(...types: (Type<any> | any)[]) {\n return this.manyOf(\"allOf\", types);\n }\n\n anyOf(...types: (Type<any> | any)[]) {\n return this.manyOf(\"anyOf\", types);\n }\n\n schema(partial: Partial<JsonSchemaObject>) {\n this.addAction(() => {\n const schema = this.get(\"schema\") as JsonSchema;\n\n schema!.assign(partial);\n });\n\n return this;\n }\n\n examples(examples: any) {\n this.set(\"examples\", isString(examples) ? [examples] : examples);\n return this;\n }\n\n title(title: string) {\n return this.schema({title});\n }\n\n protected checkPrimitive(model: any) {\n if (isPrimitiveOrPrimitiveClass(model)) {\n throw new Error(\"Returns.Of cannot be used with the following primitive classes: String, Number, Boolean\");\n }\n }\n\n protected checkCollection(model: any) {\n if (isCollection(model)) {\n throw new Error(\"Returns.Nested cannot be used with the following classes: Map, Set, Array, String, Number, Boolean\");\n }\n }\n\n protected getContentType() {\n const model = this.get(\"model\");\n let contentType = this.get(\"contentType\");\n\n if (model && !isPlainObject(model) && !isPrimitiveOrPrimitiveClass(model)) {\n contentType = contentType || \"application/json\";\n }\n\n return contentType;\n }\n\n protected getStatus() {\n return this.get(\"status\") || \"default\";\n }\n\n protected onInit(args: any[], decorator: any) {\n const type = decoratorTypeOf(args);\n switch (type) {\n case DecoratorTypes.METHOD:\n this.entity = JsonEntityStore.from(...args);\n if (this.entity.operation) {\n this.map();\n }\n break;\n case DecoratorTypes.CLASS:\n this.decoratorType = DecoratorTypes.CLASS;\n decorateMethodsOf(args[0], decorator);\n break;\n }\n }\n\n protected map() {\n const model = this.get(\"model\");\n const {entity, decoratorType} = this;\n const operation = this.entity.operation!;\n const currentStatus = this.getStatus();\n const response = operation.ensureResponseOf(currentStatus);\n const contentType = this.getContentType();\n\n let {description = response.get(\"description\")} = this.toObject();\n\n if (description) {\n description = decoratorType === DecoratorTypes.CLASS ? response.get(\"description\") || description : description;\n response.description(description);\n }\n\n const headers = this.getMergedKey(\"headers\", response.get(\"headers\"));\n\n if (headers) {\n response.headers(headers);\n }\n\n this.mapMedia(response);\n\n if (isSuccessStatus(this.get(\"status\")) || currentStatus === \"default\") {\n if (model) {\n entity.type = model;\n }\n }\n\n // additional info for OS2\n contentType && operation.addProduce(contentType);\n\n // run additional actions\n return this.runActions();\n }\n\n protected mapMedia(response: JsonResponse) {\n const contentType = this.getContentType();\n const model = this.get(\"model\");\n const media = response.getMedia(contentType || \"*/*\");\n const schema = media.get(\"schema\") || new JsonSchema({type: model});\n const groups = this.get(\"groups\");\n const groupsName = this.get(\"groupsName\");\n const allowedGroups = this.get(\"allowedGroups\");\n const operation = this.entity.operation!;\n\n if (model) {\n if (isArray(model)) {\n schema.oneOf(model.map((type) => ({type})));\n } else {\n schema.type(model);\n }\n }\n\n this.set(\"schema\", schema);\n\n media.schema(schema);\n\n media.groups = groups;\n media.groupsName = groupsName;\n\n if (allowedGroups) {\n media.allowedGroups = allowedGroups;\n\n const jsonParameter = new JsonParameter();\n jsonParameter.in(\"query\").name(\"includes\");\n jsonParameter.schema(\n JsonSchema.from({\n type: \"array\",\n items: {\n type: \"string\",\n enum: [...allowedGroups]\n }\n })\n );\n\n operation.addParameter(-1, jsonParameter);\n }\n\n const examples = this.get(\"examples\");\n\n if (examples) {\n media.examples(examples);\n }\n\n return media;\n }\n\n private manyOf(kind: string, types: any[]) {\n const model = this.get(\"model\");\n\n this.addAction(() => {\n const schema = this.get(\"schema\") as JsonSchema;\n\n if (isCollection(model)) {\n schema.type(model || Object);\n\n schema.itemSchema().set(kind, types);\n } else {\n schema.set(kind, types);\n }\n });\n\n return this;\n }\n}\n\n/**\n * Add responses documentation for a specific status code.\n *\n * ## Usage\n *\n * Ts.ED v5/v6 API introducing the chaining decorator concept. Now a decorator like Returns can be used with another decorators like Description.\n *\n * ::: warning\n * v5 has a basic support of the chaining decorator to facilitate the migration to v6!\n * :::\n *\n * ```typescript\n * import {Returns} from \"@tsed/schema\";\n *\n * @Controller(\"/\")\n * class MyController {\n * @Returns(404, String).Description(\"Not Found\")\n * @Returns(200, Model).Description(\"Success\")\n * async myMethod(): Promise<Model> {}\n * }\n * ```\n *\n * ::: tip\n * TypeScript and your IDE will discover automatically the chained decorators. But for more details you can look on @@ReturnsChainedDecorators@@ interface, to know\n * what chained decorators are available under Returns decorator.\n * :::\n *\n * This example will produce this documentation in swagger:\n *\n * ```json\n * {\n * \"responses\": {\n * \"404\": {\n * \"description\": \"Description\",\n * \"schema\": {\"type\": \"string\"}\n * },\n * \"2OO\": {\n * \"description\": \"Description\",\n * \"schema\": {\"$ref\": \"...\"}\n * }\n * }\n * }\n * ```\n *\n * ## Declaring an Array\n *\n * Use chained decorators to declare an array with model as following:\n *\n * ```typescript\n * import {Returns} from \"@tsed/schema\";\n *\n * @Controller(\"/models\")\n * class ModelCtrl {\n * @Get(\"/\")\n * @Returns(200, Array).Of(Model).Description(\"Success\")\n * async myMethod(): Promise<Model> {\n * }\n * }\n * ```\n *\n * Deprecated version:\n *\n * ```typescript\n * import {ReturnsArray} from \"@tsed/common\";\n * import {Returns} from \"@tsed/schema\";\n *\n * @Controller(\"/\")\n * class MyController {\n * @ReturnsArray(200, Model) // deprecated\n * async myMethod(): Promise<Model> {}\n * }\n * ```\n *\n * ### Declaring a generic model <Badge text=\"6+\"/>\n *\n * Sometime, it might be useful to use generic models. TypeScript doesn't store the generic type in the metadata. This is why we need to\n * declare explicitly the generic models with the decorators.\n *\n * One of the generic's usage, can be a paginated list. With Returns decorator it's now possible to declare generic type and generate the appropriate OpenSpec documentation.\n *\n * Starting with the pagination model, by using @@Generics@@ and @@CollectionOf@@:\n *\n * ```typescript\n * @Generics(\"T\")\n * class Pagination<T> {\n * @CollectionOf(\"T\")\n * data: T[];\n *\n * @Property()\n * totalCount: number;\n * }\n * ```\n *\n * Now, we need a model to be used with the generic Pagination model:\n *\n * ```typescript\n * class Product {\n * @Property()\n * id: string;\n *\n * @Property()\n * title: string;\n * }\n * ```\n *\n * Finally, we can use our models on a method as following:\n *\n * ```typescript\n * class Controller {\n * @OperationPath(\"POST\", \"/\")\n * @Returns(200, Pagination).Of(Product).Description(\"description\")\n * async method(): Promise<Pagination<Product> | null> {\n * return null;\n * }\n * }\n * ```\n *\n * ### Declaring a nested generics models <Badge text=\"6+\"/>\n *\n * It's also possible to declare a nested generics models in order to have this type `Pagination<Submission<Product>>`:\n *\n * ```typescript\n * import {Generics, Property, Returns} from \"@tsed/schema\";\n * import {Post} from \"@tsed/common\";\n *\n * class Controller {\n * @Post(\"/\")\n * @Returns(200, Pagination).Of(Submission).Nested(Product).Description(\"description\")\n * async method(): Promise<Pagination<Submission<Product>> | null> {\n * return null;\n * }\n * }\n * ```\n *\n * And here is the Submission model:\n *\n * ```typescript\n * import {Generics, Property} from \"@tsed/schema\";\n *\n * @Generics(\"T\")\n * class Submission<T> {\n * @Property()\n * _id: string;\n * @Property(\"T\")\n * data: T;\n * }\n * ```\n *\n * @param status\n * @param model\n * @decorator\n * @swagger\n * @schema\n * @response\n * @operation\n */\nexport function Returns(status?: string | number, model?: Type<any> | Type<any>[]): ReturnsChainedDecorators;\nexport function Returns(status?: string | number, model?: Type<any> | Type<any>[] | any): ReturnsChainedDecorators {\n const context = new ReturnDecoratorContext({\n status,\n model\n });\n\n return context.build();\n}\n"]}
1
+ {"version":3,"file":"returns.js","sourceRoot":"","sources":["../../../../src/decorators/operations/returns.ts"],"names":[],"mappings":";;;AAAA,qCAWoB;AAEpB,2EAAoE;AACpE,oEAA+D;AAC/D,kEAA6D;AAC7D,8DAAyD;AAEzD,wDAAqE;AAErE,qEAA6D;AAC7D,2CAAwC;AAExC,iEAA4D;AAC5D,uDAAkD;AA6HlD;;GAEG;AACH,SAAS,MAAM,CAAC,IAAS;IACvB,OAAO,IAAA,eAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,WAAW,CAAC,KAAqB;IACxC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE;YAChB,OAAO,IAAA,aAAM,GAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3C;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,sBAAuB,SAAQ,mCAA0C;IACpE,OAAO,GAAa;QAC3B,aAAa;QACb,aAAa;QACb,UAAU;QACV,MAAM;QACN,QAAQ;QACR,IAAI;QACJ,WAAW;QACX,OAAO;QACP,OAAO;QACP,OAA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BAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC;AAFD,0BAEC","sourcesContent":["import {DecoratorContext} from \"../../domain/DecoratorContext\";\nimport {mapRouteOptions} from \"../../utils/mapRouteOptions\";\nimport {OperationMethods} from \"../../constants/httpMethods\";\nimport {JsonMethodStore} from \"../../domain/JsonMethodStore\";\n\nexport interface RouteChainedDecorators {\n <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;\n\n /**\n * @param string\n * @constructor\n */\n Path(string: string): this;\n\n /**\n * Set the operation method\n * @param method\n */\n Method(method: OperationMethods | string): this;\n\n /**\n * Set the operation id\n * @param id\n */\n Id(id: string): this;\n\n /**\n * Set the operation id\n * @param name\n */\n Name(name: string): this;\n\n /**\n *\n * @param description\n */\n Description(description: string): this;\n\n /**\n * Summary\n * @constructor\n * @param Summary\n */\n Summary(Summary: string): this;\n\n Use(...args: any[]): this;\n\n UseAfter(...args: any[]): this;\n\n UseBefore(...args: any[]): this;\n}\n\nclass RouteDecoratorContext extends DecoratorContext<RouteChainedDecorators> {\n readonly methods: string[] = [\"name\", \"description\", \"summary\", \"method\", \"id\", \"use\", \"useAfter\", \"useBefore\"];\n protected declare entity: JsonMethodStore;\n\n protected beforeInit() {\n const path: string = this.get(\"path\");\n const method: string = OperationMethods[this.get(\"method\") as OperationMethods] || OperationMethods.CUSTOM;\n\n path && this.entity.operation.addOperationPath(method, path);\n }\n\n protected onMapKey(key: string, value: any) {\n switch (key) {\n case \"name\":\n case \"id\":\n this.entity.operation.operationId(value);\n return;\n case \"summary\":\n this.entity.operation.summary(value);\n return;\n case \"description\":\n this.entity.operation.description(value);\n return;\n case \"use\":\n this.entity.use(value);\n return;\n case \"useAfter\":\n this.entity.after(value);\n return;\n case \"useBefore\":\n this.entity.before(value);\n return;\n }\n\n return super.onMapKey(key, value);\n }\n}\n\n/**\n * Describe a new route with a method and path.\n *\n * ```typescript\n * @Controller('/')\n * export class Ctrl {\n *\n * @Route('GET', '/')\n * get() { }\n * }\n *\n * ```\n *\n * @returns {Function}\n * @param method\n * @param path\n * @param args\n * @decorator\n * @operation\n */\nexport function Route(method: string, path: string, ...args: any[]): RouteChainedDecorators;\nexport function Route(...args: any[]): RouteChainedDecorators;\nexport function Route(...args: any[]): RouteChainedDecorators {\n const routeOptions = mapRouteOptions(args);\n\n const context = new RouteDecoratorContext(routeOptions);\n\n return context.build();\n}\n\n/**\n * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).\n *\n * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.\n * For example, if you placed the following route at the top of all other route definitions, it would require that\n * all routes from that point on would require authentication, and automatically load a user.\n * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()\n * to continue matching subsequent routes.\n * @param path\n * @param args\n * @returns {Function}\n * @decorator\n * @operation\n * @httpMethod\n */\nexport function All(path: string | RegExp | any = \"/\", ...args: any[]) {\n return Route(...[OperationMethods.ALL, path].concat(args));\n}\n\n/**\n * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).\n *\n * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.\n * For example, if you placed the following route at the top of all other route definitions, it would require that\n * all routes from that point on would require authentication, and automatically load a user.\n * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()\n * to continue matching subsequent routes.\n * @param path\n * @param args\n * @returns {Function}\n * @decorator\n * @operation\n * @httpMethod\n */\nexport function Get(path: string | RegExp | any = \"/\", ...args: any[]) {\n return Route(...[OperationMethods.GET, path].concat(args));\n}\n\n/**\n * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).\n *\n * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.\n * For example, if you placed the following route at the top of all other route definitions, it would require that\n * all routes from that point on would require authentication, and automatically load a user.\n * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()\n * to continue matching subsequent routes.\n * @param path\n * @param args\n * @returns {Function}\n * @decorator\n * @operation\n * @httpMethod\n */\nexport function Post(path: string | RegExp | any = \"/\", ...args: any[]) {\n return Route(...[OperationMethods.POST, path].concat(args));\n}\n\n/**\n * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).\n *\n * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.\n * For example, if you placed the following route at the top of all other route definitions, it would require that\n * all routes from that point on would require authentication, and automatically load a user.\n * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()\n * to continue matching subsequent routes.\n * @param path\n * @param args\n * @returns {Function}\n * @decorator\n * @operation\n * @httpMethod\n */\nexport function Put(path: string | RegExp | any = \"/\", ...args: any[]) {\n return Route(...[OperationMethods.PUT, path].concat(args));\n}\n\n/**\n * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).\n *\n * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.\n * For example, if you placed the following route at the top of all other route definitions, it would require that\n * all routes from that point on would require authentication, and automatically load a user.\n * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()\n * to continue matching subsequent routes.\n * @param path\n * @param args\n * @returns {Function}\n * @decorator\n * @operation\n * @httpMethod\n */\nexport function Delete(path: string | RegExp | any = \"/\", ...args: any[]) {\n return Route(...[OperationMethods.DELETE, path].concat(args));\n}\n\n/**\n * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).\n *\n * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.\n * For example, if you placed the following route at the top of all other route definitions, it would require that\n * all routes from that point on would require authentication, and automatically load a user.\n * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()\n * to continue matching subsequent routes.\n * @param path\n * @param args\n * @returns {Function}\n * @decorator\n * @operation\n * @httpMethod\n */\nexport function Head(path: string | RegExp | any = \"/\", ...args: any[]) {\n return Route(...[OperationMethods.HEAD, path].concat(args));\n}\n\n/**\n * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).\n *\n * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.\n * For example, if you placed the following route at the top of all other route definitions, it would require that\n * all routes from that point on would require authentication, and automatically load a user.\n * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()\n * to continue matching subsequent routes.\n * @param path\n * @param args\n * @returns {Function}\n * @decorator\n * @operation\n * @httpMethod\n */\nexport function Patch(path: string | RegExp | any = \"/\", ...args: any[]) {\n return Route(...[OperationMethods.PATCH, path].concat(args));\n}\n\n/**\n * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).\n *\n * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.\n * For example, if you placed the following route at the top of all other route definitions, it would require that\n * all routes from that point on would require authentication, and automatically load a user.\n * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()\n * to continue matching subsequent routes.\n * @param path\n * @param args\n * @returns {Function}\n * @decorator\n * @operation\n * @httpMethod\n */\nexport function Options(path: string | RegExp | any = \"/\", ...args: any[]) {\n return Route(...[OperationMethods.OPTIONS, path].concat(args));\n}\n"]}
1
+ {"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../src/decorators/operations/route.ts"],"names":[],"mappings":";;;AAAA,oEAA+D;AAC/D,iEAA4D;AAC5D,6DAA6D;AAkD7D,MAAM,qBAAsB,SAAQ,mCAAwC;IACjE,OAAO,GAAa,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;IAGtG,UAAU;QAClB,MAAM,IAAI,GAAW,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtC,MAAM,MAAM,GAAW,8BAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAqB,CAAC,IAAI,8BAAgB,CAAC,MAAM,CAAC;QAE3G,IAAI,I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AAgB,KAAK,CAAC,OAA8B,GAAG,EAAE,GAAG,IAAW;IACrE,OAAO,KAAK,CAAC,GAAG,CAAC,8BAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/D,CAAC;AAFD,sBAEC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,OAAO,CAAC,OAA8B,GAAG,EAAE,GAAG,IAAW;IACvE,OAAO,KAAK,CAAC,GAAG,CAAC,8BAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC;AAFD,0BAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"security.js","sourceRoot":"","sources":["../../../../src/decorators/operations/security.ts"],"names":[],"mappings":";;;AAAA,qCAAuF;AACvF,yDAAoD;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,GAAG,MAAgB;IACxD,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,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;gBACjD,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;gBACtD,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 security metadata on the decorated method.\n *\n * ## Examples\n * ### On method\n *\n * ```typescript\n * @Controller(\"/\")\n * class ModelCtrl {\n * @Security(\"write:calendars\")\n * async method() {}\n * }\n * ```\n *\n * @param name\n * @param scopes\n * @decorator\n * @swagger\n * @schema\n * @classDecorator\n * @operation\n */\nexport function Security(name: string, ...scopes: string[]) {\n return JsonEntityFn((store, args) => {\n switch (store.decoratorType) {\n case DecoratorTypes.METHOD:\n store.operation!.addSecurityScopes(name, scopes);\n break;\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], Security(name, ...scopes));\n break;\n\n default:\n throw new UnsupportedDecoratorType(Security, args);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"security.js","sourceRoot":"","sources":["../../../../src/decorators/operations/security.ts"],"names":[],"mappings":";;;AAAA,qCAAuF;AACvF,yDAAoD;AAEpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,GAAG,MAAgB;IACxD,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,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;gBACjD,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;gBACtD,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAdD,4BAcC"}
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/decorators/operations/status.ts"],"names":[],"mappings":";;;AACA,uCAA4D;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AACH,SAAgB,MAAM,CAAC,MAAuB,EAAE,KAAuB;IACrE,OAAO,IAAA,iBAAO,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAChC,CAAC;AAFD,wBAEC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {Returns, ReturnsChainedDecorators} from \"./returns\";\n\n/**\n * Add responses documentation for a specific status code.\n *\n * ## Usage\n *\n * Ts.ED v6 API introducing the chaining decorator concept.\n * Now a decorator like Returns can be used with another decorators like Description.\n *\n * ```typescript\n * import {Returns} from \"@tsed/schema\";\n *\n * @Controller(\"/\")\n * class MyController {\n * @Status(404, String).Description(\"Not Found\")\n * @Status(200, Model).Description(\"Success\")\n * async myMethod(): Promise<Model> {}\n * }\n * ```\n *\n * ::: tip\n * TypeScript and your IDE will discover automatically the chained decorators. But for more details you can look on @@ReturnsChainedDecorators@@ interface, to know\n * what chained decorators are available under Returns decorator.\n * :::\n *\n * This example will produce this documentation in swagger:\n *\n * ```json\n * {\n * \"responses\": {\n * \"404\": {\n * \"description\": \"Description\",\n * \"schema\": {\"type\": \"string\"}\n * },\n * \"2OO\": {\n * \"description\": \"Description\",\n * \"schema\": {\"$ref\": \"...\"}\n * }\n * }\n * }\n * ```\n *\n * ### Declaring a generic model\n *\n * Sometime, it might be useful to use generic models. TypeScript doesn't store the generic type in the metadata. This is why we need to\n * declare explicitly the generic models with the decorators.\n *\n * One of the generic's usage, can be a paginated list. With Returns decorator it's now possible to declare generic type and generate the appropriate OpenSpec documentation.\n *\n * Starting with the pagination model, by using @@Generics@@ and @@CollectionOf@@:\n *\n * ```typescript\n * @Generics(\"T\")\n * class Pagination<T> {\n * @CollectionOf(\"T\")\n * data: T[];\n *\n * @Property()\n * totalCount: number;\n * }\n * ```\n *\n * Now, we need a model to be used with the generic Pagination model:\n *\n * ```typescript\n * class Product {\n * @Property()\n * id: string;\n *\n * @Property()\n * title: string;\n * }\n * ```\n *\n * Finally, we can use our models on a method as following:\n *\n * ```typescript\n * class Controller {\n * @OperationPath(\"POST\", \"/\")\n * @Status(200, Pagination).Of(Product).Description(\"description\")\n * async method(): Promise<Pagination<Product> | null> {\n * return null;\n * }\n * }\n * ```\n *\n * ### Declaring a nested generics models <Badge text=\"6+\"/>\n *\n * It's also possible to declare a nested generics models in order to have this type `Pagination<Submission<Product>>`:\n *\n * ```typescript\n * import {Generics, Property, Returns} from \"@tsed/schema\";\n * import {Post} from \"@tsed/common\";\n *\n * class Controller {\n * @Post(\"/\")\n * @Status(200, Pagination).Of(Submission).Nested(Product).Description(\"description\")\n * async method(): Promise<Pagination<Submission<Product>> | null> {\n * return null;\n * }\n * }\n * ```\n *\n * And here is the Submission model:\n *\n * ```typescript\n * import {Generics, Property} from \"@tsed/schema\";\n *\n * @Generics(\"T\")\n * class Submission<T> {\n * @Property()\n * _id: string;\n * @Property(\"T\")\n * data: T;\n * }\n * ```\n *\n * @param status\n * @param model\n * @decorator\n * @swagger\n * @schema\n * @response\n * @operation\n */\nexport function Status(status: string | number, model?: Type<any> | any): ReturnsChainedDecorators {\n return Returns(status, model);\n}\n"]}
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/decorators/operations/status.ts"],"names":[],"mappings":";;;AACA,uCAA4D;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AACH,SAAgB,MAAM,CAAC,MAAuB,EAAE,KAAuB;IACrE,OAAO,IAAA,iBAAO,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAChC,CAAC;AAFD,wBAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"summary.js","sourceRoot":"","sources":["../../../../src/decorators/operations/summary.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,yDAAoD;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,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,OAAO,EAAE,IAAI,CAAC,CAAC;SACnD;QAED,KAAK,CAAC,SAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC;AARD,0BAQC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\n\n/**\n * Add summary metadata on the decorated element.\n *\n * ## Examples\n * ### On method\n *\n * ```typescript\n * class Model {\n * @Summary(\"summary\")\n * id: string;\n * }\n * ```\n *\n * @param summary\n * @decorator\n * @swagger\n * @schema\n * @operation\n */\nexport function Summary(summary: string) {\n return JsonEntityFn((store, args) => {\n if (store.decoratorType !== DecoratorTypes.METHOD) {\n throw new UnsupportedDecoratorType(Summary, args);\n }\n\n store.operation!.summary(summary);\n });\n}\n"]}
1
+ {"version":3,"file":"summary.js","sourceRoot":"","sources":["../../../../src/decorators/operations/summary.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,yDAAoD;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,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,OAAO,EAAE,IAAI,CAAC,CAAC;SACnD;QAED,KAAK,CAAC,SAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC;AARD,0BAQC"}
@@ -1 +1 @@
1
- {"version":3,"file":"tags.js","sourceRoot":"","sources":["../../../../src/decorators/operations/tags.ts"],"names":[],"mappings":";;;AAAA,qCAAuF;AAEvF,yDAAoD;AAEpD,SAAS,OAAO,CAAC,IAA8B;IAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACtB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,OAAO;gBACL,IAAI,EAAE,GAAG;aACV,CAAC;SACH;QAED,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,IAAI,CAAC,GAAG,IAA8B;IACpD,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,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACxC,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;gBAC1C,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAClD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAdD,oBAcC","sourcesContent":["import {decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {OpenSpecTag} from \"@tsed/openspec\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\n\nfunction mapTags(tags: (string | OpenSpecTag)[]) {\n return tags.map((tag) => {\n if (typeof tag === \"string\") {\n return {\n name: tag\n };\n }\n\n return tag;\n });\n}\n\n/**\n * Add tags metadata on the decorated element.\n *\n * ## Examples\n * ### On method\n *\n * ```typescript\n * @Controller(\"/\")\n * class MyController {\n * @Tags(\"api\")\n * get() {}\n * }\n * ```\n *\n * @param tags\n * @decorator\n * @swagger\n * @schema\n * @classDecorator\n * @operation\n */\nexport function Tags(...tags: (string | OpenSpecTag)[]) {\n return JsonEntityFn((store, args) => {\n switch (store.decoratorType) {\n case DecoratorTypes.METHOD:\n store.operation!.addTags(mapTags(tags));\n break;\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], Tags(...tags));\n break;\n\n default:\n throw new UnsupportedDecoratorType(Tags, args);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"tags.js","sourceRoot":"","sources":["../../../../src/decorators/operations/tags.ts"],"names":[],"mappings":";;;AAAA,qCAAuF;AAEvF,yDAAoD;AAEpD,SAAS,OAAO,CAAC,IAA8B;IAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACtB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,OAAO;gBACL,IAAI,EAAE,GAAG;aACV,CAAC;SACH;QAED,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,IAAI,CAAC,GAAG,IAA8B;IACpD,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,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBACxC,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;gBAC1C,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SAClD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAdD,oBAcC"}
@@ -1 +1 @@
1
- {"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../src/decorators/operations/view.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,IAAI,CAAC,IAAY,EAAE,OAAgB;IACjD,OAAO,IAAA,eAAQ,EAAC,MAAM,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAQ,CAAC;AAClD,CAAC;AAFD,oBAEC","sourcesContent":["import {StoreSet} from \"@tsed/core\";\n\n/**\n * Use a view and sends the rendered HTML string to the client. Optional parameter:\n *\n * * viewOptions, an object whose properties define local variables for the view.\n *\n * The view argument is a string that is the file path of the view file to render.\n * This can be an absolute path, or a path relative to the views setting.\n * If the path does not contain a file extension, then the view engine setting determines the file extension.\n * If the path does contain a file extension, then Express will load the module for the specified template engine (via require())\n * and render it using the loaded module’s __express function.\n *\n * For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).\n *\n * > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,\n * and as so for security reasons should not contain input from the end-user.\n *\n * @param path Relative path to the view file.\n * @param options Additional options\n * @decorator\n * @operation\n * @response\n */\nexport function View(path: string, options?: Object): MethodDecorator {\n return StoreSet(\"view\", {path, options}) as any;\n}\n"]}
1
+ {"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../src/decorators/operations/view.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,IAAI,CAAC,IAAY,EAAE,OAAgB;IACjD,OAAO,IAAA,eAAQ,EAAC,MAAM,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAQ,CAAC;AAClD,CAAC;AAFD,oBAEC"}
@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ES,MAAM,CAAC,IAAyB,EAAE,SAAc;QACxD,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC1B,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC;IAES,QAAQ,CAAC,GAAW,EAAE,KAAU;QACxC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC;IAES,UAAU;QAClB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAW,EAAE,EAAE;YACnC,MAAM,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;IAES,UAAU,KAAI,CAAC;IAEf,SAAS,KAAI,CAAC;CACzB;AApGD,4CAoGC","sourcesContent":["import {DecoratorParameters, DecoratorTypes} from \"@tsed/core\";\nimport {pascalCase} from \"change-case\";\nimport {JsonEntityStore} from \"./JsonEntityStore\";\n\n/**\n * @ignore\n */\nexport interface DecoratorActionHandler {\n (ctx: Map<string, any>): void;\n}\n\n/**\n * @ignore\n */\nexport abstract class DecoratorContext<T = any> extends Map<string, any> {\n readonly methods: string[];\n protected decoratorType: DecoratorTypes;\n protected entity: JsonEntityStore;\n protected actions: DecoratorActionHandler[] = [];\n\n constructor(opts: any = {}) {\n super();\n\n Object.entries(opts).forEach(([key, value]) => {\n this.set(key, value);\n });\n }\n\n addAction(cb: DecoratorActionHandler) {\n this.actions.push(cb);\n return this;\n }\n\n build(): T {\n const decorator: any = (...args: DecoratorParameters) => this.bind(args, decorator);\n\n const wrap = (cb: any) => {\n return (...args: any[]) => {\n cb(...args);\n return decorator;\n };\n };\n\n const wrapKey = (key: string) => {\n return wrap((...values: any[]) => {\n key in this ? (this as any)[key](...values) : this.set(key, values[0]);\n });\n };\n\n this.methods.forEach((name) => {\n decorator[pascalCase(name)] = wrapKey(name);\n });\n\n return decorator as unknown as T;\n }\n\n toObject(): any {\n return [...this.entries()].reduce((obj, [key, value]) => {\n return {\n ...obj,\n [key]: value\n };\n }, {});\n }\n\n getMergedKey(key: string, defaultValue: any) {\n let value = this.get(key) || defaultValue;\n\n if (!value) {\n return;\n }\n\n if (this.decoratorType === DecoratorTypes.CLASS) {\n value = {\n ...value,\n ...(defaultValue || {})\n };\n }\n\n return {\n ...(defaultValue || {}),\n ...value\n };\n }\n\n protected bind(args: DecoratorParameters, decorator: any) {\n this.entity = JsonEntityStore.from(...args);\n\n this.beforeInit();\n this.onInit(args, decorator);\n this.afterInit();\n }\n\n protected onInit(args: DecoratorParameters, decorator: any): void {\n this.forEach((value, key) => {\n this.onMapKey(key, value);\n });\n }\n\n protected onMapKey(key: string, value: any): void {\n this.entity.set(key, value);\n }\n\n protected runActions() {\n this.actions.forEach((action: any) => {\n action(this);\n });\n\n return this;\n }\n\n protected beforeInit() {}\n\n protected afterInit() {}\n}\n"]}
1
+ {"version":3,"file":"DecoratorContext.js","sourceRoot":"","sources":["../../../src/domain/DecoratorContext.ts"],"names":[],"mappings":";;;AAAA,qCAA+D;AAC/D,6CAAuC;AACvC,uDAAkD;AASlD;;GAEG;AACH,MAAsB,gBAA0B,SAAQ,GAAgB;IAC7D,OAAO,CAAW;IACjB,aAAa,CAAiB;IAC9B,MAAM,CAAkB;IACxB,OAAO,GAA6B,EAAE,CAAC;IAEjD,YAAY,OAAY,EAAE;QACxB,KAAK,EAAE,CAAC;QAER,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC5C,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,EAA0B;QAClC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtB,OAAO,IA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sonAliasMap.ts"],"names":[],"mappings":";;;AAQA;;GAEG;AACH,SAAgB,oBAAoB,CAAC,KAAU,EAAE,KAAe;IAC9D,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAM,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpE,GAAG,GAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAY,IAAI,GAAG,CAAC;QACxC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAExB,OAAO,UAAU,CAAC;IACpB,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAPD,oDAOC","sourcesContent":["/**\n * @ignore\n */\nexport type AliasType = string | number | symbol;\n/**\n * @ignore\n */\nexport type AliasMap = Map<AliasType, AliasType>;\n/**\n * @ignore\n */\nexport function mapAliasedProperties(value: any, alias: AliasMap) {\n return Object.entries(value).reduce<any>((properties, [key, value]) => {\n key = (alias.get(key) as string) || key;\n properties[key] = value;\n\n return properties;\n }, {});\n}\n"]}
1
+ {"version":3,"file":"JsonAliasMap.js","sourceRoot":"","sources":["../../../src/domain/JsonAliasMap.ts"],"names":[],"mappings":";;;AAQA;;GAEG;AACH,SAAgB,oBAAoB,CAAC,KAAU,EAAE,KAAe;IAC9D,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAM,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpE,GAAG,GAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAY,IAAI,GAAG,CAAC;QACxC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAExB,OAAO,UAAU,CAAC;IACpB,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAPD,oDAOC"}
@@ -1 +1 @@
1
- {"version":3,"file":"JsonClassStore.js","sourceRoot":"","sources":["../../../src/domain/JsonClassStore.ts"],"names":[],"mappings":";;;;AAAA,qCAA0C;AAG1C,uDAA0E;AAC1E,6CAAwC;AACxC,kFAA6E;AAG7E,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,iCAAe;IACjD;;OAEG;IACM,QAAQ,GAA8D,IAAI,GAAG,EAAE,CAAC;IAEzF,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC;IAED,IAAI,IAAI,CAAC,IAAY;QACnB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAES,KAAK;QACb,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC7B;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC;QAElC,IAAI,CAAC,OAAO,GAAG,uBAAU,CAAC,IAAI,CAAC;YAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAzBY,cAAc;IAD1B,IAAA,yCAAmB,EAAC,qBAAc,CAAC,KAAK,CAAC;GAC7B,cAAc,CAyB1B;AAzBY,wCAAc","sourcesContent":["import {DecoratorTypes} from \"@tsed/core\";\nimport type {JsonMethodStore} from \"./JsonMethodStore\";\nimport type {JsonPropertyStore} from \"./JsonPropertyStore\";\nimport {JsonEntityStore, JsonEntityStoreOptions} from \"./JsonEntityStore\";\nimport {JsonSchema} from \"./JsonSchema\";\nimport {JsonEntityComponent} from \"../decorators/config/jsonEntityComponent\";\n\n@JsonEntityComponent(DecoratorTypes.CLASS)\nexport class JsonClassStore extends JsonEntityStore {\n /**\n * List of children JsonEntityStore (properties or methods or params)\n */\n readonly children: Map<string | number, JsonMethodStore | JsonPropertyStore> = new Map();\n\n get path() {\n return this.store.get(\"path\", \"/\");\n }\n\n set path(path: string) {\n this.store.set(\"path\", path);\n }\n\n protected build() {\n if (!this._type) {\n this.buildType(this.target);\n }\n\n this._type = this._type || Object;\n\n this._schema = JsonSchema.from({\n type: this.type\n });\n }\n}\n"]}
1
+ {"version":3,"file":"JsonClassStore.js","sourceRoot":"","sources":["../../../src/domain/JsonClassStore.ts"],"names":[],"mappings":";;;;AAAA,qCAA0C;AAG1C,uDAA0E;AAC1E,6CAAwC;AACxC,kFAA6E;AAGtE,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,iCAAe;IACjD;;OAEG;IACM,QAAQ,GAA8D,IAAI,GAAG,EAAE,CAAC;IAEzF,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC;IAED,IAAI,IAAI,CAAC,IAAY;QACnB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAES,KAAK;QACb,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC7B;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC;QAElC,IAAI,CAAC,OAAO,GAAG,uBAAU,CAAC,IAAI,CAAC;YAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAzBY,cAAc;IAD1B,IAAA,yCAAmB,EAAC,qBAAc,CAAC,KAAK,CAAC;GAC7B,cAAc,CAyB1B;AAzBY,wCAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"JsonDiscriminator.js","sourceRoot":"","sources":["../../../src/domain/JsonDiscriminator.ts"],"names":[],"mappings":";;;AAAA,qCAA6C;AAE7C,MAAa,aAAa;IACxB,YAAY,CAAS;IACrB,IAAI,CAAY;IAChB,MAAM,GAAsB,IAAI,G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CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AAjDD,sCAiDC","sourcesContent":["import {cleanObject, Type} from \"@tsed/core\";\n\nexport class Discriminator {\n propertyName: string;\n base: Type<any>;\n values: Map<string, Type> = new Map();\n types: Map<Type, string[]> = new Map();\n\n constructor({\n base,\n propertyName,\n types,\n values\n }: Partial<{base: Type<any>; propertyName: string; values: Map<string, Type<any>>; types: Map<Type, string[]>}> = {}) {\n Object.assign(\n this,\n cleanObject({\n base,\n propertyName,\n types: types ? new Map(types) : undefined,\n values: values ? new Map(values) : undefined\n })\n );\n }\n\n add(type: Type<string>, values: string[]) {\n values.forEach((value) => {\n this.values.set(value, type);\n });\n\n this.types.set(type, values);\n\n return this;\n }\n\n getType(discriminatorValue: string): Type<any> {\n return this.values.get(discriminatorValue) || this.base;\n }\n\n getValues(type: Type) {\n return this.types.get(type);\n }\n\n getDefaultValue(type: Type<any>) {\n const values = this.types.get(type);\n return values ? values[0] : undefined;\n }\n\n children() {\n return [...new Set([...this.types.keys()])];\n }\n}\n"]}
1
+ {"version":3,"file":"JsonDiscriminator.js","sourceRoot":"","sources":["../../../src/domain/JsonDiscriminator.ts"],"names":[],"mappings":";;;AAAA,qCAA6C;AAE7C,MAAa,aAAa;IACxB,YAAY,CAAS;IACrB,IAAI,CAAY;IAChB,MAAM,GAAsB,IAAI,GAAG,EAAE,CAAC;IACtC,KAAK,GAAwB,IAAI,GAAG,EAAE,CAAC;IAEvC,YAAY,EACV,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,MAAM,KAC0G,EAAE;QAClH,MAAM,CAAC,MAAM,CACX,IAAI,EACJ,IAAA,kBAAW,EAAC;YACV,IAAI;YACJ,YAAY;YACZ,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;YACzC,MAAM,EAAE,MAAM,CAAC,CAAC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