adorn-api 1.0.22 → 1.0.24

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 (380) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.cjs +30 -0
  3. package/README.md +375 -531
  4. package/dist/core/express-adapter.d.ts +27 -0
  5. package/dist/core/express-adapter.d.ts.map +1 -0
  6. package/dist/core/express-adapter.js +146 -0
  7. package/dist/core/express-adapter.js.map +1 -0
  8. package/dist/core/http-error.d.ts +7 -0
  9. package/dist/core/http-error.d.ts.map +1 -0
  10. package/dist/core/http-error.js +14 -0
  11. package/dist/core/http-error.js.map +1 -0
  12. package/dist/decorators/controller.decorator.d.ts +2 -0
  13. package/dist/decorators/controller.decorator.d.ts.map +1 -0
  14. package/dist/decorators/controller.decorator.js +26 -0
  15. package/dist/decorators/controller.decorator.js.map +1 -0
  16. package/dist/decorators/create.decorator.d.ts +8 -0
  17. package/dist/decorators/create.decorator.d.ts.map +1 -0
  18. package/dist/decorators/create.decorator.js +67 -0
  19. package/dist/decorators/create.decorator.js.map +1 -0
  20. package/dist/decorators/http-method.decorator.d.ts +16 -0
  21. package/dist/decorators/http-method.decorator.d.ts.map +1 -0
  22. package/dist/decorators/http-method.decorator.js +117 -0
  23. package/dist/decorators/http-method.decorator.js.map +1 -0
  24. package/dist/decorators/http-params.d.ts +17 -0
  25. package/dist/decorators/http-params.d.ts.map +1 -0
  26. package/dist/decorators/http-params.js +26 -0
  27. package/dist/decorators/http-params.js.map +1 -0
  28. package/dist/decorators/index.d.ts +10 -5
  29. package/dist/decorators/index.d.ts.map +1 -1
  30. package/dist/decorators/index.js +14 -0
  31. package/dist/decorators/index.js.map +1 -0
  32. package/dist/decorators/list.decorator.d.ts +18 -0
  33. package/dist/decorators/list.decorator.d.ts.map +1 -0
  34. package/dist/decorators/list.decorator.js +99 -0
  35. package/dist/decorators/list.decorator.js.map +1 -0
  36. package/dist/decorators/middleware.decorator.d.ts +4 -0
  37. package/dist/decorators/middleware.decorator.d.ts.map +1 -0
  38. package/dist/decorators/middleware.decorator.js +34 -0
  39. package/dist/decorators/middleware.decorator.js.map +1 -0
  40. package/dist/decorators/response.decorator.d.ts +8 -0
  41. package/dist/decorators/response.decorator.d.ts.map +1 -0
  42. package/dist/decorators/response.decorator.js +44 -0
  43. package/dist/decorators/response.decorator.js.map +1 -0
  44. package/dist/decorators/route-options.d.ts +14 -0
  45. package/dist/decorators/route-options.d.ts.map +1 -0
  46. package/dist/decorators/route-options.js +22 -0
  47. package/dist/decorators/route-options.js.map +1 -0
  48. package/dist/decorators/schema.decorator.d.ts +82 -0
  49. package/dist/decorators/schema.decorator.d.ts.map +1 -0
  50. package/dist/decorators/schema.decorator.js +123 -0
  51. package/dist/decorators/schema.decorator.js.map +1 -0
  52. package/dist/decorators/update.decorator.d.ts +8 -0
  53. package/dist/decorators/update.decorator.d.ts.map +1 -0
  54. package/dist/decorators/update.decorator.js +63 -0
  55. package/dist/decorators/update.decorator.js.map +1 -0
  56. package/dist/index.d.ts +11 -13
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +18 -637
  59. package/dist/index.js.map +1 -1
  60. package/dist/metadata/metadata-storage.d.ts +38 -0
  61. package/dist/metadata/metadata-storage.d.ts.map +1 -0
  62. package/dist/metadata/metadata-storage.js +102 -0
  63. package/dist/metadata/metadata-storage.js.map +1 -0
  64. package/dist/metal-orm-integration/dto-helper.d.ts +5 -0
  65. package/dist/metal-orm-integration/dto-helper.d.ts.map +1 -0
  66. package/dist/metal-orm-integration/dto-helper.js +48 -0
  67. package/dist/metal-orm-integration/dto-helper.js.map +1 -0
  68. package/dist/metal-orm-integration/dto-response.decorator.d.ts +4 -0
  69. package/dist/metal-orm-integration/dto-response.decorator.d.ts.map +1 -0
  70. package/dist/metal-orm-integration/dto-response.decorator.js +69 -0
  71. package/dist/metal-orm-integration/dto-response.decorator.js.map +1 -0
  72. package/dist/metal-orm-integration/entity-schema-builder.d.ts +20 -0
  73. package/dist/metal-orm-integration/entity-schema-builder.d.ts.map +1 -0
  74. package/dist/metal-orm-integration/entity-schema-builder.js +356 -0
  75. package/dist/metal-orm-integration/entity-schema-builder.js.map +1 -0
  76. package/dist/metal-orm-integration/index.d.ts +5 -0
  77. package/dist/metal-orm-integration/index.d.ts.map +1 -0
  78. package/dist/metal-orm-integration/index.js +5 -0
  79. package/dist/metal-orm-integration/index.js.map +1 -0
  80. package/dist/metal-orm-integration/schema-modifier.d.ts +11 -0
  81. package/dist/metal-orm-integration/schema-modifier.d.ts.map +1 -0
  82. package/dist/metal-orm-integration/schema-modifier.js +62 -0
  83. package/dist/metal-orm-integration/schema-modifier.js.map +1 -0
  84. package/dist/openapi/index.d.ts +4 -0
  85. package/dist/openapi/index.d.ts.map +1 -0
  86. package/dist/openapi/index.js +4 -0
  87. package/dist/openapi/index.js.map +1 -0
  88. package/dist/openapi/openapi-generator.d.ts +22 -0
  89. package/dist/openapi/openapi-generator.d.ts.map +1 -0
  90. package/dist/openapi/openapi-generator.js +428 -0
  91. package/dist/openapi/openapi-generator.js.map +1 -0
  92. package/dist/openapi/swagger-ui.d.ts +11 -0
  93. package/dist/openapi/swagger-ui.d.ts.map +1 -0
  94. package/dist/openapi/swagger-ui.js +20 -0
  95. package/dist/openapi/swagger-ui.js.map +1 -0
  96. package/dist/openapi/zod-to-openapi.d.ts +4 -0
  97. package/dist/openapi/zod-to-openapi.d.ts.map +1 -0
  98. package/dist/openapi/zod-to-openapi.js +184 -0
  99. package/dist/openapi/zod-to-openapi.js.map +1 -0
  100. package/dist/types/common.d.ts +4 -0
  101. package/dist/types/common.d.ts.map +1 -0
  102. package/dist/types/common.js +2 -0
  103. package/dist/types/common.js.map +1 -0
  104. package/dist/types/controller.d.ts +14 -0
  105. package/dist/types/controller.d.ts.map +1 -0
  106. package/dist/types/controller.js +2 -0
  107. package/dist/types/controller.js.map +1 -0
  108. package/dist/types/metadata.d.ts +48 -0
  109. package/dist/types/metadata.d.ts.map +1 -0
  110. package/dist/types/metadata.js +2 -0
  111. package/dist/types/metadata.js.map +1 -0
  112. package/dist/types/openapi.d.ts +30 -0
  113. package/dist/types/openapi.d.ts.map +1 -0
  114. package/dist/types/openapi.js +2 -0
  115. package/dist/types/openapi.js.map +1 -0
  116. package/dist/validation/zod-adapter.d.ts +15 -0
  117. package/dist/validation/zod-adapter.d.ts.map +1 -0
  118. package/dist/validation/zod-adapter.js +61 -0
  119. package/dist/validation/zod-adapter.js.map +1 -0
  120. package/examples/basic/app.ts +15 -0
  121. package/examples/basic/index.ts +6 -0
  122. package/examples/basic/user.controller.ts +35 -0
  123. package/examples/basic/user.dtos.ts +23 -0
  124. package/examples/metal-orm-sqlite/app.ts +18 -0
  125. package/examples/metal-orm-sqlite/db.ts +90 -0
  126. package/examples/metal-orm-sqlite/index.ts +6 -0
  127. package/examples/metal-orm-sqlite/post.controller.ts +209 -0
  128. package/examples/metal-orm-sqlite/post.dtos.ts +78 -0
  129. package/examples/metal-orm-sqlite/post.entity.ts +24 -0
  130. package/examples/metal-orm-sqlite/user.controller.helpers.ts +305 -0
  131. package/examples/metal-orm-sqlite/user.controller.ts +231 -0
  132. package/examples/metal-orm-sqlite/user.dtos.ts +88 -0
  133. package/examples/metal-orm-sqlite/user.entity.ts +21 -0
  134. package/examples/metal-orm-sqlite-music/album.controller.ts +278 -0
  135. package/examples/metal-orm-sqlite-music/album.dtos.ts +85 -0
  136. package/examples/metal-orm-sqlite-music/album.entity.ts +28 -0
  137. package/examples/metal-orm-sqlite-music/app.ts +19 -0
  138. package/examples/metal-orm-sqlite-music/artist.controller.ts +272 -0
  139. package/examples/metal-orm-sqlite-music/artist.dtos.ts +68 -0
  140. package/examples/metal-orm-sqlite-music/artist.entity.ts +27 -0
  141. package/examples/metal-orm-sqlite-music/db.ts +148 -0
  142. package/examples/metal-orm-sqlite-music/index.ts +6 -0
  143. package/examples/metal-orm-sqlite-music/track.controller.ts +221 -0
  144. package/examples/metal-orm-sqlite-music/track.dtos.ts +82 -0
  145. package/examples/metal-orm-sqlite-music/track.entity.ts +27 -0
  146. package/examples/openapi/health.controller.ts +11 -0
  147. package/examples/openapi/health.dto.ts +7 -0
  148. package/examples/openapi/index.ts +12 -0
  149. package/examples/restful/app.ts +15 -0
  150. package/examples/restful/index.ts +9 -0
  151. package/examples/restful/task.controller.ts +118 -0
  152. package/examples/restful/task.dtos.ts +66 -0
  153. package/examples/restful/task.store.ts +95 -0
  154. package/examples/tsconfig.json +8 -0
  155. package/examples/utils/start-server.ts +56 -0
  156. package/package.json +33 -97
  157. package/scripts/run-example.js +29 -0
  158. package/src/adapter/express.ts +589 -0
  159. package/src/adapter/metal-orm/convention-overrides.ts +115 -0
  160. package/src/adapter/metal-orm/crud-dtos.ts +141 -0
  161. package/src/adapter/metal-orm/dto.ts +20 -0
  162. package/src/adapter/metal-orm/error-dtos.ts +51 -0
  163. package/src/adapter/metal-orm/field-builder.ts +185 -0
  164. package/src/adapter/metal-orm/filters.ts +52 -0
  165. package/src/adapter/metal-orm/index.ts +66 -0
  166. package/src/adapter/metal-orm/paged-dtos.ts +94 -0
  167. package/src/adapter/metal-orm/pagination.ts +28 -0
  168. package/src/adapter/metal-orm/types.ts +250 -0
  169. package/src/adapter/metal-orm/utils.ts +36 -0
  170. package/src/adapter/metal-orm.test.ts +439 -0
  171. package/src/core/__tests__/coerce.test.ts +39 -0
  172. package/src/core/__tests__/dto-compose.test.ts +68 -0
  173. package/src/core/__tests__/schema-builder.test.ts +82 -0
  174. package/src/core/coerce.ts +190 -0
  175. package/src/core/decorators.ts +645 -0
  176. package/src/core/errors.ts +55 -0
  177. package/src/core/metadata.ts +110 -0
  178. package/src/core/openapi.ts +282 -0
  179. package/src/core/schema-builder.ts +287 -0
  180. package/src/core/schema.ts +400 -0
  181. package/src/core/types.ts +14 -0
  182. package/src/e2e/http-error.e2e.test.ts +52 -0
  183. package/src/e2e/sqlite-metal-orm.e2e.test.ts +174 -0
  184. package/src/e2e/sqlite.e2e.test.ts +126 -0
  185. package/src/index.ts +8 -0
  186. package/tsconfig.eslint.json +7 -0
  187. package/tsconfig.json +18 -0
  188. package/vitest.config.ts +8 -0
  189. package/dist/adapter/express/auth.d.ts +0 -13
  190. package/dist/adapter/express/auth.d.ts.map +0 -1
  191. package/dist/adapter/express/bootstrap.d.ts +0 -40
  192. package/dist/adapter/express/bootstrap.d.ts.map +0 -1
  193. package/dist/adapter/express/coercion.d.ts +0 -102
  194. package/dist/adapter/express/coercion.d.ts.map +0 -1
  195. package/dist/adapter/express/index.d.ts +0 -6
  196. package/dist/adapter/express/index.d.ts.map +0 -1
  197. package/dist/adapter/express/merge.d.ts +0 -45
  198. package/dist/adapter/express/merge.d.ts.map +0 -1
  199. package/dist/adapter/express/openapi.d.ts +0 -66
  200. package/dist/adapter/express/openapi.d.ts.map +0 -1
  201. package/dist/adapter/express/router.d.ts +0 -10
  202. package/dist/adapter/express/router.d.ts.map +0 -1
  203. package/dist/adapter/express/swagger.d.ts +0 -18
  204. package/dist/adapter/express/swagger.d.ts.map +0 -1
  205. package/dist/adapter/express/types.d.ts +0 -110
  206. package/dist/adapter/express/types.d.ts.map +0 -1
  207. package/dist/adapter/express/validation.d.ts +0 -27
  208. package/dist/adapter/express/validation.d.ts.map +0 -1
  209. package/dist/cli/progress.d.ts +0 -122
  210. package/dist/cli/progress.d.ts.map +0 -1
  211. package/dist/cli.cjs +0 -4390
  212. package/dist/cli.cjs.map +0 -1
  213. package/dist/cli.d.ts +0 -3
  214. package/dist/cli.d.ts.map +0 -1
  215. package/dist/cli.js +0 -4371
  216. package/dist/cli.js.map +0 -1
  217. package/dist/compiler/analyze/index.d.ts +0 -5
  218. package/dist/compiler/analyze/index.d.ts.map +0 -1
  219. package/dist/compiler/analyze/scanControllers.d.ts +0 -88
  220. package/dist/compiler/analyze/scanControllers.d.ts.map +0 -1
  221. package/dist/compiler/cache/isStale.d.ts +0 -46
  222. package/dist/compiler/cache/isStale.d.ts.map +0 -1
  223. package/dist/compiler/cache/loadArtifacts.d.ts +0 -149
  224. package/dist/compiler/cache/loadArtifacts.d.ts.map +0 -1
  225. package/dist/compiler/cache/schema.d.ts +0 -32
  226. package/dist/compiler/cache/schema.d.ts.map +0 -1
  227. package/dist/compiler/cache/writeCache.d.ts +0 -14
  228. package/dist/compiler/cache/writeCache.d.ts.map +0 -1
  229. package/dist/compiler/gems.d.ts +0 -75
  230. package/dist/compiler/gems.d.ts.map +0 -1
  231. package/dist/compiler/generator/index.d.ts +0 -7
  232. package/dist/compiler/generator/index.d.ts.map +0 -1
  233. package/dist/compiler/generator/manifest.d.ts +0 -23
  234. package/dist/compiler/generator/manifest.d.ts.map +0 -1
  235. package/dist/compiler/generator/openapi.d.ts +0 -118
  236. package/dist/compiler/generator/openapi.d.ts.map +0 -1
  237. package/dist/compiler/graph/builder.d.ts +0 -24
  238. package/dist/compiler/graph/builder.d.ts.map +0 -1
  239. package/dist/compiler/graph/index.d.ts +0 -7
  240. package/dist/compiler/graph/index.d.ts.map +0 -1
  241. package/dist/compiler/graph/schemaGraph.d.ts +0 -67
  242. package/dist/compiler/graph/schemaGraph.d.ts.map +0 -1
  243. package/dist/compiler/graph/types.d.ts +0 -203
  244. package/dist/compiler/graph/types.d.ts.map +0 -1
  245. package/dist/compiler/index.d.ts +0 -12
  246. package/dist/compiler/index.d.ts.map +0 -1
  247. package/dist/compiler/ir/index.d.ts +0 -7
  248. package/dist/compiler/ir/index.d.ts.map +0 -1
  249. package/dist/compiler/ir/pipeline.d.ts +0 -82
  250. package/dist/compiler/ir/pipeline.d.ts.map +0 -1
  251. package/dist/compiler/ir/stages.d.ts +0 -40
  252. package/dist/compiler/ir/stages.d.ts.map +0 -1
  253. package/dist/compiler/ir/visitor.d.ts +0 -98
  254. package/dist/compiler/ir/visitor.d.ts.map +0 -1
  255. package/dist/compiler/manifest/emit.d.ts +0 -21
  256. package/dist/compiler/manifest/emit.d.ts.map +0 -1
  257. package/dist/compiler/manifest/format.d.ts +0 -119
  258. package/dist/compiler/manifest/format.d.ts.map +0 -1
  259. package/dist/compiler/manifest/index.d.ts +0 -6
  260. package/dist/compiler/manifest/index.d.ts.map +0 -1
  261. package/dist/compiler/runner/createProgram.d.ts +0 -24
  262. package/dist/compiler/runner/createProgram.d.ts.map +0 -1
  263. package/dist/compiler/runner/index.d.ts +0 -5
  264. package/dist/compiler/runner/index.d.ts.map +0 -1
  265. package/dist/compiler/schema/extractAnnotations.d.ts +0 -57
  266. package/dist/compiler/schema/extractAnnotations.d.ts.map +0 -1
  267. package/dist/compiler/schema/index.d.ts +0 -8
  268. package/dist/compiler/schema/index.d.ts.map +0 -1
  269. package/dist/compiler/schema/intersectionHandler.d.ts +0 -44
  270. package/dist/compiler/schema/intersectionHandler.d.ts.map +0 -1
  271. package/dist/compiler/schema/objectHandler.d.ts +0 -146
  272. package/dist/compiler/schema/objectHandler.d.ts.map +0 -1
  273. package/dist/compiler/schema/openapi.d.ts +0 -71
  274. package/dist/compiler/schema/openapi.d.ts.map +0 -1
  275. package/dist/compiler/schema/parameters.d.ts +0 -90
  276. package/dist/compiler/schema/parameters.d.ts.map +0 -1
  277. package/dist/compiler/schema/partitioner.d.ts +0 -85
  278. package/dist/compiler/schema/partitioner.d.ts.map +0 -1
  279. package/dist/compiler/schema/primitives.d.ts +0 -68
  280. package/dist/compiler/schema/primitives.d.ts.map +0 -1
  281. package/dist/compiler/schema/queryBuilderAnalyzer.d.ts +0 -76
  282. package/dist/compiler/schema/queryBuilderAnalyzer.d.ts.map +0 -1
  283. package/dist/compiler/schema/queryBuilderSchemaBuilder.d.ts +0 -13
  284. package/dist/compiler/schema/queryBuilderSchemaBuilder.d.ts.map +0 -1
  285. package/dist/compiler/schema/splitOpenapi.d.ts +0 -46
  286. package/dist/compiler/schema/splitOpenapi.d.ts.map +0 -1
  287. package/dist/compiler/schema/typeToJsonSchema.d.ts +0 -26
  288. package/dist/compiler/schema/typeToJsonSchema.d.ts.map +0 -1
  289. package/dist/compiler/schema/types.d.ts +0 -70
  290. package/dist/compiler/schema/types.d.ts.map +0 -1
  291. package/dist/compiler/schema/unionHandler.d.ts +0 -70
  292. package/dist/compiler/schema/unionHandler.d.ts.map +0 -1
  293. package/dist/compiler/transform/dedup.d.ts +0 -35
  294. package/dist/compiler/transform/dedup.d.ts.map +0 -1
  295. package/dist/compiler/transform/flatten.d.ts +0 -50
  296. package/dist/compiler/transform/flatten.d.ts.map +0 -1
  297. package/dist/compiler/transform/index.d.ts +0 -7
  298. package/dist/compiler/transform/index.d.ts.map +0 -1
  299. package/dist/compiler/transform/inline.d.ts +0 -46
  300. package/dist/compiler/transform/inline.d.ts.map +0 -1
  301. package/dist/compiler/validation/emitPrecompiledValidators.d.ts +0 -62
  302. package/dist/compiler/validation/emitPrecompiledValidators.d.ts.map +0 -1
  303. package/dist/compiler/validation/index.d.ts +0 -5
  304. package/dist/compiler/validation/index.d.ts.map +0 -1
  305. package/dist/decorators/Auth.d.ts +0 -22
  306. package/dist/decorators/Auth.d.ts.map +0 -1
  307. package/dist/decorators/Controller.d.ts +0 -17
  308. package/dist/decorators/Controller.d.ts.map +0 -1
  309. package/dist/decorators/Public.d.ts +0 -15
  310. package/dist/decorators/Public.d.ts.map +0 -1
  311. package/dist/decorators/Use.d.ts +0 -23
  312. package/dist/decorators/Use.d.ts.map +0 -1
  313. package/dist/decorators/methods.d.ts +0 -26
  314. package/dist/decorators/methods.d.ts.map +0 -1
  315. package/dist/express.cjs +0 -1186
  316. package/dist/express.cjs.map +0 -1
  317. package/dist/express.d.ts +0 -8
  318. package/dist/express.d.ts.map +0 -1
  319. package/dist/express.js +0 -1150
  320. package/dist/express.js.map +0 -1
  321. package/dist/http.d.ts +0 -33
  322. package/dist/http.d.ts.map +0 -1
  323. package/dist/index.cjs +0 -724
  324. package/dist/index.cjs.map +0 -1
  325. package/dist/metal/applyListQuery.d.ts +0 -100
  326. package/dist/metal/applyListQuery.d.ts.map +0 -1
  327. package/dist/metal/index.cjs +0 -278
  328. package/dist/metal/index.cjs.map +0 -1
  329. package/dist/metal/index.d.ts +0 -15
  330. package/dist/metal/index.d.ts.map +0 -1
  331. package/dist/metal/index.js +0 -243
  332. package/dist/metal/index.js.map +0 -1
  333. package/dist/metal/listQuery.d.ts +0 -26
  334. package/dist/metal/listQuery.d.ts.map +0 -1
  335. package/dist/metal/queryOptions.d.ts +0 -16
  336. package/dist/metal/queryOptions.d.ts.map +0 -1
  337. package/dist/metal/readMetalBag.d.ts +0 -69
  338. package/dist/metal/readMetalBag.d.ts.map +0 -1
  339. package/dist/metal/registerMetalEntities.d.ts +0 -26
  340. package/dist/metal/registerMetalEntities.d.ts.map +0 -1
  341. package/dist/metal/schemaFromEntity.d.ts +0 -41
  342. package/dist/metal/schemaFromEntity.d.ts.map +0 -1
  343. package/dist/metal/searchWhere.d.ts +0 -97
  344. package/dist/metal/searchWhere.d.ts.map +0 -1
  345. package/dist/metal/symbolMetadata.d.ts +0 -8
  346. package/dist/metal/symbolMetadata.d.ts.map +0 -1
  347. package/dist/runtime/auth/runtime.d.ts +0 -183
  348. package/dist/runtime/auth/runtime.d.ts.map +0 -1
  349. package/dist/runtime/metadata/bucket.d.ts +0 -2
  350. package/dist/runtime/metadata/bucket.d.ts.map +0 -1
  351. package/dist/runtime/metadata/key.d.ts +0 -2
  352. package/dist/runtime/metadata/key.d.ts.map +0 -1
  353. package/dist/runtime/metadata/read.d.ts +0 -2
  354. package/dist/runtime/metadata/read.d.ts.map +0 -1
  355. package/dist/runtime/metadata/types.d.ts +0 -95
  356. package/dist/runtime/metadata/types.d.ts.map +0 -1
  357. package/dist/runtime/polyfill.d.ts +0 -2
  358. package/dist/runtime/polyfill.d.ts.map +0 -1
  359. package/dist/runtime/upload.d.ts +0 -44
  360. package/dist/runtime/upload.d.ts.map +0 -1
  361. package/dist/runtime/validation/ajv.d.ts +0 -120
  362. package/dist/runtime/validation/ajv.d.ts.map +0 -1
  363. package/dist/runtime/validation/index.d.ts +0 -11
  364. package/dist/runtime/validation/index.d.ts.map +0 -1
  365. package/dist/schema/decorators.d.ts +0 -37
  366. package/dist/schema/decorators.d.ts.map +0 -1
  367. package/dist/schema/index.cjs +0 -214
  368. package/dist/schema/index.cjs.map +0 -1
  369. package/dist/schema/index.d.ts +0 -2
  370. package/dist/schema/index.d.ts.map +0 -1
  371. package/dist/schema/index.js +0 -163
  372. package/dist/schema/index.js.map +0 -1
  373. package/dist/scripts/adorn-example.cjs +0 -404
  374. package/dist/scripts/adorn-example.cjs.map +0 -1
  375. package/dist/utils/operationId.d.ts +0 -2
  376. package/dist/utils/operationId.d.ts.map +0 -1
  377. package/dist/utils/path.d.ts +0 -2
  378. package/dist/utils/path.d.ts.map +0 -1
  379. package/dist/utils/port.d.ts +0 -9
  380. package/dist/utils/port.d.ts.map +0 -1
@@ -1,183 +0,0 @@
1
- /**
2
- * Runtime authentication module for adorn-api.
3
- *
4
- * @remarks
5
- * This module provides interfaces and factory functions for implementing
6
- * authentication schemes in adorn-api. It includes utilities for Bearer JWT
7
- * authentication and API key authentication.
8
- *
9
- * @package
10
- */
11
- /**
12
- * Result of an authentication attempt.
13
- *
14
- * @remarks
15
- * Contains the authenticated principal (user/entity) and any granted scopes
16
- * that can be used for authorization decisions.
17
- *
18
- * @public
19
- */
20
- export interface AuthResult {
21
- /**
22
- * The authenticated principal (user object, token payload, etc.).
23
- */
24
- principal: any;
25
- /**
26
- * Array of scope strings granted to the principal.
27
- * Used for authorization checks.
28
- */
29
- scopes?: string[];
30
- }
31
- /**
32
- * Runtime interface for an authentication scheme.
33
- *
34
- * @remarks
35
- * Implement this interface to create custom authentication schemes.
36
- * Each scheme must provide methods for authentication, issuing challenges,
37
- * and optional authorization.
38
- *
39
- * @public
40
- */
41
- export interface AuthSchemeRuntime {
42
- /**
43
- * Unique name identifying this authentication scheme.
44
- */
45
- name: string;
46
- /**
47
- * Authenticate a request and return the result.
48
- *
49
- * @param req - The incoming request object
50
- * @returns Promise resolving to AuthResult if authenticated, null otherwise
51
- */
52
- authenticate(req: any): Promise<AuthResult | null>;
53
- /**
54
- * Send an authentication challenge to the client.
55
- *
56
- * @param res - The response object to send the challenge
57
- */
58
- challenge(res: any): void;
59
- /**
60
- * Authorize an authenticated principal against required scopes.
61
- *
62
- * @param auth - The authentication result
63
- * @param requiredScopes - Scopes required for the operation
64
- * @returns true if authorized, false otherwise
65
- */
66
- authorize?(auth: AuthResult, requiredScopes: string[]): boolean;
67
- }
68
- /**
69
- * Options for creating a Bearer JWT authentication runtime.
70
- *
71
- * @public
72
- */
73
- export interface BearerJwtRuntimeOptions {
74
- /**
75
- * Extract the Bearer token from a request.
76
- *
77
- * @param req - The incoming request object
78
- * @returns The token string, or undefined if not present
79
- */
80
- getToken: (req: any) => string | undefined;
81
- /**
82
- * Verify a JWT token and return its payload.
83
- *
84
- * @param token - The JWT token to verify
85
- * @returns Promise resolving to the token payload
86
- * @defaultvalue Async function that returns the token as payload
87
- */
88
- verify?: (token: string) => Promise<any>;
89
- /**
90
- * Extract scopes from a token payload.
91
- *
92
- * @param payload - The JWT payload
93
- * @returns Array of scope strings
94
- * @defaultvalue Function returning empty array
95
- */
96
- getScopes?: (payload: any) => string[];
97
- }
98
- /**
99
- * Options for creating an API key header authentication runtime.
100
- *
101
- * @public
102
- */
103
- export interface ApiKeyHeaderRuntimeOptions {
104
- /**
105
- * The name of the header containing the API key.
106
- */
107
- headerName: string;
108
- /**
109
- * Validate an API key and return the associated principal.
110
- *
111
- * @param key - The API key to validate
112
- * @returns Promise resolving to the principal (user/service) associated with the key
113
- */
114
- validate: (key: string) => Promise<any>;
115
- }
116
- /**
117
- * Creates a Bearer JWT authentication runtime.
118
- *
119
- * @remarks
120
- * This factory function creates an AuthSchemeRuntime for Bearer token authentication.
121
- * The implementation extracts the token from the Authorization header, verifies it,
122
- * and extracts scopes from the payload.
123
- *
124
- * @example
125
- * ```typescript
126
- * const bearerRuntime = createBearerJwtRuntime({
127
- * getToken: (req) => req.headers.authorization?.split(' ')[1],
128
- * verify: async (token) => jwt.verify(token, secret),
129
- * getScopes: (payload) => payload.scopes || []
130
- * });
131
- * ```
132
- *
133
- * @param options - Configuration options for the Bearer JWT runtime
134
- * @returns An AuthSchemeRuntime for Bearer authentication
135
- *
136
- * @public
137
- */
138
- export declare function createBearerJwtRuntime(options: BearerJwtRuntimeOptions): {
139
- name: string;
140
- /** @inheritdoc */
141
- authenticate(req: any): Promise<{
142
- principal: any;
143
- scopes: string[];
144
- } | null>;
145
- /** @inheritdoc */
146
- challenge(res: any): void;
147
- /** @inheritdoc */
148
- authorize(auth: AuthResult, requiredScopes: string[]): boolean;
149
- };
150
- /**
151
- * Creates an API key header authentication runtime.
152
- *
153
- * @remarks
154
- * This factory function creates an AuthSchemeRuntime for API key authentication.
155
- * The implementation extracts the API key from a specified header and validates it.
156
- *
157
- * @example
158
- * ```typescript
159
- * const apiKeyRuntime = createApiKeyHeaderRuntime({
160
- * headerName: "X-API-Key",
161
- * validate: async (key) => {
162
- * const user = await db.users.findByApiKey(key);
163
- * if (!user) throw new Error("Invalid API key");
164
- * return user;
165
- * }
166
- * });
167
- * ```
168
- *
169
- * @param options - Configuration options for the API key runtime
170
- * @returns An AuthSchemeRuntime for API key authentication
171
- *
172
- * @public
173
- */
174
- export declare function createApiKeyHeaderRuntime(options: ApiKeyHeaderRuntimeOptions): {
175
- name: string;
176
- /** @inheritdoc */
177
- authenticate(req: any): Promise<{
178
- principal: any;
179
- } | null>;
180
- /** @inheritdoc */
181
- challenge(res: any): void;
182
- };
183
- //# sourceMappingURL=runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/runtime/auth/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;IAEf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC;;O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.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bucket.d.ts","sourceRoot":"","sources":["../../../src/runtime/metadata/bucket.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=key.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../../src/runtime/metadata/key.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=read.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/runtime/metadata/read.ts"],"names":[],"mappings":""}
@@ -1,95 +0,0 @@
1
- /**
2
- * Runtime metadata types for adorn-api.
3
- *
4
- * @remarks
5
- * This module contains the type definitions used by the runtime metadata
6
- * system, including HTTP methods, route operations, and authentication metadata.
7
- *
8
- * @package
9
- */
10
- /**
11
- * Supported HTTP methods for route operations.
12
- *
13
- * @public
14
- */
15
- export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
16
- /**
17
- * Represents a single route operation registered on a controller.
18
- *
19
- * @public
20
- */
21
- export interface RouteOperation {
22
- /**
23
- * The HTTP method for this route.
24
- */
25
- httpMethod: HttpMethod;
26
- /**
27
- * The URL path pattern for this route (relative to controller base path).
28
- */
29
- path: string;
30
- /**
31
- * The name of the method on the controller class.
32
- */
33
- methodName: string;
34
- /**
35
- * Optional OpenAPI operation ID.
36
- */
37
- operationId?: string;
38
- /**
39
- * Array of middleware names or functions to apply to this route.
40
- */
41
- use?: Array<string | ExpressMw>;
42
- /**
43
- * Authentication configuration: "public" for open access, AuthMeta for protected.
44
- */
45
- auth?: AuthMeta | "public";
46
- }
47
- /**
48
- * Authentication metadata for a route.
49
- *
50
- * @public
51
- */
52
- export interface AuthMeta {
53
- /**
54
- * The authentication scheme name (e.g., "BearerAuth", "ApiKeyAuth").
55
- */
56
- scheme: string;
57
- /**
58
- * Required scopes for authorization. Empty array means any authenticated user.
59
- */
60
- scopes?: string[];
61
- /**
62
- * Whether authentication is optional for this route.
63
- */
64
- optional?: boolean;
65
- }
66
- /**
67
- * Type alias for Express middleware functions.
68
- *
69
- * @public
70
- */
71
- export type ExpressMw = (req: any, res: any, next: (err?: any) => void) => any;
72
- /**
73
- * Container for all decorator metadata on a controller class.
74
- *
75
- * @remarks
76
- * The AdornBucket is stored in class metadata and contains all route operations,
77
- * controller-level middleware, and base path configuration.
78
- *
79
- * @public
80
- */
81
- export interface AdornBucket {
82
- /**
83
- * Base path prefix for all routes in this controller.
84
- */
85
- basePath?: string;
86
- /**
87
- * Middleware to apply to all routes in this controller.
88
- */
89
- controllerUse?: Array<string | ExpressMw>;
90
- /**
91
- * Array of route operations defined on this controller.
92
- */
93
- ops: RouteOperation[];
94
- }
95
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/runtime/metadata/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,KAAK,GACL,MAAM,GACN,KAAK,GACL,OAAO,GACP,QAAQ,GACR,SAAS,GACT,MAAM,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,IAAI,KAAK,GAAG,CAAC;AAE/E;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAE1C;;OAEG;IACH,GAAG,EAAE,cAAc,EAAE,CAAC;CACvB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=polyfill.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"polyfill.d.ts","sourceRoot":"","sources":["../../src/runtime/polyfill.ts"],"names":[],"mappings":""}
@@ -1,44 +0,0 @@
1
- /**
2
- * Represents an uploaded file in the request.
3
- *
4
- * @remarks
5
- * This interface describes the structure of a file uploaded via multipart/form-data
6
- * requests. It provides metadata about the file as well as access to its contents
7
- * through a readable stream.
8
- *
9
- * @example
10
- * ```typescript
11
- * async function handleUpload(file: UploadFile) {
12
- * console.log(`Received file: ${file.filename}`);
13
- * console.log(`Type: ${file.mimeType}`);
14
- * console.log(`Size: ${file.size} bytes`);
15
- *
16
- * // Process the file stream
17
- * for await (const chunk of file.stream) {
18
- * // Handle chunk...
19
- * }
20
- * }
21
- * ```
22
- *
23
- * @public
24
- */
25
- export interface UploadFile {
26
- /**
27
- * The original filename as sent by the client.
28
- */
29
- filename: string;
30
- /**
31
- * The MIME type of the file (e.g., "image/png", "application/pdf").
32
- */
33
- mimeType: string;
34
- /**
35
- * The file size in bytes, if available.
36
- */
37
- size?: number;
38
- /**
39
- * A Node.js readable stream to read the file contents.
40
- * Use this to pipe, transform, or buffer the file data.
41
- */
42
- stream: NodeJS.ReadableStream;
43
- }
44
- //# sourceMappingURL=upload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/runtime/upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;CAC/B"}
@@ -1,120 +0,0 @@
1
- import Ajv from "ajv";
2
- /**
3
- * Runtime validation module using AJV.
4
- *
5
- * @remarks
6
- * This module provides validation utilities using the AJV JSON schema validator.
7
- * It includes interfaces for validation results, errors, and helper functions
8
- * for creating validators and formatting error messages.
9
- *
10
- * @package
11
- */
12
- /**
13
- * Represents a single validation error with details.
14
- *
15
- * @public
16
- */
17
- export interface ValidationError {
18
- /**
19
- * The JSON path to the invalid property.
20
- */
21
- path: string;
22
- /**
23
- * Human-readable error message.
24
- */
25
- message: string;
26
- /**
27
- * The AJV keyword that failed validation.
28
- */
29
- keyword: string;
30
- /**
31
- * Additional parameters from the validation error.
32
- */
33
- params: Record<string, unknown>;
34
- }
35
- /**
36
- * Result of a validation operation.
37
- *
38
- * @public
39
- */
40
- export interface ValidationResult {
41
- /**
42
- * Whether the data passed validation.
43
- */
44
- valid: boolean;
45
- /**
46
- * Array of validation errors if validation failed, null otherwise.
47
- */
48
- errors: ValidationError[] | null;
49
- }
50
- /**
51
- * Error thrown when request validation fails.
52
- *
53
- * @public
54
- */
55
- export declare class ValidationErrorResponse extends Error {
56
- /**
57
- * HTTP status code for validation errors.
58
- */
59
- statusCode: number;
60
- /**
61
- * Detailed validation errors.
62
- */
63
- errors: ValidationError[];
64
- /**
65
- * Creates a new ValidationErrorResponse.
66
- *
67
- * @param statusCode - HTTP status code (typically 400)
68
- * @param errors - Array of validation errors
69
- */
70
- constructor(statusCode: number, errors: ValidationError[]);
71
- }
72
- /**
73
- * Creates a configured AJV validator instance.
74
- *
75
- * @remarks
76
- * This function creates an AJV validator with adorn-api's default configuration,
77
- * including support for custom formats like "br-phone" for Brazilian phone numbers.
78
- *
79
- * @returns A configured AJV validator instance
80
- *
81
- * @example
82
- * ```typescript
83
- * const validator = createValidator();
84
- * const validate = validator.compile(mySchema);
85
- * const result = validate(myData);
86
- * ```
87
- *
88
- * @public
89
- */
90
- export declare function createValidator(): Ajv.Ajv;
91
- /**
92
- * Validates data against a JSON schema.
93
- *
94
- * @remarks
95
- * This function compiles the schema and validates the data, returning a
96
- * structured result with formatted error messages.
97
- *
98
- * @param ajv - The AJV validator instance
99
- * @param data - The data to validate
100
- * @param schema - The JSON schema to validate against
101
- * @param dataPath - Base path for error messages (default: "#")
102
- * @returns ValidationResult with validity and any errors
103
- *
104
- * @public
105
- */
106
- export declare function validateData(ajv: ReturnType<typeof createValidator>, data: unknown, schema: Record<string, unknown>, dataPath?: string): ValidationResult;
107
- /**
108
- * Formats validation errors into a structured API response.
109
- *
110
- * @remarks
111
- * This function converts validation errors into a format suitable for API
112
- * responses, grouping errors by their path.
113
- *
114
- * @param errors - Array of validation errors
115
- * @returns Formatted error response object
116
- *
117
- * @public
118
- */
119
- export declare function formatValidationErrors(errors: ValidationError[]): Record<string, unknown>;
120
- //# sourceMappingURL=ajv.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ajv.d.ts","sourceRoot":"","sources":["../../../src/runtime/validation/ajv.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAItB;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;CAClC;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,eAAe,EAAE,CAAC;IAE1B;;;;;OAKG;gBACS,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE;CAM1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,YAa9B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,EACvC,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,QAAQ,GAAE,MAAY,GACrB,gBAAgB,CAgBlB;AAqBD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAezF"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Re-exports all validation utilities.
3
- *
4
- * @remarks
5
- * This module re-exports the validation functionality provided by the AJV-based
6
- * validation system, including validation results, errors, and helper functions.
7
- *
8
- * @package
9
- */
10
- export * from "./ajv.js";
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,UAAU,CAAC"}
@@ -1,37 +0,0 @@
1
- declare const ADORN_META: unique symbol;
2
- interface SchemaFrag {
3
- [key: string]: unknown;
4
- }
5
- interface SchemaMetadata {
6
- schema: {
7
- props: Record<string, SchemaFrag[]>;
8
- };
9
- }
10
- type PropertyDecorator = (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => void;
11
- export declare function Schema(frag: SchemaFrag): PropertyDecorator;
12
- export declare function Min(n: number): PropertyDecorator;
13
- export declare function Max(n: number): PropertyDecorator;
14
- export declare function ExclusiveMin(n: number): PropertyDecorator;
15
- export declare function ExclusiveMax(n: number): PropertyDecorator;
16
- export declare function MinLength(n: number): PropertyDecorator;
17
- export declare function MaxLength(n: number): PropertyDecorator;
18
- export declare function Pattern(re: RegExp | string): PropertyDecorator;
19
- export declare function Format(fmt: string): PropertyDecorator;
20
- export declare function MinItems(n: number): PropertyDecorator;
21
- export declare function MaxItems(n: number): PropertyDecorator;
22
- export declare function MinProperties(n: number): PropertyDecorator;
23
- export declare function MaxProperties(n: number): PropertyDecorator;
24
- export declare function MultipleOf(n: number): PropertyDecorator;
25
- export declare function Example(value: unknown): PropertyDecorator;
26
- export declare function Examples(values: unknown[]): PropertyDecorator;
27
- export declare function Description(desc: string): PropertyDecorator;
28
- export declare function Enum<T extends string | number>(vals: T[]): PropertyDecorator;
29
- export declare function Const<T>(val: T): PropertyDecorator;
30
- export declare function Default<T>(val: T): PropertyDecorator;
31
- export declare function AdditionalProperties(value: boolean | Record<string, unknown>): PropertyDecorator;
32
- export declare function Closed(): PropertyDecorator;
33
- export declare function ClosedUnevaluated(): PropertyDecorator;
34
- export declare function Union(mode: "anyOf" | "oneOf" | "allOf"): ClassDecorator;
35
- export { ADORN_META };
36
- export type { SchemaFrag, SchemaMetadata };
37
- //# sourceMappingURL=decorators.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/schema/decorators.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,U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