@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
package/.eslintignore ADDED
@@ -0,0 +1,13 @@
1
+ node_modules
2
+ docs
3
+ docs-references
4
+ lib
5
+ dist
6
+ coverage
7
+ .nyc_output
8
+ *-lock.json
9
+ *.lock
10
+ benchmarks.*
11
+ **/generated
12
+
13
+ **/*.js
package/.eslintrc.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require("@tsed/eslint/node.js");
package/jest.config.js CHANGED
@@ -2,8 +2,18 @@
2
2
  // https://jestjs.io/docs/en/configuration.html
3
3
 
4
4
  module.exports = {
5
- ...require("@tsed/jest-config")(__dirname, "schema"),
5
+ ...require("@tsed/jest-config"),
6
+ roots: ["<rootDir>/src", "<rootDir>/test"],
6
7
  coverageThreshold: {
7
- global: require("./coverage.json")
8
- }
8
+ global: {
9
+ statements: 99.45,
10
+ branches: 96.13,
11
+ functions: 100,
12
+ lines: 99.45
13
+ }
14
+ },
15
+ moduleNameMapper: {
16
+ "@tsed/schema": "<rootDir>/src/index.ts"
17
+ },
18
+ setupFiles: ["./test/helpers/setup.ts"]
9
19
  };
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see schema.umd.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@tsed/core"),require("change-case")):"function"==typeof define&&define.amd?define(["@tsed/core","change-case"],t):"object"==typeof exports?exports.schema=t(require("@tsed/core"),require("change-case")):e.schema=t(e["@tsed/core"],e["change-case"])}(self,((e,t)=>(()=>{"use strict";var r={379:e=>{const t="\\\\/",r=`[^${t}]`,s="\\.",n="\\/",i="[^/]",o=`(?:${n}|$)`,a=`(?:^|${n})`,c=`${s}{1,2}${o}`,u={DOT_LITERAL:s,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:n,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:o,DOTS_SLASH:c,NO_DOT:`(?!${s})`,NO_DOTS:`(?!${a}${c})`,NO_DOT_SLASH:`(?!${s}{0,1}${o})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${n}]`,STAR:`${i}*?`,START_ANCHOR:a,SEP:"/"},p={...u,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${s}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${s})`,NO_DOTS:`(?!(?:^|[${t}])${s}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${s}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${s}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?p:u}},390:(e,t,r)=>{const s=r(379),n=r(290),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:u}=s,p=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>n.escapeRegex(e))).join("..")}return r},h=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,l=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=u[e]||e;const r={...t},l="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;let m=e.length;if(m>l)throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${l}`);const d={type:"bos",value:"",output:r.prepend||""},f=[d],y=r.capture?"":"?:",g=s.globChars(r.windows),O=s.extglobChars(g),{DOT_LITERAL:S,PLUS_LITERAL:b,SLASH_LITERAL:T,ONE_CHAR:R,DOTS_SLASH:A,NO_DOT:E,NO_DOT_SLASH:v,NO_DOTS_SLASH:x,QMARK:C,QMARK_NO_DOT:P,STAR:w,START_ANCHOR:$}=g,_=e=>`(${y}(?:(?!${$}${e.dot?A:S}).)*?)`,M=r.dot?"":E,N=r.dot?C:P;let D=!0===r.bash?_(r):w;r.capture&&(D=`(${D})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const L={input:e,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:f};e=n.removePrefix(e,L),m=e.length;const k=[],I=[],H=[];let j,G=d;const q=()=>L.index===m-1,U=L.peek=(t=1)=>e[L.index+t],J=L.advance=()=>e[++L.index],K=()=>e.slice(L.index+1),B=(e="",t=0)=>{L.consumed+=e,L.index+=t},F=e=>{L.output+=null!=e.output?e.output:e.value,B(e.value)},W=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)J(),L.start++,e++;return e%2!=0&&(L.negated=!0,L.start++,!0)},V=e=>{L[e]++,H.push(e)},X=e=>{L[e]--,H.pop()},z=e=>{if("globstar"===G.type){const t=L.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||k.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(L.output=L.output.slice(0,-G.output.length),G.type="star",G.value="*",G.output=D,L.output+=G.output)}if(k.length&&"paren"!==e.type&&!O[e.value]&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&F(e),G&&"text"===G.type&&"text"===e.type)return G.value+=e.value,void(G.output=(G.output||"")+e.value);e.prev=G,f.push(e),G=e},Q=(e,t)=>{const s={...O[t],conditions:1,inner:""};s.prev=G,s.parens=L.parens,s.output=L.output;const n=(r.capture?"(":"")+s.open;V("parens"),z({type:e,value:t,output:L.output?"":R}),z({type:"paren",extglob:!0,value:J(),output:n}),k.push(s)},Y=e=>{let t=e.close+(r.capture?")":"");if("negate"===e.type){let s=D;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(s=_(r)),(s!==D||q()||/^\)+$/.test(K()))&&(t=e.close=`)$))${s}`),"bos"===e.prev.type&&q()&&(L.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:j,output:t}),X("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let s=!1,i=e.replace(c,((e,t,r,n,i,o)=>"\\"===n?(s=!0,e):"?"===n?t?t+n+(i?C.repeat(i.length):""):0===o?N+(i?C.repeat(i.length):""):C.repeat(r.length):"."===n?S.repeat(r.length):"*"===n?t?t+n+(i?D:""):D:t?e:`\\${e}`));return!0===s&&(i=!0===r.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===r.contains?(L.output=e,L):(L.output=n.wrapOutput(i,L,t),L)}for(;!q();){if(j=J(),"\0"===j)continue;if("\\"===j){const e=U();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){j+="\\",z({type:"text",value:j});continue}const t=/^\\+/.exec(K());let s=0;if(t&&t[0].length>2&&(s=t[0].length,L.index+=s,s%2!=0&&(j+="\\")),!0===r.unescape?j=J()||"":j+=J()||"",0===L.brackets){z({type:"text",value:j});continue}}if(L.brackets>0&&("]"!==j||"["===G.value||"[^"===G.value)){if(!1!==r.posix&&":"===j){const e=G.value.slice(1);if(e.includes("[")&&(G.posix=!0,e.includes(":"))){const e=G.value.lastIndexOf("["),t=G.value.slice(0,e),r=G.value.slice(e+2),s=o[r];if(s){G.value=t+s,L.backtrack=!0,J(),d.output||1!==f.indexOf(G)||(d.output=R);continue}}}("["===j&&":"!==U()||"-"===j&&"]"===U())&&(j=`\\${j}`),"]"!==j||"["!==G.value&&"[^"!==G.value||(j=`\\${j}`),!0===r.posix&&"!"===j&&"["===G.value&&(j="^"),G.value+=j,F({value:j});continue}if(1===L.quotes&&'"'!==j){j=n.escapeRegex(j),G.value+=j,F({value:j});continue}if('"'===j){L.quotes=1===L.quotes?0:1,!0===r.keepQuotes&&z({type:"text",value:j});continue}if("("===j){V("parens"),z({type:"paren",value:j});continue}if(")"===j){if(0===L.parens&&!0===r.strictBrackets)throw new SyntaxError(h("opening","("));const e=k[k.length-1];if(e&&L.parens===e.parens+1){Y(k.pop());continue}z({type:"paren",value:j,output:L.parens?")":"\\)"}),X("parens");continue}if("["===j){if(!0!==r.nobracket&&K().includes("]"))V("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));j=`\\${j}`}z({type:"bracket",value:j});continue}if("]"===j){if(!0===r.nobracket||G&&"bracket"===G.type&&1===G.value.length){z({type:"text",value:j,output:`\\${j}`});continue}if(0===L.brackets){if(!0===r.strictBrackets)throw new SyntaxError(h("opening","["));z({type:"text",value:j,output:`\\${j}`});continue}X("brackets");const e=G.value.slice(1);if(!0===G.posix||"^"!==e[0]||e.includes("/")||(j=`/${j}`),G.value+=j,F({value:j}),!1===r.literalBrackets||n.hasRegexChars(e))continue;const t=n.escapeRegex(G.value);if(L.output=L.output.slice(0,-G.value.length),!0===r.literalBrackets){L.output+=t,G.value=t;continue}G.value=`(${y}${t}|${G.value})`,L.output+=G.value;continue}if("{"===j&&!0!==r.nobrace){V("braces");const e={type:"brace",value:j,output:"(",outputIndex:L.output.length,tokensIndex:L.tokens.length};I.push(e),z(e);continue}if("}"===j){const e=I[I.length-1];if(!0===r.nobrace||!e){z({type:"text",value:j,output:j});continue}let t=")";if(!0===e.dots){const e=f.slice(),s=[];for(let t=e.length-1;t>=0&&(f.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&s.unshift(e[t].value);t=p(s,r),L.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=L.output.slice(0,e.outputIndex),s=L.tokens.slice(e.tokensIndex);e.value=e.output="\\{",j=t="\\}",L.output=r;for(const e of s)L.output+=e.output||e.value}z({type:"brace",value:j,output:t}),X("braces"),I.pop();continue}if("|"===j){k.length>0&&k[k.length-1].conditions++,z({type:"text",value:j});continue}if(","===j){let e=j;const t=I[I.length-1];t&&"braces"===H[H.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:j,output:e});continue}if("/"===j){if("dot"===G.type&&L.index===L.start+1){L.start=L.index+1,L.consumed="",L.output="",f.pop(),G=d;continue}z({type:"slash",value:j,output:T});continue}if("."===j){if(L.braces>0&&"dot"===G.type){"."===G.value&&(G.output=S);const e=I[I.length-1];G.type="dots",G.output+=j,G.value+=j,e.dots=!0;continue}if(L.braces+L.parens===0&&"bos"!==G.type&&"slash"!==G.type){z({type:"text",value:j,output:S});continue}z({type:"dot",value:j,output:S});continue}if("?"===j){if((!G||"("!==G.value)&&!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("qmark",j);continue}if(G&&"paren"===G.type){const e=U();let t=j;if("<"===e&&!n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===G.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(K()))&&(t=`\\${j}`),z({type:"text",value:j,output:t});continue}if(!0!==r.dot&&("slash"===G.type||"bos"===G.type)){z({type:"qmark",value:j,output:P});continue}z({type:"qmark",value:j,output:C});continue}if("!"===j){if(!0!==r.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){Q("negate",j);continue}if(!0!==r.nonegate&&0===L.index){W();continue}}if("+"===j){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("plus",j);continue}if(G&&"("===G.value||!1===r.regex){z({type:"plus",value:j,output:b});continue}if(G&&("bracket"===G.type||"paren"===G.type||"brace"===G.type)||L.parens>0){z({type:"plus",value:j});continue}z({type:"plus",value:b});continue}if("@"===j){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){z({type:"at",extglob:!0,value:j,output:""});continue}z({type:"text",value:j});continue}if("*"!==j){"$"!==j&&"^"!==j||(j=`\\${j}`);const e=a.exec(K());e&&(j+=e[0],L.index+=e[0].length),z({type:"text",value:j});continue}if(G&&("globstar"===G.type||!0===G.star)){G.type="star",G.star=!0,G.value+=j,G.output=D,L.backtrack=!0,L.globstar=!0,B(j);continue}let t=K();if(!0!==r.noextglob&&/^\([^?]/.test(t)){Q("star",j);continue}if("star"===G.type){if(!0===r.noglobstar){B(j);continue}const s=G.prev,n=s.prev,i="slash"===s.type||"bos"===s.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===r.bash&&(!i||t[0]&&"/"!==t[0])){z({type:"star",value:j,output:""});continue}const a=L.braces>0&&("comma"===s.type||"brace"===s.type),c=k.length&&("pipe"===s.type||"paren"===s.type);if(!i&&"paren"!==s.type&&!a&&!c){z({type:"star",value:j,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[L.index+4];if(r&&"/"!==r)break;t=t.slice(3),B("/**",3)}if("bos"===s.type&&q()){G.type="globstar",G.value+=j,G.output=_(r),L.output=G.output,L.globstar=!0,B(j);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!o&&q()){L.output=L.output.slice(0,-(s.output+G.output).length),s.output=`(?:${s.output}`,G.type="globstar",G.output=_(r)+(r.strictSlashes?")":"|$)"),G.value+=j,L.globstar=!0,L.output+=s.output+G.output,B(j);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";L.output=L.output.slice(0,-(s.output+G.output).length),s.output=`(?:${s.output}`,G.type="globstar",G.output=`${_(r)}${T}|${T}${e})`,G.value+=j,L.output+=s.output+G.output,L.globstar=!0,B(j+J()),z({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===t[0]){G.type="globstar",G.value+=j,G.output=`(?:^|${T}|${_(r)}${T})`,L.output=G.output,L.globstar=!0,B(j+J()),z({type:"slash",value:"/",output:""});continue}L.output=L.output.slice(0,-G.output.length),G.type="globstar",G.output=_(r),G.value+=j,L.output+=G.output,L.globstar=!0,B(j);continue}const s={type:"star",value:j,output:D};!0!==r.bash?!G||"bracket"!==G.type&&"paren"!==G.type||!0!==r.regex?(L.index!==L.start&&"slash"!==G.type&&"dot"!==G.type||("dot"===G.type?(L.output+=v,G.output+=v):!0===r.dot?(L.output+=x,G.output+=x):(L.output+=M,G.output+=M),"*"!==U()&&(L.output+=R,G.output+=R)),z(s)):(s.output=j,z(s)):(s.output=".*?","bos"!==G.type&&"slash"!==G.type||(s.output=M+s.output),z(s))}for(;L.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));L.output=n.escapeLast(L.output,"["),X("brackets")}for(;L.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing",")"));L.output=n.escapeLast(L.output,"("),X("parens")}for(;L.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","}"));L.output=n.escapeLast(L.output,"{"),X("braces")}if(!0===r.strictSlashes||"star"!==G.type&&"bracket"!==G.type||z({type:"maybe_slash",value:"",output:`${T}?`}),!0===L.backtrack){L.output="";for(const e of L.tokens)L.output+=null!=e.output?e.output:e.value,e.suffix&&(L.output+=e.suffix)}return L};l.fastpaths=(e,t)=>{const r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=u[e]||e;const{DOT_LITERAL:c,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:l,NO_DOT:m,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:y,START_ANCHOR:g}=s.globChars(r.windows),O=r.dot?d:m,S=r.dot?f:m,b=r.capture?"":"?:";let T=!0===r.bash?".*?":y;r.capture&&(T=`(${T})`);const R=e=>!0===e.noglobstar?T:`(${b}(?:(?!${g}${e.dot?l:c}).)*?)`,A=e=>{switch(e){case"*":return`${O}${h}${T}`;case".*":return`${c}${h}${T}`;case"*.*":return`${O}${T}${c}${h}${T}`;case"*/*":return`${O}${T}${p}${h}${S}${T}`;case"**":return O+R(r);case"**/*":return`(?:${O}${R(r)}${p})?${S}${h}${T}`;case"**/*.*":return`(?:${O}${R(r)}${p})?${S}${T}${c}${h}${T}`;case"**/.*":return`(?:${O}${R(r)}${p})?${c}${h}${T}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=A(t[1]);if(!r)return;return r+c+t[2]}}},E=n.removePrefix(e,{negated:!1,prefix:""});let v=A(E);return v&&!0!==r.strictSlashes&&(v+=`${p}?`),v},e.exports=l},555:(e,t,r)=>{const s=r(270),n=r(390),i=r(290),o=r(379),a=(e,t,r=!1)=>{if(Array.isArray(e)){const s=e.map((e=>a(e,t,r))),n=e=>{for(const t of s){const r=t(e);if(r)return r}return!1};return n}const s=(n=e)&&"object"==typeof n&&!Array.isArray(n)&&e.tokens&&e.input;var n;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},o=i.windows,c=s?a.compileRe(e,t):a.makeRe(e,t,!1,!0),u=c.state;delete c.state;let p=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};p=a(i.ignore,e,r)}const h=(r,s=!1)=>{const{isMatch:n,match:h,output:l}=a.test(r,c,t,{glob:e,posix:o}),m={glob:e,state:u,regex:c,posix:o,input:r,output:l,match:h,isMatch:n};return"function"==typeof i.onResult&&i.onResult(m),!1===n?(m.isMatch=!1,!!s&&m):p(r)?("function"==typeof i.onIgnore&&i.onIgnore(m),m.isMatch=!1,!!s&&m):("function"==typeof i.onMatch&&i.onMatch(m),!s||m)};return r&&(h.state=u),h};a.test=(e,t,r,{glob:s,posix:n}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const o=r||{},c=o.format||(n?i.toPosixSlashes:null);let u=e===s,p=u&&c?c(e):e;return!1===u&&(p=c?c(e):e,u=p===s),!1!==u&&!0!==o.capture||(u=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,n):t.exec(p)),{isMatch:Boolean(u),match:u,output:p}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map((e=>a.parse(e,t))):n(e,{...t,fastpaths:!1}),a.scan=(e,t)=>s(e,t),a.compileRe=(e,t,r=!1,s=!1)=>{if(!0===r)return e.output;const n=t||{},i=n.contains?"":"^",o=n.contains?"":"$";let c=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=a.toRegex(c,t);return!0===s&&(u.state=e),u},a.makeRe=(e,t,r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");const i=t||{};let o,c={negated:!1,fastpaths:!0},u="";return e.startsWith("./")&&(e=e.slice(2),u=c.prefix="./"),!1===i.fastpaths||"."!==e[0]&&"*"!==e[0]||(o=n.fastpaths(e,t)),void 0===o?(c=n(e,t),c.prefix=u+(c.prefix||"")):c.output=o,a.compileRe(c,t,r,s)},a.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,e.exports=a},270:(e,t,r)=>{const s=r(290),{CHAR_ASTERISK:n,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:h,CHAR_LEFT_PARENTHESES:l,CHAR_LEFT_SQUARE_BRACKET:m,CHAR_PLUS:d,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:y,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:O}=r(379),S=e=>e===p||e===o,b=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const r=t||{},T=e.length-1,R=!0===r.parts||!0===r.scanToEnd,A=[],E=[],v=[];let x,C,P=e,w=-1,$=0,_=0,M=!1,N=!1,D=!1,L=!1,k=!1,I=!1,H=!1,j=!1,G=!1,q=0,U={value:"",depth:0,isGlob:!1};const J=()=>w>=T,K=()=>(x=C,P.charCodeAt(++w));for(;w<T;){let e;if(C=K(),C!==o){if(!0===I||C===h){for(q++;!0!==J()&&(C=K());)if(C!==o)if(C!==h){if(!0!==I&&C===c&&(C=K())===c){if(M=U.isBrace=!0,D=U.isGlob=!0,G=!0,!0===R)continue;break}if(!0!==I&&C===a){if(M=U.isBrace=!0,D=U.isGlob=!0,G=!0,!0===R)continue;break}if(C===y&&(q--,0===q)){I=!1,M=U.isBrace=!0,G=!0;break}}else q++;else H=U.backslashes=!0,K();if(!0===R)continue;break}if(C!==p){if(!0!==r.noext&&!0==(C===d||C===i||C===n||C===f||C===u)&&P.charCodeAt(w+1)===l){if(D=U.isGlob=!0,L=U.isExtglob=!0,G=!0,!0===R){for(;!0!==J()&&(C=K());)if(C!==o){if(C===g){D=U.isGlob=!0,G=!0;break}}else H=U.backslashes=!0,C=K();continue}break}if(C===n){if(x===n&&(k=U.isGlobstar=!0),D=U.isGlob=!0,G=!0,!0===R)continue;break}if(C===f){if(D=U.isGlob=!0,G=!0,!0===R)continue;break}if(C===m)for(;!0!==J()&&(e=K());)if(e!==o){if(e===O){if(N=U.isBracket=!0,D=U.isGlob=!0,G=!0,!0===R)continue;break}}else H=U.backslashes=!0,K();if(!0===r.nonegate||C!==u||w!==$){if(!0!==r.noparen&&C===l){if(D=U.isGlob=!0,!0===R){for(;!0!==J()&&(C=K());)if(C!==l){if(C===g){G=!0;break}}else H=U.backslashes=!0,C=K();continue}break}if(!0===D){if(G=!0,!0===R)continue;break}}else j=U.negated=!0,$++}else{if(A.push(w),E.push(U),U={value:"",depth:0,isGlob:!1},!0===G)continue;if(x===c&&w===$+1){$+=2;continue}_=w+1}}else H=U.backslashes=!0,C=K(),C===h&&(I=!0)}!0===r.noext&&(L=!1,D=!1);let B=P,F="",W="";$>0&&(F=P.slice(0,$),P=P.slice($),_-=$),B&&!0===D&&_>0?(B=P.slice(0,_),W=P.slice(_)):!0===D?(B="",W=P):B=P,B&&""!==B&&"/"!==B&&B!==P&&S(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),!0===r.unescape&&(W&&(W=s.removeBackslashes(W)),B&&!0===H&&(B=s.removeBackslashes(B)));const V={prefix:F,input:e,start:$,base:B,glob:W,isBrace:M,isBracket:N,isGlob:D,isExtglob:L,isGlobstar:k,negated:j};if(!0===r.tokens&&(V.maxDepth=0,S(C)||E.push(U),V.tokens=E),!0===r.parts||!0===r.tokens){let t;for(let s=0;s<A.length;s++){const n=t?t+1:$,i=A[s],o=e.slice(n,i);r.tokens&&(0===s&&0!==$?(E[s].isPrefix=!0,E[s].value=F):E[s].value=o,b(E[s]),V.maxDepth+=E[s].depth),0===s&&""===o||v.push(o),t=i}if(t&&t+1<e.length){const s=e.slice(t+1);v.push(s),r.tokens&&(E[E.length-1].value=s,b(E[E.length-1]),V.maxDepth+=E[E.length-1].depth)}V.slashes=A,V.parts=v}return V}},290:(e,t,r)=>{const{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=r(379);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>i.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(o,"\\$1"),t.toPosixSlashes=e=>e.replace(s,"/"),t.removeBackslashes=e=>e.replace(n,(e=>"\\"===e?"":e)),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.escapeLast=(e,r,s)=>{const n=e.lastIndexOf(r,s);return-1===n?e:"\\"===e[n-1]?t.escapeLast(e,r,n-1):`${e.slice(0,n)}\\${e.slice(n)}`},t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},t.wrapOutput=(e,t={},r={})=>{let s=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(s=`(?:^(?!${s}).*$)`),s},t.basename=(e,{windows:t}={})=>t?e.replace(/[\\/]$/,"").replace(/.*[\\/]/,""):e.replace(/\/$/,"").replace(/.*\//,"")},870:(e,t,r)=>{e.exports=r(555)},203:(e,t,r)=>{var s=r(739);function n(e){if(!Object.prototype.hasOwnProperty.call(i.message,e))throw new Error("invalid status code: "+e);return i.message[e]}function i(e){if("number"==typeof e)return n(e);if("string"!=typeof e)throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?function(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(i.code,t))throw new Error('invalid status message: "'+e+'"');return i.code[t]}(e):n(t)}e.exports=i,i.message=s,i.code=function(e){var t={};return Object.keys(e).forEach((function(r){var s=e[r],n=Number(r);t[s.toLowerCase()]=n})),t}(s),i.codes=function(e){return Object.keys(e).map((function(e){return Number(e)}))}(s),i.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},i.empty={204:!0,205:!0,304:!0},i.retry={502:!0,503:!0,504:!0}},803:t=>{t.exports=e},598:e=>{e.exports=t},739:e=>{e.exports=JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}')}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{n.r(i),n.d(i,{AcceptMime:()=>dr,AdditionalProperties:()=>qe,All:()=>Ir,AllOf:()=>Ue,Allow:()=>Ke,Any:()=>Be,AnyOf:()=>Fe,ArrayOf:()=>_e,Children:()=>Pe,CollectionContains:()=>Ne,CollectionOf:()=>$e,Const:()=>We,Consumes:()=>fr,ContentType:()=>Ar,Converter:()=>ws,CustomKey:()=>Ve,CustomKeys:()=>Xe,DateFormat:()=>mt,DateTime:()=>lt,DecoratorContext:()=>yr,Default:()=>ze,DefaultMsg:()=>Qe,Delete:()=>qr,Deprecated:()=>Er,Description:()=>Ye,Discriminator:()=>S,DiscriminatorKey:()=>Ze,DiscriminatorValue:()=>we,Email:()=>ht,EndpointMetadata:()=>re,Enum:()=>et,ErrorMsg:()=>De,Example:()=>tt,Examples:()=>rt,ExclusiveMaximum:()=>it,ExclusiveMinimum:()=>ct,For:()=>It,Format:()=>pt,ForwardGroups:()=>gt,GenericOf:()=>hr,Generics:()=>lr,Get:()=>Hr,Groups:()=>Rt,HTTP_METHODS:()=>ve,HTTP_STATUS_MESSAGES:()=>K,Head:()=>Ur,Header:()=>vr,Hidden:()=>At,Ignore:()=>vt,In:()=>xr,InFile:()=>Cr,Integer:()=>xt,JSON_TYPES:()=>d,JsonClassStore:()=>E,JsonEntitiesContainer:()=>c,JsonEntityComponent:()=>A,JsonEntityFn:()=>Ce,JsonEntityStore:()=>u,JsonFormatTypes:()=>ut,JsonLazyRef:()=>ne,JsonMap:()=>k,JsonMedia:()=>Y,JsonMethodStore:()=>te,JsonOperation:()=>ee,JsonOperationPathsMap:()=>zr,JsonOperationRoute:()=>Yr,JsonParameter:()=>j,JsonParameterStore:()=>G,JsonParameterTypes:()=>_,JsonPropertyStore:()=>v,JsonRequestBody:()=>z,JsonResponse:()=>Z,JsonSchema:()=>R,Location:()=>Pr,MapOf:()=>Me,Max:()=>nt,MaxItems:()=>ke,MaxLength:()=>Ct,MaxProperties:()=>Ie,Maximum:()=>st,Min:()=>at,MinItems:()=>He,MinLength:()=>Pt,MinProperties:()=>je,Minimum:()=>ot,MultipleOf:()=>wt,Name:()=>$t,Nullable:()=>_t,OneOf:()=>Mt,OperationId:()=>wr,OperationMethods:()=>xe,OperationPath:()=>$r,Optional:()=>Nt,Options:()=>Kr,ParamMetadata:()=>q,Partial:()=>_r,Patch:()=>Jr,Path:()=>Mr,Pattern:()=>Dt,Post:()=>jr,Produces:()=>mr,Property:()=>Je,PropertyMetadata:()=>x,Put:()=>Gr,ReadOnly:()=>Lt,RecordOf:()=>Ht,Redirect:()=>Nr,Required:()=>jt,RequiredGroups:()=>Gt,Returns:()=>Rr,Route:()=>kr,Schema:()=>kt,Security:()=>Br,SpecTypes:()=>$,Status:()=>Fr,Summary:()=>Wr,Tags:()=>Vr,TimeFormat:()=>dt,Title:()=>qt,TypeError:()=>Ut,UniqueItems:()=>Ge,Uri:()=>ft,Url:()=>yt,View:()=>Xr,WriteOnly:()=>Jt,allOf:()=>cr,alterIgnore:()=>me,alterOneOf:()=>Te,alterRequiredGroups:()=>Se,any:()=>ir,anyMapper:()=>ie,anyOf:()=>or,array:()=>tr,boolean:()=>Vt,buildPath:()=>Zr,classMapper:()=>oe,concatParameters:()=>es,concatPath:()=>Qr,createRef:()=>D,createRefName:()=>N,date:()=>Xt,datetime:()=>zt,defineStatusModel:()=>Or,email:()=>Yt,enums:()=>pr,enumsRegistry:()=>l,execMapper:()=>o,formatParameterType:()=>I,from:()=>Kt,generateSpec:()=>_s,genericsMapper:()=>ae,getComputedType:()=>m,getGenericsMap:()=>C,getInheritedStores:()=>ce,getJsonEntityStore:()=>se,getJsonPathParameters:()=>rs,getJsonSchema:()=>Ns,getJsonSchemaMapper:()=>s,getJsonType:()=>f,getOperationsRoutes:()=>Ds,getOperationsStores:()=>ts,getProperties:()=>ks,getPropertiesStores:()=>Ls,getRequiredProperties:()=>be,getSpec:()=>ls,getSpecType:()=>ms,getSpecTypeFromSpec:()=>ds,getStatusConstant:()=>B,getStatusMessage:()=>F,getStatusModel:()=>Sr,hasMapper:()=>a,inheritedClassMapper:()=>ue,integer:()=>Ft,isParameterType:()=>H,isRedirectionStatus:()=>V,isSuccessStatus:()=>W,itemMapper:()=>pe,lazyRef:()=>ur,lazyRefMapper:()=>he,map:()=>rr,mapAliasedProperties:()=>Oe,mapGenericsOptions:()=>P,mapHeaders:()=>Q,mapMapper:()=>le,mapNullableType:()=>de,mapOpenSpec:()=>Os,mapOpenSpec2:()=>ys,mapOpenSpec3:()=>gs,mapOpenSpecInfo:()=>fs,mapRouteOptions:()=>Dr,matchGroups:()=>Tt,mergeOperation:()=>ss,mergeSpec:()=>ps,number:()=>Bt,object:()=>nr,objectMapper:()=>fe,ofMapper:()=>ye,oneOf:()=>ar,operationIdFormatter:()=>ns,parameters:()=>os,popGenerics:()=>w,propertiesMapper:()=>ge,registerJsonSchemaMapper:()=>r,schemaMapper:()=>Ee,schemesReducer:()=>is,security:()=>as,serializeEnum:()=>y,serializeEnumValues:()=>g,set:()=>sr,string:()=>Wt,tagsReducer:()=>cs,time:()=>Qt,toJsonMapCollection:()=>X,toJsonRegex:()=>O,toRef:()=>L,transformInformation:()=>Ps,transformSecurity:()=>Cs,transformToOS2:()=>$s,uri:()=>Zt,url:()=>er,withErrorMsg:()=>Le});var e=n(803);const t=new Map;function r(e,r){return t.set(e,r)}function s(e){if(!t.has(e))throw new Error(`JsonSchema ${e} mapper doesn't exists`);return t.get(e)}function o(e,t,r,n){return s(e)(t,r,n)}function a(e){return t.has(e)}const c=new Map;class u{propertyKey;propertyName;index;descriptor;decoratorType;collectionType;token;store;isStore=!0;parent;target;_type;_schema;constructor(e){const{target:t,propertyKey:r,descriptor:s,index:n,decoratorType:i}=e;this.target=t,this.propertyKey=r,this.propertyName=String(r),this.descriptor=s,this.index=n,this.decoratorType=i,this.token=t,this.store=e.store,this.parent=this}get targetName(){return(0,e.nameOf)(this.token)}get isCollection(){return!!this.collectionType}get isArray(){return(0,e.isArrayOrArrayClass)(this.collectionType)}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.target).find((e=>u.from(e).schema.isDiscriminator));return t&&u.from(t)}get isPrimitive(){return(0,e.isPrimitiveOrPrimitiveClass)(this._type)}get isDate(){return(0,e.isDate)(this.computedType)}get isObject(){return(0,e.isObject)(this.computedType)}get isClass(){return(0,e.isClass)(this.computedType)}get schema(){return this._schema}get nestedGenerics(){return this.schema.nestedGenerics}set nestedGenerics(e){this.schema.nestedGenerics=e}get type(){return this._type}set type(e){this._type=e,this.build()}get computedType(){return this.itemSchema.getComputedType()}get itemSchema(){return this.isCollection?this.schema.itemSchema():this.schema}get parentSchema(){return this.parent.schema}get isDiscriminatorChild(){return this.schema.isDiscriminator&&this.discriminatorAncestor?.schema.discriminator().base!==this.target}static from(...t){if(t[0].isStore)return t[0];const r=t[0];t.length>1&&(t[0]=(0,e.prototypeOf)(t[0]));const s=e.Store.from(...t);if(!s.has("JsonEntityStore")){const n=(0,e.decoratorTypeOf)(t),i=c.get(n);if(!i)throw Error("Unsupported json entity type");const o=new i({store:s,decoratorType:n,target:(0,e.classOf)(r),propertyKey:t[1],index:"number"==typeof t[2]?t[2]:void 0,descriptor:"object"==typeof t[2]?t[2]:void 0});o.build(),s.set("JsonEntityStore",o)}return s.get("JsonEntityStore")}static fromMethod(t,r){return this.from(t,r,(0,e.descriptorOf)(t,r))}static get(t,r,s){return u.from((0,e.prototypeOf)(t),r,s)}isGetterOnly(){return(0,e.isObject)(this.descriptor)&&!this.descriptor.value&&this.descriptor.get&&!this.descriptor.set}get(e,t){return this.store.get(e,t)}set(e,t){return this.store.set(e,t)}toString(){return[this.targetName,this.propertyName,this.index].filter((e=>void 0!==e)).join(":")}buildType(t){(0,e.isCollection)(t)?this.collectionType=t:(this._type=t,this._type&&(0,e.isPlainObject)(this._type)&&(this._type=String))}getBestType(){return this.itemSchema.isDiscriminator?this.itemSchema.discriminator():(0,e.isClassObject)(this.type)?this.itemSchema.getTarget():this.type}}function p(e,t,r,s){var n,i=arguments.length,o=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(i<3?n(o):i>3?n(t,r,o):n(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function h(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create,Object.create;const l=new Map;function m(t){return(0,e.isPromise)(t)?Object:(0,e.isClass)(t)||(0,e.isSymbol)(t)||(0,e.isPrimitiveOrPrimitiveClass)(t)||(0,e.isClassObject)(t)||(0,e.isDate)(t)||(0,e.isCollection)(t)?(0,e.classOf)(t):(0,e.isArrowFn)(t)?t():t}const d=["string","number","integer","boolean","object","array","null","any"];function f(t){return null===t?"null":(0,e.isPrimitiveOrPrimitiveClass)(t)?d.indexOf(t)>-1?t:"string"==typeof t?"file"===t?"file":"generic":(0,e.primitiveOf)(t):t===Array?"array":(0,e.isArray)(t)?t.map(f):t===Set?"array":(0,e.isDate)(t)||(0,e.isBuffer)(t)?"string":"object"}const y=t=>(0,e.isObject)(t)&&null!==t?Object.entries(t).reduce(((e,[t,r])=>isNaN(+t)?e.concat(r):e),[]):t;function g(t){const r=t.reduce(((e,t)=>e.concat(y(t))),[]),s=r.reduce(((e,t)=>e.add((e=>null===e?"null":typeof e)(t))),new Set);return{values:(0,e.uniq)(r),types:s}}function O(e){return String(e).replace(/^(\/)(.*)(\/)$/,"$2")}class S{propertyName;base;values=new Map;types=new Map;constructor({base:t,propertyName:r,types:s,values:n}={}){Object.assign(this,(0,e.cleanObject)({base:t,propertyName:r,types:s?new Map(s):void 0,values:n?new Map(n):void 0}))}add(e,t){return t.forEach((t=>{this.values.set(t,e)})),this.types.set(e,t),this}getType(e){return this.values.get(e)||this.base}getValues(e){return this.types.get(e)}getDefaultValue(e){const t=this.types.get(e);return t?t[0]:void 0}children(){return[...new Set([...this.types.keys()])]}}function b(e){return e instanceof R?e:Object.entries(e).reduce(((e,[t,r])=>(e[O(t)]=T(r),e)),{})}function T(t){return(0,e.isArray)(t)?t.map(T):t.isStore||t.isJsonSchema||t.isLazyRef?t:(0,e.classOf)(t)!==Object&&(0,e.isClass)(t)?u.from(t).schema:(0,e.isObject)(t)?R.from(t):(0,e.isPrimitiveClass)(t)?R.from({type:t}):t}class R extends Map{isJsonSchema=!0;$hooks=new e.Hooks;$required=new Set;$allow=[];$selfRequired;$forwardGroups=!1;isDiscriminatorKey=!1;isDiscriminator=!1;#e=!1;#t=null;#r;#s=[];#n=new Map;#i;#o;#a=!1;#c=!1;#u=!1;constructor(e={}){super(),e&&this.assign(e)}get alias(){return this.#n}get nestedGenerics(){return this.#s}set nestedGenerics(e){this.#s=e}get genericLabels(){return this.#r}set genericLabels(e){this.#r=e}get isClass(){return(0,e.isClass)(this.class)&&![Map,Array,Set,Object,Date,Boolean,Number,String].includes(this.#o)}get isCollection(){return this.#c}get isGeneric(){return this.#a}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.#o).find((e=>u.from(e).schema.isDiscriminator));return t&&u.from(t).schema}get hasGenerics(){return!(!this.nestedGenerics||!this.nestedGenerics.length)}get genericType(){return this.get("$ref")}get class(){return this.getComputedType()}get canRef(){return this.#u}get isNullable(){return this.#e||this.$allow.includes(null)}get isReadOnly(){return this.get("readOnly")}get isWriteOnly(){return this.get("writeOnly")}get hasDiscriminator(){return!!this.#t}static from(e={}){return new R(e)}nullable(e){this.#e=e}itemSchema(e={}){return this.#i=this.#i||T(e),this.#i.assign(e),this.#i}getAliasOf(e){return this.#n.get(e)}addAlias(e,t){return this.#n.set(e,t),this.#n.set(t,e),this}removeAlias(e){const t=this.#n.get(e);return t&&this.#n.delete(t),this.#n.delete(e),this}$id(e){return super.set("$id",e),this}$ref(e){return super.set("$ref",e),this}$schema(e){return super.set("$schema",e),this}label(e){return this.#u=!0,super.set("name",e),this}name(e){return super.set("name",e),this}ignore(e){if("boolean"==typeof e){const t=e;e=()=>t}return this.$hooks.on("ignore",e),this}default(e){return super.set("default",e),this}const(e){return super.set("const",e),this}description(e){return super.set("description",e),this}discriminator(){return this.isDiscriminator=!0,this.#t=this.#t||new S({base:this.#o})}discriminatorKey(e){return this.discriminator().propertyName=e,this.isDiscriminator=!0,this}discriminatorValue(...e){const t=this.discriminatorAncestor.discriminator();t.add(this.#o,e),this.isDiscriminator=!0;const r=this.get("properties"),s=r[t.propertyName]||new R({type:"string"});return 1===e.length?(s.const(e[0]),s.examples([e[0]])):(s.enum(...e),s.examples(e)),r[t.propertyName]=s,this.set("properties",r),this}additionalItems(e){return super.set("additionalItems",T(e)),this}contains(e){return super.set("contains",T(e)),this}examples(e){return super.set("examples",e),this}example(...e){return this.examples(e)}items(e){return super.set("items",this.#i=T(e)),this}maxItems(e){return super.set("maxItems",e),this}minItems(e){return super.set("minItems",e),this}uniqueItems(e){return super.set("uniqueItems",e),this}maxProperties(e){return super.set("maxProperties",e),this}minProperties(e){return super.set("minProperties",e),this}allow(...e){return this.$allow.push(...e),this}required(t=!0){if(!(0,e.isArray)(t)){const e=this.clone();return e.$selfRequired=t,e}return this.$required.clear(),t.forEach((e=>this.$required.add(e))),this}addRequired(e){return this.$required.add(e),this}removeRequired(e){return this.$required.delete(e),this}isRequired(e){return this.$required.has(e)}properties(e){return super.set("properties",b(e)),this}addProperty(e,t){const r=this.get("properties")||{};return r[e]=t,super.set("properties",b(r)),this}patternProperties(e){return super.set("patternProperties",b(e)),this}additionalProperties(e){return super.set("additionalProperties",T(e)),this}unknown(e=!0){return this.additionalProperties(e)}dependencies(e){return super.set("dependencies",b(e)),this}propertyNames(e){return super.set("propertyNames",T(e)),this}enum(e,...t){if(l.has(e))return this.enum(l.get(e));if(e instanceof R)e.getName()?super.set("enum",e):super.set("enum",e.get("enum")).any(...e.getJsonType());else{const{values:r,types:s}=g([e,t].flat());super.set("enum",r).any(...s)}return this}definitions(e){return super.set("definitions",b(e)),this}allOf(e){return super.set("allOf",e.map(T)),this}anyOf(e){return super.set("anyOf",e.map(T)),this}oneOf(e){let t=e.map(T);if(1===t.length&&!(e[0]instanceof R)){if(!t[0].hasDiscriminator)return this.type(e[0]);const r=t[0].discriminator().children();if(!r.length)return this.type(e[0]);t=r.map(T)}super.set("oneOf",t);const r=t[0];if(r.isDiscriminator){const e=r.discriminatorAncestor.discriminator(),{propertyName:t}=e;super.set("discriminator",{propertyName:t}),this.isDiscriminator=!0,this.#t=e}return this}not(e){return super.set("not",T(e)),this}multipleOf(e){return super.set("multipleOf",e),this}maximum(e){return super.set("maximum",e),this}exclusiveMaximum(e){return super.set("exclusiveMaximum",e),this}minimum(e){return super.set("minimum",e),this}exclusiveMinimum(e){return super.set("exclusiveMinimum",e),this}maxLength(e){return super.set("maxLength",e),this}minLength(e){return super.set("minLength",e),this}pattern(e){return super.set("pattern",O(e)),this}format(e){return super.set("format",e),this}type(t){switch(t){case Map:super.set("type",f(t)),this.#o=t,this.#c=!0,this.has("additionalProperties")||super.set("additionalProperties",this.itemSchema({}));break;case Array:super.set("type",f(t)),this.#o=t,this.#c=!0,this.has("items")||super.set("items",this.itemSchema({}));break;case Set:super.set("type",f(t)),this.#o=t,this.#c=!0,this.uniqueItems(!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"integer":super.set("type",f(t)),this.integer();break;case Object:case Date:case Boolean:case Number:case String:super.set("type",f(t)),this.#o=t,this.has("properties")||super.set("properties",{});break;default:if((0,e.isClass)(t)||(0,e.isFunction)(t))super.set("type",void 0),this.#o=t,this.has("properties")||super.set("properties",{});else{const e=f(t);"generic"===e?(this.#a=!0,super.set("$ref",t)):super.set("type",e)}}return this}any(...t){return t.filter((t=>(0,e.isClass)(t))).length>=2?this.oneOf(t.filter((e=>null!==e&&(this.nullable(!0),!0)))):(t.length?(t=(0,e.uniq)(t).map(f)).includes("null")&&(this.nullable(!0),t=t.filter((e=>"null"!==e))):(t=["integer","number","string","boolean","array","object"],this.nullable(!0)),this.type(1===t.length?t[0]:t)),this}integer(){return super.set("type","integer"),super.set("multipleOf",1),this}title(e){return super.set("title",e),this}readOnly(e){return super.set("readOnly",e),this}writeOnly(e){return super.set("writeOnly",e),this}customKey(e,t){return super.set(`#${e}`,t),this}toObject(e){return this.toJSON(e)}toJSON(e){let t=!1;e||(t=!0,e={schemas:{}});const r=o("schema",this,e);return t&&e.schemas&&Object.keys(e.schemas).length&&(r.definitions=e.schemas),r}assign(e={}){return(e instanceof R?[...e.entries()]:Object.entries(e)).forEach((([e,t])=>{this.set(e,t)})),e instanceof R&&(this.$selfRequired=e.$selfRequired,this.$allow.push(...e.$allow),e.$required.forEach((e=>{this.$required.add(e)})),this.#t=this.#t?new S(this.#t):null,this.isDiscriminator=e.isDiscriminator,this.isDiscriminatorKey=e.isDiscriminatorKey,this.#u=e.#u,this.#n=new Map(this.#n.entries()),e.#r&&(this.#r=[...e.#r]),this.#s=e.#s.map((e=>[...e])),this.#o=e.#o,this.#a=e.#a,this.#c=e.#c,this.#u=e.#u,super.set("type",e.get("type"))),this}set(t,r){return t in this?(0,e.isFunction)(this[t])&&this[t](r):super.set(t,r),this}getComputedType(){return m(this.#o)}getComputedItemType(){return this.#i?this.#i.getComputedType():this.getComputedType()}getJsonType(){return this.get("type")||f(this.getComputedType())}getTarget(){return this.#o}getName(){return this.get("name")||((0,e.isClass)(this.#o)?(0,e.nameOf)((0,e.classOf)(this.getComputedType())):"")}clone(){return new R(this)}}function A(e){return t=>{c.set(e,t)}}let E=class extends u{children=new Map;get path(){return this.store.get("path","/")}set path(e){this.store.set("path",e)}build(){this._type||this.buildType(this.target),this._type=this._type||Object,this._schema=R.from({type:this.type})}};E=p([A(e.DecoratorTypes.CLASS)],E);let v=class extends u{parent=u.from(this.target);get required(){return this.parent.schema.isRequired(this.propertyKey)}set required(e){e?this.parent.schema.addRequired(this.propertyKey):this.parent.schema.removeRequired(this.propertyKey)}get allowedRequiredValues(){return this.schema.$allow}discriminatorKey(){return this.parent.schema.discriminatorKey(String(this.propertyKey)),this.itemSchema.isDiscriminatorKey=!0,this}isDiscriminatorKey(){return this.itemSchema.isDiscriminatorKey}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}build(){this._type||this.buildType(e.Metadata.getType((0,e.prototypeOf)(this.target),this.propertyKey)),this._type=this._type||Object;let t=this.parent.schema.get("properties")[this.propertyName];t||(this.parent.children.set(this.propertyName,this),t=R.from({type:this.collectionType||this.type}),this.collectionType&&t.itemSchema(this.type)),this.parent.schema.addProperty(this.propertyName,t),this._schema=t}static get(t,r){return u.from((0,e.prototypeOf)(t),r)}};v=p([A(e.DecoratorTypes.PROP)],v);const x=v;function C(e,t){return e.reduce(((e,r,s)=>e.set(r,t[s])),new Map)}function P(e){if(e.genericLabels&&e.genericTypes){const{genericLabels:t,genericTypes:r,...s}=e;return{...s,generics:C(t,r)}}return e}function w(e){const[t,...r]=e.nestedGenerics;return{genericTypes:t,nestedGenerics:r}}var $,_,M=n(598);function N(e,t){return t.groups&&t.groups.length?(0,M.pascalCase)(`${e} ${t.groupsName||t.groups.join(" ")}`):e}function D(t,r,s){const n=function(e){const{host:t="#/"+("openapi3"===e.specType?"components/schemas":"definitions")}=e;return t}(s),i={$ref:`${n}/${t}`},o=r.isNullable,a=r.isReadOnly,c=r.isWriteOnly;if(o||a||c)switch(s.specType){case $.OPENAPI:return(0,e.cleanObject)({nullable:!!o||void 0,readOnly:!!a||void 0,writeOnly:!!c||void 0,oneOf:[i]});case $.JSON:return(0,e.cleanObject)({readOnly:a,writeOnly:c,oneOf:[i]})}return i}function L(e,t,r){const s=N(e.getName(),r);return r.schemas[s]=t,D(s,e,r)}!function(e){e.JSON="jsonschema",e.SWAGGER="swagger2",e.OPENAPI="openapi3"}($||($={}));class k extends Map{constructor(e={}){super(),this.assign(e)}assign(t={}){return Object.entries(t).forEach((([t,r])=>{(0,e.isFunction)(this[t])?this[t](r):this.set(t,r)})),this}toJSON(e={}){return o("map",this,e)}}function I(e){return String(e).toLowerCase().replace("raw_","").replace("cookies","cookie")}function H(e){return Object.values(_).includes(I(e))}!function(e){e.BODY="body",e.PATH="path",e.QUERY="query",e.HEADER="header",e.COOKIES="cookie",e.FILES="files"}(_||(_={}));class j extends k{nestedGenerics=[];groups;groupsName;$schema;expression;getName(){const e=this.get("name");return"files"===this.get("in")?e.split(".")[0]:e}name(e){return this.set("name",e),this}examples(e){return super.set("examples",e),this}description(e){return this.set("description",e),this}in(e,t=""){return this.set("in",I(e)),this.expression=t,this}required(e){return this.set("required",e),this}schema(e){return this.$schema=e,this}toJSON(t={}){if(!H(this.get("in")))return null;const r=(0,e.toMap)(t.schemas||{});return this.build({...t,groups:this.groups,groupsName:this.groupsName},r)}build(e,t){const{type:r,schema:s,...n}=super.toJSON(e),i=o("item",this.$schema,{...e,...w(this)});switch(n.required=n.required||this.get("in")===_.PATH,this.get("in")){case _.FILES:return this.getFileSchema(i,n);case _.QUERY:if(i.$ref){if(!n.name)return this.refToParameters(n,e,t);n.style="deepObject"}}return n.schema=i,n}getFileSchema(t,r){const s={type:"string",format:"binary",oneOf:void 0};return"array"===t.type?(t.items=(0,e.cleanObject)({...t.items,...s}),r.schema=t):r.schema=(0,e.cleanObject)({...t,...s}),r}refToParameters(t,r,s){const n=N(this.$schema.getName(),r),i=r.schemas[n];return r.schemas[n]&&!s.has(n)&&delete r.schemas[this.$schema.getName()],Object.entries(i.properties||{}).reduce(((r,[s,{description:n,...o}])=>[...r,(0,e.cleanObject)({...t,name:s,required:(i.required||[]).includes(s),description:n,schema:o,style:o.$ref?"deepObject":void 0})]),[])}}let G=class extends u{paramType;expression;dataPath;pipes;parameter=new j;parent=u.fromMethod(this.target,this.propertyKey);constructor(e){super(e),this.pipes=e.pipes||[],this.paramType=e.paramType||this.paramType,this.expression=e.expression||this.expression,this.dataPath=e.dataPath||this.dataPath}get nestedGenerics(){return this.parameter.nestedGenerics}set nestedGenerics(e){this.parameter.nestedGenerics=e}get required(){return!!this.parameter.get("required")}set required(e){this.parameter.required(e)}get allowedRequiredValues(){return this.schema.$allow}static getParams(t,r){const s=[],n=(0,e.ancestorsOf)(t).reverse().find((t=>(0,e.isMethodDescriptor)(t,r)&&u.fromMethod(t,r).children.size));return n?(u.fromMethod(n,r).children.forEach(((e,t)=>{s[+t]=e})),s):[]}static get(t,r,s){return u.from((0,e.prototypeOf)(t),r,s)}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}getSchema(t){return(0,e.isCollection)(t)||!(0,e.isClass)(t)?R.from({type:t}):u.from(t).schema}build(){if(!this._type){const t=e.Metadata.getParamTypes((0,e.prototypeOf)(this.target),this.propertyKey)[this.index];this.buildType(t)}this._type=this._type||Object,this._schema||(this.parent.children.set(this.index,this),this._schema=this.getSchema(this.collectionType||this.type),this.parameter.schema(this._schema),this.collectionType&&this._schema.itemSchema(this.getSchema(this.type)),this.parent.operation.addParameter(this.index,this.parameter))}};G=p([A(e.DecoratorTypes.PARAM),h("design:paramtypes",[Object])],G);const q=G;var U=n(203),J=n.n(U);const K=J().codes.reduce(((e,t)=>{const r=String(J()(t));return{...e,[String(t)]:{label:r,code:(0,M.constantCase)(r)}}}),{});function B(e){return K[e]?.code}function F(e){return K[e]?.label}K[200].label="Success",K[200].code="SUCCESS";const W=e=>Number(e)&&200<=Number(e)&&Number(e)<300,V=e=>Number(e)&&300<=Number(e)&&Number(e)<400;function X(e,t=k){return Object.entries(e).reduce(((e,[r,s])=>(e.set(r,new t(s)),e)),new k)}class z extends k{constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}content(e){return this.set("content",X(e)),this}addContent(e,t,r){const s=this.get("content"),n=new k;return n.set("schema",t),r&&n.set("examples",r),s.set(e,n),this}required(e){return this.set("required",e),this}}function Q(t){return Object.keys(t).reduce(((r,s)=>{const n=t[s];let i=typeof n,o={example:n};return"object"===i&&(o=n,o.example=void 0===o.value?o.example:o.value,delete o.value,i=typeof o.example),o.type=o.type||i,r[s]=(0,e.cleanObject)(o),r}),{})}class Y extends k{groups=[];groupsName;allowedGroups;schema(e){return this.set("schema",e),this}examples(e){return this.set("examples",e),this}toJSON(e={}){let t=[...this.groups||[]];return super.toJSON({...e,groups:t,groupsName:this.groupsName})}}class Z extends k{status;constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}headers(e){return this.set("headers",Q(e)),this}content(e){return this.set("content",X(e,Y)),this}getContent(){return this.get("content")}getMedia(e,t=!0){return t&&this.addMedia(e),this.getContent()?.get(e)}addMedia(e){const t=this.get("content");return t.has(e)||t.set(e,new Y),this}toJSON(e={}){const t=super.toJSON(e);return 204===this.status&&delete t.content,t.headers&&Object.entries(t.headers).forEach((([e,{type:r,...s}])=>{t.headers[e]={...s,schema:{type:r}}})),t}}class ee extends k{operationPaths=new Map;#p;#h=!1;constructor(e={}){super({parameters:[],responses:new k,...e})}get response(){return this.getResponses().get(this.getStatus().toString())}get status(){return this.#p}tags(e){return super.set("tags",e),this}addTags(t){return t=(0,e.uniqBy)([...this.get("tags")||[],...t],"name"),this.tags(t)}summary(e){return super.set("summary",e),this}operationId(e){return this.set("operationId",e),this}responses(e){return this.set("responses",e),this}defaultStatus(e){return this.#p=e,this}getStatus(){return this.#p||200}setRedirection(e=302){return this.#h=!0,this.#p=e,this}isRedirection(e){return this.#h&&e?V(e):this.#h}addResponse(t,r){if((W(t)||V(t))&&!this.#p){const e=this.getResponseOf(200);this.getResponses().set(t.toString(),e).delete("200"),this.defaultStatus(Number(t))}const s="default"===t?this.getStatus().toString():t.toString(),n=this.getResponses().get(s);return n?(r.forEach(((t,r)=>{["content"].includes(r)||n.set(r,(0,e.deepMerge)(n.get(r),t))})),n.status=Number(s)):(r.status=Number(s),this.getResponses().set(s,r)),this}getResponses(){return this.get("responses")}getResponseOf(e){return("default"===e?this.response:this.getResponses().get(String(e)))||new Z}ensureResponseOf(e){return this.addResponse(e,this.getResponseOf(e)),this.getResponseOf(e)}getHeadersOf(e){return this.getResponseOf(e).get("headers")||{}}getContentTypeOf(e){return[...this.getResponseOf(e).get("content").keys()].slice(-1)[0]}security(e){return this.set("security",e),this}addSecurityScopes(t,r){const s=this.get("security")||{};return s[t]=(0,e.uniq)([...s[t]||[],...r]),this.security(s)}description(e){return super.set("description",e),this}deprecated(e){return super.set("deprecated",e),this}parameters(e){return super.set("parameters",e),this}addParameter(e,t){-1===e&&(e=this.get("parameters").length),this.get("parameters")[e]=t}consumes(e){return super.set("consumes",e),this}produces(e){return super.set("produces",e),this}addProduce(t){const r=(0,e.uniq)([].concat(this.get("produces"),t)).filter(Boolean);this.set("produces",r)}addOperationPath(e,t,r={}){return this.operationPaths.set(String(e)+String(t),{...r,method:e,path:t}),this}toJSON(e={}){const t=super.toJSON({...e,ignore:["parameters"]}),r=[],s=[];if(t.security&&(t.security=[].concat(t.security)),this.get("parameters").forEach((t=>{H(this.get("in"))||t.get("in")&&([_.BODY,_.FILES].includes(t.get("in"))?r.push(t):s.push(...[].concat(t.toJSON(e))))})),t.parameters=s.filter(Boolean),0===this.get("responses").size&&(t.responses={200:{description:F(200)}}),r.length){const s=function(e,t){let r=new R;const s={},n=[];let i=0;return e.forEach((e=>{const o=e.getName();Array.from(e.entries()).filter((([e])=>!["in","name"].includes(e))).forEach((([e,t])=>{void 0===s[e]&&(s[e]=t)}));const a=e.toJSON(t);o?(r.addProperty(o,a.schema||{type:a.type}),e.get("required")&&r.addRequired(o),i++):n.push(a)})),i||1!==n.length?(r.type("object"),{schema:r.toJSON(t),required:!1,...s}):n[0]}(r,e);t.requestBody=function(e,{schema:t,examples:r,in:s,...n}){const i=new z(n);return(e.get("consumes")?.length?e.get("consumes"):["application/json"]).forEach((e=>{i.addContent(e,t,r)})),i}(this,s).toJSON(e)}return delete t.consumes,delete t.produces,t}}let te=class extends u{parent=u.from(this.target);middlewares=[];beforeMiddlewares=[];afterMiddlewares=[];operation=new ee;children=new Map;constructor(t){super({store:e.Store.fromMethod(t.target,t.propertyKey),descriptor:(0,e.descriptorOf)(t.target,t.propertyKey),...t});const{beforeMiddlewares:r=[],middlewares:s=[],afterMiddlewares:n=[]}=t;this.after(n),this.before(r),this.use(s)}get params(){return this.parameters}get view(){return this.store.get("view")}set view(e){this.store.set("view",e)}get acceptMimes(){return this.store.get("acceptMimes",[])}set acceptMimes(e){this.store.set("acceptMimes",e)}get parameters(){return[...this.children.values()]}get operationPaths(){return this.operation.operationPaths}static get(t,r,s){return s=s||(0,e.descriptorOf)((0,e.prototypeOf)(t),r),u.from((0,e.prototypeOf)(t),r,s)}getResponseOptions(e,{contentType:t="application/json",includes:r}={}){const s=this.operation.getResponseOf(e).getMedia(t,!1);if(s&&s.has("schema")){const e=s.get("schema");let t=s.groups;return r&&s.allowedGroups?.size&&(t=[...t||[],...r.filter((e=>s.allowedGroups.has(e)))]),{type:e.getComputedItemType(),groups:t}}return{type:this.type}}before(t){return this.beforeMiddlewares=this.beforeMiddlewares.concat(t).filter(e.isFunction),this}after(t){return this.afterMiddlewares=this.afterMiddlewares.concat(t).filter(e.isFunction),this}use(t){return this.middlewares=this.middlewares.concat(t).filter(e.isFunction),this}get(t){const r=e.Store.from(this.target).get(t);return(0,e.deepMerge)(r,this.store.get(t))}getParamTypes(){return[...this.children.values()].reduce(((e,t)=>({...e,[t.paramType]:!0})),{})}build(){if(!this._type){let t=e.Metadata.getReturnType(this.target,this.propertyKey);t=(0,e.isPromise)(t)?void 0:t,this.buildType(t)}this._type=this._type||Object,this.parent.children.set(this.propertyName,this),(0,e.isCollection)(this._type)&&(this.collectionType=this._type,delete this._type),this._schema=R.from({type:this.collectionType||this.type}),this.collectionType&&this._schema.itemSchema(this.type),this.parent.schema.addProperty(this.propertyName,this.schema)}};te=p([A(e.DecoratorTypes.METHOD),h("design:paramtypes",[Object])],te);const re=te;function se(...e){return u.from(...e)}c.set(e.DecoratorTypes.CLASS,E),c.set(e.DecoratorTypes.PROP,v),c.set(e.DecoratorTypes.PARAM,G),c.set(e.DecoratorTypes.METHOD,te);class ne{getType;isLazyRef=!0;constructor(e){this.getType=e}get target(){return this.getType()}get schema(){return se(this.getType()).schema}get name(){return(0,e.nameOf)(this.getType())}toJSON(e){return this.getType()&&o("schema",this.schema,e)}}function ie(e,t={}){if("object"!=typeof e||null===e)return e;if(e instanceof ne)return o("lazyRef",e,t);if(e instanceof R&&e.get("enum")instanceof R){const r=e.get("enum");return L(r,r.toJSON(t),t)}if("toJSON"in e){const r=e.toJSON(P(t));return e.canRef?L(e,r,t):r}return o("object",e,t)}function oe(e,t){const r=u.from(e.class),s=N(r.schema.getName()||e.getName(),t);if(e.hasGenerics){const{type:s,properties:n,additionalProperties:i,items:a,...c}=e.toJSON(t),u={...o("any",r.schema,{...t,...w(e),root:!1}),...c};if(u.title){const r=N(u.title,t);return t.schemas[r]=u,delete u.title,D(r,e,t)}return u}return t.schemas&&!t.schemas[s]&&(t.schemas[s]={},t.schemas[s]=o("any",r.schema,P({...t,root:!1}))),D(s,e,t)}function ae(t,r){const{generics:s}=r;if(s&&t.$ref&&s.has(t.$ref)){let n=s.get(t.$ref);if((0,e.isPrimitiveClass)(n))return{type:f(n)};if(n===Date)return{type:"string",format:"date-time"};if(n.toJSON)return n.toJSON({...r,generics:void 0});if(n===Object)return{type:"object"};if((0,e.isClass)(n)){const e={class:n};return 0===r.nestedGenerics.length?o("class",e,{...r,generics:void 0}):o("schema",u.from(e.class).schema,{...r,...w(r),root:!1})}}return t}function ce(t){const r=t.isStore?t:se(t);return r.$inherited||(r.$inherited=(0,e.ancestorsOf)(r.target).reverse().reduce(((e,t)=>e.set(t,se(t))),new Map)),r.$inherited}function ue(t,{target:r,...s}){const n=Array.from(ce(r).entries()).filter((([t])=>(0,e.classOf)(t)!==(0,e.classOf)(r)));if(n.length){const r=n.reduce(((t,[,r])=>(0,e.deepMerge)(t,o("schema",r.schema,s))),{});t=(0,e.deepMerge)(r,t)}return t}function pe(e,t){return e&&e.isClass?o("class",e,t):o("any",e,t)}function he(e,t){const r=e.name;if(t.$refs?.find((t=>t===e.target)))return D(r,e.schema,t);t.$refs=[...t.$refs||[],e.target];const s=e.toJSON(P(t));return L(e.schema,s,t)}function le(e,{ignore:t=[],...r}){return r=P(r),Array.from(e.entries()).reduce(((e,[s,n])=>(t.includes(s)||(e[s]=o("item",n,r)),e)),{})}function me(e,t){let r=e?.$hooks?.alter("ignore",!1,[t]);return r||(!1!==t.groups?e?.$hooks?.alter("groups",!1,[t.groups]):r)}function de(t,r,s){if(!r?.isNullable)return t;let n=[].concat(t.type).filter(Boolean);switch(s.specType){default:case $.JSON:t.discriminator||(t.oneOf?function(e){return e.oneOf.find((e=>"null"===e.type))}(t)||t.oneOf.unshift({type:"null"}):t.type=(0,e.uniq)(["null",...n]));break;case $.OPENAPI:t.nullable=!0,t.oneOf||(n.length>1?(t.oneOf=n.map((e=>({type:e}))),delete t.type):t.type=n[0])}return t}function fe(t,r){const{specType:s,operationIdFormatter:n,root:i,schemas:a,genericTypes:c,nestedGenerics:u,useAlias:p,genericLabels:h,...l}=r;return Object.entries(t).reduce(((e,[s,n])=>{if(!1!==r.withIgnoredProps&&!me(n,l)){const i={...r,groups:t?.$forwardGroups||n?.$forwardGroups?r.groups:void 0};e[s]=o("item",n,i),e[s]=de(e[s],n,i)}return e}),(0,e.isArray)(t)?[]:{})}function ye(e,t,r){return e.map((e=>o("item",e,{...t,genericLabels:r.genericLabels})))}function ge(e,t,r){return e.isClass?o("class",e,t):o("any",e,{...t,genericLabels:r.genericLabels})}function Oe(e,t){return Object.entries(e).reduce(((e,[r,s])=>(e[r=t.get(r)||r]=s,e)),{})}function Se(e,t,r){return!1!==r.groups?t?.$hooks?.alter("requiredGroups",e,[r.groups]):e}function be(t,r,s){if(s.groups&&s.groups.includes("partial"))return t.discriminator?{...t,required:[t.discriminator.propertyName]}:t;let n=function(t,r,s){let n=t.required||[];return n=[...n,...r.$required],r.get("properties")&&(n=Object.entries(r.get("properties")).reduce(((e,[t,r])=>r&&void 0!==r.$selfRequired?r.$selfRequired?e.concat(t):e.filter((e=>e===t)):e),n)),Se((0,e.uniq)(n),r,s)}(t,r,s);return n=(0,e.uniq)(n).reduce(function(e,t,r={}){const{useAlias:s}=r,n=Object.keys(e.properties||{});return(r,i)=>{const o=s&&t.alias.get(i)||i;if(n.includes(o)){const s=t.get("properties")[i],n=e.properties[o];return e.properties[o]=function(e,t){if(!t?.$allow.includes("")&&[].concat(t?.get("type")).includes("string")){const t=e?.minLength;if(void 0===t)return{...e,minLength:1}}return e}(n,s),r.concat(o)}return r}}(t,r,s),[]),t.discriminator&&n.push(t.discriminator.propertyName),n.length?{...t,required:n}:t}function Te(e,t,r){return e.oneOf&&!1!==r.groups&&(e={...e,oneOf:t.$hooks.alter("oneOf",e.oneOf,[r.groups])}),!(e.oneOf||e.allOf||e.anyOf)||e.items||e.properties||delete e.type,e}r("any",ie),r("class",oe),r("generics",ae),r("inheritedClass",ue),r("item",pe),r("lazyRef",he),r("map",le),r("object",fe),r("anyOf",ye),r("allOf",ye),r("oneOf",ye),r("properties",ge),r("items",ge),r("additionalProperties",ge),r("propertyNames",ge),r("contains",ge),r("dependencies",ge),r("patternProperties",ge),r("additionalItems",ge),r("not",ge),r("definitions",ge);const Re=["name","$required","$hooks","_nestedGenerics",$.OPENAPI,$.SWAGGER,$.JSON],Ae=["const"];function Ee(t,r){const{useAlias:s=!0,schemas:n={}}=r;r={...r,useAlias:s,schemas:n};let i=[...t.keys()].filter((e=>!function(e,{specType:t=$.JSON,customKeys:r=!1}){return Re.includes(e)||e.startsWith("#")&&(!1===r||t!==$.JSON)||t!==$.JSON&&Ae.includes(e)}(e,r))).reduce(((n,i)=>{let c=t.get(i);if("type"===(i=i.replace(/^#/,"")))return{...n,[i]:t.getJsonType()};if(function(t,r,s){return"examples"===t&&(0,e.isObject)(r)&&$.OPENAPI===s.specType}(i,c,r)&&(i="example",c=Object.values(c)[0]),c&&"object"==typeof c&&a(i)){if(c=o(i,c,r,t),function(e,t){return"object"==typeof t&&["items","properties","additionalProperties"].includes(e)&&0===Object.keys(t).length}(i,c))return n;(function(e,t,r){return"object"==typeof t&&r&&["properties","additionalProperties"].includes(e)})(i,c,s)&&(c=Oe(c,t.alias))}return{...n,[i]:c}}),{});return t.isClass&&(i=o("inheritedClass",i,{...r,root:!1,schemas:n,target:t.getComputedType()})),i=o("generics",i,{...r,root:!1,schemas:n}),t.has(r.specType)&&(i={...i,...t.get(r.specType).toJSON(r)}),i=be(i,t,{...r,useAlias:s}),i=de(i,t,r),i=Te(i,t,r),i}r("schema",Ee);const ve=["all","checkout","connect","copy","delete","get","head","lock","merge","mkactivity","mkcol","move","m-search","notify","options","param","patch","post","propfind","propatch","purge","put","report","search","subscribe","trace","unlock","unsuscribe"];var xe;function Ce(e){return(...t)=>{const r=e(se(...t),t);"function"==typeof r&&r(...t)}}function Pe(...t){return Ce((r=>{r.store.set("childrenControllers",t),t.forEach((t=>{e.Store.from(t).set("parentController",r.token)}))}))}function we(e,...t){return Ce((r=>{e=e||(0,M.snakeCase)(r.targetName),r.discriminatorAncestor&&r.schema.discriminatorValue(e,...t)}))}function $e(e,t){if(!e)throw new Error("A type is required on `@CollectionOf(type)` decorator. Please give a type or wrap it inside an arrow function if you have a circular reference.");const r={};let s=!1;const n=(...n)=>{const i=u.from(...n);t&&(i.collectionType=t,i.schema.type(t)),i.type=e,i.itemSchema.type(e),i.schema.assign(r),i.isArray&&s&&(i.schema.set("contains",i.schema.get("items")),i.schema.delete("items"))};return n.MinItems=e=>(r.minItems=e,n),n.MaxItems=e=>(r.maxItems=e,n),n.MinProperties=e=>(r.minProperties=e,n),n.MaxProperties=e=>(r.maxProperties=e,n),n.Contains=()=>(s=!0,n),n.UniqueItems=(e=!0)=>(r.uniqueItems=e,n),n}function _e(e){return $e(e,Array)}function Me(e){return $e(e,Map)}function Ne(e){return $e(e).Contains()}function De(e){return Ce((t=>{const r=t.parentSchema.get("#errorMessage")||{};t.parentSchema.customKey("errorMessage",{...r,...e})}))}function Le(t,r){const s={};return(...n)=>{const i=(0,e.useDecorators)(r(...n));return i.Error=r=>(s.message=r,(0,e.useDecorators)(i,s.message&&De({[t]:r}))),i}}!function(e){e.ALL="ALL",e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.HEAD="HEAD",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.CUSTOM="CUSTOM"}(xe||(xe={}));const ke=Le("maxItems",(e=>{if(e<0)throw new Error("The value of maxItems MUST be a non-negative integer.");return Ce((t=>{t.schema.maxItems(e)}))})),Ie=Le("maxProperties",(e=>{if(e<0)throw new Error("The value of maxProperties MUST be a non-negative integer.");return Ce((t=>{t.isCollection?t.schema.maxProperties(e):t.itemSchema.maxProperties(e)}))})),He=Le("minItems",(e=>{if(e<0)throw new Error("The value of minItems MUST be a non-negative integer.");return Ce((t=>{t.schema.minItems(e)}))})),je=Le("minProperties",(e=>{if(e<0)throw new Error("The value of minProperties MUST be a non-negative integer.");return Ce((t=>{t.isCollection?t.schema.minProperties(e):t.itemSchema.minProperties(e)}))})),Ge=Le("uniqueItems",((e=!0)=>Ce((t=>{t.schema.uniqueItems(e)}))));function qe(e){return Ce(((t,r)=>{t.itemSchema.additionalProperties(e)}))}function Ue(...e){return Ce((t=>{t.itemSchema.allOf(e)}))}function Je(t){return Ce((r=>{t&&((0,e.isClass)(t)&&(r.type=t),r.itemSchema.type(t))}))}function Ke(...t){const r=t.find((t=>(0,e.isClass)(t)));return(0,e.useDecorators)(r&&Je(r),Ce(((r,s)=>{r.schema.allow(...t),r.decoratorType===e.DecoratorTypes.PARAM&&(r.required=!0),r.decoratorType===e.DecoratorTypes.PROP&&r.parentSchema.addRequired(r.propertyName)})))}function Be(...e){return Ce((t=>{t.itemSchema.any(...e)}))}function Fe(...e){return Ce((t=>{t.itemSchema.anyOf(e)}))}function We(e){return Ce((t=>{t.itemSchema.const(e)}))}function Ve(e,t){return Ce((r=>{r.itemSchema.customKey(e,t)}))}function Xe(e){return Ce((t=>{Object.entries(e).forEach((([e,r])=>{t.itemSchema.customKey(e,r)}))}))}function ze(e){return Ce((t=>{t.itemSchema.default(e)}))}function Qe(t){return(0,e.useDecorators)(De({_:t}))}function Ye(t){return Ce(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.PROP:case e.DecoratorTypes.CLASS:r.schema.description(t);break;case e.DecoratorTypes.PARAM:r.parameter.description(t);break;case e.DecoratorTypes.METHOD:r.operation?.description(t)}}))}function Ze(){return(0,e.useDecorators)(Je(),Ce((e=>{e.discriminatorKey()})))}const et=Le("enum",(function(e,...t){return Ce((r=>{r.itemSchema.enum(e,...t)}))}));function tt(...e){return Ce((t=>{t.schema.examples(e)}))}function rt(e){return Ce((t=>{t.parameter.examples(e)}))}const st=Le("maximum",((e,t=!1)=>Ce((r=>{t?r.itemSchema.exclusiveMaximum(e):r.itemSchema.maximum(e)})))),nt=st,it=Le("exclusiveMaximum",((e,t=!0)=>st(e,t))),ot=Le("minimum",((e,t=!1)=>Ce((r=>{t?r.itemSchema.exclusiveMinimum(e):r.itemSchema.minimum(e)})))),at=ot,ct=Le("exclusiveMinimum",((e,t=!0)=>ot(e,t)));var ut;!function(e){e.DATE_TIME="date-time",e.DATE="date",e.TIME="time",e.EMAIL="email",e.HOSTNAME="hostname",e.IPV4="ipv4",e.IPV6="ipv6",e.URI="uri",e.URL="url",e.URI_REF="uri-reference",e.URI_TEMPLATE="uri-template",e.JSON_POINTER="json-pointer",e.RELATIVE_JSON_POINTER="relative-json-pointer",e.UUID="uuid",e.REGEX="regex"}(ut||(ut={}));const pt=Le("format",(e=>Ce((t=>{t.itemSchema.format(e)})))),ht=Le("format",(()=>pt(ut.EMAIL))),lt=Le("format",(()=>pt(ut.DATE_TIME))),mt=Le("format",(()=>pt(ut.DATE))),dt=Le("format",(()=>pt(ut.TIME))),ft=Le("format",(()=>pt(ut.URI))),yt=Le("format",(()=>pt(ut.URL)));function gt(e=!0){return Ce((t=>{t.schema.$forwardGroups=e}))}var Ot=n(870),St=n.n(Ot);function bt(e,t){t=[].concat(t),e=[].concat(e);let r=new Set,s=new Set,n=new Set,i=0,o=e=>{n.add(e.output)};for(let n=0;n<t.length;n++){let a=St()(String(t[n]),{onResult:o},!0),c=a.state.negated||a.state.negatedExtglob;c&&i++;for(let t of e){let e=a(t,!0);(c?!e.isMatch:e.isMatch)&&(c?r.add(e.output):(r.delete(e.output),s.add(e.output)))}}return!!(i===t.length?[...n]:[...s]).filter((e=>!r.has(e))).length}function Tt(e,t=[]){const r=e.filter((e=>e.startsWith("!"))).map((e=>e.replace("!",""))),s=e.filter((e=>!e.startsWith("!")));return!!(r.length&&t.length&&bt(r,t))||!!s.length&&!bt(e.filter((e=>!e.startsWith("!"))),t)}function Rt(...t){return Ce((r=>{switch(r.decoratorType){case e.DecoratorTypes.CLASS:!function(e,t){const r=Object.entries(e[0]);t.children.forEach((e=>{Rt(...r.filter((([,t])=>t.includes(e.propertyName))).map((([e])=>e)))(e.target,e.propertyKey)}))}(t,r);break;case e.DecoratorTypes.PROP:r.schema.$hooks.on("groups",((e,r)=>!(e||!Tt(t,r))||e));break;case e.DecoratorTypes.PARAM:let s="";2==t.length&&(0,e.isArray)(t[1])&&(s=t[0],t=t[1]),r.parameter.groups=t,r.parameter.groupsName=s}}))}function At(){return(0,e.StoreSet)("hidden",!0)}const Et=(e,t)=>!0!==t.mongoose;function vt(e=Et){return Ce((t=>{t.schema.ignore(e)}))}function xt(){return Ce((e=>{e.itemSchema.type("integer")}))}const Ct=Le("maxLength",(e=>{if(e<0)throw new Error("The value of maxLength MUST be a non-negative integer.");return Ce((t=>{t.itemSchema.maxLength(e)}))})),Pt=Le("minLength",(e=>{if(e<0)throw new Error("The value of minLength MUST be a non-negative integer.");return Ce((t=>{t.itemSchema.minLength(e)}))})),wt=Le("multipleOf",(e=>{if(e<=0)throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");return Ce((t=>{t.itemSchema.multipleOf(e)}))}));function $t(t){return Ce(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.CLASS:r.schema.name(t);break;case e.DecoratorTypes.PARAM:r.parameter.name(t);break;default:r.parent.schema.addAlias(s[1],t)}}))}function _t(t,...r){return r=[t,...r],(0,e.useDecorators)(1===r.length&&Je(r[0]),Be(null,...r))}function Mt(...e){return Ce((t=>{t.itemSchema.oneOf(e),t.type=Object}))}function Nt(){return Ce((t=>{switch(t.decoratorType){case e.DecoratorTypes.PARAM:t.required=!1;break;case e.DecoratorTypes.PROP:t.parentSchema.removeRequired(t.propertyName)}}))}const Dt=Le("pattern",(e=>Ce((t=>{t.itemSchema.pattern(e)}))));function Lt(e=!0){return Ce((t=>{t.itemSchema.readOnly(e)}))}function kt(e){return Ce((t=>{Object.entries(e).forEach((([e,r])=>{t.schema.set(e,r)}))}))}function It(e,t){return Ce((r=>{r.schema.set(e,t)}))}function Ht(e,...t){return kt({properties:{...t.reduce(((t,r)=>({...t,[r]:e})),{})}})}const jt=Le("required",((e=!0,...t)=>e?Ke(...t):Nt()));function Gt(...e){return Ce((t=>{t.parent.schema.$hooks.on("requiredGroups",((r,s)=>Tt(e,s)?r.filter((e=>e!==t.propertyKey)):r))}))}function qt(e){return Ce((t=>{t.schema.title(e)}))}function Ut(t){return Ce((()=>(0,e.useDecorators)(De({type:t}))))}function Jt(e=!0){return Ce((t=>{t.itemSchema.writeOnly(e)}))}function Kt(t=Object){if((0,e.isClass)(t)){const{schema:e}=se(t);return e.properties=function(e){return Object.entries(e).forEach((([e,r])=>{se(t.prototype,e).schema.assign(r)})),this},e}return R.from({type:t})}function Bt(){return Kt(Number)}function Ft(){return Kt(Number).integer()}function Wt(){return Kt(String)}function Vt(){return Kt(Boolean)}function Xt(){return Kt(Date).format(ut.DATE)}function zt(){return Kt(Date).format(ut.DATE_TIME)}function Qt(){return Kt(Date).format(ut.TIME)}function Yt(){return Kt(String).format(ut.EMAIL)}function Zt(){return Kt(String).format(ut.URI)}function er(){return Kt(String).format(ut.URL)}function tr(){return Kt(Array)}function rr(){return Kt(Map).unknown(!0)}function sr(){return Kt(Array).uniqueItems(!0)}function nr(e={}){return Kt(Object).properties(e)}function ir(...e){return Kt().any(...e)}function or(...e){return Kt().anyOf(e)}function ar(...e){return Kt().oneOf(e)}function cr(...e){return Kt().allOf(e)}function ur(e){try{if(e())return u.from(e()).schema}catch(e){}return new ne(e)}function pr(e){const t=Wt().enum(e);return l.set(e,t),t}function hr(...t){const r=[t.map((t=>function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(t)?Wt().enum(Object.values(t)):t))],s=(...e)=>{u.from(...e).nestedGenerics=r};return s.Nested=(...e)=>(r.push(e),s),s}function lr(...e){return t=>{u.from(t).schema.genericLabels=e}}function mr(...t){return Ce(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.produces(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],mr(...t));break;default:throw new e.UnsupportedDecoratorType(mr,s)}}))}function dr(...t){return(0,e.useDecorators)(mr(...t),(0,e.StoreSet)("acceptMimes",t))}function fr(...t){return Ce(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.consumes(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],fr(...t));break;default:throw new e.UnsupportedDecoratorType(fr,s)}}))}class yr extends Map{methods;decoratorType;entity;actions=[];constructor(e={}){super(),Object.entries(e).forEach((([e,t])=>{this.set(e,t)}))}addAction(e){return this.actions.push(e),this}build(){const e=(...t)=>this.bind(t,e),t=t=>{return r=(...e)=>{t in this?this[t](...e):this.set(t,e[0])},(...t)=>(r(...t),e);var r};return this.methods.forEach((r=>{e[(0,M.pascalCase)(r)]=t(r)})),e}toObject(){return[...this.entries()].reduce(((e,[t,r])=>({...e,[t]:r})),{})}getMergedKey(t,r){let s=this.get(t)||r;if(s)return this.decoratorType===e.DecoratorTypes.CLASS&&(s={...s,...r||{}}),{...r||{},...s}}bind(e,t){this.entity=u.from(...e),this.beforeInit(),this.onInit(e,t),this.afterInit()}onInit(e,t){this.forEach(((e,t)=>{this.onMapKey(t,e)}))}onMapKey(e,t){this.entity.set(e,t)}runActions(){return this.actions.forEach((e=>{e(this)})),this}beforeInit(){}afterInit(){}}const gr=new Map;function Or(e,t){gr.set(e,t)}function Sr(e){return gr.get(e)}function br(t){return t.map((t=>function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(t)?Wt().enum(Object.values(t)):t))}class Tr extends yr{methods=["contentType","description","examples","type","status","of","ofInteger","oneOf","allOf","anyOf","nested","header","headers","schema","title","groups","allowedGroups","location"];constructor({status:e,model:t}){super(),this.model(t),this.status(e)}type(e){return this.model(e)}model(e){return e&&this.set("model",e),this}status(e){return this.set("status",e),e&&F(e)&&!this.get("description")&&(this.set("description",F(e)),this.get("model")||this.model(Sr(+e))),this}headers(e){return this.set("headers",{...this.get("headers")||{},...Q(e)}),this}header(e,t){return this.headers({[e]:t})}location(e,t={}){return this.headers({Location:{...t,value:e}}),this}groups(...t){return 2===t.length&&(0,e.isArray)(t[1])?(this.set("groupsName",t[0]),this.set("groups",t[1])):this.set("groups",t),this}allowedGroups(...e){return this.set("allowedGroups",new Set(e)),this}nested(...e){const t=this.get("model");return this.checkPrimitive(t),this.checkCollection(t),this.addAction((t=>{this.get("schema").nestedGenerics.push(br(e))})),this}of(...t){const r=this.get("model");return this.checkPrimitive(r),this.addAction((()=>{const s=this.get("schema");(0,e.isCollection)(r)?s?.itemSchema({type:t[0]}):s?.nestedGenerics.push(br(t))})),this}ofInteger(){return this.of("integer")}oneOf(...e){return this.manyOf("oneOf",e)}allOf(...e){return this.manyOf("allOf",e)}anyOf(...e){return this.manyOf("anyOf",e)}schema(e){return this.addAction((()=>{this.get("schema").assign(e)})),this}examples(t){return this.set("examples",(0,e.isString)(t)?[t]:t),this}title(e){return this.schema({title:e})}checkPrimitive(t){if((0,e.isPrimitiveOrPrimitiveClass)(t))throw new Error("Returns.Of cannot be used with the following primitive classes: String, Number, Boolean")}checkCollection(t){if((0,e.isCollection)(t))throw new Error("Returns.Nested cannot be used with the following classes: Map, Set, Array, String, Number, Boolean")}getContentType(){const t=this.get("model");let r=this.get("contentType");return!t||(0,e.isPlainObject)(t)||(0,e.isPrimitiveOrPrimitiveClass)(t)||(r=r||"application/json"),r}getStatus(){return this.get("status")||"default"}onInit(t,r){switch((0,e.decoratorTypeOf)(t)){case e.DecoratorTypes.METHOD:this.entity=u.from(...t),this.entity.operation&&this.map();break;case e.DecoratorTypes.CLASS:this.decoratorType=e.DecoratorTypes.CLASS,(0,e.decorateMethodsOf)(t[0],r)}}map(){const t=this.get("model"),{entity:r,decoratorType:s}=this,n=this.entity.operation,i=this.getStatus(),o=n.ensureResponseOf(i),a=this.getContentType();let{description:c=o.get("description")}=this.toObject();c&&(c=s===e.DecoratorTypes.CLASS&&o.get("description")||c,o.description(c));const u=this.getMergedKey("headers",o.get("headers"));return u&&o.headers(u),this.mapMedia(o),(W(this.get("status"))||"default"===i)&&t&&(r.type=t),a&&n.addProduce(a),this.runActions()}mapMedia(t){const r=this.getContentType(),s=this.get("model"),n=t.getMedia(r||"*/*"),i=n.get("schema")||new R({type:s}),o=this.get("groups"),a=this.get("groupsName"),c=this.get("allowedGroups"),u=this.entity.operation;if(s&&((0,e.isArray)(s)?i.oneOf(s.map((e=>({type:e})))):i.type(s)),this.set("schema",i),n.schema(i),n.groups=o,n.groupsName=a,c){n.allowedGroups=c;const e=new j;e.in("query").name("includes"),e.schema(R.from({type:"array",items:{type:"string",enum:[...c]}})),u.addParameter(-1,e)}const p=this.get("examples");return p&&n.examples(p),n}manyOf(t,r){const s=this.get("model");return this.addAction((()=>{const n=this.get("schema");(0,e.isCollection)(s)?(n.type(s||Object),n.itemSchema().set(t,r)):n.set(t,r)})),this}}function Rr(e,t){return new Tr({status:e,model:t}).build()}function Ar(e){return Rr().ContentType(e)}function Er(t=!0){return Ce(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.METHOD:r.operation.deprecated(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],Er(t));break;case e.DecoratorTypes.PARAM:r.parameter.set("deprecated",t);break;case e.DecoratorTypes.PROP:r.schema.set("deprecated",t);break;default:throw new e.UnsupportedDecoratorType(Er,s)}}))}function vr(e,t){return void 0!==t&&(e={[e]:t}),Rr().Headers(e)}function xr(t){const r=new j,s={},n=(i,o,a)=>{const c=u.from(i,o,a);switch(c.decoratorType){case e.DecoratorTypes.PARAM:c.parameter.in(t);break;case e.DecoratorTypes.METHOD:r.in(t),c.operation.addParameter(-1,r),r.schema(R.from(s));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(i,n);break;default:throw new e.UnsupportedDecoratorType(xr,[i,o,a])}};return n.Type=e=>(s.type=e,n),n.Name=e=>(r.name(e),n),n.Description=e=>(r.description(e),n),n.Required=(e=!0)=>(r.required(e),n),n.Pattern=e=>n.Schema({pattern:e.toString()}),n.Schema=e=>(Object.assign(s,e),n),n}function Cr(t){return(...r)=>{const[s,n,i]=r,o=e.Metadata.getParamTypes(s,n)[i]===Array,a=[t="object"==typeof t?void 0:t,!o&&"0"].filter(Boolean).join(".");(0,e.useDecorators)(xr(_.FILES),$t(a),(0,e.useMethodDecorators)(Rr(400).Description("<File too long | Too many parts | Too many files | Field name too long | Field value too long | Too many fields | Unexpected field> [fieldName] Example: File too long file1"),fr("multipart/form-data")))(...r)}}function Pr(e,t){return Rr().Location(e,t)}function wr(t){return Ce(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(wr,s);r.operation.operationId(t)}))}function $r(t,r="/"){return Ce(((s,n)=>{if(s.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType($r,n);s.operation.addOperationPath(t.toUpperCase(),r)}))}function _r(){return Rt("partial")}function Mr(t){return Ce(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.CLASS)throw new e.UnsupportedDecoratorType(Mr,s);r.path=t}))}function Nr(...t){const{status:r,url:s,meta:n}=t.reduce(((t,r)=>(0,e.isNumber)(r)?(t.status=r,t):(0,e.isString)(r)?(t.url=r,t):(t.meta=r,t)),{status:302,url:"",meta:{}});return(0,e.useDecorators)(Rr(r).Location(s,n),Ce((e=>{e.operation?.setRedirection(r)})))}function Dr(e){let t,r;const s=e.filter((e=>"string"==typeof e&&ve.includes(e.toLowerCase())?(t=e.toLocaleUpperCase(),!1):"string"==typeof e||e instanceof RegExp?(r=e||"/",!1):!!e));return{path:r,method:t,use:s}}class Lr extends yr{methods=["name","description","summary","method","id","use","useAfter","useBefore"];beforeInit(){const e=this.get("path"),t=xe[this.get("method")]||xe.CUSTOM;e&&this.entity.operation.addOperationPath(t,e)}onMapKey(e,t){switch(e){case"name":case"id":return void this.entity.operation.operationId(t);case"summary":return void this.entity.operation.summary(t);case"description":return void this.entity.operation.description(t);case"use":return void this.entity.use(t);case"useAfter":return void this.entity.after(t);case"useBefore":return void this.entity.before(t)}return super.onMapKey(e,t)}}function kr(...e){const t=Dr(e);return new Lr(t).build()}function Ir(e="/",...t){return kr(...[xe.ALL,e].concat(t))}function Hr(e="/",...t){return kr(...[xe.GET,e].concat(t))}function jr(e="/",...t){return kr(...[xe.POST,e].concat(t))}function Gr(e="/",...t){return kr(...[xe.PUT,e].concat(t))}function qr(e="/",...t){return kr(...[xe.DELETE,e].concat(t))}function Ur(e="/",...t){return kr(...[xe.HEAD,e].concat(t))}function Jr(e="/",...t){return kr(...[xe.PATCH,e].concat(t))}function Kr(e="/",...t){return kr(...[xe.OPTIONS,e].concat(t))}function Br(t,...r){return Ce(((s,n)=>{switch(s.decoratorType){case e.DecoratorTypes.METHOD:s.operation.addSecurityScopes(t,r);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(n[0],Br(t,...r));break;default:throw new e.UnsupportedDecoratorType(Br,n)}}))}function Fr(e,t){return Rr(e,t)}function Wr(t){return Ce(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Wr,s);r.operation.summary(t)}))}function Vr(...t){return Ce(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.addTags(function(e){return e.map((e=>"string"==typeof e?{name:e}:e))}(t));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],Vr(...t));break;default:throw new e.UnsupportedDecoratorType(Vr,s)}}))}function Xr(t,r){return(0,e.StoreSet)("view",{path:t,options:r})}class zr extends Map{setOperationPath(e){if(e.method!==xe.CUSTOM){const t=this.getKey(e.method,e.path);this.set(t,e)}}getKey=(e,t)=>`${e}-${t}`}function Qr(e,t){if(e instanceof RegExp||t instanceof RegExp){if(!e)return t;if(!t)return e;const r=e instanceof RegExp?e:new RegExp(e,"gi"),s=t instanceof RegExp?t:new RegExp(t,"gi");return new RegExp(r.source+s.source,(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":""))}e&&t&&e.endsWith("/")&&t.startsWith("/")&&(t=t.slice(1));const r=(e||"")+(t||"");return r.endsWith("/")&&r.length>1?r.slice(0,-1):r}class Yr{token;endpoint;operationPath;basePath;paramsTypes;constructor(e){Object.assign(this,e),this.paramsTypes=this.endpoint.getParamTypes()}get url(){return this.fullPath}get path(){return this.operationPath?.path}get fullPath(){return Qr(this.basePath,this.path)}get method(){return this.operationPath?.method||"USE"}get name(){return`${this.endpoint.targetName}.${this.methodClassName}()`}get className(){return this.endpoint.targetName}get methodClassName(){return this.propertyKey}get parameters(){return this.endpoint.parameters}get propertyKey(){return String(this.endpoint.propertyKey)}get propertyName(){return this.endpoint.propertyName}get store(){return this.endpoint.store}get operation(){return this.endpoint.operation}get operationId(){return this.operation.get("operationId")||this.endpoint.propertyKey}has(e){return this.paramsTypes[e]}}function Zr(e){return e.split("/").filter(Boolean).join("/")}function es(e,t){return e.map((e=>t.parameters.find((t=>t.in===e.in&&t.name===e.name))||e)).concat(...t.parameters.filter((e=>"path"!==e.in)))}function ts(e){const t=e.isStore?e:se(e);if(!t.$operations){const e=new zr;t.$operations=new Map,ce(t).forEach((e=>{e.children.forEach((e=>{e instanceof te&&!t.$operations.has(e.propertyKey)&&t.$operations.set(e.propertyKey,e)}))})),t.$operations.forEach((t=>{t.operation.operationPaths.forEach((t=>{e.setOperationPath(t)}))})),e.clear()}return t.$operations}function rs(e,t=""){t instanceof RegExp&&(t=t.toString().replace(/^\//g,"").replace(/\/$/g,"").replace(/\\/g,""));const r=[],s=[];let n=!1,i="";return function(e){let t=0;return e.split("").filter((e=>{"("===e&&t++;const r=0===t;return")"===e&&t--,r})).join("").split("/").filter((e=>!!e))}(`${e}${t}`).map((e=>{const t=e.replace(":","").replace("?","");if(e.includes(":")){const o=e.includes("?");o&&!n&&(n=!0,s.push({path:i,parameters:[].concat(r)}));const{prefix:a,name:c,postfix:u}=function(e){const[t,r]=e.split("="),s=(r||t).split(".");return{prefix:r&&t?`${t}=`:"",name:s.splice(0,1)[0],postfix:s.length?`.${s.join(".")}`:""}}(t);i+=`/${a}{${c}}${u}`,r.push({in:"path",name:c,type:"string",required:!0}),o&&n&&s.push({path:i,parameters:[].concat(r)})}else i+=`/${e}`})),s.length?s:[{path:i,parameters:[].concat(r)}]}function ss(e,t,{rootPath:r,specType:s,operationId:n,defaultTags:i,tags:o,path:a,method:c}){const u=rs(r,a).map((({path:e,parameters:t})=>(e=e||"/",s===$.OPENAPI&&(t=t.map((({type:e,...t})=>({...t,schema:{type:e}})))),{path:e,parameters:t})));return u.reduce(((e,{path:r,parameters:s})=>{s=es(s,t),r=r||"/";const a=t.tags?.length?t.tags:[i];return e.paths[r]={...e.paths[r],[c.toLowerCase()]:{operationId:t.operationId||n(r),...t,tags:a.map((({name:e})=>e)),parameters:s}},o.push(...a),e}),e)}function ns(e=""){const t=new Map;return(r,s,n="")=>{const i=((t,r)=>{const s=(e||"%c.%m").replace(/%c/,t).replace(/%m/,r);return""===e?(0,M.camelCase)(s):s})(r,s),o=r+s;if(!t.has(o))return t.set(o,0),i;const a=n.match(/{(\w+)}/gi);if(a){const e=r+s+a[0];if(!t.has(e))return t.set(e,0),(0,M.camelCase)(`${i} By ${a}`)}const c=t.get(o)+1;return t.set(o,c),`${i}_${c}`}}const is=(0,e.mergeReducerBuilder)(((e,t)=>e.type&&e.type===t.type||e.$ref&&e.$ref===t.$ref)),os=(0,e.mergeReducerBuilder)(((e,t)=>e.in===t.in&&e.name===t.name)),as=(0,e.mergeReducerBuilder)(((e,t)=>!!Object.keys(t).find((t=>!!e[t])))),cs=(0,e.mergeReducerBuilder)(((e,t)=>e.name===t.name)),us={security:as,parameters:os,oneOf:is,anyOf:is,allOf:is,tags:cs};function ps(t,r){return(0,e.deepMerge)(t,r,{reducers:us,cleanUndefinedProps:!0})}const hs=new Map;function ls(t,r={}){if(r={...r,operationIdFormatter:r.operationIdFormatter||ns(r.operationIdPattern),root:!1},(0,e.isArray)(t)){let e={};return r={...r,specType:$.OPENAPI,paths:{},tags:[],schemas:{},append(t){e=ps(e,t)}},t.forEach((({token:e,...t})=>{const s=ls(e,{...r,...t});r.append(s)})),e}return function(e,t,r){hs.has(e)||hs.set(e,new Map);const s=hs.get(e),n=JSON.stringify(t);return s.has(n)||s.set(n,r()),s.get(n)}(t,r,(()=>function(t,r){const s=se(t),{schemas:n={},paths:i={},rootPath:o="/",tags:a=[]}=r,c=$.OPENAPI,u=s.path,p=(0,e.cleanObject)({name:s.schema.getName(),description:s.schema.get("description")}),h={paths:i};return ts(t).forEach((e=>{if(e.store.get("hidden"))return;const t=e.operation.toJSON({...r,specType:c,schemas:n});e.operation.operationPaths.forEach((({path:s,method:n})=>{n&&ss(h,t,{rootPath:Zr(o+u),path:s,method:n,defaultTags:p,tags:a,specType:c,operationId:t=>r.operationIdFormatter(e.parent.schema.get("name")||e.parent.targetName,e.propertyName,t)})}))})),h.tags=(0,e.uniqBy)(a,"name"),Object.keys(n).length&&(h.components={schemas:n}),h}(t,r)))}function ms(e){return e.startsWith("3.")?$.OPENAPI:$.SWAGGER}function ds(e){return"openapi"in e?$.OPENAPI:$.SWAGGER}function fs(t){const{title:r,description:s,version:n,termsOfService:i,contact:o,license:a}=t;return(0,e.cleanObject)({version:n,title:r,description:s,termsOfService:i,contact:o,license:a})}function ys(t,{version:r,specVersion:s,acceptMimes:n=["application/json"]}){const{paths:i,security:o,tags:a,host:c,basePath:u,schemes:p,consumes:h=[],produces:l=["application/json"],definitions:m,parameters:d,responses:f,securityDefinitions:y,externalDocs:g}=t;return{swagger:s,consumes:(0,e.uniq)([...n,...h]),produces:(0,e.uniq)([...l]),info:fs((0,e.getValue)(t,"info",{})),paths:i,host:c,basePath:u,schemes:p,definitions:m,parameters:d,responses:f,security:o,securityDefinitions:y,tags:a,externalDocs:g}}function gs(t,{specVersion:r}){const{servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}=t;return{openapi:r,info:fs((0,e.getValue)(t,"info",{})),servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}}function Os(t,{fileSpec:r,acceptMimes:s,specVersion:n,version:i}){const o={specVersion:n=n||(0,e.getValue)(t,"openapi",(0,e.getValue)(t,"swagger","2.0")),acceptMimes:s};switch(ms(n)){case $.OPENAPI:t=gs(t,o),r=r?gs(r,o):r;break;default:case $.SWAGGER:t=ys(t,o),r=r?ys(r,o):r}return t=ps(t,r),(0,e.setValue)(t,"info.title",(0,e.getValue)(t,"info.title","Api documentation")),(0,e.setValue)(t,"info.version",(0,e.getValue)(t,"info.version",i)),t}const Ss=["get","put","post","delete","options","head","patch","trace"],bs=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],Ts=["type","items"],Rs=/^(application\/json|[^;\/ \t]+\/[^;\/ \t]+[+]json)[ \t]*(;.*)?$/,As={APPLICATION_X_WWW_URLENCODED:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data"};function Es(e){if(Array.isArray(e))e.forEach(Es);else if("object"==typeof e)for(let t in e)"$ref"===t?e.$ref=e.$ref.replace("#/components/schemas/","#/definitions/").replace("#/components/","#/x-components/"):Es(e[t])}function vs(e){return new RegExp(Rs,"i").test(e)}function xs(e){const t=Object.keys(As).map((e=>As[e]));return Object.keys(e).filter((e=>t.indexOf(e)>-1||vs(e)))}function Cs(e){function t(e){const{scheme:t,type:r,name:s,bearerFormat:n,flows:i,...o}=e;switch(r){case"http":if("basic"===t)return{...o,type:t};if("bearer"===t)return{...o,type:"apiKey",name:"Authorization",in:"header"};break;case"oauth2":const e=Object.keys(i)[0],s=i[e];let n=e;return"clientCredentials"===n?n="application":"authorizationCode"===n&&(n="accessCode"),{type:r,flow:n,authorizationUrl:s.authorizationUrl,tokenUrl:s.tokenUrl,scopes:s.scopes}}}return Object.entries(e).reduce(((e,[r,s])=>({...e,[r]:t(s)})),{})}function Ps(e){let t=e.url;const r=e.variables||{};for(const e in r){const s=r[e]||{};if(s.default){const r=RegExp(`{${e}}`,"g");t=t.replace(r,s.default)}}const s=new URL(t);return{host:s.host?s.host:void 0,basePath:s.pathname,schemes:null!==s.protocol?[s.protocol.substring(0,s.protocol.length-1)]:void 0}}class ws{spec;constructor(e){this.spec=JSON.parse(JSON.stringify(e))}convertInfos(){const e=this.spec.servers&&this.spec.servers[0];return e?Ps(e):{}}resolveReference(e,t,r){if(!t||!t.$ref)return t;const s=t.$ref;if(s.startsWith("#")){const t=s.split("/").map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~")));t.shift();let n=e;return t.forEach((e=>{n=n[e]})),r?JSON.parse(JSON.stringify(n)):n}}convert(){const t={swagger:"2.0",...this.convertInfos(),paths:this.spec.paths?this.convertOperations(this.spec.paths,this.spec):void 0};return this.spec.components&&(this.convertSchemas(),this.convertSecurityDefinitions(),this.spec["x-components"]=this.spec.components,delete this.spec.components,Es(this.spec)),delete this.spec.servers,delete this.spec.openapi,delete this.spec["x-components"],(0,e.cleanObject)({...t,...this.spec})}convertOperations(e,t){return Object.entries(e).reduce(((e,[r,s])=>{const n=e[r]=this.resolveReference({...t,paths:e},s,!0);return this.convertParameters(n),Object.keys(n).forEach((r=>{if(Ss.indexOf(r)>=0){const s=n[r]=this.resolveReference({...t,paths:e},n[r],!0);this.convertOperationParameters(s),this.convertResponses(s)}})),e}),e)}convertOperationParameters(e){let t,r,s,n;if(e.parameters=e.parameters||[],e.requestBody){let i=this.resolveReference(this.spec,e.requestBody,!0);if(e.requestBody.content){const t=xs(e.requestBody.content)[0],r={content:{}},s=e.requestBody.content[t];s&&s.schema&&s.schema.$ref&&!s.schema.$ref.startsWith("#")&&(i=this.resolveReference(this.spec,s.schema,!0),r.content[`${t}`]={schema:i},i=r)}if(i.name="body",t=i.content,t&&Object.keys(t).length){if(s=Object.keys(t).filter((e=>e.indexOf("/")>0)),n=s.filter((e=>e.indexOf("*")<0)),r=xs(t)[0],delete i.content,[As.APPLICATION_X_WWW_URLENCODED,As.MULTIPART_FORM_DATA].includes(r))if(e.consumes=n,i.in="formData",i.schema=t[r].schema,i.schema=this.resolveReference(this.spec,i.schema,!0),"object"===i.schema.type&&i.schema.properties){const t=i.schema.required||[];Object.keys(i.schema.properties).forEach((r=>{const s=i.schema.properties[r];if(!s.readOnly){const n={name:r,in:"formData",schema:s};t.indexOf(r)>=0&&(n.required=!0),e.parameters?.push(n)}}))}else e.parameters.push(i);else r?(e.consumes=n,i.in="body",i.schema=t[r].schema,e.parameters.push(i)):s&&(e.consumes=n||["application/octet-stream"],i.in="body",i.name=i.name||"file",delete i.type,i.schema=t[s[0]].schema||{type:"string",format:"binary"},e.parameters.push(i));i.schema&&this.convertSchema(i.schema,"request")}delete e.requestBody}this.convertParameters(e)}convertParameters(e){void 0!==e.parameters&&(e.parameters=e.parameters||[],(e.parameters||[]).forEach(((t,r)=>{if("body"!==(t=e.parameters[r]=this.resolveReference(this.spec,t,!1)).in){if(this.copySchemaProperties(t,bs),this.copySchemaProperties(t,Ts),this.copySchemaXProperties(t),!t.description){const e=this.resolveReference(this.spec,t.schema,!1);e&&e.description&&(t.description=e.description)}void 0!==t.example&&(t["x-example"]=t.example),delete t.schema,delete t.allowReserved,delete t.example}if("array"===t.type)switch(t.style||("query"===t.in||"cookie"===t.in?"form":"simple")){case"matrix":t.collectionFormat=t.explode?void 0:"csv";break;case"label":t.collectionFormat=void 0;break;case"simple":t.collectionFormat="csv";break;case"spaceDelimited":t.collectionFormat="ssv";break;case"pipeDelimited":t.collectionFormat="pipes";break;case"deepOpbject":t.collectionFormat="multi";break;case"form":t.collectionFormat=!1===t.explode?"csv":"multi"}delete t.style,delete t.explode})))}copySchemaProperties(e,t){let r=this.resolveReference(this.spec,e.schema,!0);r&&t.forEach((t=>{const s=r[t];"additionalProperties"===t&&"boolean"==typeof s||void 0!==s&&(e[t]=s)}))}copySchemaXProperties(e){let t=this.resolveReference(this.spec,e.schema,!0);t&&Object.keys(t).forEach((r=>{Reflect.hasOwnProperty.call(t,r)&&!Reflect.hasOwnProperty.call(e,r)&&r.startsWith("x-")&&(e[r]=t[r])}))}convertResponses(e){Object.keys(e.responses||{}).forEach((t=>{const r=e.responses[t]=this.resolveReference(this.spec,e.responses[t],!0);if(r.content){let t=null,s=null;if(Object.keys(r.content).forEach((n=>{const i=n.indexOf("*")<0?n:"application/octet-stream";e.produces?e.produces.indexOf(i)<0&&e.produces.push(i):e.produces=[i];const o=r.content[n];t=t||o.schema,!s&&vs(i)&&(s=o.schema),o.example&&(r.examples=r.examples||{},r.examples[i]=o.example)})),t){r.schema=s||t;const e=this.resolveReference(this.spec,r.schema,!0);e&&r.schema.$ref&&!r.schema.$ref.startsWith("#")&&(r.schema=e),this.convertSchema(r.schema,"response")}}Object.keys(r.headers||{}).forEach((e=>{const t=this.resolveReference(this.spec,r.headers[e],!0);t.schema&&(t.type=t.schema.type,t.format=t.schema.format,delete t.schema),r.headers[e]=t})),delete r.content}))}convertSchema(e,t){if(e.oneOf&&(delete e.oneOf,e.discriminator&&delete e.discriminator),e.anyOf&&(delete e.anyOf,e.discriminator&&delete e.discriminator),e.allOf)for(const r in e.allOf)this.convertSchema(e.allOf[r],t);switch(e.discriminator&&(e.discriminator.mapping&&this.convertDiscriminatorMapping(e.discriminator.mapping),e.discriminator=e.discriminator.propertyName),e.type){case"object":e.properties&&Object.keys(e.properties).forEach((r=>{!0===e.properties[r].writeOnly&&"response"===t?delete e.properties[r]:(this.convertSchema(e.properties[r],t),delete e.properties[r].writeOnly)}));break;case"array":e.items&&this.convertSchema(e.items,t)}e.nullable&&(e["x-nullable"]=!0,delete e.nullable),void 0!==e.deprecated&&(void 0===e["x-deprecated"]&&(e["x-deprecated"]=e.deprecated),delete e.deprecated)}convertSchemas(){this.spec.definitions=this.spec.components.schemas,Object.keys(this.spec.definitions||{}).forEach((e=>{this.convertSchema(this.spec.definitions[e])})),delete this.spec.components.schemas}convertDiscriminatorMapping(e){Object.keys(e).forEach((t=>{const r=e[t];if("string"!=typeof r)return void console.warn(`Ignoring ${r} for ${t} in discriminator.mapping.`);let s;if(/^[a-zA-Z0-9._-]+$/.test(r))try{s=this.resolveReference(this.spec,{$ref:`#/components/schemas/${r}`},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} as schema name in discriminator.mapping: ${e}`)}if(!s)try{s=this.resolveReference(this.spec,{$ref:r},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} in discriminator.mapping: ${e}`)}s?(s["x-discriminator-value"]=t,s["x-ms-discriminator-value"]=t):console.warn(`Unable to resolve ${r} for ${t} in discriminator.mapping.`)}))}convertSecurityDefinitions(){this.spec.components.securitySchemes&&(this.spec.securityDefinitions=Cs(this.spec.components.securitySchemes),delete this.spec.components.securitySchemes)}}function $s(e){return new ws(e).convert()}async function _s({tokens:t,...r}){const{version:s="1.0.0",acceptMimes:n,specPath:i,specVersion:o}=r,a=Os((0,e.getValue)(r,"spec",{}),{fileSpec:{},version:s,specVersion:o,acceptMimes:n}),c=ds(a),u=ps(a,ls(t,r));return c===$.SWAGGER?$s(u):u}const Ms="$cache:schemes";function Ns(e,t={}){const r=se(e);return t={endpoint:!0,groups:[],...t,specType:t.specType||$.JSON,schemas:{}},"parameter"===r.decoratorType&&(t={...t,genericTypes:r.nestedGenerics[0],nestedGenerics:r.nestedGenerics,groups:r.parameter?.groups}),function(e,t){const r=e.store.get(Ms)||new Map,s=function(e){return JSON.stringify(e)}(t);if(!r.has(s)){const n=o("schema",e.schema,t);Object.keys(t.schemas).length&&(n.definitions=t.schemas),r.set(s,n)}return e.store.set(Ms,r),r.get(s)}(r,t)}function Ds(e,t={}){const r=e.isStore?e:se(e),s=Qr(t.basePath,r.path);let n=[];return t.withChildren&&(n=r.get("childrenControllers",[]).reduce(((e,r)=>e.concat(Ds(r,{...t,basePath:s}))),n)),[...ts(e).values()].reduce(((t,r)=>{const{operation:n}=r;return n&&n.operationPaths.forEach((n=>{t.push(new Yr({basePath:s,token:e,endpoint:r,operationPath:n}))})),t}),n)}function Ls(e){const t=e.isStore?e:se(e);if(!t.$properties){const e=ce(t);t.$properties=new Map,e.forEach((e=>{e.children.forEach((e=>{t.$properties.has(e.propertyKey)||t.$properties.set(e.propertyKey,e)}))}))}return t.$properties}function ks(e,t={}){const r=Ls(e),s=new Map;return r.forEach(((e,r)=>{!t.withIgnoredProps&&me(e.itemSchema,t)||s.set(r,e)})),s}})(),i})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@tsed/core"),require("change-case")):"function"==typeof define&&define.amd?define(["@tsed/core","change-case"],t):"object"==typeof exports?exports.schema=t(require("@tsed/core"),require("change-case")):e.schema=t(e["@tsed/core"],e["change-case"])}(self,((e,t)=>(()=>{"use strict";var r={379:e=>{const t="\\\\/",r=`[^${t}]`,s="\\.",n="\\/",i="[^/]",o=`(?:${n}|$)`,a=`(?:^|${n})`,c=`${s}{1,2}${o}`,u={DOT_LITERAL:s,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:n,ONE_CHAR:"(?=.)",QMARK:i,END_ANCHOR:o,DOTS_SLASH:c,NO_DOT:`(?!${s})`,NO_DOTS:`(?!${a}${c})`,NO_DOT_SLASH:`(?!${s}{0,1}${o})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.${n}]`,STAR:`${i}*?`,START_ANCHOR:a,SEP:"/"},p={...u,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${s}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${s})`,NO_DOTS:`(?!(?:^|[${t}])${s}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${s}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${s}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?p:u}},390:(e,t,r)=>{const s=r(379),n=r(290),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:u}=s,p=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>n.escapeRegex(e))).join("..")}return r},h=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,l=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=u[e]||e;const r={...t},l="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;let m=e.length;if(m>l)throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${l}`);const d={type:"bos",value:"",output:r.prepend||""},f=[d],y=r.capture?"":"?:",g=s.globChars(r.windows),O=s.extglobChars(g),{DOT_LITERAL:S,PLUS_LITERAL:b,SLASH_LITERAL:T,ONE_CHAR:R,DOTS_SLASH:A,NO_DOT:E,NO_DOT_SLASH:v,NO_DOTS_SLASH:x,QMARK:C,QMARK_NO_DOT:P,STAR:w,START_ANCHOR:$}=g,_=e=>`(${y}(?:(?!${$}${e.dot?A:S}).)*?)`,M=r.dot?"":E,N=r.dot?C:P;let D=!0===r.bash?_(r):w;r.capture&&(D=`(${D})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const L={input:e,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:f};e=n.removePrefix(e,L),m=e.length;const k=[],I=[],H=[];let j,G=d;const q=()=>L.index===m-1,U=L.peek=(t=1)=>e[L.index+t],J=L.advance=()=>e[++L.index],K=()=>e.slice(L.index+1),B=(e="",t=0)=>{L.consumed+=e,L.index+=t},F=e=>{L.output+=null!=e.output?e.output:e.value,B(e.value)},W=()=>{let e=1;for(;"!"===U()&&("("!==U(2)||"?"===U(3));)J(),L.start++,e++;return e%2!=0&&(L.negated=!0,L.start++,!0)},V=e=>{L[e]++,H.push(e)},X=e=>{L[e]--,H.pop()},z=e=>{if("globstar"===G.type){const t=L.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||k.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(L.output=L.output.slice(0,-G.output.length),G.type="star",G.value="*",G.output=D,L.output+=G.output)}if(k.length&&"paren"!==e.type&&!O[e.value]&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&F(e),G&&"text"===G.type&&"text"===e.type)return G.value+=e.value,void(G.output=(G.output||"")+e.value);e.prev=G,f.push(e),G=e},Q=(e,t)=>{const s={...O[t],conditions:1,inner:""};s.prev=G,s.parens=L.parens,s.output=L.output;const n=(r.capture?"(":"")+s.open;V("parens"),z({type:e,value:t,output:L.output?"":R}),z({type:"paren",extglob:!0,value:J(),output:n}),k.push(s)},Y=e=>{let t=e.close+(r.capture?")":"");if("negate"===e.type){let s=D;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(s=_(r)),(s!==D||q()||/^\)+$/.test(K()))&&(t=e.close=`)$))${s}`),"bos"===e.prev.type&&q()&&(L.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:j,output:t}),X("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let s=!1,i=e.replace(c,((e,t,r,n,i,o)=>"\\"===n?(s=!0,e):"?"===n?t?t+n+(i?C.repeat(i.length):""):0===o?N+(i?C.repeat(i.length):""):C.repeat(r.length):"."===n?S.repeat(r.length):"*"===n?t?t+n+(i?D:""):D:t?e:`\\${e}`));return!0===s&&(i=!0===r.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===r.contains?(L.output=e,L):(L.output=n.wrapOutput(i,L,t),L)}for(;!q();){if(j=J(),"\0"===j)continue;if("\\"===j){const e=U();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){j+="\\",z({type:"text",value:j});continue}const t=/^\\+/.exec(K());let s=0;if(t&&t[0].length>2&&(s=t[0].length,L.index+=s,s%2!=0&&(j+="\\")),!0===r.unescape?j=J()||"":j+=J()||"",0===L.brackets){z({type:"text",value:j});continue}}if(L.brackets>0&&("]"!==j||"["===G.value||"[^"===G.value)){if(!1!==r.posix&&":"===j){const e=G.value.slice(1);if(e.includes("[")&&(G.posix=!0,e.includes(":"))){const e=G.value.lastIndexOf("["),t=G.value.slice(0,e),r=G.value.slice(e+2),s=o[r];if(s){G.value=t+s,L.backtrack=!0,J(),d.output||1!==f.indexOf(G)||(d.output=R);continue}}}("["===j&&":"!==U()||"-"===j&&"]"===U())&&(j=`\\${j}`),"]"!==j||"["!==G.value&&"[^"!==G.value||(j=`\\${j}`),!0===r.posix&&"!"===j&&"["===G.value&&(j="^"),G.value+=j,F({value:j});continue}if(1===L.quotes&&'"'!==j){j=n.escapeRegex(j),G.value+=j,F({value:j});continue}if('"'===j){L.quotes=1===L.quotes?0:1,!0===r.keepQuotes&&z({type:"text",value:j});continue}if("("===j){V("parens"),z({type:"paren",value:j});continue}if(")"===j){if(0===L.parens&&!0===r.strictBrackets)throw new SyntaxError(h("opening","("));const e=k[k.length-1];if(e&&L.parens===e.parens+1){Y(k.pop());continue}z({type:"paren",value:j,output:L.parens?")":"\\)"}),X("parens");continue}if("["===j){if(!0!==r.nobracket&&K().includes("]"))V("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));j=`\\${j}`}z({type:"bracket",value:j});continue}if("]"===j){if(!0===r.nobracket||G&&"bracket"===G.type&&1===G.value.length){z({type:"text",value:j,output:`\\${j}`});continue}if(0===L.brackets){if(!0===r.strictBrackets)throw new SyntaxError(h("opening","["));z({type:"text",value:j,output:`\\${j}`});continue}X("brackets");const e=G.value.slice(1);if(!0===G.posix||"^"!==e[0]||e.includes("/")||(j=`/${j}`),G.value+=j,F({value:j}),!1===r.literalBrackets||n.hasRegexChars(e))continue;const t=n.escapeRegex(G.value);if(L.output=L.output.slice(0,-G.value.length),!0===r.literalBrackets){L.output+=t,G.value=t;continue}G.value=`(${y}${t}|${G.value})`,L.output+=G.value;continue}if("{"===j&&!0!==r.nobrace){V("braces");const e={type:"brace",value:j,output:"(",outputIndex:L.output.length,tokensIndex:L.tokens.length};I.push(e),z(e);continue}if("}"===j){const e=I[I.length-1];if(!0===r.nobrace||!e){z({type:"text",value:j,output:j});continue}let t=")";if(!0===e.dots){const e=f.slice(),s=[];for(let t=e.length-1;t>=0&&(f.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&s.unshift(e[t].value);t=p(s,r),L.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=L.output.slice(0,e.outputIndex),s=L.tokens.slice(e.tokensIndex);e.value=e.output="\\{",j=t="\\}",L.output=r;for(const e of s)L.output+=e.output||e.value}z({type:"brace",value:j,output:t}),X("braces"),I.pop();continue}if("|"===j){k.length>0&&k[k.length-1].conditions++,z({type:"text",value:j});continue}if(","===j){let e=j;const t=I[I.length-1];t&&"braces"===H[H.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:j,output:e});continue}if("/"===j){if("dot"===G.type&&L.index===L.start+1){L.start=L.index+1,L.consumed="",L.output="",f.pop(),G=d;continue}z({type:"slash",value:j,output:T});continue}if("."===j){if(L.braces>0&&"dot"===G.type){"."===G.value&&(G.output=S);const e=I[I.length-1];G.type="dots",G.output+=j,G.value+=j,e.dots=!0;continue}if(L.braces+L.parens===0&&"bos"!==G.type&&"slash"!==G.type){z({type:"text",value:j,output:S});continue}z({type:"dot",value:j,output:S});continue}if("?"===j){if((!G||"("!==G.value)&&!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("qmark",j);continue}if(G&&"paren"===G.type){const e=U();let t=j;if("<"===e&&!n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===G.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(K()))&&(t=`\\${j}`),z({type:"text",value:j,output:t});continue}if(!0!==r.dot&&("slash"===G.type||"bos"===G.type)){z({type:"qmark",value:j,output:P});continue}z({type:"qmark",value:j,output:C});continue}if("!"===j){if(!0!==r.noextglob&&"("===U()&&("?"!==U(2)||!/[!=<:]/.test(U(3)))){Q("negate",j);continue}if(!0!==r.nonegate&&0===L.index){W();continue}}if("+"===j){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){Q("plus",j);continue}if(G&&"("===G.value||!1===r.regex){z({type:"plus",value:j,output:b});continue}if(G&&("bracket"===G.type||"paren"===G.type||"brace"===G.type)||L.parens>0){z({type:"plus",value:j});continue}z({type:"plus",value:b});continue}if("@"===j){if(!0!==r.noextglob&&"("===U()&&"?"!==U(2)){z({type:"at",extglob:!0,value:j,output:""});continue}z({type:"text",value:j});continue}if("*"!==j){"$"!==j&&"^"!==j||(j=`\\${j}`);const e=a.exec(K());e&&(j+=e[0],L.index+=e[0].length),z({type:"text",value:j});continue}if(G&&("globstar"===G.type||!0===G.star)){G.type="star",G.star=!0,G.value+=j,G.output=D,L.backtrack=!0,L.globstar=!0,B(j);continue}let t=K();if(!0!==r.noextglob&&/^\([^?]/.test(t)){Q("star",j);continue}if("star"===G.type){if(!0===r.noglobstar){B(j);continue}const s=G.prev,n=s.prev,i="slash"===s.type||"bos"===s.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===r.bash&&(!i||t[0]&&"/"!==t[0])){z({type:"star",value:j,output:""});continue}const a=L.braces>0&&("comma"===s.type||"brace"===s.type),c=k.length&&("pipe"===s.type||"paren"===s.type);if(!i&&"paren"!==s.type&&!a&&!c){z({type:"star",value:j,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[L.index+4];if(r&&"/"!==r)break;t=t.slice(3),B("/**",3)}if("bos"===s.type&&q()){G.type="globstar",G.value+=j,G.output=_(r),L.output=G.output,L.globstar=!0,B(j);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!o&&q()){L.output=L.output.slice(0,-(s.output+G.output).length),s.output=`(?:${s.output}`,G.type="globstar",G.output=_(r)+(r.strictSlashes?")":"|$)"),G.value+=j,L.globstar=!0,L.output+=s.output+G.output,B(j);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";L.output=L.output.slice(0,-(s.output+G.output).length),s.output=`(?:${s.output}`,G.type="globstar",G.output=`${_(r)}${T}|${T}${e})`,G.value+=j,L.output+=s.output+G.output,L.globstar=!0,B(j+J()),z({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===t[0]){G.type="globstar",G.value+=j,G.output=`(?:^|${T}|${_(r)}${T})`,L.output=G.output,L.globstar=!0,B(j+J()),z({type:"slash",value:"/",output:""});continue}L.output=L.output.slice(0,-G.output.length),G.type="globstar",G.output=_(r),G.value+=j,L.output+=G.output,L.globstar=!0,B(j);continue}const s={type:"star",value:j,output:D};!0!==r.bash?!G||"bracket"!==G.type&&"paren"!==G.type||!0!==r.regex?(L.index!==L.start&&"slash"!==G.type&&"dot"!==G.type||("dot"===G.type?(L.output+=v,G.output+=v):!0===r.dot?(L.output+=x,G.output+=x):(L.output+=M,G.output+=M),"*"!==U()&&(L.output+=R,G.output+=R)),z(s)):(s.output=j,z(s)):(s.output=".*?","bos"!==G.type&&"slash"!==G.type||(s.output=M+s.output),z(s))}for(;L.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));L.output=n.escapeLast(L.output,"["),X("brackets")}for(;L.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing",")"));L.output=n.escapeLast(L.output,"("),X("parens")}for(;L.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","}"));L.output=n.escapeLast(L.output,"{"),X("braces")}if(!0===r.strictSlashes||"star"!==G.type&&"bracket"!==G.type||z({type:"maybe_slash",value:"",output:`${T}?`}),!0===L.backtrack){L.output="";for(const e of L.tokens)L.output+=null!=e.output?e.output:e.value,e.suffix&&(L.output+=e.suffix)}return L};l.fastpaths=(e,t)=>{const r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=u[e]||e;const{DOT_LITERAL:c,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:l,NO_DOT:m,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:y,START_ANCHOR:g}=s.globChars(r.windows),O=r.dot?d:m,S=r.dot?f:m,b=r.capture?"":"?:";let T=!0===r.bash?".*?":y;r.capture&&(T=`(${T})`);const R=e=>!0===e.noglobstar?T:`(${b}(?:(?!${g}${e.dot?l:c}).)*?)`,A=e=>{switch(e){case"*":return`${O}${h}${T}`;case".*":return`${c}${h}${T}`;case"*.*":return`${O}${T}${c}${h}${T}`;case"*/*":return`${O}${T}${p}${h}${S}${T}`;case"**":return O+R(r);case"**/*":return`(?:${O}${R(r)}${p})?${S}${h}${T}`;case"**/*.*":return`(?:${O}${R(r)}${p})?${S}${T}${c}${h}${T}`;case"**/.*":return`(?:${O}${R(r)}${p})?${c}${h}${T}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=A(t[1]);if(!r)return;return r+c+t[2]}}},E=n.removePrefix(e,{negated:!1,prefix:""});let v=A(E);return v&&!0!==r.strictSlashes&&(v+=`${p}?`),v},e.exports=l},555:(e,t,r)=>{const s=r(270),n=r(390),i=r(290),o=r(379),a=(e,t,r=!1)=>{if(Array.isArray(e)){const s=e.map((e=>a(e,t,r))),n=e=>{for(const t of s){const r=t(e);if(r)return r}return!1};return n}const s=(n=e)&&"object"==typeof n&&!Array.isArray(n)&&e.tokens&&e.input;var n;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},o=i.windows,c=s?a.compileRe(e,t):a.makeRe(e,t,!1,!0),u=c.state;delete c.state;let p=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};p=a(i.ignore,e,r)}const h=(r,s=!1)=>{const{isMatch:n,match:h,output:l}=a.test(r,c,t,{glob:e,posix:o}),m={glob:e,state:u,regex:c,posix:o,input:r,output:l,match:h,isMatch:n};return"function"==typeof i.onResult&&i.onResult(m),!1===n?(m.isMatch=!1,!!s&&m):p(r)?("function"==typeof i.onIgnore&&i.onIgnore(m),m.isMatch=!1,!!s&&m):("function"==typeof i.onMatch&&i.onMatch(m),!s||m)};return r&&(h.state=u),h};a.test=(e,t,r,{glob:s,posix:n}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const o=r||{},c=o.format||(n?i.toPosixSlashes:null);let u=e===s,p=u&&c?c(e):e;return!1===u&&(p=c?c(e):e,u=p===s),!1!==u&&!0!==o.capture||(u=!0===o.matchBase||!0===o.basename?a.matchBase(e,t,r,n):t.exec(p)),{isMatch:Boolean(u),match:u,output:p}},a.matchBase=(e,t,r)=>(t instanceof RegExp?t:a.makeRe(t,r)).test(i.basename(e)),a.isMatch=(e,t,r)=>a(t,r)(e),a.parse=(e,t)=>Array.isArray(e)?e.map((e=>a.parse(e,t))):n(e,{...t,fastpaths:!1}),a.scan=(e,t)=>s(e,t),a.compileRe=(e,t,r=!1,s=!1)=>{if(!0===r)return e.output;const n=t||{},i=n.contains?"":"^",o=n.contains?"":"$";let c=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(c=`^(?!${c}).*$`);const u=a.toRegex(c,t);return!0===s&&(u.state=e),u},a.makeRe=(e,t,r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");const i=t||{};let o,c={negated:!1,fastpaths:!0},u="";return e.startsWith("./")&&(e=e.slice(2),u=c.prefix="./"),!1===i.fastpaths||"."!==e[0]&&"*"!==e[0]||(o=n.fastpaths(e,t)),void 0===o?(c=n(e,t),c.prefix=u+(c.prefix||"")):c.output=o,a.compileRe(c,t,r,s)},a.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},a.constants=o,e.exports=a},270:(e,t,r)=>{const s=r(290),{CHAR_ASTERISK:n,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:h,CHAR_LEFT_PARENTHESES:l,CHAR_LEFT_SQUARE_BRACKET:m,CHAR_PLUS:d,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:y,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:O}=r(379),S=e=>e===p||e===o,b=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const r=t||{},T=e.length-1,R=!0===r.parts||!0===r.scanToEnd,A=[],E=[],v=[];let x,C,P=e,w=-1,$=0,_=0,M=!1,N=!1,D=!1,L=!1,k=!1,I=!1,H=!1,j=!1,G=!1,q=0,U={value:"",depth:0,isGlob:!1};const J=()=>w>=T,K=()=>(x=C,P.charCodeAt(++w));for(;w<T;){let e;if(C=K(),C!==o){if(!0===I||C===h){for(q++;!0!==J()&&(C=K());)if(C!==o)if(C!==h){if(!0!==I&&C===c&&(C=K())===c){if(M=U.isBrace=!0,D=U.isGlob=!0,G=!0,!0===R)continue;break}if(!0!==I&&C===a){if(M=U.isBrace=!0,D=U.isGlob=!0,G=!0,!0===R)continue;break}if(C===y&&(q--,0===q)){I=!1,M=U.isBrace=!0,G=!0;break}}else q++;else H=U.backslashes=!0,K();if(!0===R)continue;break}if(C!==p){if(!0!==r.noext&&!0==(C===d||C===i||C===n||C===f||C===u)&&P.charCodeAt(w+1)===l){if(D=U.isGlob=!0,L=U.isExtglob=!0,G=!0,!0===R){for(;!0!==J()&&(C=K());)if(C!==o){if(C===g){D=U.isGlob=!0,G=!0;break}}else H=U.backslashes=!0,C=K();continue}break}if(C===n){if(x===n&&(k=U.isGlobstar=!0),D=U.isGlob=!0,G=!0,!0===R)continue;break}if(C===f){if(D=U.isGlob=!0,G=!0,!0===R)continue;break}if(C===m)for(;!0!==J()&&(e=K());)if(e!==o){if(e===O){if(N=U.isBracket=!0,D=U.isGlob=!0,G=!0,!0===R)continue;break}}else H=U.backslashes=!0,K();if(!0===r.nonegate||C!==u||w!==$){if(!0!==r.noparen&&C===l){if(D=U.isGlob=!0,!0===R){for(;!0!==J()&&(C=K());)if(C!==l){if(C===g){G=!0;break}}else H=U.backslashes=!0,C=K();continue}break}if(!0===D){if(G=!0,!0===R)continue;break}}else j=U.negated=!0,$++}else{if(A.push(w),E.push(U),U={value:"",depth:0,isGlob:!1},!0===G)continue;if(x===c&&w===$+1){$+=2;continue}_=w+1}}else H=U.backslashes=!0,C=K(),C===h&&(I=!0)}!0===r.noext&&(L=!1,D=!1);let B=P,F="",W="";$>0&&(F=P.slice(0,$),P=P.slice($),_-=$),B&&!0===D&&_>0?(B=P.slice(0,_),W=P.slice(_)):!0===D?(B="",W=P):B=P,B&&""!==B&&"/"!==B&&B!==P&&S(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),!0===r.unescape&&(W&&(W=s.removeBackslashes(W)),B&&!0===H&&(B=s.removeBackslashes(B)));const V={prefix:F,input:e,start:$,base:B,glob:W,isBrace:M,isBracket:N,isGlob:D,isExtglob:L,isGlobstar:k,negated:j};if(!0===r.tokens&&(V.maxDepth=0,S(C)||E.push(U),V.tokens=E),!0===r.parts||!0===r.tokens){let t;for(let s=0;s<A.length;s++){const n=t?t+1:$,i=A[s],o=e.slice(n,i);r.tokens&&(0===s&&0!==$?(E[s].isPrefix=!0,E[s].value=F):E[s].value=o,b(E[s]),V.maxDepth+=E[s].depth),0===s&&""===o||v.push(o),t=i}if(t&&t+1<e.length){const s=e.slice(t+1);v.push(s),r.tokens&&(E[E.length-1].value=s,b(E[E.length-1]),V.maxDepth+=E[E.length-1].depth)}V.slashes=A,V.parts=v}return V}},290:(e,t,r)=>{const{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=r(379);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>i.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(o,"\\$1"),t.toPosixSlashes=e=>e.replace(s,"/"),t.removeBackslashes=e=>e.replace(n,(e=>"\\"===e?"":e)),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.escapeLast=(e,r,s)=>{const n=e.lastIndexOf(r,s);return-1===n?e:"\\"===e[n-1]?t.escapeLast(e,r,n-1):`${e.slice(0,n)}\\${e.slice(n)}`},t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},t.wrapOutput=(e,t={},r={})=>{let s=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(s=`(?:^(?!${s}).*$)`),s},t.basename=(e,{windows:t}={})=>t?e.replace(/[\\/]$/,"").replace(/.*[\\/]/,""):e.replace(/\/$/,"").replace(/.*\//,"")},870:(e,t,r)=>{e.exports=r(555)},203:(e,t,r)=>{var s=r(739);function n(e){if(!Object.prototype.hasOwnProperty.call(i.message,e))throw new Error("invalid status code: "+e);return i.message[e]}function i(e){if("number"==typeof e)return n(e);if("string"!=typeof e)throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?function(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(i.code,t))throw new Error('invalid status message: "'+e+'"');return i.code[t]}(e):n(t)}e.exports=i,i.message=s,i.code=function(e){var t={};return Object.keys(e).forEach((function(r){var s=e[r],n=Number(r);t[s.toLowerCase()]=n})),t}(s),i.codes=function(e){return Object.keys(e).map((function(e){return Number(e)}))}(s),i.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},i.empty={204:!0,205:!0,304:!0},i.retry={502:!0,503:!0,504:!0}},803:t=>{t.exports=e},598:e=>{e.exports=t},739:e=>{e.exports=JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}')}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{n.r(i),n.d(i,{AcceptMime:()=>dr,AdditionalProperties:()=>qe,All:()=>Ir,AllOf:()=>Ue,Allow:()=>Ke,Any:()=>Be,AnyOf:()=>Fe,ArrayOf:()=>_e,Children:()=>Pe,CollectionContains:()=>Ne,CollectionOf:()=>$e,Const:()=>We,Consumes:()=>fr,ContentType:()=>Ar,Converter:()=>ws,CustomKey:()=>Ve,CustomKeys:()=>Xe,DateFormat:()=>mt,DateTime:()=>lt,DecoratorContext:()=>yr,Default:()=>ze,DefaultMsg:()=>Qe,Delete:()=>qr,Deprecated:()=>Er,Description:()=>Ye,Discriminator:()=>S,DiscriminatorKey:()=>Ze,DiscriminatorValue:()=>we,Email:()=>ht,EndpointMetadata:()=>re,Enum:()=>et,ErrorMsg:()=>De,Example:()=>tt,Examples:()=>rt,ExclusiveMaximum:()=>it,ExclusiveMinimum:()=>ct,For:()=>It,Format:()=>pt,ForwardGroups:()=>gt,GenericOf:()=>hr,Generics:()=>lr,Get:()=>Hr,Groups:()=>Rt,HTTP_METHODS:()=>ve,HTTP_STATUS_MESSAGES:()=>K,Head:()=>Ur,Header:()=>vr,Hidden:()=>At,Ignore:()=>vt,In:()=>xr,InFile:()=>Cr,Integer:()=>xt,JSON_TYPES:()=>d,JsonClassStore:()=>E,JsonEntitiesContainer:()=>c,JsonEntityComponent:()=>A,JsonEntityFn:()=>Ce,JsonEntityStore:()=>u,JsonFormatTypes:()=>ut,JsonLazyRef:()=>ne,JsonMap:()=>k,JsonMedia:()=>Y,JsonMethodStore:()=>te,JsonOperation:()=>ee,JsonOperationPathsMap:()=>zr,JsonOperationRoute:()=>Yr,JsonParameter:()=>j,JsonParameterStore:()=>G,JsonParameterTypes:()=>_,JsonPropertyStore:()=>v,JsonRequestBody:()=>z,JsonResponse:()=>Z,JsonSchema:()=>R,Location:()=>Pr,MapOf:()=>Me,Max:()=>nt,MaxItems:()=>ke,MaxLength:()=>Ct,MaxProperties:()=>Ie,Maximum:()=>st,Min:()=>at,MinItems:()=>He,MinLength:()=>Pt,MinProperties:()=>je,Minimum:()=>ot,MultipleOf:()=>wt,Name:()=>$t,Nullable:()=>_t,OneOf:()=>Mt,OperationId:()=>wr,OperationMethods:()=>xe,OperationPath:()=>$r,Optional:()=>Nt,Options:()=>Kr,ParamMetadata:()=>q,Partial:()=>_r,Patch:()=>Jr,Path:()=>Mr,Pattern:()=>Dt,Post:()=>jr,Produces:()=>mr,Property:()=>Je,PropertyMetadata:()=>x,Put:()=>Gr,ReadOnly:()=>Lt,RecordOf:()=>Ht,Redirect:()=>Nr,Required:()=>jt,RequiredGroups:()=>Gt,Returns:()=>Rr,Route:()=>kr,Schema:()=>kt,Security:()=>Br,SpecTypes:()=>$,Status:()=>Fr,Summary:()=>Wr,Tags:()=>Vr,TimeFormat:()=>dt,Title:()=>qt,TypeError:()=>Ut,UniqueItems:()=>Ge,Uri:()=>ft,Url:()=>yt,View:()=>Xr,WriteOnly:()=>Jt,allOf:()=>cr,alterIgnore:()=>me,alterOneOf:()=>Te,alterRequiredGroups:()=>Se,any:()=>ir,anyMapper:()=>ie,anyOf:()=>or,array:()=>tr,boolean:()=>Vt,buildPath:()=>Zr,classMapper:()=>oe,concatParameters:()=>es,concatPath:()=>Qr,createRef:()=>D,createRefName:()=>N,date:()=>Xt,datetime:()=>zt,defineStatusModel:()=>Or,email:()=>Yt,enums:()=>pr,enumsRegistry:()=>l,execMapper:()=>o,formatParameterType:()=>I,from:()=>Kt,generateSpec:()=>_s,genericsMapper:()=>ae,getComputedType:()=>m,getGenericsMap:()=>C,getInheritedStores:()=>ce,getJsonEntityStore:()=>se,getJsonPathParameters:()=>rs,getJsonSchema:()=>Ns,getJsonSchemaMapper:()=>s,getJsonType:()=>f,getOperationsRoutes:()=>Ds,getOperationsStores:()=>ts,getProperties:()=>ks,getPropertiesStores:()=>Ls,getRequiredProperties:()=>be,getSpec:()=>ls,getSpecType:()=>ms,getSpecTypeFromSpec:()=>ds,getStatusConstant:()=>B,getStatusMessage:()=>F,getStatusModel:()=>Sr,hasMapper:()=>a,inheritedClassMapper:()=>ue,integer:()=>Ft,isParameterType:()=>H,isRedirectionStatus:()=>V,isSuccessStatus:()=>W,itemMapper:()=>pe,lazyRef:()=>ur,lazyRefMapper:()=>he,map:()=>rr,mapAliasedProperties:()=>Oe,mapGenericsOptions:()=>P,mapHeaders:()=>Q,mapMapper:()=>le,mapNullableType:()=>de,mapOpenSpec:()=>Os,mapOpenSpec2:()=>ys,mapOpenSpec3:()=>gs,mapOpenSpecInfo:()=>fs,mapRouteOptions:()=>Dr,matchGroups:()=>Tt,mergeOperation:()=>ss,mergeSpec:()=>ps,number:()=>Bt,object:()=>nr,objectMapper:()=>fe,ofMapper:()=>ye,oneOf:()=>ar,operationIdFormatter:()=>ns,parameters:()=>os,popGenerics:()=>w,propertiesMapper:()=>ge,registerJsonSchemaMapper:()=>r,schemaMapper:()=>Ee,schemesReducer:()=>is,security:()=>as,serializeEnum:()=>y,serializeEnumValues:()=>g,set:()=>sr,string:()=>Wt,tagsReducer:()=>cs,time:()=>Qt,toJsonMapCollection:()=>X,toJsonRegex:()=>O,toRef:()=>L,transformInformation:()=>Ps,transformSecurity:()=>Cs,transformToOS2:()=>$s,uri:()=>Zt,url:()=>er,withErrorMsg:()=>Le});var e=n(803);const t=new Map;function r(e,r){return t.set(e,r)}function s(e){if(!t.has(e))throw new Error(`JsonSchema ${e} mapper doesn't exists`);return t.get(e)}function o(e,t,r,n){return s(e)(t,r,n)}function a(e){return t.has(e)}const c=new Map;class u{propertyKey;propertyName;index;descriptor;decoratorType;collectionType;token;store;isStore=!0;parent;target;_type;_schema;constructor(e){const{target:t,propertyKey:r,descriptor:s,index:n,decoratorType:i}=e;this.target=t,this.propertyKey=r,this.propertyName=String(r),this.descriptor=s,this.index=n,this.decoratorType=i,this.token=t,this.store=e.store,this.parent=this}get targetName(){return(0,e.nameOf)(this.token)}get isCollection(){return!!this.collectionType}get isArray(){return(0,e.isArrayOrArrayClass)(this.collectionType)}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.target).find((e=>u.from(e).schema.isDiscriminator));return t&&u.from(t)}get isPrimitive(){return(0,e.isPrimitiveOrPrimitiveClass)(this._type)}get isDate(){return(0,e.isDate)(this.computedType)}get isObject(){return(0,e.isObject)(this.computedType)}get isClass(){return(0,e.isClass)(this.computedType)}get schema(){return this._schema}get nestedGenerics(){return this.schema.nestedGenerics}set nestedGenerics(e){this.schema.nestedGenerics=e}get type(){return this._type}set type(e){this._type=e,this.build()}get computedType(){return this.itemSchema.getComputedType()}get itemSchema(){return this.isCollection?this.schema.itemSchema():this.schema}get parentSchema(){return this.parent.schema}get isDiscriminatorChild(){return this.schema.isDiscriminator&&this.discriminatorAncestor?.schema.discriminator().base!==this.target}static from(...t){if(t[0].isStore)return t[0];const r=t[0];t.length>1&&(t[0]=(0,e.prototypeOf)(t[0]));const s=e.Store.from(...t);if(!s.has("JsonEntityStore")){const n=(0,e.decoratorTypeOf)(t),i=c.get(n);if(!i)throw Error("Unsupported json entity type");const o=new i({store:s,decoratorType:n,target:(0,e.classOf)(r),propertyKey:t[1],index:"number"==typeof t[2]?t[2]:void 0,descriptor:"object"==typeof t[2]?t[2]:void 0});o.build(),s.set("JsonEntityStore",o)}return s.get("JsonEntityStore")}static fromMethod(t,r){return this.from(t,r,(0,e.descriptorOf)(t,r))}static get(t,r,s){return u.from((0,e.prototypeOf)(t),r,s)}isGetterOnly(){return(0,e.isObject)(this.descriptor)&&!this.descriptor.value&&this.descriptor.get&&!this.descriptor.set}get(e,t){return this.store.get(e,t)}set(e,t){return this.store.set(e,t)}toString(){return[this.targetName,this.propertyName,this.index].filter((e=>void 0!==e)).join(":")}buildType(t){(0,e.isCollection)(t)?this.collectionType=t:(this._type=t,this._type&&(0,e.isPlainObject)(this._type)&&(this._type=String))}getBestType(){return this.itemSchema.isDiscriminator?this.itemSchema.discriminator():(0,e.isClassObject)(this.type)?this.itemSchema.getTarget():this.type}}function p(e,t,r,s){var n,i=arguments.length,o=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(i<3?n(o):i>3?n(t,r,o):n(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function h(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create,Object.create;const l=new Map;function m(t){return(0,e.isPromise)(t)||t===Function?Object:(0,e.isClass)(t)||(0,e.isSymbol)(t)||(0,e.isPrimitiveOrPrimitiveClass)(t)||(0,e.isClassObject)(t)||(0,e.isDate)(t)||(0,e.isCollection)(t)?(0,e.classOf)(t):(0,e.isArrowFn)(t)?t():t}const d=["string","number","integer","boolean","object","array","null","any"];function f(t){return null===t?"null":(0,e.isPrimitiveOrPrimitiveClass)(t)?d.indexOf(t)>-1?t:"string"==typeof t?"file"===t?"file":"generic":(0,e.primitiveOf)(t):t===Array?"array":(0,e.isArray)(t)?t.map(f):t===Set?"array":(0,e.isDate)(t)||(0,e.isBuffer)(t)?"string":"object"}const y=t=>(0,e.isObject)(t)&&null!==t?Object.entries(t).reduce(((e,[t,r])=>isNaN(+t)?e.concat(r):e),[]):t;function g(t){const r=t.reduce(((e,t)=>e.concat(y(t))),[]),s=r.reduce(((e,t)=>e.add((e=>null===e?"null":typeof e)(t))),new Set);return{values:(0,e.uniq)(r),types:s}}function O(e){return String(e).replace(/^(\/)(.*)(\/)$/,"$2")}class S{propertyName;base;values=new Map;types=new Map;constructor({base:t,propertyName:r,types:s,values:n}={}){Object.assign(this,(0,e.cleanObject)({base:t,propertyName:r,types:s?new Map(s):void 0,values:n?new Map(n):void 0}))}add(e,t){return t.forEach((t=>{this.values.set(t,e)})),this.types.set(e,t),this}getType(e){return this.values.get(e)||this.base}getValues(e){return this.types.get(e)}getDefaultValue(e){const t=this.types.get(e);return t?t[0]:void 0}children(){return[...new Set([...this.types.keys()])]}}function b(e){return e instanceof R?e:Object.entries(e).reduce(((e,[t,r])=>(e[O(t)]=T(r),e)),{})}function T(t){return(0,e.isArray)(t)?t.map(T):t.isStore||t.isJsonSchema||t.isLazyRef?t:(0,e.classOf)(t)!==Object&&(0,e.isClass)(t)?u.from(t).schema:(0,e.isObject)(t)?R.from(t):(0,e.isPrimitiveClass)(t)?R.from({type:t}):t}class R extends Map{isJsonSchema=!0;$hooks=new e.Hooks;$required=new Set;$allow=[];$selfRequired;$forwardGroups=!1;isDiscriminatorKey=!1;isDiscriminator=!1;#e=!1;#t=null;#r;#s=[];#n=new Map;#i;#o;#a=!1;#c=!1;#u=!1;constructor(e={}){super(),e&&this.assign(e)}get alias(){return this.#n}get nestedGenerics(){return this.#s}set nestedGenerics(e){this.#s=e}get genericLabels(){return this.#r}set genericLabels(e){this.#r=e}get isClass(){return(0,e.isClass)(this.class)&&![Map,Array,Set,Object,Date,Boolean,Number,String].includes(this.#o)}get isCollection(){return this.#c}get isGeneric(){return this.#a}get discriminatorAncestor(){const t=(0,e.ancestorsOf)(this.#o).find((e=>u.from(e).schema.isDiscriminator));return t&&u.from(t).schema}get hasGenerics(){return!(!this.nestedGenerics||!this.nestedGenerics.length)}get genericType(){return this.get("$ref")}get class(){return this.getComputedType()}get canRef(){return this.#u}get isNullable(){return this.#e||this.$allow.includes(null)}get isReadOnly(){return this.get("readOnly")}get isWriteOnly(){return this.get("writeOnly")}get hasDiscriminator(){return!!this.#t}static from(e={}){return new R(e)}nullable(e){this.#e=e}itemSchema(e={}){return this.#i=this.#i||T(e),this.#i.assign(e),this.#i}getAliasOf(e){return this.#n.get(e)}addAlias(e,t){return this.#n.set(e,t),this.#n.set(t,e),this}removeAlias(e){const t=this.#n.get(e);return t&&this.#n.delete(t),this.#n.delete(e),this}$id(e){return super.set("$id",e),this}$ref(e){return super.set("$ref",e),this}$schema(e){return super.set("$schema",e),this}label(e){return this.#u=!0,super.set("name",e),this}name(e){return super.set("name",e),this}ignore(e){if("boolean"==typeof e){const t=e;e=()=>t}return this.$hooks.on("ignore",e),this}default(e){return super.set("default",e),this}const(e){return super.set("const",e),this}description(e){return super.set("description",e),this}discriminator(){return this.isDiscriminator=!0,this.#t=this.#t||new S({base:this.#o})}discriminatorKey(e){return this.discriminator().propertyName=e,this.isDiscriminator=!0,this}discriminatorValue(...e){const t=this.discriminatorAncestor.discriminator();t.add(this.#o,e),this.isDiscriminator=!0;const r=this.get("properties"),s=r[t.propertyName]||new R({type:"string"});return 1===e.length?(s.const(e[0]),s.examples([e[0]])):(s.enum(...e),s.examples(e)),r[t.propertyName]=s,this.set("properties",r),this}additionalItems(e){return super.set("additionalItems",T(e)),this}contains(e){return super.set("contains",T(e)),this}examples(e){return super.set("examples",e),this}example(...e){return this.examples(e)}items(e){return super.set("items",this.#i=T(e)),this}maxItems(e){return super.set("maxItems",e),this}minItems(e){return super.set("minItems",e),this}uniqueItems(e){return super.set("uniqueItems",e),this}maxProperties(e){return super.set("maxProperties",e),this}minProperties(e){return super.set("minProperties",e),this}allow(...e){return this.$allow.push(...e),this}required(t=!0){if(!(0,e.isArray)(t)){const e=this.clone();return e.$selfRequired=t,e}return this.$required.clear(),t.forEach((e=>this.$required.add(e))),this}addRequired(e){return this.$required.add(e),this}removeRequired(e){return this.$required.delete(e),this}isRequired(e){return this.$required.has(e)}properties(e){return super.set("properties",b(e)),this}addProperty(e,t){const r=this.get("properties")||{};return r[e]=t,super.set("properties",b(r)),this}patternProperties(e){return super.set("patternProperties",b(e)),this}additionalProperties(e){return super.set("additionalProperties",T(e)),this}unknown(e=!0){return this.additionalProperties(e)}dependencies(e){return super.set("dependencies",b(e)),this}propertyNames(e){return super.set("propertyNames",T(e)),this}enum(e,...t){if(l.has(e))return this.enum(l.get(e));if(e instanceof R)e.getName()?super.set("enum",e):super.set("enum",e.get("enum")).any(...e.getJsonType());else{const{values:r,types:s}=g([e,t].flat());super.set("enum",r).any(...s)}return this}definitions(e){return super.set("definitions",b(e)),this}allOf(e){return super.set("allOf",e.map(T)),this}anyOf(e){return super.set("anyOf",e.map(T)),this}oneOf(e){let t=e.map(T);if(1===t.length&&!(e[0]instanceof R)){if(!t[0].hasDiscriminator)return this.type(e[0]);const r=t[0].discriminator().children();if(!r.length)return this.type(e[0]);t=r.map(T)}super.set("oneOf",t);const r=t[0];if(r.isDiscriminator){const e=r.discriminatorAncestor.discriminator(),{propertyName:t}=e;super.set("discriminator",{propertyName:t}),this.isDiscriminator=!0,this.#t=e}return this}not(e){return super.set("not",T(e)),this}multipleOf(e){return super.set("multipleOf",e),this}maximum(e){return super.set("maximum",e),this}exclusiveMaximum(e){return super.set("exclusiveMaximum",e),this}minimum(e){return super.set("minimum",e),this}exclusiveMinimum(e){return super.set("exclusiveMinimum",e),this}maxLength(e){return super.set("maxLength",e),this}minLength(e){return super.set("minLength",e),this}pattern(e){return super.set("pattern",O(e)),this}format(e){return super.set("format",e),this}type(t){switch(t){case Map:super.set("type",f(t)),this.#o=t,this.#c=!0,this.has("additionalProperties")||super.set("additionalProperties",this.itemSchema({}));break;case Array:super.set("type",f(t)),this.#o=t,this.#c=!0,this.has("items")||super.set("items",this.itemSchema({}));break;case Set:super.set("type",f(t)),this.#o=t,this.#c=!0,this.uniqueItems(!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"integer":super.set("type",f(t)),this.integer();break;case Object:case Date:case Boolean:case Number:case String:super.set("type",f(t)),this.#o=t,this.has("properties")||super.set("properties",{});break;default:if((0,e.isClass)(t)||(0,e.isFunction)(t))super.set("type",void 0),this.#o=t,this.has("properties")||super.set("properties",{});else{const e=f(t);"generic"===e?(this.#a=!0,super.set("$ref",t)):super.set("type",e)}}return this}any(...t){return t.filter((t=>(0,e.isClass)(t))).length>=2?this.oneOf(t.filter((e=>null!==e&&(this.nullable(!0),!0)))):(t.length?(t=(0,e.uniq)(t).map(f)).includes("null")&&(this.nullable(!0),t=t.filter((e=>"null"!==e))):(t=["integer","number","string","boolean","array","object"],this.nullable(!0)),this.type(1===t.length?t[0]:t)),this}integer(){return super.set("type","integer"),super.set("multipleOf",1),this}title(e){return super.set("title",e),this}readOnly(e){return super.set("readOnly",e),this}writeOnly(e){return super.set("writeOnly",e),this}customKey(e,t){return super.set(`#${e}`,t),this}toObject(e){return this.toJSON(e)}toJSON(e){let t=!1;e||(t=!0,e={schemas:{}});const r=o("schema",this,e);return t&&e.schemas&&Object.keys(e.schemas).length&&(r.definitions=e.schemas),r}assign(e={}){return(e instanceof R?[...e.entries()]:Object.entries(e)).forEach((([e,t])=>{this.set(e,t)})),e instanceof R&&(this.$selfRequired=e.$selfRequired,this.$allow.push(...e.$allow),e.$required.forEach((e=>{this.$required.add(e)})),this.#t=this.#t?new S(this.#t):null,this.isDiscriminator=e.isDiscriminator,this.isDiscriminatorKey=e.isDiscriminatorKey,this.#u=e.#u,this.#n=new Map(this.#n.entries()),e.#r&&(this.#r=[...e.#r]),this.#s=e.#s.map((e=>[...e])),this.#o=e.#o,this.#a=e.#a,this.#c=e.#c,this.#u=e.#u,super.set("type",e.get("type"))),this}set(t,r){return t in this?(0,e.isFunction)(this[t])&&this[t](r):super.set(t,r),this}getComputedType(){return m(this.#o)}getComputedItemType(){return this.#i?this.#i.getComputedType():this.getComputedType()}getJsonType(){return this.get("type")||f(this.getComputedType())}getTarget(){return this.#o}getName(){return this.get("name")||((0,e.isClass)(this.#o)?(0,e.nameOf)((0,e.classOf)(this.getComputedType())):"")}clone(){return new R(this)}}function A(e){return t=>{c.set(e,t)}}let E=class extends u{children=new Map;get path(){return this.store.get("path","/")}set path(e){this.store.set("path",e)}build(){this._type||this.buildType(this.target),this._type=this._type||Object,this._schema=R.from({type:this.type})}};E=p([A(e.DecoratorTypes.CLASS)],E);let v=class extends u{parent=u.from(this.target);get required(){return this.parent.schema.isRequired(this.propertyKey)}set required(e){e?this.parent.schema.addRequired(this.propertyKey):this.parent.schema.removeRequired(this.propertyKey)}get allowedRequiredValues(){return this.schema.$allow}discriminatorKey(){return this.parent.schema.discriminatorKey(String(this.propertyKey)),this.itemSchema.isDiscriminatorKey=!0,this}isDiscriminatorKey(){return this.itemSchema.isDiscriminatorKey}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}build(){this._type||this.buildType(e.Metadata.getType((0,e.prototypeOf)(this.target),this.propertyKey)),this._type=this._type||Object;let t=this.parent.schema.get("properties")[this.propertyName];t||(this.parent.children.set(this.propertyName,this),t=R.from({type:this.collectionType||this.type}),this.collectionType&&t.itemSchema(this.type)),this.parent.schema.addProperty(this.propertyName,t),this._schema=t}static get(t,r){return u.from((0,e.prototypeOf)(t),r)}};v=p([A(e.DecoratorTypes.PROP)],v);const x=v;function C(e,t){return e.reduce(((e,r,s)=>e.set(r,t[s])),new Map)}function P(e){if(e.genericLabels&&e.genericTypes){const{genericLabels:t,genericTypes:r,...s}=e;return{...s,generics:C(t,r)}}return e}function w(e){const[t,...r]=e.nestedGenerics;return{genericTypes:t,nestedGenerics:r}}var $,_,M=n(598);function N(e,t){return t.groups&&t.groups.length?(0,M.pascalCase)(`${e} ${t.groupsName||t.groups.join(" ")}`):e}function D(t,r,s){const n=function(e){const{host:t="#/"+("openapi3"===e.specType?"components/schemas":"definitions")}=e;return t}(s),i={$ref:`${n}/${t}`},o=r.isNullable,a=r.isReadOnly,c=r.isWriteOnly;if(o||a||c)switch(s.specType){case $.OPENAPI:return(0,e.cleanObject)({nullable:!!o||void 0,readOnly:!!a||void 0,writeOnly:!!c||void 0,oneOf:[i]});case $.JSON:return(0,e.cleanObject)({readOnly:a,writeOnly:c,oneOf:[i]})}return i}function L(e,t,r){const s=N(e.getName(),r);return r.schemas[s]=t,D(s,e,r)}!function(e){e.JSON="jsonschema",e.SWAGGER="swagger2",e.OPENAPI="openapi3"}($||($={}));class k extends Map{constructor(e={}){super(),this.assign(e)}assign(t={}){return Object.entries(t).forEach((([t,r])=>{(0,e.isFunction)(this[t])?this[t](r):this.set(t,r)})),this}toJSON(e={}){return o("map",this,e)}}function I(e){return String(e).toLowerCase().replace("raw_","").replace("cookies","cookie")}function H(e){return Object.values(_).includes(I(e))}!function(e){e.BODY="body",e.PATH="path",e.QUERY="query",e.HEADER="header",e.COOKIES="cookie",e.FILES="files"}(_||(_={}));class j extends k{nestedGenerics=[];groups;groupsName;$schema;expression;getName(){const e=this.get("name");return"files"===this.get("in")?e.split(".")[0]:e}name(e){return this.set("name",e),this}examples(e){return super.set("examples",e),this}description(e){return this.set("description",e),this}in(e,t=""){return this.set("in",I(e)),this.expression=t,this}required(e){return this.set("required",e),this}schema(e){return this.$schema=e,this}toJSON(t={}){if(!H(this.get("in")))return null;const r=(0,e.toMap)(t.schemas||{});return this.build({...t,groups:this.groups,groupsName:this.groupsName},r)}build(e,t){const{type:r,schema:s,...n}=super.toJSON(e),i=o("item",this.$schema,{...e,...w(this)});switch(n.required=n.required||this.get("in")===_.PATH,this.get("in")){case _.FILES:return this.getFileSchema(i,n);case _.QUERY:if(i.$ref){if(!n.name)return this.refToParameters(n,e,t);n.style="deepObject"}}return n.schema=i,n}getFileSchema(t,r){const s={type:"string",format:"binary",oneOf:void 0};return"array"===t.type?(t.items=(0,e.cleanObject)({...t.items,...s}),r.schema=t):r.schema=(0,e.cleanObject)({...t,...s}),r}refToParameters(t,r,s){const n=N(this.$schema.getName(),r),i=r.schemas[n];return r.schemas[n]&&!s.has(n)&&delete r.schemas[this.$schema.getName()],Object.entries(i.properties||{}).reduce(((r,[s,{description:n,...o}])=>[...r,(0,e.cleanObject)({...t,name:s,required:(i.required||[]).includes(s),description:n,schema:o,style:o.$ref?"deepObject":void 0})]),[])}}let G=class extends u{paramType;expression;dataPath;pipes;parameter=new j;parent=u.fromMethod(this.target,this.propertyKey);constructor(e){super(e),this.pipes=e.pipes||[],this.paramType=e.paramType||this.paramType,this.expression=e.expression||this.expression,this.dataPath=e.dataPath||this.dataPath}get nestedGenerics(){return this.parameter.nestedGenerics}set nestedGenerics(e){this.parameter.nestedGenerics=e}get required(){return!!this.parameter.get("required")}set required(e){this.parameter.required(e)}get allowedRequiredValues(){return this.schema.$allow}static getParams(t,r){const s=[],n=(0,e.ancestorsOf)(t).reverse().find((t=>(0,e.isMethodDescriptor)(t,r)&&u.fromMethod(t,r).children.size));return n?(u.fromMethod(n,r).children.forEach(((e,t)=>{s[+t]=e})),s):[]}static get(t,r,s){return u.from((0,e.prototypeOf)(t),r,s)}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}getSchema(t){return(0,e.isCollection)(t)||!(0,e.isClass)(t)?R.from({type:t}):u.from(t).schema}build(){if(!this._type){const t=e.Metadata.getParamTypes((0,e.prototypeOf)(this.target),this.propertyKey)[this.index];this.buildType(t)}this._type=this._type||Object,this._schema||(this.parent.children.set(this.index,this),this._schema=this.getSchema(this.collectionType||this.type),this.parameter.schema(this._schema),this.collectionType&&this._schema.itemSchema(this.getSchema(this.type)),this.parent.operation.addParameter(this.index,this.parameter))}};G=p([A(e.DecoratorTypes.PARAM),h("design:paramtypes",[Object])],G);const q=G;var U=n(203),J=n.n(U);const K=J().codes.reduce(((e,t)=>{const r=String(J()(t));return{...e,[String(t)]:{label:r,code:(0,M.constantCase)(r)}}}),{});function B(e){return K[e]?.code}function F(e){return K[e]?.label}K[200].label="Success",K[200].code="SUCCESS";const W=e=>Number(e)&&200<=Number(e)&&Number(e)<300,V=e=>Number(e)&&300<=Number(e)&&Number(e)<400;function X(e,t=k){return Object.entries(e).reduce(((e,[r,s])=>(e.set(r,new t(s)),e)),new k)}class z extends k{constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}content(e){return this.set("content",X(e)),this}addContent(e,t,r){const s=this.get("content"),n=new k;return n.set("schema",t),r&&n.set("examples",r),s.set(e,n),this}required(e){return this.set("required",e),this}}function Q(t){return Object.keys(t).reduce(((r,s)=>{const n=t[s];let i=typeof n,o={example:n};return"object"===i&&(o=n,o.example=void 0===o.value?o.example:o.value,delete o.value,i=typeof o.example),o.type=o.type||i,r[s]=(0,e.cleanObject)(o),r}),{})}class Y extends k{groups=[];groupsName;allowedGroups;schema(e){return this.set("schema",e),this}examples(e){return this.set("examples",e),this}toJSON(e={}){let t=[...this.groups||[]];return super.toJSON({...e,groups:t,groupsName:this.groupsName})}}class Z extends k{status;constructor(e={}){super(e),this.content(e.content||{})}description(e){return this.set("description",e),this}headers(e){return this.set("headers",Q(e)),this}content(e){return this.set("content",X(e,Y)),this}getContent(){return this.get("content")}getMedia(e,t=!0){return t&&this.addMedia(e),this.getContent()?.get(e)}addMedia(e){const t=this.get("content");return t.has(e)||t.set(e,new Y),this}toJSON(e={}){const t=super.toJSON(e);return 204===this.status&&delete t.content,t.headers&&Object.entries(t.headers).forEach((([e,{type:r,...s}])=>{t.headers[e]={...s,schema:{type:r}}})),t}}class ee extends k{operationPaths=new Map;#p;#h=!1;constructor(e={}){super({parameters:[],responses:new k,...e})}get response(){return this.getResponses().get(this.getStatus().toString())}get status(){return this.#p}tags(e){return super.set("tags",e),this}addTags(t){return t=(0,e.uniqBy)([...this.get("tags")||[],...t],"name"),this.tags(t)}summary(e){return super.set("summary",e),this}operationId(e){return this.set("operationId",e),this}responses(e){return this.set("responses",e),this}defaultStatus(e){return this.#p=e,this}getStatus(){return this.#p||200}setRedirection(e=302){return this.#h=!0,this.#p=e,this}isRedirection(e){return this.#h&&e?V(e):this.#h}addResponse(t,r){if((W(t)||V(t))&&!this.#p){const e=this.getResponseOf(200);this.getResponses().set(t.toString(),e).delete("200"),this.defaultStatus(Number(t))}const s="default"===t?this.getStatus().toString():t.toString(),n=this.getResponses().get(s);return n?(r.forEach(((t,r)=>{["content"].includes(r)||n.set(r,(0,e.deepMerge)(n.get(r),t))})),n.status=Number(s)):(r.status=Number(s),this.getResponses().set(s,r)),this}getResponses(){return this.get("responses")}getResponseOf(e){return("default"===e?this.response:this.getResponses().get(String(e)))||new Z}ensureResponseOf(e){return this.addResponse(e,this.getResponseOf(e)),this.getResponseOf(e)}getHeadersOf(e){return this.getResponseOf(e).get("headers")||{}}getContentTypeOf(e){return[...this.getResponseOf(e).get("content").keys()].slice(-1)[0]}security(e){return this.set("security",e),this}addSecurityScopes(t,r){const s=this.get("security")||{};return s[t]=(0,e.uniq)([...s[t]||[],...r]),this.security(s)}description(e){return super.set("description",e),this}deprecated(e){return super.set("deprecated",e),this}parameters(e){return super.set("parameters",e),this}addParameter(e,t){-1===e&&(e=this.get("parameters").length),this.get("parameters")[e]=t}consumes(e){return super.set("consumes",e),this}produces(e){return super.set("produces",e),this}addProduce(t){const r=(0,e.uniq)([].concat(this.get("produces"),t)).filter(Boolean);this.set("produces",r)}addOperationPath(e,t,r={}){return this.operationPaths.set(String(e)+String(t),{...r,method:e,path:t}),this}toJSON(e={}){const t=super.toJSON({...e,ignore:["parameters"]}),r=[],s=[];if(t.security&&(t.security=[].concat(t.security)),this.get("parameters").forEach((t=>{H(this.get("in"))||t.get("in")&&([_.BODY,_.FILES].includes(t.get("in"))?r.push(t):s.push(...[].concat(t.toJSON(e))))})),t.parameters=s.filter(Boolean),0===this.get("responses").size&&(t.responses={200:{description:F(200)}}),r.length){const s=function(e,t){let r=new R;const s={},n=[];let i=0;return e.forEach((e=>{const o=e.getName();Array.from(e.entries()).filter((([e])=>!["in","name"].includes(e))).forEach((([e,t])=>{void 0===s[e]&&(s[e]=t)}));const a=e.toJSON(t);o?(r.addProperty(o,a.schema||{type:a.type}),e.get("required")&&r.addRequired(o),i++):n.push(a)})),i||1!==n.length?(r.type("object"),{schema:r.toJSON(t),required:!1,...s}):n[0]}(r,e);t.requestBody=function(e,{schema:t,examples:r,in:s,...n}){const i=new z(n);return(e.get("consumes")?.length?e.get("consumes"):["application/json"]).forEach((e=>{i.addContent(e,t,r)})),i}(this,s).toJSON(e)}return delete t.consumes,delete t.produces,t}}let te=class extends u{parent=u.from(this.target);middlewares=[];beforeMiddlewares=[];afterMiddlewares=[];operation=new ee;children=new Map;constructor(t){super({store:e.Store.fromMethod(t.target,t.propertyKey),descriptor:(0,e.descriptorOf)(t.target,t.propertyKey),...t});const{beforeMiddlewares:r=[],middlewares:s=[],afterMiddlewares:n=[]}=t;this.after(n),this.before(r),this.use(s)}get params(){return this.parameters}get view(){return this.store.get("view")}set view(e){this.store.set("view",e)}get acceptMimes(){return this.store.get("acceptMimes",[])}set acceptMimes(e){this.store.set("acceptMimes",e)}get parameters(){return[...this.children.values()]}get operationPaths(){return this.operation.operationPaths}static get(t,r,s){return s=s||(0,e.descriptorOf)((0,e.prototypeOf)(t),r),u.from((0,e.prototypeOf)(t),r,s)}getResponseOptions(e,{contentType:t="application/json",includes:r}={}){const s=this.operation.getResponseOf(e).getMedia(t,!1);if(s&&s.has("schema")){const e=s.get("schema");let t=s.groups;return r&&s.allowedGroups?.size&&(t=[...t||[],...r.filter((e=>s.allowedGroups.has(e)))]),{type:e.getComputedItemType(),groups:t}}return{type:this.type}}before(t){return this.beforeMiddlewares=this.beforeMiddlewares.concat(t).filter(e.isFunction),this}after(t){return this.afterMiddlewares=this.afterMiddlewares.concat(t).filter(e.isFunction),this}use(t){return this.middlewares=this.middlewares.concat(t).filter(e.isFunction),this}get(t){const r=e.Store.from(this.target).get(t);return(0,e.deepMerge)(r,this.store.get(t))}getParamTypes(){return[...this.children.values()].reduce(((e,t)=>({...e,[t.paramType]:!0})),{})}build(){if(!this._type){let t=e.Metadata.getReturnType(this.target,this.propertyKey);t=(0,e.isPromise)(t)?void 0:t,this.buildType(t)}this._type=this._type||Object,this.parent.children.set(this.propertyName,this),(0,e.isCollection)(this._type)&&(this.collectionType=this._type,delete this._type),this._schema=R.from({type:this.collectionType||this.type}),this.collectionType&&this._schema.itemSchema(this.type),this.parent.schema.addProperty(this.propertyName,this.schema)}};te=p([A(e.DecoratorTypes.METHOD),h("design:paramtypes",[Object])],te);const re=te;function se(...e){return u.from(...e)}c.set(e.DecoratorTypes.CLASS,E),c.set(e.DecoratorTypes.PROP,v),c.set(e.DecoratorTypes.PARAM,G),c.set(e.DecoratorTypes.METHOD,te);class ne{getType;isLazyRef=!0;constructor(e){this.getType=e}get target(){return this.getType()}get schema(){return se(this.getType()).schema}get name(){return(0,e.nameOf)(this.getType())}toJSON(e){return this.getType()&&o("schema",this.schema,e)}}function ie(e,t={}){if("object"!=typeof e||null===e)return e;if(e instanceof ne)return o("lazyRef",e,t);if(e instanceof R&&e.get("enum")instanceof R){const r=e.get("enum");return L(r,r.toJSON(t),t)}if("toJSON"in e){const r=e.toJSON(P(t));return e.canRef?L(e,r,t):r}return o("object",e,t)}function oe(e,t){const r=u.from(e.class),s=N(r.schema.getName()||e.getName(),t);if(e.hasGenerics){const{type:s,properties:n,additionalProperties:i,items:a,...c}=e.toJSON(t),u={...o("any",r.schema,{...t,...w(e),root:!1}),...c};if(u.title){const r=N(u.title,t);return t.schemas[r]=u,delete u.title,D(r,e,t)}return u}return t.schemas&&!t.schemas[s]&&(t.schemas[s]={},t.schemas[s]=o("any",r.schema,P({...t,root:!1}))),D(s,e,t)}function ae(t,r){const{generics:s}=r;if(s&&t.$ref&&s.has(t.$ref)){let n=s.get(t.$ref);if((0,e.isPrimitiveClass)(n))return{type:f(n)};if(n===Date)return{type:"string",format:"date-time"};if(n.toJSON)return n.toJSON({...r,generics:void 0});if(n===Object)return{type:"object"};if((0,e.isClass)(n)){const e={class:n};return 0===r.nestedGenerics.length?o("class",e,{...r,generics:void 0}):o("schema",u.from(e.class).schema,{...r,...w(r),root:!1})}}return t}function ce(t){const r=t.isStore?t:se(t);return r.$inherited||(r.$inherited=(0,e.ancestorsOf)(r.target).reverse().reduce(((e,t)=>e.set(t,se(t))),new Map)),r.$inherited}function ue(t,{target:r,...s}){const n=Array.from(ce(r).entries()).filter((([t])=>(0,e.classOf)(t)!==(0,e.classOf)(r)));if(n.length){const r=n.reduce(((t,[,r])=>(0,e.deepMerge)(t,o("schema",r.schema,s))),{});t=(0,e.deepMerge)(r,t)}return t}function pe(e,t){return e&&e.isClass?o("class",e,t):o("any",e,t)}function he(e,t){const r=e.name;if(t.$refs?.find((t=>t===e.target)))return D(r,e.schema,t);t.$refs=[...t.$refs||[],e.target];const s=e.toJSON(P(t));return L(e.schema,s,t)}function le(e,{ignore:t=[],...r}){return r=P(r),Array.from(e.entries()).reduce(((e,[s,n])=>(t.includes(s)||(e[s]=o("item",n,r)),e)),{})}function me(e,t){let r=e?.$hooks?.alter("ignore",!1,[t]);return r||(!1!==t.groups?e?.$hooks?.alter("groups",!1,[t.groups]):r)}function de(t,r,s){if(!r?.isNullable)return t;let n=[].concat(t.type).filter(Boolean);switch(s.specType){default:case $.JSON:t.discriminator||(t.oneOf?function(e){return e.oneOf.find((e=>"null"===e.type))}(t)||t.oneOf.unshift({type:"null"}):t.type=(0,e.uniq)(["null",...n]));break;case $.OPENAPI:t.nullable=!0,t.oneOf||(n.length>1?(t.oneOf=n.map((e=>({type:e}))),delete t.type):t.type=n[0])}return t}function fe(t,r){const{specType:s,operationIdFormatter:n,root:i,schemas:a,genericTypes:c,nestedGenerics:u,useAlias:p,genericLabels:h,...l}=r;return Object.entries(t).reduce(((e,[s,n])=>{if(!1!==r.withIgnoredProps&&!me(n,l)){const i={...r,groups:t?.$forwardGroups||n?.$forwardGroups?r.groups:void 0};e[s]=o("item",n,i),e[s]=de(e[s],n,i)}return e}),(0,e.isArray)(t)?[]:{})}function ye(e,t,r){return e.map((e=>o("item",e,{...t,genericLabels:r.genericLabels})))}function ge(e,t,r){return e.isClass?o("class",e,t):o("any",e,{...t,genericLabels:r.genericLabels})}function Oe(e,t){return Object.entries(e).reduce(((e,[r,s])=>(e[r=t.get(r)||r]=s,e)),{})}function Se(e,t,r){return!1!==r.groups?t?.$hooks?.alter("requiredGroups",e,[r.groups]):e}function be(t,r,s){if(s.groups&&s.groups.includes("partial"))return t.discriminator?{...t,required:[t.discriminator.propertyName]}:t;let n=function(t,r,s){let n=t.required||[];return n=[...n,...r.$required],r.get("properties")&&(n=Object.entries(r.get("properties")).reduce(((e,[t,r])=>r&&void 0!==r.$selfRequired?r.$selfRequired?e.concat(t):e.filter((e=>e===t)):e),n)),Se((0,e.uniq)(n),r,s)}(t,r,s);return n=(0,e.uniq)(n).reduce(function(e,t,r={}){const{useAlias:s}=r,n=Object.keys(e.properties||{});return(r,i)=>{const o=s&&t.alias.get(i)||i;if(n.includes(o)){const s=t.get("properties")[i],n=e.properties[o];return e.properties[o]=function(e,t){if(!t?.$allow.includes("")&&[].concat(t?.get("type")).includes("string")){const t=e?.minLength;if(void 0===t)return{...e,minLength:1}}return e}(n,s),r.concat(o)}return r}}(t,r,s),[]),t.discriminator&&n.push(t.discriminator.propertyName),n.length?{...t,required:n}:t}function Te(e,t,r){return e.oneOf&&!1!==r.groups&&(e={...e,oneOf:t.$hooks.alter("oneOf",e.oneOf,[r.groups])}),!(e.oneOf||e.allOf||e.anyOf)||e.items||e.properties||delete e.type,e}r("any",ie),r("class",oe),r("generics",ae),r("inheritedClass",ue),r("item",pe),r("lazyRef",he),r("map",le),r("object",fe),r("anyOf",ye),r("allOf",ye),r("oneOf",ye),r("properties",ge),r("items",ge),r("additionalProperties",ge),r("propertyNames",ge),r("contains",ge),r("dependencies",ge),r("patternProperties",ge),r("additionalItems",ge),r("not",ge),r("definitions",ge);const Re=["name","$required","$hooks","_nestedGenerics",$.OPENAPI,$.SWAGGER,$.JSON],Ae=["const"];function Ee(t,r){const{useAlias:s=!0,schemas:n={}}=r;r={...r,useAlias:s,schemas:n};let i=[...t.keys()].filter((e=>!function(e,{specType:t=$.JSON,customKeys:r=!1}){return Re.includes(e)||e.startsWith("#")&&(!1===r||t!==$.JSON)||t!==$.JSON&&Ae.includes(e)}(e,r))).reduce(((n,i)=>{let c=t.get(i);if("type"===(i=i.replace(/^#/,"")))return{...n,[i]:t.getJsonType()};if(function(t,r,s){return"examples"===t&&(0,e.isObject)(r)&&$.OPENAPI===s.specType}(i,c,r)&&(i="example",c=Object.values(c)[0]),c&&"object"==typeof c&&a(i)){if(c=o(i,c,r,t),function(e,t){return"object"==typeof t&&["items","properties","additionalProperties"].includes(e)&&0===Object.keys(t).length}(i,c))return n;(function(e,t,r){return"object"==typeof t&&r&&["properties","additionalProperties"].includes(e)})(i,c,s)&&(c=Oe(c,t.alias))}return{...n,[i]:c}}),{});return t.isClass&&(i=o("inheritedClass",i,{...r,root:!1,schemas:n,target:t.getComputedType()})),i=o("generics",i,{...r,root:!1,schemas:n}),t.has(r.specType)&&(i={...i,...t.get(r.specType).toJSON(r)}),i=be(i,t,{...r,useAlias:s}),i=de(i,t,r),i=Te(i,t,r),i}r("schema",Ee);const ve=["all","checkout","connect","copy","delete","get","head","lock","merge","mkactivity","mkcol","move","m-search","notify","options","param","patch","post","propfind","propatch","purge","put","report","search","subscribe","trace","unlock","unsuscribe"];var xe;function Ce(e){return(...t)=>{const r=e(se(...t),t);"function"==typeof r&&r(...t)}}function Pe(...t){return Ce((r=>{r.store.set("childrenControllers",t),t.forEach((t=>{e.Store.from(t).set("parentController",r.token)}))}))}function we(e,...t){return Ce((r=>{e=e||(0,M.snakeCase)(r.targetName),r.discriminatorAncestor&&r.schema.discriminatorValue(e,...t)}))}function $e(e,t){if(!e)throw new Error("A type is required on `@CollectionOf(type)` decorator. Please give a type or wrap it inside an arrow function if you have a circular reference.");const r={};let s=!1;const n=(...n)=>{const i=u.from(...n);t&&(i.collectionType=t,i.schema.type(t)),i.type=e,i.itemSchema.type(e),i.schema.assign(r),i.isArray&&s&&(i.schema.set("contains",i.schema.get("items")),i.schema.delete("items"))};return n.MinItems=e=>(r.minItems=e,n),n.MaxItems=e=>(r.maxItems=e,n),n.MinProperties=e=>(r.minProperties=e,n),n.MaxProperties=e=>(r.maxProperties=e,n),n.Contains=()=>(s=!0,n),n.UniqueItems=(e=!0)=>(r.uniqueItems=e,n),n}function _e(e){return $e(e,Array)}function Me(e){return $e(e,Map)}function Ne(e){return $e(e).Contains()}function De(e){return Ce((t=>{const r=t.parentSchema.get("#errorMessage")||{};t.parentSchema.customKey("errorMessage",{...r,...e})}))}function Le(t,r){const s={};return(...n)=>{const i=(0,e.useDecorators)(r(...n));return i.Error=r=>(s.message=r,(0,e.useDecorators)(i,s.message&&De({[t]:r}))),i}}!function(e){e.ALL="ALL",e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.HEAD="HEAD",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.CUSTOM="CUSTOM"}(xe||(xe={}));const ke=Le("maxItems",(e=>{if(e<0)throw new Error("The value of maxItems MUST be a non-negative integer.");return Ce((t=>{t.schema.maxItems(e)}))})),Ie=Le("maxProperties",(e=>{if(e<0)throw new Error("The value of maxProperties MUST be a non-negative integer.");return Ce((t=>{t.isCollection?t.schema.maxProperties(e):t.itemSchema.maxProperties(e)}))})),He=Le("minItems",(e=>{if(e<0)throw new Error("The value of minItems MUST be a non-negative integer.");return Ce((t=>{t.schema.minItems(e)}))})),je=Le("minProperties",(e=>{if(e<0)throw new Error("The value of minProperties MUST be a non-negative integer.");return Ce((t=>{t.isCollection?t.schema.minProperties(e):t.itemSchema.minProperties(e)}))})),Ge=Le("uniqueItems",((e=!0)=>Ce((t=>{t.schema.uniqueItems(e)}))));function qe(e){return Ce(((t,r)=>{t.itemSchema.additionalProperties(e)}))}function Ue(...e){return Ce((t=>{t.itemSchema.allOf(e)}))}function Je(t){return Ce((r=>{t&&((0,e.isClass)(t)&&(r.type=t),r.itemSchema.type(t))}))}function Ke(...t){const r=t.find((t=>(0,e.isClass)(t)));return(0,e.useDecorators)(r&&Je(r),Ce(((r,s)=>{r.schema.allow(...t),r.decoratorType===e.DecoratorTypes.PARAM&&(r.required=!0),r.decoratorType===e.DecoratorTypes.PROP&&r.parentSchema.addRequired(r.propertyName)})))}function Be(...e){return Ce((t=>{t.itemSchema.any(...e)}))}function Fe(...e){return Ce((t=>{t.itemSchema.anyOf(e)}))}function We(e){return Ce((t=>{t.itemSchema.const(e)}))}function Ve(e,t){return Ce((r=>{r.itemSchema.customKey(e,t)}))}function Xe(e){return Ce((t=>{Object.entries(e).forEach((([e,r])=>{t.itemSchema.customKey(e,r)}))}))}function ze(e){return Ce((t=>{t.itemSchema.default(e)}))}function Qe(t){return(0,e.useDecorators)(De({_:t}))}function Ye(t){return Ce(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.PROP:case e.DecoratorTypes.CLASS:r.schema.description(t);break;case e.DecoratorTypes.PARAM:r.parameter.description(t);break;case e.DecoratorTypes.METHOD:r.operation?.description(t)}}))}function Ze(){return(0,e.useDecorators)(Je(),Ce((e=>{e.discriminatorKey()})))}const et=Le("enum",(function(e,...t){return Ce((r=>{r.itemSchema.enum(e,...t)}))}));function tt(...e){return Ce((t=>{t.schema.examples(e)}))}function rt(e){return Ce((t=>{t.parameter.examples(e)}))}const st=Le("maximum",((e,t=!1)=>Ce((r=>{t?r.itemSchema.exclusiveMaximum(e):r.itemSchema.maximum(e)})))),nt=st,it=Le("exclusiveMaximum",((e,t=!0)=>st(e,t))),ot=Le("minimum",((e,t=!1)=>Ce((r=>{t?r.itemSchema.exclusiveMinimum(e):r.itemSchema.minimum(e)})))),at=ot,ct=Le("exclusiveMinimum",((e,t=!0)=>ot(e,t)));var ut;!function(e){e.DATE_TIME="date-time",e.DATE="date",e.TIME="time",e.EMAIL="email",e.HOSTNAME="hostname",e.IPV4="ipv4",e.IPV6="ipv6",e.URI="uri",e.URL="url",e.URI_REF="uri-reference",e.URI_TEMPLATE="uri-template",e.JSON_POINTER="json-pointer",e.RELATIVE_JSON_POINTER="relative-json-pointer",e.UUID="uuid",e.REGEX="regex"}(ut||(ut={}));const pt=Le("format",(e=>Ce((t=>{t.itemSchema.format(e)})))),ht=Le("format",(()=>pt(ut.EMAIL))),lt=Le("format",(()=>pt(ut.DATE_TIME))),mt=Le("format",(()=>pt(ut.DATE))),dt=Le("format",(()=>pt(ut.TIME))),ft=Le("format",(()=>pt(ut.URI))),yt=Le("format",(()=>pt(ut.URL)));function gt(e=!0){return Ce((t=>{t.schema.$forwardGroups=e}))}var Ot=n(870),St=n.n(Ot);function bt(e,t){t=[].concat(t),e=[].concat(e);let r=new Set,s=new Set,n=new Set,i=0,o=e=>{n.add(e.output)};for(let n=0;n<t.length;n++){let a=St()(String(t[n]),{onResult:o},!0),c=a.state.negated||a.state.negatedExtglob;c&&i++;for(let t of e){let e=a(t,!0);(c?!e.isMatch:e.isMatch)&&(c?r.add(e.output):(r.delete(e.output),s.add(e.output)))}}return!!(i===t.length?[...n]:[...s]).filter((e=>!r.has(e))).length}function Tt(e,t=[]){const r=e.filter((e=>e.startsWith("!"))).map((e=>e.replace("!",""))),s=e.filter((e=>!e.startsWith("!")));return!!(r.length&&t.length&&bt(r,t))||!!s.length&&!bt(e.filter((e=>!e.startsWith("!"))),t)}function Rt(...t){return Ce((r=>{switch(r.decoratorType){case e.DecoratorTypes.CLASS:!function(e,t){const r=Object.entries(e[0]);t.children.forEach((e=>{Rt(...r.filter((([,t])=>t.includes(e.propertyName))).map((([e])=>e)))(e.target,e.propertyKey)}))}(t,r);break;case e.DecoratorTypes.PROP:r.schema.$hooks.on("groups",((e,r)=>!(e||!Tt(t,r))||e));break;case e.DecoratorTypes.PARAM:let s="";2==t.length&&(0,e.isArray)(t[1])&&(s=t[0],t=t[1]),r.parameter.groups=t,r.parameter.groupsName=s}}))}function At(){return(0,e.StoreSet)("hidden",!0)}const Et=(e,t)=>!0!==t.mongoose;function vt(e=Et){return Ce((t=>{t.schema.ignore(e)}))}function xt(){return Ce((e=>{e.itemSchema.type("integer")}))}const Ct=Le("maxLength",(e=>{if(e<0)throw new Error("The value of maxLength MUST be a non-negative integer.");return Ce((t=>{t.itemSchema.maxLength(e)}))})),Pt=Le("minLength",(e=>{if(e<0)throw new Error("The value of minLength MUST be a non-negative integer.");return Ce((t=>{t.itemSchema.minLength(e)}))})),wt=Le("multipleOf",(e=>{if(e<=0)throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");return Ce((t=>{t.itemSchema.multipleOf(e)}))}));function $t(t){return Ce(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.CLASS:r.schema.name(t);break;case e.DecoratorTypes.PARAM:r.parameter.name(t);break;default:r.parent.schema.addAlias(s[1],t)}}))}function _t(t,...r){return r=[t,...r],(0,e.useDecorators)(1===r.length&&Je(r[0]),Be(null,...r))}function Mt(...e){return Ce((t=>{t.itemSchema.oneOf(e),t.type=Object}))}function Nt(){return Ce((t=>{switch(t.decoratorType){case e.DecoratorTypes.PARAM:t.required=!1;break;case e.DecoratorTypes.PROP:t.parentSchema.removeRequired(t.propertyName)}}))}const Dt=Le("pattern",(e=>Ce((t=>{t.itemSchema.pattern(e)}))));function Lt(e=!0){return Ce((t=>{t.itemSchema.readOnly(e)}))}function kt(e){return Ce((t=>{Object.entries(e).forEach((([e,r])=>{t.schema.set(e,r)}))}))}function It(e,t){return Ce((r=>{r.schema.set(e,t)}))}function Ht(e,...t){return kt({properties:{...t.reduce(((t,r)=>({...t,[r]:e})),{})}})}const jt=Le("required",((e=!0,...t)=>e?Ke(...t):Nt()));function Gt(...e){return Ce((t=>{t.parent.schema.$hooks.on("requiredGroups",((r,s)=>Tt(e,s)?r.filter((e=>e!==t.propertyKey)):r))}))}function qt(e){return Ce((t=>{t.schema.title(e)}))}function Ut(t){return Ce((()=>(0,e.useDecorators)(De({type:t}))))}function Jt(e=!0){return Ce((t=>{t.itemSchema.writeOnly(e)}))}function Kt(t=Object){if((0,e.isClass)(t)){const{schema:e}=se(t);return e.properties=function(e){return Object.entries(e).forEach((([e,r])=>{se(t.prototype,e).schema.assign(r)})),this},e}return R.from({type:t})}function Bt(){return Kt(Number)}function Ft(){return Kt(Number).integer()}function Wt(){return Kt(String)}function Vt(){return Kt(Boolean)}function Xt(){return Kt(Date).format(ut.DATE)}function zt(){return Kt(Date).format(ut.DATE_TIME)}function Qt(){return Kt(Date).format(ut.TIME)}function Yt(){return Kt(String).format(ut.EMAIL)}function Zt(){return Kt(String).format(ut.URI)}function er(){return Kt(String).format(ut.URL)}function tr(){return Kt(Array)}function rr(){return Kt(Map).unknown(!0)}function sr(){return Kt(Array).uniqueItems(!0)}function nr(e={}){return Kt(Object).properties(e)}function ir(...e){return Kt().any(...e)}function or(...e){return Kt().anyOf(e)}function ar(...e){return Kt().oneOf(e)}function cr(...e){return Kt().allOf(e)}function ur(e){try{if(e())return u.from(e()).schema}catch(e){}return new ne(e)}function pr(e){const t=Wt().enum(e);return l.set(e,t),t}function hr(...t){const r=[t.map((t=>function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(t)?Wt().enum(Object.values(t)):t))],s=(...e)=>{u.from(...e).nestedGenerics=r};return s.Nested=(...e)=>(r.push(e),s),s}function lr(...e){return t=>{u.from(t).schema.genericLabels=e}}function mr(...t){return Ce(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.produces(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],mr(...t));break;default:throw new e.UnsupportedDecoratorType(mr,s)}}))}function dr(...t){return(0,e.useDecorators)(mr(...t),(0,e.StoreSet)("acceptMimes",t))}function fr(...t){return Ce(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.consumes(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],fr(...t));break;default:throw new e.UnsupportedDecoratorType(fr,s)}}))}class yr extends Map{methods;decoratorType;entity;actions=[];constructor(e={}){super(),Object.entries(e).forEach((([e,t])=>{this.set(e,t)}))}addAction(e){return this.actions.push(e),this}build(){const e=(...t)=>this.bind(t,e),t=t=>{return r=(...e)=>{t in this?this[t](...e):this.set(t,e[0])},(...t)=>(r(...t),e);var r};return this.methods.forEach((r=>{e[(0,M.pascalCase)(r)]=t(r)})),e}toObject(){return[...this.entries()].reduce(((e,[t,r])=>({...e,[t]:r})),{})}getMergedKey(t,r){let s=this.get(t)||r;if(s)return this.decoratorType===e.DecoratorTypes.CLASS&&(s={...s,...r||{}}),{...r||{},...s}}bind(e,t){this.entity=u.from(...e),this.beforeInit(),this.onInit(e,t),this.afterInit()}onInit(e,t){this.forEach(((e,t)=>{this.onMapKey(t,e)}))}onMapKey(e,t){this.entity.set(e,t)}runActions(){return this.actions.forEach((e=>{e(this)})),this}beforeInit(){}afterInit(){}}const gr=new Map;function Or(e,t){gr.set(e,t)}function Sr(e){return gr.get(e)}function br(t){return t.map((t=>function(t){return(0,e.isObject)(t)&&!("toJSON"in t)}(t)?Wt().enum(Object.values(t)):t))}class Tr extends yr{methods=["contentType","description","examples","type","status","of","ofInteger","oneOf","allOf","anyOf","nested","header","headers","schema","title","groups","allowedGroups","location"];constructor({status:e,model:t}){super(),this.model(t),this.status(e)}type(e){return this.model(e)}model(e){return e&&this.set("model",e),this}status(e){return this.set("status",e),e&&F(e)&&!this.get("description")&&(this.set("description",F(e)),this.get("model")||this.model(Sr(+e))),this}headers(e){return this.set("headers",{...this.get("headers")||{},...Q(e)}),this}header(e,t){return this.headers({[e]:t})}location(e,t={}){return this.headers({Location:{...t,value:e}}),this}groups(...t){return 2===t.length&&(0,e.isArray)(t[1])?(this.set("groupsName",t[0]),this.set("groups",t[1])):this.set("groups",t),this}allowedGroups(...e){return this.set("allowedGroups",new Set(e)),this}nested(...e){const t=this.get("model");return this.checkPrimitive(t),this.checkCollection(t),this.addAction((t=>{this.get("schema").nestedGenerics.push(br(e))})),this}of(...t){const r=this.get("model");return this.checkPrimitive(r),this.addAction((()=>{const s=this.get("schema");(0,e.isCollection)(r)?s?.itemSchema({type:t[0]}):s?.nestedGenerics.push(br(t))})),this}ofInteger(){return this.of("integer")}oneOf(...e){return this.manyOf("oneOf",e)}allOf(...e){return this.manyOf("allOf",e)}anyOf(...e){return this.manyOf("anyOf",e)}schema(e){return this.addAction((()=>{this.get("schema").assign(e)})),this}examples(t){return this.set("examples",(0,e.isString)(t)?[t]:t),this}title(e){return this.schema({title:e})}checkPrimitive(t){if((0,e.isPrimitiveOrPrimitiveClass)(t))throw new Error("Returns.Of cannot be used with the following primitive classes: String, Number, Boolean")}checkCollection(t){if((0,e.isCollection)(t))throw new Error("Returns.Nested cannot be used with the following classes: Map, Set, Array, String, Number, Boolean")}getContentType(){const t=this.get("model");let r=this.get("contentType");return!t||(0,e.isPlainObject)(t)||(0,e.isPrimitiveOrPrimitiveClass)(t)||(r=r||"application/json"),r}getStatus(){return this.get("status")||"default"}onInit(t,r){switch((0,e.decoratorTypeOf)(t)){case e.DecoratorTypes.METHOD:this.entity=u.from(...t),this.entity.operation&&this.map();break;case e.DecoratorTypes.CLASS:this.decoratorType=e.DecoratorTypes.CLASS,(0,e.decorateMethodsOf)(t[0],r)}}map(){const t=this.get("model"),{entity:r,decoratorType:s}=this,n=this.entity.operation,i=this.getStatus(),o=n.ensureResponseOf(i),a=this.getContentType();let{description:c=o.get("description")}=this.toObject();c&&(c=s===e.DecoratorTypes.CLASS&&o.get("description")||c,o.description(c));const u=this.getMergedKey("headers",o.get("headers"));return u&&o.headers(u),this.mapMedia(o),(W(this.get("status"))||"default"===i)&&t&&(r.type=t),a&&n.addProduce(a),this.runActions()}mapMedia(t){const r=this.getContentType(),s=this.get("model"),n=t.getMedia(r||"*/*"),i=n.get("schema")||new R({type:s}),o=this.get("groups"),a=this.get("groupsName"),c=this.get("allowedGroups"),u=this.entity.operation;if(s&&((0,e.isArray)(s)?i.oneOf(s.map((e=>({type:e})))):i.type(s)),this.set("schema",i),n.schema(i),n.groups=o,n.groupsName=a,c){n.allowedGroups=c;const e=new j;e.in("query").name("includes"),e.schema(R.from({type:"array",items:{type:"string",enum:[...c]}})),u.addParameter(-1,e)}const p=this.get("examples");return p&&n.examples(p),n}manyOf(t,r){const s=this.get("model");return this.addAction((()=>{const n=this.get("schema");(0,e.isCollection)(s)?(n.type(s||Object),n.itemSchema().set(t,r)):n.set(t,r)})),this}}function Rr(e,t){return new Tr({status:e,model:t}).build()}function Ar(e){return Rr().ContentType(e)}function Er(t=!0){return Ce(((r,s)=>{switch((0,e.decoratorTypeOf)(s)){case e.DecoratorTypes.METHOD:r.operation.deprecated(t);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],Er(t));break;case e.DecoratorTypes.PARAM:r.parameter.set("deprecated",t);break;case e.DecoratorTypes.PROP:r.schema.set("deprecated",t);break;default:throw new e.UnsupportedDecoratorType(Er,s)}}))}function vr(e,t){return void 0!==t&&(e={[e]:t}),Rr().Headers(e)}function xr(t){const r=new j,s={},n=(i,o,a)=>{const c=u.from(i,o,a);switch(c.decoratorType){case e.DecoratorTypes.PARAM:c.parameter.in(t);break;case e.DecoratorTypes.METHOD:r.in(t),c.operation.addParameter(-1,r),r.schema(R.from(s));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(i,n);break;default:throw new e.UnsupportedDecoratorType(xr,[i,o,a])}};return n.Type=e=>(s.type=e,n),n.Name=e=>(r.name(e),n),n.Description=e=>(r.description(e),n),n.Required=(e=!0)=>(r.required(e),n),n.Pattern=e=>n.Schema({pattern:e.toString()}),n.Schema=e=>(Object.assign(s,e),n),n}function Cr(t){return(...r)=>{const[s,n,i]=r,o=e.Metadata.getParamTypes(s,n)[i]===Array,a=[t="object"==typeof t?void 0:t,!o&&"0"].filter(Boolean).join(".");(0,e.useDecorators)(xr(_.FILES),$t(a),(0,e.useMethodDecorators)(Rr(400).Description("<File too long | Too many parts | Too many files | Field name too long | Field value too long | Too many fields | Unexpected field> [fieldName] Example: File too long file1"),fr("multipart/form-data")))(...r)}}function Pr(e,t){return Rr().Location(e,t)}function wr(t){return Ce(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(wr,s);r.operation.operationId(t)}))}function $r(t,r="/"){return Ce(((s,n)=>{if(s.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType($r,n);s.operation.addOperationPath(t.toUpperCase(),r)}))}function _r(){return Rt("partial")}function Mr(t){return Ce(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.CLASS)throw new e.UnsupportedDecoratorType(Mr,s);r.path=t}))}function Nr(...t){const{status:r,url:s,meta:n}=t.reduce(((t,r)=>(0,e.isNumber)(r)?(t.status=r,t):(0,e.isString)(r)?(t.url=r,t):(t.meta=r,t)),{status:302,url:"",meta:{}});return(0,e.useDecorators)(Rr(r).Location(s,n),Ce((e=>{e.operation?.setRedirection(r)})))}function Dr(e){let t,r;const s=e.filter((e=>"string"==typeof e&&ve.includes(e.toLowerCase())?(t=e.toLocaleUpperCase(),!1):"string"==typeof e||e instanceof RegExp?(r=e||"/",!1):!!e));return{path:r,method:t,use:s}}class Lr extends yr{methods=["name","description","summary","method","id","use","useAfter","useBefore"];beforeInit(){const e=this.get("path"),t=xe[this.get("method")]||xe.CUSTOM;e&&this.entity.operation.addOperationPath(t,e)}onMapKey(e,t){switch(e){case"name":case"id":return void this.entity.operation.operationId(t);case"summary":return void this.entity.operation.summary(t);case"description":return void this.entity.operation.description(t);case"use":return void this.entity.use(t);case"useAfter":return void this.entity.after(t);case"useBefore":return void this.entity.before(t)}return super.onMapKey(e,t)}}function kr(...e){const t=Dr(e);return new Lr(t).build()}function Ir(e="/",...t){return kr(...[xe.ALL,e].concat(t))}function Hr(e="/",...t){return kr(...[xe.GET,e].concat(t))}function jr(e="/",...t){return kr(...[xe.POST,e].concat(t))}function Gr(e="/",...t){return kr(...[xe.PUT,e].concat(t))}function qr(e="/",...t){return kr(...[xe.DELETE,e].concat(t))}function Ur(e="/",...t){return kr(...[xe.HEAD,e].concat(t))}function Jr(e="/",...t){return kr(...[xe.PATCH,e].concat(t))}function Kr(e="/",...t){return kr(...[xe.OPTIONS,e].concat(t))}function Br(t,...r){return Ce(((s,n)=>{switch(s.decoratorType){case e.DecoratorTypes.METHOD:s.operation.addSecurityScopes(t,r);break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(n[0],Br(t,...r));break;default:throw new e.UnsupportedDecoratorType(Br,n)}}))}function Fr(e,t){return Rr(e,t)}function Wr(t){return Ce(((r,s)=>{if(r.decoratorType!==e.DecoratorTypes.METHOD)throw new e.UnsupportedDecoratorType(Wr,s);r.operation.summary(t)}))}function Vr(...t){return Ce(((r,s)=>{switch(r.decoratorType){case e.DecoratorTypes.METHOD:r.operation.addTags(function(e){return e.map((e=>"string"==typeof e?{name:e}:e))}(t));break;case e.DecoratorTypes.CLASS:(0,e.decorateMethodsOf)(s[0],Vr(...t));break;default:throw new e.UnsupportedDecoratorType(Vr,s)}}))}function Xr(t,r){return(0,e.StoreSet)("view",{path:t,options:r})}class zr extends Map{setOperationPath(e){if(e.method!==xe.CUSTOM){const t=this.getKey(e.method,e.path);this.set(t,e)}}getKey=(e,t)=>`${e}-${t}`}function Qr(e,t){if(e instanceof RegExp||t instanceof RegExp){if(!e)return t;if(!t)return e;const r=e instanceof RegExp?e:new RegExp(e,"gi"),s=t instanceof RegExp?t:new RegExp(t,"gi");return new RegExp(r.source+s.source,(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":""))}e&&t&&e.endsWith("/")&&t.startsWith("/")&&(t=t.slice(1));const r=(e||"")+(t||"");return r.endsWith("/")&&r.length>1?r.slice(0,-1):r}class Yr{token;endpoint;operationPath;basePath;paramsTypes;constructor(e){Object.assign(this,e),this.paramsTypes=this.endpoint.getParamTypes()}get url(){return this.fullPath}get path(){return this.operationPath?.path}get fullPath(){return Qr(this.basePath,this.path)}get method(){return this.operationPath?.method||"USE"}get name(){return`${this.endpoint.targetName}.${this.methodClassName}()`}get className(){return this.endpoint.targetName}get methodClassName(){return this.propertyKey}get parameters(){return this.endpoint.parameters}get propertyKey(){return String(this.endpoint.propertyKey)}get propertyName(){return this.endpoint.propertyName}get store(){return this.endpoint.store}get operation(){return this.endpoint.operation}get operationId(){return this.operation.get("operationId")||this.endpoint.propertyKey}has(e){return this.paramsTypes[e]}}function Zr(e){return e.split("/").filter(Boolean).join("/")}function es(e,t){return e.map((e=>t.parameters.find((t=>t.in===e.in&&t.name===e.name))||e)).concat(...t.parameters.filter((e=>"path"!==e.in)))}function ts(e){const t=e.isStore?e:se(e);if(!t.$operations){const e=new zr;t.$operations=new Map,ce(t).forEach((e=>{e.children.forEach((e=>{e instanceof te&&!t.$operations.has(e.propertyKey)&&t.$operations.set(e.propertyKey,e)}))})),t.$operations.forEach((t=>{t.operation.operationPaths.forEach((t=>{e.setOperationPath(t)}))})),e.clear()}return t.$operations}function rs(e,t=""){t instanceof RegExp&&(t=t.toString().replace(/^\//g,"").replace(/\/$/g,"").replace(/\\/g,""));const r=[],s=[];let n=!1,i="";return function(e){let t=0;return e.split("").filter((e=>{"("===e&&t++;const r=0===t;return")"===e&&t--,r})).join("").split("/").filter((e=>!!e))}(`${e}${t}`).map((e=>{const t=e.replace(":","").replace("?","");if(e.includes(":")){const o=e.includes("?");o&&!n&&(n=!0,s.push({path:i,parameters:[].concat(r)}));const{prefix:a,name:c,postfix:u}=function(e){const[t,r]=e.split("="),s=(r||t).split(".");return{prefix:r&&t?`${t}=`:"",name:s.splice(0,1)[0],postfix:s.length?`.${s.join(".")}`:""}}(t);i+=`/${a}{${c}}${u}`,r.push({in:"path",name:c,type:"string",required:!0}),o&&n&&s.push({path:i,parameters:[].concat(r)})}else i+=`/${e}`})),s.length?s:[{path:i,parameters:[].concat(r)}]}function ss(e,t,{rootPath:r,specType:s,operationId:n,defaultTags:i,tags:o,path:a,method:c}){const u=rs(r,a).map((({path:e,parameters:t})=>(e=e||"/",s===$.OPENAPI&&(t=t.map((({type:e,...t})=>({...t,schema:{type:e}})))),{path:e,parameters:t})));return u.reduce(((e,{path:r,parameters:s})=>{s=es(s,t),r=r||"/";const a=t.tags?.length?t.tags:[i];return e.paths[r]={...e.paths[r],[c.toLowerCase()]:{operationId:t.operationId||n(r),...t,tags:a.map((({name:e})=>e)),parameters:s}},o.push(...a),e}),e)}function ns(e=""){const t=new Map;return(r,s,n="")=>{const i=((t,r)=>{const s=(e||"%c.%m").replace(/%c/,t).replace(/%m/,r);return""===e?(0,M.camelCase)(s):s})(r,s),o=r+s;if(!t.has(o))return t.set(o,0),i;const a=n.match(/{(\w+)}/gi);if(a){const e=r+s+a[0];if(!t.has(e))return t.set(e,0),(0,M.camelCase)(`${i} By ${a}`)}const c=t.get(o)+1;return t.set(o,c),`${i}_${c}`}}const is=(0,e.mergeReducerBuilder)(((e,t)=>e.type&&e.type===t.type||e.$ref&&e.$ref===t.$ref)),os=(0,e.mergeReducerBuilder)(((e,t)=>e.in===t.in&&e.name===t.name)),as=(0,e.mergeReducerBuilder)(((e,t)=>!!Object.keys(t).find((t=>!!e[t])))),cs=(0,e.mergeReducerBuilder)(((e,t)=>e.name===t.name)),us={security:as,parameters:os,oneOf:is,anyOf:is,allOf:is,tags:cs};function ps(t,r){return(0,e.deepMerge)(t,r,{reducers:us,cleanUndefinedProps:!0})}const hs=new Map;function ls(t,r={}){if(r={...r,operationIdFormatter:r.operationIdFormatter||ns(r.operationIdPattern),root:!1},(0,e.isArray)(t)){let e={};return r={...r,specType:$.OPENAPI,paths:{},tags:[],schemas:{},append(t){e=ps(e,t)}},t.forEach((({token:e,...t})=>{const s=ls(e,{...r,...t});r.append(s)})),e}return function(e,t,r){hs.has(e)||hs.set(e,new Map);const s=hs.get(e),n=JSON.stringify(t);return s.has(n)||s.set(n,r()),s.get(n)}(t,r,(()=>function(t,r){const s=se(t),{schemas:n={},paths:i={},rootPath:o="/",tags:a=[]}=r,c=$.OPENAPI,u=s.path,p=(0,e.cleanObject)({name:s.schema.getName(),description:s.schema.get("description")}),h={paths:i};return ts(t).forEach((e=>{if(e.store.get("hidden"))return;const t=e.operation.toJSON({...r,specType:c,schemas:n});e.operation.operationPaths.forEach((({path:s,method:n})=>{n&&ss(h,t,{rootPath:Zr(o+u),path:s,method:n,defaultTags:p,tags:a,specType:c,operationId:t=>r.operationIdFormatter(e.parent.schema.get("name")||e.parent.targetName,e.propertyName,t)})}))})),h.tags=(0,e.uniqBy)(a,"name"),Object.keys(n).length&&(h.components={schemas:n}),h}(t,r)))}function ms(e){return e.startsWith("3.")?$.OPENAPI:$.SWAGGER}function ds(e){return"openapi"in e?$.OPENAPI:$.SWAGGER}function fs(t){const{title:r,description:s,version:n,termsOfService:i,contact:o,license:a}=t;return(0,e.cleanObject)({version:n,title:r,description:s,termsOfService:i,contact:o,license:a})}function ys(t,{version:r,specVersion:s,acceptMimes:n=["application/json"]}){const{paths:i,security:o,tags:a,host:c,basePath:u,schemes:p,consumes:h=[],produces:l=["application/json"],definitions:m,parameters:d,responses:f,securityDefinitions:y,externalDocs:g}=t;return{swagger:s,consumes:(0,e.uniq)([...n,...h]),produces:(0,e.uniq)([...l]),info:fs((0,e.getValue)(t,"info",{})),paths:i,host:c,basePath:u,schemes:p,definitions:m,parameters:d,responses:f,security:o,securityDefinitions:y,tags:a,externalDocs:g}}function gs(t,{specVersion:r}){const{servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}=t;return{openapi:r,info:fs((0,e.getValue)(t,"info",{})),servers:s,paths:n,components:i,security:o,tags:a,externalDocs:c}}function Os(t,{fileSpec:r,acceptMimes:s,specVersion:n,version:i}){const o={specVersion:n=n||(0,e.getValue)(t,"openapi",(0,e.getValue)(t,"swagger","2.0")),acceptMimes:s};switch(ms(n)){case $.OPENAPI:t=gs(t,o),r=r?gs(r,o):r;break;default:case $.SWAGGER:t=ys(t,o),r=r?ys(r,o):r}return t=ps(t,r),(0,e.setValue)(t,"info.title",(0,e.getValue)(t,"info.title","Api documentation")),(0,e.setValue)(t,"info.version",(0,e.getValue)(t,"info.version",i)),t}const Ss=["get","put","post","delete","options","head","patch","trace"],bs=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],Ts=["type","items"],Rs=/^(application\/json|[^;\/ \t]+\/[^;\/ \t]+[+]json)[ \t]*(;.*)?$/,As={APPLICATION_X_WWW_URLENCODED:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data"};function Es(e){if(Array.isArray(e))e.forEach(Es);else if("object"==typeof e)for(let t in e)"$ref"===t?e.$ref=e.$ref.replace("#/components/schemas/","#/definitions/").replace("#/components/","#/x-components/"):Es(e[t])}function vs(e){return new RegExp(Rs,"i").test(e)}function xs(e){const t=Object.keys(As).map((e=>As[e]));return Object.keys(e).filter((e=>t.indexOf(e)>-1||vs(e)))}function Cs(e){function t(e){const{scheme:t,type:r,name:s,bearerFormat:n,flows:i,...o}=e;switch(r){case"http":if("basic"===t)return{...o,type:t};if("bearer"===t)return{...o,type:"apiKey",name:"Authorization",in:"header"};break;case"oauth2":const e=Object.keys(i)[0],s=i[e];let n=e;return"clientCredentials"===n?n="application":"authorizationCode"===n&&(n="accessCode"),{type:r,flow:n,authorizationUrl:s.authorizationUrl,tokenUrl:s.tokenUrl,scopes:s.scopes}}}return Object.entries(e).reduce(((e,[r,s])=>({...e,[r]:t(s)})),{})}function Ps(e){let t=e.url;const r=e.variables||{};for(const e in r){const s=r[e]||{};if(s.default){const r=RegExp(`{${e}}`,"g");t=t.replace(r,s.default)}}const s=new URL(t);return{host:s.host?s.host:void 0,basePath:s.pathname,schemes:null!==s.protocol?[s.protocol.substring(0,s.protocol.length-1)]:void 0}}class ws{spec;constructor(e){this.spec=JSON.parse(JSON.stringify(e))}convertInfos(){const e=this.spec.servers&&this.spec.servers[0];return e?Ps(e):{}}resolveReference(e,t,r){if(!t||!t.$ref)return t;const s=t.$ref;if(s.startsWith("#")){const t=s.split("/").map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~")));t.shift();let n=e;return t.forEach((e=>{n=n[e]})),r?JSON.parse(JSON.stringify(n)):n}}convert(){const t={swagger:"2.0",...this.convertInfos(),paths:this.spec.paths?this.convertOperations(this.spec.paths,this.spec):void 0};return this.spec.components&&(this.convertSchemas(),this.convertSecurityDefinitions(),this.spec["x-components"]=this.spec.components,delete this.spec.components,Es(this.spec)),delete this.spec.servers,delete this.spec.openapi,delete this.spec["x-components"],(0,e.cleanObject)({...t,...this.spec})}convertOperations(e,t){return Object.entries(e).reduce(((e,[r,s])=>{const n=e[r]=this.resolveReference({...t,paths:e},s,!0);return this.convertParameters(n),Object.keys(n).forEach((r=>{if(Ss.indexOf(r)>=0){const s=n[r]=this.resolveReference({...t,paths:e},n[r],!0);this.convertOperationParameters(s),this.convertResponses(s)}})),e}),e)}convertOperationParameters(e){let t,r,s,n;if(e.parameters=e.parameters||[],e.requestBody){let i=this.resolveReference(this.spec,e.requestBody,!0);if(e.requestBody.content){const t=xs(e.requestBody.content)[0],r={content:{}},s=e.requestBody.content[t];s&&s.schema&&s.schema.$ref&&!s.schema.$ref.startsWith("#")&&(i=this.resolveReference(this.spec,s.schema,!0),r.content[`${t}`]={schema:i},i=r)}if(i.name="body",t=i.content,t&&Object.keys(t).length){if(s=Object.keys(t).filter((e=>e.indexOf("/")>0)),n=s.filter((e=>e.indexOf("*")<0)),r=xs(t)[0],delete i.content,[As.APPLICATION_X_WWW_URLENCODED,As.MULTIPART_FORM_DATA].includes(r))if(e.consumes=n,i.in="formData",i.schema=t[r].schema,i.schema=this.resolveReference(this.spec,i.schema,!0),"object"===i.schema.type&&i.schema.properties){const t=i.schema.required||[];Object.keys(i.schema.properties).forEach((r=>{const s=i.schema.properties[r];if(!s.readOnly){const n={name:r,in:"formData",schema:s};t.indexOf(r)>=0&&(n.required=!0),e.parameters?.push(n)}}))}else e.parameters.push(i);else r?(e.consumes=n,i.in="body",i.schema=t[r].schema,e.parameters.push(i)):s&&(e.consumes=n||["application/octet-stream"],i.in="body",i.name=i.name||"file",delete i.type,i.schema=t[s[0]].schema||{type:"string",format:"binary"},e.parameters.push(i));i.schema&&this.convertSchema(i.schema,"request")}delete e.requestBody}this.convertParameters(e)}convertParameters(e){void 0!==e.parameters&&(e.parameters=e.parameters||[],(e.parameters||[]).forEach(((t,r)=>{if("body"!==(t=e.parameters[r]=this.resolveReference(this.spec,t,!1)).in){if(this.copySchemaProperties(t,bs),this.copySchemaProperties(t,Ts),this.copySchemaXProperties(t),!t.description){const e=this.resolveReference(this.spec,t.schema,!1);e&&e.description&&(t.description=e.description)}void 0!==t.example&&(t["x-example"]=t.example),delete t.schema,delete t.allowReserved,delete t.example}if("array"===t.type)switch(t.style||("query"===t.in||"cookie"===t.in?"form":"simple")){case"matrix":t.collectionFormat=t.explode?void 0:"csv";break;case"label":t.collectionFormat=void 0;break;case"simple":t.collectionFormat="csv";break;case"spaceDelimited":t.collectionFormat="ssv";break;case"pipeDelimited":t.collectionFormat="pipes";break;case"deepOpbject":t.collectionFormat="multi";break;case"form":t.collectionFormat=!1===t.explode?"csv":"multi"}delete t.style,delete t.explode})))}copySchemaProperties(e,t){let r=this.resolveReference(this.spec,e.schema,!0);r&&t.forEach((t=>{const s=r[t];"additionalProperties"===t&&"boolean"==typeof s||void 0!==s&&(e[t]=s)}))}copySchemaXProperties(e){let t=this.resolveReference(this.spec,e.schema,!0);t&&Object.keys(t).forEach((r=>{Reflect.hasOwnProperty.call(t,r)&&!Reflect.hasOwnProperty.call(e,r)&&r.startsWith("x-")&&(e[r]=t[r])}))}convertResponses(e){Object.keys(e.responses||{}).forEach((t=>{const r=e.responses[t]=this.resolveReference(this.spec,e.responses[t],!0);if(r.content){let t=null,s=null;if(Object.keys(r.content).forEach((n=>{const i=n.indexOf("*")<0?n:"application/octet-stream";e.produces?e.produces.indexOf(i)<0&&e.produces.push(i):e.produces=[i];const o=r.content[n];t=t||o.schema,!s&&vs(i)&&(s=o.schema),o.example&&(r.examples=r.examples||{},r.examples[i]=o.example)})),t){r.schema=s||t;const e=this.resolveReference(this.spec,r.schema,!0);e&&r.schema.$ref&&!r.schema.$ref.startsWith("#")&&(r.schema=e),this.convertSchema(r.schema,"response")}}Object.keys(r.headers||{}).forEach((e=>{const t=this.resolveReference(this.spec,r.headers[e],!0);t.schema&&(t.type=t.schema.type,t.format=t.schema.format,delete t.schema),r.headers[e]=t})),delete r.content}))}convertSchema(e,t){if(e.oneOf&&(delete e.oneOf,e.discriminator&&delete e.discriminator),e.anyOf&&(delete e.anyOf,e.discriminator&&delete e.discriminator),e.allOf)for(const r in e.allOf)this.convertSchema(e.allOf[r],t);switch(e.discriminator&&(e.discriminator.mapping&&this.convertDiscriminatorMapping(e.discriminator.mapping),e.discriminator=e.discriminator.propertyName),e.type){case"object":e.properties&&Object.keys(e.properties).forEach((r=>{!0===e.properties[r].writeOnly&&"response"===t?delete e.properties[r]:(this.convertSchema(e.properties[r],t),delete e.properties[r].writeOnly)}));break;case"array":e.items&&this.convertSchema(e.items,t)}e.nullable&&(e["x-nullable"]=!0,delete e.nullable),void 0!==e.deprecated&&(void 0===e["x-deprecated"]&&(e["x-deprecated"]=e.deprecated),delete e.deprecated)}convertSchemas(){this.spec.definitions=this.spec.components.schemas,Object.keys(this.spec.definitions||{}).forEach((e=>{this.convertSchema(this.spec.definitions[e])})),delete this.spec.components.schemas}convertDiscriminatorMapping(e){Object.keys(e).forEach((t=>{const r=e[t];if("string"!=typeof r)return void console.warn(`Ignoring ${r} for ${t} in discriminator.mapping.`);let s;if(/^[a-zA-Z0-9._-]+$/.test(r))try{s=this.resolveReference(this.spec,{$ref:`#/components/schemas/${r}`},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} as schema name in discriminator.mapping: ${e}`)}if(!s)try{s=this.resolveReference(this.spec,{$ref:r},!1)}catch(e){console.debug(`Error resolving ${r} for ${t} in discriminator.mapping: ${e}`)}s?(s["x-discriminator-value"]=t,s["x-ms-discriminator-value"]=t):console.warn(`Unable to resolve ${r} for ${t} in discriminator.mapping.`)}))}convertSecurityDefinitions(){this.spec.components.securitySchemes&&(this.spec.securityDefinitions=Cs(this.spec.components.securitySchemes),delete this.spec.components.securitySchemes)}}function $s(e){return new ws(e).convert()}async function _s({tokens:t,...r}){const{version:s="1.0.0",acceptMimes:n,specPath:i,specVersion:o}=r,a=Os((0,e.getValue)(r,"spec",{}),{fileSpec:{},version:s,specVersion:o,acceptMimes:n}),c=ds(a),u=ps(a,ls(t,r));return c===$.SWAGGER?$s(u):u}const Ms="$cache:schemes";function Ns(e,t={}){const r=se(e);return t={endpoint:!0,groups:[],...t,specType:t.specType||$.JSON,schemas:{}},"parameter"===r.decoratorType&&(t={...t,genericTypes:r.nestedGenerics[0],nestedGenerics:r.nestedGenerics,groups:r.parameter?.groups}),function(e,t){const r=e.store.get(Ms)||new Map,s=function(e){return JSON.stringify(e)}(t);if(!r.has(s)){const n=o("schema",e.schema,t);Object.keys(t.schemas).length&&(n.definitions=t.schemas),r.set(s,n)}return e.store.set(Ms,r),r.get(s)}(r,t)}function Ds(e,t={}){const r=e.isStore?e:se(e),s=Qr(t.basePath,r.path);let n=[];return t.withChildren&&(n=r.get("childrenControllers",[]).reduce(((e,r)=>e.concat(Ds(r,{...t,basePath:s}))),n)),[...ts(e).values()].reduce(((t,r)=>{const{operation:n}=r;return n&&n.operationPaths.forEach((n=>{t.push(new Yr({basePath:s,token:e,endpoint:r,operationPath:n}))})),t}),n)}function Ls(e){const t=e.isStore?e:se(e);if(!t.$properties){const e=ce(t);t.$properties=new Map,e.forEach((e=>{e.children.forEach((e=>{t.$properties.has(e.propertyKey)||t.$properties.set(e.propertyKey,e)}))}))}return t.$properties}function ks(e,t={}){const r=Ls(e),s=new Map;return r.forEach(((e,r)=>{!t.withIgnoredProps&&me(e.itemSchema,t)||s.set(r,e)})),s}})(),i})()));
3
3
  //# sourceMappingURL=schema.umd.min.js.map