adorn-api 1.0.23 → 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 (382) 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 -124
  210. package/dist/cli/progress.d.ts.map +0 -1
  211. package/dist/cli.cjs +0 -4622
  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 -4603
  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 -10
  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 -95
  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/serviceCallAnalyzer.d.ts +0 -102
  286. package/dist/compiler/schema/serviceCallAnalyzer.d.ts.map +0 -1
  287. package/dist/compiler/schema/splitOpenapi.d.ts +0 -46
  288. package/dist/compiler/schema/splitOpenapi.d.ts.map +0 -1
  289. package/dist/compiler/schema/typeToJsonSchema.d.ts +0 -26
  290. package/dist/compiler/schema/typeToJsonSchema.d.ts.map +0 -1
  291. package/dist/compiler/schema/types.d.ts +0 -70
  292. package/dist/compiler/schema/types.d.ts.map +0 -1
  293. package/dist/compiler/schema/unionHandler.d.ts +0 -70
  294. package/dist/compiler/schema/unionHandler.d.ts.map +0 -1
  295. package/dist/compiler/transform/dedup.d.ts +0 -35
  296. package/dist/compiler/transform/dedup.d.ts.map +0 -1
  297. package/dist/compiler/transform/flatten.d.ts +0 -50
  298. package/dist/compiler/transform/flatten.d.ts.map +0 -1
  299. package/dist/compiler/transform/index.d.ts +0 -7
  300. package/dist/compiler/transform/index.d.ts.map +0 -1
  301. package/dist/compiler/transform/inline.d.ts +0 -46
  302. package/dist/compiler/transform/inline.d.ts.map +0 -1
  303. package/dist/compiler/validation/emitPrecompiledValidators.d.ts +0 -62
  304. package/dist/compiler/validation/emitPrecompiledValidators.d.ts.map +0 -1
  305. package/dist/compiler/validation/index.d.ts +0 -5
  306. package/dist/compiler/validation/index.d.ts.map +0 -1
  307. package/dist/decorators/Auth.d.ts +0 -22
  308. package/dist/decorators/Auth.d.ts.map +0 -1
  309. package/dist/decorators/Controller.d.ts +0 -17
  310. package/dist/decorators/Controller.d.ts.map +0 -1
  311. package/dist/decorators/Public.d.ts +0 -15
  312. package/dist/decorators/Public.d.ts.map +0 -1
  313. package/dist/decorators/Use.d.ts +0 -23
  314. package/dist/decorators/Use.d.ts.map +0 -1
  315. package/dist/decorators/methods.d.ts +0 -26
  316. package/dist/decorators/methods.d.ts.map +0 -1
  317. package/dist/express.cjs +0 -1186
  318. package/dist/express.cjs.map +0 -1
  319. package/dist/express.d.ts +0 -8
  320. package/dist/express.d.ts.map +0 -1
  321. package/dist/express.js +0 -1150
  322. package/dist/express.js.map +0 -1
  323. package/dist/http.d.ts +0 -33
  324. package/dist/http.d.ts.map +0 -1
  325. package/dist/index.cjs +0 -724
  326. package/dist/index.cjs.map +0 -1
  327. package/dist/metal/applyListQuery.d.ts +0 -100
  328. package/dist/metal/applyListQuery.d.ts.map +0 -1
  329. package/dist/metal/index.cjs +0 -278
  330. package/dist/metal/index.cjs.map +0 -1
  331. package/dist/metal/index.d.ts +0 -15
  332. package/dist/metal/index.d.ts.map +0 -1
  333. package/dist/metal/index.js +0 -243
  334. package/dist/metal/index.js.map +0 -1
  335. package/dist/metal/listQuery.d.ts +0 -26
  336. package/dist/metal/listQuery.d.ts.map +0 -1
  337. package/dist/metal/queryOptions.d.ts +0 -16
  338. package/dist/metal/queryOptions.d.ts.map +0 -1
  339. package/dist/metal/readMetalBag.d.ts +0 -69
  340. package/dist/metal/readMetalBag.d.ts.map +0 -1
  341. package/dist/metal/registerMetalEntities.d.ts +0 -26
  342. package/dist/metal/registerMetalEntities.d.ts.map +0 -1
  343. package/dist/metal/schemaFromEntity.d.ts +0 -41
  344. package/dist/metal/schemaFromEntity.d.ts.map +0 -1
  345. package/dist/metal/searchWhere.d.ts +0 -97
  346. package/dist/metal/searchWhere.d.ts.map +0 -1
  347. package/dist/metal/symbolMetadata.d.ts +0 -8
  348. package/dist/metal/symbolMetadata.d.ts.map +0 -1
  349. package/dist/runtime/auth/runtime.d.ts +0 -183
  350. package/dist/runtime/auth/runtime.d.ts.map +0 -1
  351. package/dist/runtime/metadata/bucket.d.ts +0 -2
  352. package/dist/runtime/metadata/bucket.d.ts.map +0 -1
  353. package/dist/runtime/metadata/key.d.ts +0 -2
  354. package/dist/runtime/metadata/key.d.ts.map +0 -1
  355. package/dist/runtime/metadata/read.d.ts +0 -2
  356. package/dist/runtime/metadata/read.d.ts.map +0 -1
  357. package/dist/runtime/metadata/types.d.ts +0 -95
  358. package/dist/runtime/metadata/types.d.ts.map +0 -1
  359. package/dist/runtime/polyfill.d.ts +0 -2
  360. package/dist/runtime/polyfill.d.ts.map +0 -1
  361. package/dist/runtime/upload.d.ts +0 -44
  362. package/dist/runtime/upload.d.ts.map +0 -1
  363. package/dist/runtime/validation/ajv.d.ts +0 -120
  364. package/dist/runtime/validation/ajv.d.ts.map +0 -1
  365. package/dist/runtime/validation/index.d.ts +0 -11
  366. package/dist/runtime/validation/index.d.ts.map +0 -1
  367. package/dist/schema/decorators.d.ts +0 -37
  368. package/dist/schema/decorators.d.ts.map +0 -1
  369. package/dist/schema/index.cjs +0 -214
  370. package/dist/schema/index.cjs.map +0 -1
  371. package/dist/schema/index.d.ts +0 -2
  372. package/dist/schema/index.d.ts.map +0 -1
  373. package/dist/schema/index.js +0 -163
  374. package/dist/schema/index.js.map +0 -1
  375. package/dist/scripts/adorn-example.cjs +0 -404
  376. package/dist/scripts/adorn-example.cjs.map +0 -1
  377. package/dist/utils/operationId.d.ts +0 -2
  378. package/dist/utils/operationId.d.ts.map +0 -1
  379. package/dist/utils/path.d.ts +0 -2
  380. package/dist/utils/path.d.ts.map +0 -1
  381. package/dist/utils/port.d.ts +0 -9
  382. package/dist/utils/port.d.ts.map +0 -1
@@ -1,119 +0,0 @@
1
- /**
2
- * Manifest type definitions.
3
- * Describes the structure of the manifest file generated during compilation.
4
- */
5
- /**
6
- * Supported HTTP methods for API operations.
7
- */
8
- export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
9
- /**
10
- * Supported content types for request and response bodies.
11
- */
12
- export type ContentType = "application/json" | "text/plain" | "application/octet-stream" | "multipart/form-data" | string;
13
- /**
14
- * Root manifest interface representing the complete API metadata.
15
- * Contains version, generation info, schema references, and all controller definitions.
16
- */
17
- export interface ManifestV1 {
18
- manifestVersion: 1;
19
- generatedAt: string;
20
- generator: {
21
- name: "adorn-api";
22
- version: string;
23
- typescript: string;
24
- };
25
- schemas: {
26
- kind: "openapi-3.1";
27
- file: string;
28
- componentsSchemasPointer: string;
29
- };
30
- validation: {
31
- mode: "none" | "ajv-runtime" | "precompiled";
32
- precompiledModule: string | null;
33
- };
34
- controllers: ControllerEntry[];
35
- }
36
- /**
37
- * Represents a controller entry in the manifest.
38
- * Contains the controller identifier and all its operations.
39
- */
40
- export interface ControllerEntry {
41
- controllerId: string;
42
- basePath: string;
43
- operations: OperationEntry[];
44
- }
45
- /**
46
- * Represents a single API operation (endpoint) in the manifest.
47
- * Contains operation ID, HTTP method/path, handler reference, arguments, and responses.
48
- */
49
- export interface OperationEntry {
50
- operationId: string;
51
- http: {
52
- method: HttpMethod;
53
- path: string;
54
- };
55
- handler: {
56
- methodName: string;
57
- };
58
- args: ArgsSpec;
59
- responses: ResponseSpec[];
60
- }
61
- /**
62
- * Specification of all arguments for an operation.
63
- * Groups arguments by their location (body, path, query, headers, cookies).
64
- */
65
- export interface ArgsSpec {
66
- body: BodyArgSpec | null;
67
- path: NamedArgSpec[];
68
- query: NamedArgSpec[];
69
- headers: NamedArgSpec[];
70
- cookies: NamedArgSpec[];
71
- }
72
- /**
73
- * Specification for a request body argument.
74
- */
75
- export interface BodyArgSpec {
76
- index: number;
77
- required: boolean;
78
- contentType: ContentType;
79
- schemaRef: string;
80
- encoding?: Record<string, EncodingSpec>;
81
- }
82
- /**
83
- * Encoding options for multipart request bodies.
84
- */
85
- export interface EncodingSpec {
86
- contentType?: string;
87
- headers?: Record<string, string>;
88
- }
89
- /**
90
- * Specification for named arguments (path, query, headers, cookies).
91
- * Contains the parameter name, index, requirement status, and schema reference.
92
- */
93
- export interface NamedArgSpec {
94
- name: string;
95
- index: number;
96
- required: boolean;
97
- schemaRef: string;
98
- schemaType?: string | string[];
99
- serialization?: SerializationSpec;
100
- content?: "application/json";
101
- }
102
- /**
103
- * Serialization options for complex parameter types.
104
- */
105
- export interface SerializationSpec {
106
- style?: "form" | "spaceDelimited" | "pipeDelimited" | "deepObject";
107
- explode?: boolean;
108
- allowReserved?: boolean;
109
- }
110
- /**
111
- * Specification for an operation response.
112
- */
113
- export interface ResponseSpec {
114
- status: number;
115
- contentType: ContentType;
116
- schemaRef: string;
117
- isArray?: boolean;
118
- }
119
- //# sourceMappingURL=format.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/compiler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AAC;CACnB"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Manifest module exports
3
- */
4
- export { generateManifest } from './emit.js';
5
- export type { ManifestV1, ControllerEntry, OperationEntry, HttpMethod } from './format.js';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/compiler/manifest/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACX,MAAM,aAAa,CAAC"}
@@ -1,24 +0,0 @@
1
- /**
2
- * TypeScript program creation module.
3
- * Sets up the TypeScript compiler API for source analysis.
4
- */
5
- import ts from "typescript";
6
- /**
7
- * Context object containing the TypeScript program, type checker, and source files.
8
- * Used throughout the compiler for source analysis and type information.
9
- */
10
- export interface ProgramContext {
11
- program: ts.Program;
12
- checker: ts.TypeChecker;
13
- sourceFiles: ts.SourceFile[];
14
- }
15
- /**
16
- * Creates a TypeScript program from a tsconfig.json file.
17
- * Parses the configuration and sets up the compiler host for source analysis.
18
- *
19
- * @param tsconfigPath - Path to the TypeScript configuration file
20
- * @returns ProgramContext containing the program, checker, and filtered source files
21
- * @throws Error if the config file cannot be read or parsed
22
- */
23
- export declare function createProgramFromConfig(tsconfigPath: string): ProgramContext;
24
- //# sourceMappingURL=createProgram.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createProgram.d.ts","sourceRoot":"","sources":["../../../src/compiler/runner/createProgram.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;IACpB,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC;IACxB,WAAW,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,CAwB5E"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Runner module exports
3
- */
4
- export { createProgramFromConfig, type ProgramContext } from './createProgram.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/compiler/runner/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,uBAAuB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,57 +0,0 @@
1
- /**
2
- * Schema annotation extraction module.
3
- * Parses decorator-based schema annotations from TypeScript source code.
4
- */
5
- import ts from "typescript";
6
- /**
7
- * Represents a fragment of JSON Schema that can be merged with other fragments.
8
- * Used for collecting schema annotations from decorators.
9
- */
10
- export interface SchemaFragment {
11
- [key: string]: unknown;
12
- }
13
- /**
14
- * Extracts schema annotation fragments from a property or parameter declaration.
15
- * Looks for decorators like @Min, @Max, @Pattern, etc. and converts them to JSON Schema fragments.
16
- *
17
- * @param checker - TypeScript type checker for symbol resolution
18
- * @param prop - The property or parameter declaration to analyze
19
- * @returns Array of schema fragments from found decorators
20
- */
21
- export declare function extractPropertySchemaFragments(checker: ts.TypeChecker, prop: ts.PropertyDeclaration | ts.ParameterDeclaration): SchemaFragment[];
22
- /**
23
- * Merges multiple schema fragments into a single schema object.
24
- * Later fragments override earlier ones for conflicting keys.
25
- *
26
- * @param base - The base schema object to merge into
27
- * @param frags - Variable number of schema fragments to merge
28
- * @returns The merged schema object
29
- */
30
- export declare function mergeFragments(base: Record<string, unknown>, ...frags: SchemaFragment[]): Record<string, unknown>;
31
- /**
32
- * Extracts the description from JSDoc comments on a node.
33
- *
34
- * @param checker - TypeScript type checker
35
- * @param node - The AST node to extract description from
36
- * @returns The cleaned description text, or undefined if no description found
37
- */
38
- export declare function extractJSDocDescription(checker: ts.TypeChecker, node: ts.Node): string | undefined;
39
- /**
40
- * Extracts JSDoc tags from a node and converts them to schema properties.
41
- * Supports @example, @default, @description, and @deprecated tags.
42
- *
43
- * @param checker - TypeScript type checker
44
- * @param node - The AST node to extract tags from
45
- * @returns Object mapping tag names to their extracted values
46
- */
47
- export declare function extractJSDocTags(checker: ts.TypeChecker, node: ts.Node): Record<string, unknown>;
48
- /**
49
- * Extracts schema annotation fragments from a class declaration.
50
- * Looks for class-level decorators and JSDoc comments.
51
- *
52
- * @param checker - TypeScript type checker for symbol resolution
53
- * @param classDecl - The class declaration to analyze
54
- * @returns Array of schema fragments from found annotations
55
- */
56
- export declare function extractClassSchemaFragments(checker: ts.TypeChecker, classDecl: ts.ClassDeclaration): SchemaFragment[];
57
- //# sourceMappingURL=extractAnnotations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extractAnnotations.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/extractAnnotations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,mBAAmB,GAAG,EAAE,CAAC,oBAAoB,GACrD,cAAc,EAAE,CAkGlB;AA+DD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMjH;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,GAAG,SAAS,CAmBlG;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+BhG;AA+BD;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,SAAS,EAAE,EAAE,CAAC,gBAAgB,GAC7B,cAAc,EAAE,CA4DlB"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Schema module exports
3
- */
4
- export { typeToJsonSchema, createSchemaContext } from './typeToJsonSchema.js';
5
- export type { JsonSchema, SchemaContext } from './types.js';
6
- export { analyzeQueryBuilderWithServiceCalls, } from './queryBuilderAnalyzer.js';
7
- export { ServiceCallAnalyzer, analyzeMultipleControllersWithServiceCalls, clearServiceCallAnalyzerCaches, type ServiceCallInfo, type MethodCallChain, type ServiceCallAnalyzerOptions, } from './serviceCallAnalyzer.js';
8
- export { partitionSchemas, SchemaPartitioner, type PartitionStrategy, type SchemaGroup, type PartitioningResult, type SchemaComplexity, calculateSchemaComplexity, } from './partitioner.js';
9
- export { generateModularOpenAPI, generateLazyOpenAPI, type SplitOpenAPIConfig, type SplitOpenAPIResult, } from './splitOpenapi.js';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EACL,mCAAmC,GACpC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,mBAAmB,EACnB,0CAA0C,EAC1C,8BAA8B,EAC9B,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,0BAA0B,GAChC,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC"}
@@ -1,44 +0,0 @@
1
- /**
2
- * Intersection type handling module.
3
- * Converts TypeScript intersection types to JSON Schema allOf constructs.
4
- */
5
- import ts from "typescript";
6
- import type { JsonSchema, SchemaContext } from "./types.js";
7
- /**
8
- * Handles TypeScript intersection types and converts them to JSON Schema.
9
- * Tries to collapse branded intersections and builds named schemas for complex intersections.
10
- *
11
- * @param type - The intersection type to convert
12
- * @param ctx - The schema generation context
13
- * @param typeNode - Optional type node for additional context
14
- * @returns The generated JSON Schema
15
- */
16
- export declare function handleIntersection(type: ts.IntersectionType, ctx: SchemaContext, typeNode?: ts.TypeNode): JsonSchema;
17
- /**
18
- * Attempts to collapse a branded intersection type to a simpler schema.
19
- * A branded intersection is one that combines a primitive type with a brand object type.
20
- *
21
- * @param types - The constituent types of the intersection
22
- * @param ctx - The schema generation context
23
- * @param typeNode - Optional type node for additional context
24
- * @returns The simplified schema if collapse is possible, null otherwise
25
- */
26
- export declare function tryCollapseBrandedIntersection(types: readonly ts.Type[], ctx: SchemaContext, _typeNode?: ts.TypeNode): JsonSchema | null;
27
- /**
28
- * Checks if a TypeScript type represents a primitive type (string, number, boolean, bigint, or their literals).
29
- *
30
- * @param t - The type to check
31
- * @returns True if the type is a primitive or primitive literal
32
- */
33
- export declare function isPrimitiveLike(t: ts.Type): boolean;
34
- /**
35
- * Checks if a TypeScript type represents a brand/billing object type.
36
- * Brand objects are simple objects with only brand-related properties like __brand or brand.
37
- *
38
- * @param checker - TypeScript type checker
39
- * @param t - The type to check
40
- * @param _ctx - The schema generation context (unused)
41
- * @returns True if the type appears to be a brand object
42
- */
43
- export declare function isBrandObject(checker: ts.TypeChecker, t: ts.Type, _ctx: SchemaContext): boolean;
44
- //# sourceMappingURL=intersectionHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intersectionHandler.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/intersectionHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG5D;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,gBAAgB,EACzB,GAAG,EAAE,aAAa,EAClB,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,GACrB,UAAU,CA6BZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,EACzB,GAAG,EAAE,aAAa,EAClB,SAAS,CAAC,EAAE,EAAE,CAAC,QAAQ,GACtB,UAAU,GAAG,IAAI,CAanB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAInD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAkB/F"}
@@ -1,146 +0,0 @@
1
- /**
2
- * Object type handling module.
3
- * Converts TypeScript object types and interfaces to JSON Schema.
4
- */
5
- import ts from "typescript";
6
- import type { JsonSchema, SchemaContext } from "./types.js";
7
- /**
8
- * Checks if a type is a type parameter (generic type variable like T, U, etc.)
9
- *
10
- * @param type - The type to check
11
- * @returns True if the type is a type parameter
12
- */
13
- export declare function isTypeParameter(type: ts.Type): boolean;
14
- /**
15
- * Gets the name of a type parameter if the type is one
16
- *
17
- * @param type - The type to check
18
- * @returns The type parameter name, or null if not a type parameter
19
- */
20
- export declare function getTypeParameterName(type: ts.Type): string | null;
21
- /**
22
- * Extracts type arguments from a generic type reference
23
- *
24
- * @param type - The type to extract from
25
- * @returns Array of type arguments, or undefined if not a generic type
26
- */
27
- export declare function getTypeArguments(type: ts.Type): ts.Type[] | undefined;
28
- /**
29
- * Creates a type parameter substitution map from a generic type
30
- * For interface Foo<T, U>, creates Map("T" -> arg1, "U" -> arg2)
31
- *
32
- * @param type - The generic type
33
- * @param typeNode - Optional type node for extracting type parameter names
34
- * @param checker - TypeScript type checker
35
- * @returns Map of type parameter names to actual types
36
- */
37
- export declare function createTypeParameterSubstitutions(type: ts.Type, typeNode: ts.TypeNode | undefined, checker: ts.TypeChecker): Map<string, ts.Type> | undefined;
38
- /**
39
- * Resolves a type parameter to its actual type if a substitution is available
40
- *
41
- * @param type - The type to resolve
42
- * @param substitutions - Map of type parameter names to actual types
43
- * @param _checker - TypeScript type checker (unused, for future extensions)
44
- * @returns The resolved type if the type is a type parameter with a substitution, otherwise null
45
- */
46
- export declare function resolveTypeParameter(type: ts.Type, substitutions: Map<string, ts.Type> | undefined, _checker: ts.TypeChecker): ts.Type | null;
47
- /**
48
- * Handles TypeScript object types and converts them to JSON Schema.
49
- * Manages named schemas, component registration, and cycle detection.
50
- *
51
- * @param type - The object type to convert
52
- * @param ctx - The schema generation context
53
- * @param typeNode - Optional type node for additional context
54
- * @returns The generated JSON Schema
55
- */
56
- export declare function handleObjectType(type: ts.ObjectType, ctx: SchemaContext, typeNode?: ts.TypeNode): JsonSchema;
57
- /**
58
- * Builds the actual object schema from a TypeScript object type.
59
- * Extracts properties, handles required fields, and processes Record types.
60
- *
61
- * @param type - The object type to convert
62
- * @param ctx - The schema generation context
63
- * @param typeNode - Optional type node for additional context
64
- * @returns The generated object schema
65
- */
66
- export declare function buildObjectSchema(type: ts.ObjectType, ctx: SchemaContext, _typeNode?: ts.TypeNode): JsonSchema;
67
- /**
68
- * Checks if a TypeScript type represents a Record type.
69
- *
70
- * @param type - The type to check
71
- * @param _checker - TypeScript type checker (unused)
72
- * @returns True if the type is a Record type
73
- */
74
- export declare function isRecordType(type: ts.ObjectType, _checker: ts.TypeChecker): boolean;
75
- /**
76
- * Extracts the value type from a Record type.
77
- * For Record<K, V>, returns V.
78
- *
79
- * @param type - The Record type to extract from
80
- * @param _checker - TypeScript type checker (unused)
81
- * @returns The value type, or null if not a Record or has no type arguments
82
- */
83
- export declare function getRecordValueType(type: ts.ObjectType, _checker: ts.TypeChecker): ts.Type | null;
84
- /**
85
- * Checks if a type represents a Metal ORM wrapper type (e.g., HasManyCollection, BelongsToReference).
86
- *
87
- * @param type - The type to check
88
- * @param checker - TypeScript type checker for symbol resolution
89
- * @returns True if the type is a Metal ORM wrapper
90
- */
91
- export declare function isMetalOrmWrapperType(type: ts.Type, checker: ts.TypeChecker): boolean;
92
- /**
93
- * Checks if a TypeScript type represents a callable/method-like type.
94
- *
95
- * @param type - The type to check
96
- * @returns True if the type has call signatures (is callable)
97
- */
98
- export declare function isMethodLike(type: ts.Type): boolean;
99
- /**
100
- * Checks if a property name represents an iterator or Symbol property that should be excluded.
101
- *
102
- * @param propName - The property name to check
103
- * @returns True if the property should be excluded from schema generation
104
- */
105
- export declare function isIteratorOrSymbolProperty(propName: string): boolean;
106
- /**
107
- * Gets the type name from a type node or generates an anonymous name.
108
- *
109
- * @param typeNode - The type node to extract name from
110
- * @param _ctx - The schema generation context (unused)
111
- * @returns The type name or generated anonymous name
112
- */
113
- export declare function getTypeNameFromNode(typeNode: ts.TypeNode | undefined, _ctx: SchemaContext): string;
114
- interface MetalOrmWrapperInfo {
115
- wrapperName: string;
116
- targetTypeArgs: ReadonlyArray<ts.Type>;
117
- isReadonlyArray: boolean;
118
- }
119
- /**
120
- * Finds and extracts information about a Metal ORM wrapper type within a type.
121
- * Handles both direct wrapper types and wrapper types within intersections.
122
- *
123
- * @param type - The type to analyze
124
- * @param checker - TypeScript type checker for symbol resolution
125
- * @returns Wrapper info if found, null otherwise
126
- */
127
- export declare function findMetalOrmWrapper(type: ts.Type, checker: ts.TypeChecker): MetalOrmWrapperInfo | null;
128
- /**
129
- * Gets the name of a Metal ORM wrapper type if applicable.
130
- *
131
- * @param type - The type to check
132
- * @param _checker - TypeScript type checker (unused)
133
- * @returns The wrapper type name if applicable, null otherwise
134
- */
135
- export declare function getWrapperTypeName(type: ts.Type, _checker: ts.TypeChecker): string | null;
136
- /**
137
- * Handles Metal ORM wrapper types and converts them to appropriate JSON Schema.
138
- * Different wrapper types result in different schema structures.
139
- *
140
- * @param type - The wrapper object type to convert
141
- * @param ctx - The schema generation context
142
- * @returns The generated JSON Schema for the wrapper
143
- */
144
- export declare function handleMetalOrmWrapper(type: ts.ObjectType, ctx: SchemaContext): JsonSchema;
145
- export {};
146
- //# sourceMappingURL=objectHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"objectHandler.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/objectHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG5D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI,CAMjE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,SAAS,CAKrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,QAAQ,EAAE,EAAE,CAAC,QAAQ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CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,GAAG,SAAS,EAAE,IAAI,EAAE,aAAa,GAAG,MAAM,CAKlG;AA0ID,UAAU,mBAAmB;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACvC,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,EAAE,EAAE,CAAC,WAAW,GACtB,mBAAmB,GAAG,IAAI,CAwB5B;AAwBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,WAAW,GAAG,MAAM,GAAG,IAAI,CAKzF;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,UAAU,CAsDzF"}
@@ -1,71 +0,0 @@
1
- /**
2
- * OpenAPI specification generation module.
3
- * Converts scanned controllers to OpenAPI 3.1 format.
4
- */
5
- import ts from "typescript";
6
- import type { ScannedController } from "../analyze/scanControllers.js";
7
- import type { JsonSchema } from "./types.js";
8
- /**
9
- * OpenAPI 3.1 specification interface.
10
- */
11
- export interface OpenAPI31 {
12
- openapi: "3.1.0";
13
- info: {
14
- title: string;
15
- version: string;
16
- };
17
- components: {
18
- schemas: Record<string, JsonSchema>;
19
- };
20
- paths: Record<string, Record<string, any>>;
21
- }
22
- /**
23
- * Progress callback for OpenAPI generation
24
- */
25
- export interface OpenAPIProgressCallback {
26
- (message: string, current: number, total: number): void;
27
- }
28
- /**
29
- * Detailed progress callback with query builder analysis info
30
- */
31
- export interface OpenAPIDetailedProgressCallback {
32
- (info: {
33
- /** Controller being processed */
34
- controller: string;
35
- /** Operation being processed */
36
- operation: string;
37
- /** HTTP method */
38
- method: string;
39
- /** Operation path */
40
- path: string;
41
- /** Whether query builder pattern was detected */
42
- queryBuilderDetected: boolean;
43
- /** Entity name if detected */
44
- entityName?: string;
45
- /** Selected fields if detected */
46
- selectedFields?: string[];
47
- /** Whether using paged results */
48
- isPaged?: boolean;
49
- /** Current progress */
50
- current: number;
51
- /** Total operations */
52
- total: number;
53
- }): void;
54
- }
55
- /**
56
- * Generates an OpenAPI 3.1 specification from scanned controllers.
57
- *
58
- * @param controllers - Array of scanned controllers to include in the spec
59
- * @param checker - TypeScript type checker for type analysis
60
- * @param options - Optional title and version for the OpenAPI info object
61
- * @param onProgress - Optional callback to report progress during generation
62
- * @param onQueryBuilderProgress - Optional callback to report query builder detection details
63
- * @returns Complete OpenAPI 3.1 specification object
64
- */
65
- export declare function generateOpenAPI(controllers: ScannedController[], checker: ts.TypeChecker, options?: {
66
- title?: string;
67
- version?: string;
68
- onProgress?: OpenAPIProgressCallback;
69
- onQueryBuilderProgress?: OpenAPIDetailedProgressCallback;
70
- }): OpenAPI31;
71
- //# sourceMappingURL=openapi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/openapi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAsC,MAAM,+BAA+B,CAAC;AAG3G,OAAO,KAAK,EAAiB,UAAU,EAAE,MAAM,YAAY,CAAC;AAY5D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,EAAE;QACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;KACrC,CAAC;IACF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,CAAC,IAAI,EAAE;QACL,iCAAiC;QACjC,UAAU,EAAE,MAAM,CAAC;QACnB,gCAAgC;QAChC,SAAS,EAAE,MAAM,CAAC;QAClB,kBAAkB;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,qBAAqB;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,iDAAiD;QACjD,oBAAoB,EAAE,OAAO,CAAC;QAC9B,8BAA8B;QAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kCAAkC;QAClC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,kCAAkC;QAClC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,uBAAuB;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,uBAAuB;QACvB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI,CAAC;CACV;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,iBAAiB,EAAE,EAChC,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,sBAAsB,CAAC,EAAE,+BAA+B,CAAC;CACrD,GACL,SAAS,CAyFX"}
@@ -1,90 +0,0 @@
1
- /**
2
- * Parameter specification building module.
3
- * Converts scanned parameters to OpenAPI parameter objects.
4
- */
5
- import type { ScannedOperation } from "../analyze/scanControllers.js";
6
- import type { SchemaContext, JsonSchema } from "./types.js";
7
- /**
8
- * Builds OpenAPI path parameter objects from scanned operation parameters.
9
- * Adds them to the provided parameters array.
10
- *
11
- * @param operation - The scanned operation containing path parameters
12
- * @param ctx - The schema generation context
13
- * @param parameters - Array to accumulate parameter objects
14
- */
15
- export declare function buildPathParameters(operation: ScannedOperation, ctx: SchemaContext, parameters: any[]): void;
16
- /**
17
- * Builds OpenAPI query parameter objects from scanned operation parameters.
18
- * Handles both individual query parameters and query objects.
19
- *
20
- * @param operation - The scanned operation containing query parameters
21
- * @param ctx - The schema generation context
22
- * @param parameters - Array to accumulate parameter objects
23
- */
24
- export declare function buildQueryParameters(operation: ScannedOperation, ctx: SchemaContext, parameters: any[]): void;
25
- /**
26
- * Builds OpenAPI header parameter objects from scanned operation parameters.
27
- * Extracts individual header parameters from a headers object.
28
- *
29
- * @param operation - The scanned operation containing header parameters
30
- * @param ctx - The schema generation context
31
- * @param parameters - Array to accumulate parameter objects
32
- */
33
- export declare function buildHeaderParameters(operation: ScannedOperation, ctx: SchemaContext, parameters: any[]): void;
34
- /**
35
- * Builds OpenAPI cookie parameter objects from scanned operation parameters.
36
- * Extracts individual cookie parameters from a cookies object.
37
- *
38
- * @param operation - The scanned operation containing cookie parameters
39
- * @param ctx - The schema generation context
40
- * @param parameters - Array to accumulate parameter objects
41
- */
42
- export declare function buildCookieParameters(operation: ScannedOperation, ctx: SchemaContext, parameters: any[]): void;
43
- /**
44
- * Determines OpenAPI serialization style/explode options based on schema type.
45
- *
46
- * @param schemaType - The schema type(s) to analyze
47
- * @returns Object containing style and explode options if applicable
48
- */
49
- export declare function determineQuerySerialization(schemaType: string | string[] | undefined): {
50
- style?: string;
51
- explode?: boolean;
52
- };
53
- /**
54
- * Generates an example value description for a schema.
55
- * Creates a human-readable example showing the expected structure.
56
- *
57
- * @param schema - The JSON Schema to generate example for
58
- * @param propName - The property name for the example
59
- * @returns A description string with example value
60
- */
61
- export declare function generateExampleValue(schema: JsonSchema, propName: string): string;
62
- /**
63
- * Parses an example value from a description string.
64
- * Extracts the JSON object from "Example: propName={...}" format.
65
- *
66
- * @param description - The description string to parse
67
- * @returns The extracted JSON string, or default if not found
68
- */
69
- export declare function parseExampleValue(description: string): string;
70
- /**
71
- * Recursively resolves $ref references in a JSON Schema.
72
- *
73
- * @param schema - The schema to resolve references in
74
- * @param components - Map of component schemas for reference resolution
75
- * @returns The resolved schema with all references followed
76
- */
77
- export declare function resolveSchemaRef(schema: JsonSchema, components: Map<string, JsonSchema>): JsonSchema;
78
- /**
79
- * Resolves object schema references and collects all properties.
80
- * Handles allOf composition and $ref resolution.
81
- *
82
- * @param schema - The object schema to process
83
- * @param components - Map of component schemas for reference resolution
84
- * @returns Object containing all collected properties and required fields
85
- */
86
- export declare function resolveAndCollectObjectProps(schema: JsonSchema, components: Map<string, JsonSchema>): {
87
- properties: Record<string, JsonSchema>;
88
- required: string[];
89
- };
90
- //# sourceMappingURL=parameters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/parameters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAI5D;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI,CAkC5G;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI,CA4H7G;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,EAAE,U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