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,85 +0,0 @@
1
- /**
2
- * Smart OpenAPI Schema Partitioner
3
- * Automatically partitions schemas into optimal groups based on heuristics
4
- */
5
- import type { Graph } from "../graph/types.js";
6
- import type { SchemaGraph } from "../graph/schemaGraph.js";
7
- import type { JsonSchema } from "./types.js";
8
- /**
9
- * Partitioning strategy options
10
- */
11
- export type PartitionStrategy = 'auto' | 'none' | 'controller' | 'dependency' | 'size';
12
- /**
13
- * Schema complexity metrics
14
- */
15
- export interface SchemaComplexity {
16
- propertyCount: number;
17
- nestedDepth: number;
18
- refCount: number;
19
- hasUnion: boolean;
20
- hasIntersection: boolean;
21
- hasEnum: boolean;
22
- jsonSize: number;
23
- }
24
- /**
25
- * A group of schemas for partitioning
26
- */
27
- export interface SchemaGroup {
28
- name: string;
29
- schemas: Map<string, JsonSchema>;
30
- complexity: number;
31
- dependencies: string[];
32
- }
33
- /**
34
- * Partitioning result with metadata
35
- */
36
- export interface PartitioningResult {
37
- shouldSplit: boolean;
38
- strategy: PartitionStrategy;
39
- groups: SchemaGroup[];
40
- recommendation: string;
41
- metrics: {
42
- totalSchemas: number;
43
- averageComplexity: number;
44
- avgDependencyDensity: number;
45
- controllerGroups: number;
46
- };
47
- }
48
- /**
49
- * Configuration for partitioning
50
- */
51
- export interface PartitionerConfig {
52
- strategy?: PartitionStrategy;
53
- threshold?: number;
54
- maxGroupSize?: number;
55
- complexityThreshold?: number;
56
- verbose?: boolean;
57
- }
58
- /**
59
- * Calculate complexity metrics for a schema
60
- */
61
- export declare function calculateSchemaComplexity(schema: JsonSchema): SchemaComplexity;
62
- /**
63
- * Main partitioning function with smart auto-detection
64
- */
65
- export declare function partitionSchemas(schemas: Map<string, JsonSchema>, graph: Graph, schemaGraph: SchemaGraph, config?: PartitionerConfig): PartitioningResult;
66
- /**
67
- * Export partitioner class for advanced use cases
68
- */
69
- export declare class SchemaPartitioner {
70
- private config;
71
- constructor(config?: PartitionerConfig);
72
- /**
73
- * Partition schemas with the configured strategy
74
- */
75
- partition(schemas: Map<string, JsonSchema>, graph: Graph, schemaGraph: SchemaGraph): PartitioningResult;
76
- /**
77
- * Set the partitioning strategy
78
- */
79
- setStrategy(strategy: PartitionStrategy): void;
80
- /**
81
- * Get current configuration
82
- */
83
- getConfig(): Readonly<Required<PartitionerConfig>>;
84
- }
85
- //# sourceMappingURL=partitioner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"partitioner.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/partitioner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,KAAK,EAAU,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,MAAM,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAA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ACH,SAAS,CACP,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EAChC,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,GACvB,kBAAkB;IAIrB;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAI9C;;OAEG;IACH,SAAS,IAAI,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;CAGnD"}
@@ -1,68 +0,0 @@
1
- /**
2
- * Primitive type handling module.
3
- * Converts TypeScript primitive types to JSON Schema.
4
- */
5
- import ts from "typescript";
6
- import type { JsonSchema, SchemaContext } from "./types.js";
7
- /**
8
- * Handles TypeScript primitive types and converts them to JSON Schema.
9
- * Supports string, number, boolean, bigint, null, undefined, Date, and literal types.
10
- *
11
- * @param type - The primitive 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, or null if not a recognized primitive
15
- */
16
- export declare function handlePrimitiveType(type: ts.Type, ctx: SchemaContext, typeNode?: ts.TypeNode): JsonSchema | null;
17
- /**
18
- * Checks if a TypeScript type represents a Date type.
19
- * Handles both direct Date references and aliased Date types.
20
- *
21
- * @param type - The type to check
22
- * @param checker - TypeScript type checker for symbol resolution
23
- * @returns True if the type represents Date
24
- */
25
- export declare function isDateType(type: ts.Type, checker: ts.TypeChecker): boolean;
26
- /**
27
- * Checks if a TypeScript type represents a Set type.
28
- *
29
- * @param type - The type to check
30
- * @param _checker - TypeScript type checker (unused)
31
- * @returns True if the type is a Set type
32
- */
33
- export declare function isSetType(type: ts.Type, _checker: ts.TypeChecker): boolean;
34
- /**
35
- * Normalizes numeric types to either integer or number based on naming conventions.
36
- * Types named like "id", "page", "pageSize", etc. are converted to integer schema.
37
- *
38
- * @param type - The numeric type to normalize
39
- * @param checker - TypeScript type checker for symbol resolution
40
- * @param typeNode - Optional type node for name extraction
41
- * @param propertyName - Optional property name for name-based inference
42
- * @returns The normalized numeric schema
43
- */
44
- export declare function normalizeNumericType(type: ts.Type, checker: ts.TypeChecker, typeNode?: ts.TypeNode, propertyName?: string): JsonSchema;
45
- /**
46
- * Determines if a type should be represented as an integer based on its name.
47
- * Common patterns include "id", "page", "pageSize", "limit", etc.
48
- *
49
- * @param typeName - The type or property name to check
50
- * @returns True if the name suggests an integer type
51
- */
52
- export declare function shouldBeIntegerType(typeName: string | null): boolean;
53
- /**
54
- * Extracts the explicit type name from a type reference node or type alias declaration.
55
- *
56
- * @param typeNode - The type node to extract name from
57
- * @returns The extracted type name, or null if not found
58
- */
59
- export declare function getExplicitTypeNameFromNode(typeNode?: ts.TypeNode): string | null;
60
- /**
61
- * Gets the effective symbol for a type, resolving type aliases.
62
- *
63
- * @param type - The type to get symbol from
64
- * @param checker - TypeScript type checker for alias resolution
65
- * @returns The effective symbol, or null if not found
66
- */
67
- export declare function getEffectiveSymbol(type: ts.Type, checker: ts.TypeChecker): ts.Symbol | null;
68
- //# sourceMappingURL=primitives.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/primitives.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,GAAG,EAAE,aAAa,EAClB,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,GACrB,UAAU,GAAG,IAAI,CA4CnB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,GAAG,OAAO,CAc1E;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,WAAW,GAAG,OAAO,CAM1E;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU,CAUtI;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAYpE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,CAgBjF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC,MAAM,GAAG,IAAI,CAM3F"}
@@ -1,76 +0,0 @@
1
- /**
2
- * Query Builder Schema Analyzer
3
- * Parses method bodies to detect selectFromEntity patterns and extract schema information
4
- * Supports variable reassignment patterns (e.g., let qb = selectFromEntity(); qb = qb.select())
5
- *
6
- * Improvements made:
7
- * - Fixed variable tracking to support reassignments like "let qb = selectFromEntity(Entity); qb = qb.select(...)"
8
- * - Enhanced `extractChainedOperation` to detect both direct calls and method chains
9
- * - Added proper handling for selectFromEntity/selectFrom patterns in variable initialization
10
- * - Fixed PaginatedResult schema filtering to properly filter items array instead of wrapper
11
- */
12
- import ts from "typescript";
13
- /**
14
- * Represents a schema extracted from a query builder chain
15
- */
16
- export interface QueryBuilderSchema {
17
- /** Entity class name (e.g., "BlogPost") */
18
- entityName: string;
19
- /** Fields selected via .select() calls */
20
- selectedFields: string[];
21
- /** Relations included via .include() calls */
22
- includes: Record<string, QueryBuilderSchema | boolean>;
23
- /** Whether query ends with .executePaged() instead of .execute() */
24
- isPaged: boolean;
25
- }
26
- /**
27
- * Result of query builder analysis including operation details for logging
28
- */
29
- export interface QueryBuilderAnalysisResult {
30
- /** Whether a query builder pattern was detected */
31
- detected: boolean;
32
- /** Schema information if detected */
33
- schema: QueryBuilderSchema | null;
34
- /** Operation method name (for logging) */
35
- methodName?: string;
36
- /** Operation HTTP method (for logging) */
37
- httpMethod?: string;
38
- /** Operation path (for logging) */
39
- path?: string;
40
- /** Operation ID (for logging) */
41
- operationId?: string;
42
- }
43
- /**
44
- * Analysis options for query builder detection
45
- */
46
- export interface QueryBuilderAnalyzerOptions {
47
- /** Maximum depth to traverse for nested includes */
48
- maxDepth?: number;
49
- }
50
- /**
51
- * Analyzes a method declaration to detect query builder patterns and extract schema
52
- * Supports variable reassignment patterns (e.g., let qb = selectFromEntity(); qb = qb.select())
53
- *
54
- * @param methodDeclaration - The method declaration to analyze
55
- * @param checker - TypeScript type checker
56
- * @param options - Analyzer options
57
- * @returns Query builder schema if pattern detected, null otherwise
58
- */
59
- export declare function analyzeQueryBuilderForSchema(methodDeclaration: ts.MethodDeclaration, checker: ts.TypeChecker, options?: QueryBuilderAnalyzerOptions): QueryBuilderSchema | null;
60
- /**
61
- * Analyzes a method declaration and returns detailed result with operation info
62
- * Useful for logging and statistics
63
- *
64
- * @param methodDeclaration - The method declaration to analyze
65
- * @param checker - TypeScript type checker
66
- * @param options - Analyzer options
67
- * @param operationInfo - Optional operation metadata for logging
68
- * @returns Detailed analysis result with operation info
69
- */
70
- export declare function analyzeQueryBuilderWithDetails(methodDeclaration: ts.MethodDeclaration, checker: ts.TypeChecker, options?: QueryBuilderAnalyzerOptions, operationInfo?: {
71
- methodName?: string;
72
- httpMethod?: string;
73
- path?: string;
74
- operationId?: string;
75
- }): QueryBuilderAnalysisResult;
76
- //# sourceMappingURL=queryBuilderAnalyzer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryBuilderAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/queryBuilderAnalyzer.ts"],"names":[],"mappings":"AAA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M,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAChG,0BAA0B,CAQ5B"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Schema Builder from Query Builder Analysis
3
- * Converts QueryBuilderSchema into minimal OpenAPI 3.1 schemas
4
- */
5
- import type { JsonSchema, SchemaContext } from "./types.js";
6
- import type { QueryBuilderSchema } from "./queryBuilderAnalyzer.js";
7
- import ts from "typescript";
8
- export declare function buildSchemaFromQueryBuilder(querySchema: QueryBuilderSchema, entityType: ts.ObjectType, ctx: SchemaContext): JsonSchema | null;
9
- /**
10
- * Wraps a schema in PaginatedResult if needed
11
- */
12
- export declare function wrapInPaginatedResult(schema: JsonSchema): JsonSchema;
13
- //# sourceMappingURL=queryBuilderSchemaBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryBuilderSchemaBuilder.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/queryBuilderSchemaBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,kBAAkB,EAC/B,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,GAAG,EAAE,aAAa,GACjB,UAAU,GAAG,IAAI,CAiBnB;AA4ED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAcpE"}
@@ -1,46 +0,0 @@
1
- import type { OpenAPI31 } from "./openapi.js";
2
- import type { PartitioningResult } from "./partitioner.js";
3
- /**
4
- * Progress callback for modular OpenAPI generation
5
- */
6
- export interface ModularProgressCallback {
7
- (step: string, index: number, total: number): void;
8
- }
9
- /**
10
- * Configuration for modular OpenAPI generation
11
- */
12
- export interface SplitOpenAPIConfig {
13
- outputDir: string;
14
- schemasDir?: string;
15
- createIndexFile?: boolean;
16
- prettyPrint?: boolean;
17
- onProgress?: ModularProgressCallback;
18
- }
19
- /**
20
- * Result of modular OpenAPI generation
21
- */
22
- export interface SplitOpenAPIResult {
23
- mainSpec: string;
24
- schemaFiles: string[];
25
- indexFile?: string;
26
- totalSize: number;
27
- splitEnabled: boolean;
28
- }
29
- /**
30
- * Generate modular OpenAPI specification with split schema files
31
- */
32
- export declare function generateModularOpenAPI(openapi: OpenAPI31, partitioning: PartitioningResult, config: SplitOpenAPIConfig): SplitOpenAPIResult;
33
- /**
34
- * Generate a lightweight OpenAPI spec that references external files
35
- * This is useful for Swagger UI lazy loading
36
- */
37
- export declare function generateLazyOpenAPI(openapi: OpenAPI31, partitioning: PartitioningResult): OpenAPI31;
38
- /**
39
- * Get the file path for a schema group
40
- */
41
- export declare function getSchemaFilePath(groupName: string, outputDir: string, schemasDir?: string): string;
42
- /**
43
- * Check if a schema exists in a specific file
44
- */
45
- export declare function schemaExistsInFile(schemaName: string, outputDir: string, groupName: string): boolean;
46
- //# sourceMappingURL=splitOpenapi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splitOpenapi.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/splitOpenapi.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAe,MAAM,kBAAkB,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;CACvB;AAsHD;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,EAClB,YAAY,EAAE,kBAAkB,EAChC,MAAM,EAAE,kBAAkB,GACzB,kBAAkB,CA+FpB;AA0CD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,SAAS,EAClB,YAAY,EAAE,kBAAkB,GAC/B,SAAS,CAuBX;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,UAAU,GAAE,MAAkB,GAC7B,MAAM,CAGR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAaT"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Main type-to-JSON-Schema conversion module.
3
- * Routes different TypeScript types to appropriate handlers.
4
- */
5
- import ts from "typescript";
6
- import type { JsonSchema, SchemaContext } from "./types.js";
7
- export type { JsonSchema, DiscriminatorObject, SchemaContext } from "./types.js";
8
- /**
9
- * Converts a TypeScript type to a JSON Schema object.
10
- * This is the main entry point for schema generation, routing to appropriate type handlers.
11
- *
12
- * @param type - The TypeScript type to convert
13
- * @param ctx - The schema generation context
14
- * @param typeNode - Optional type node for additional context
15
- * @returns The generated JSON Schema
16
- */
17
- export declare function typeToJsonSchema(type: ts.Type, ctx: SchemaContext, typeNode?: ts.TypeNode): JsonSchema;
18
- /**
19
- * Creates a new schema generation context with fresh component registry and type stack.
20
- *
21
- * @param checker - TypeScript type checker for type analysis
22
- * @param mode - Generation mode ("request" or "response"), defaults to "response"
23
- * @returns A new SchemaContext for schema generation
24
- */
25
- export declare function createSchemaContext(checker: ts.TypeChecker, mode?: "request" | "response"): SchemaContext;
26
- //# sourceMappingURL=typeToJsonSchema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typeToJsonSchema.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/typeToJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAM5D,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEjF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,GAAG,EAAE,aAAa,EAClB,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,GACrB,UAAU,CAkCZ;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,GAAE,SAAS,GAAG,UAAuB,GAAG,aAAa,CAQrH"}
@@ -1,70 +0,0 @@
1
- /**
2
- * JSON Schema type definitions for the compiler.
3
- * Core types used throughout schema generation.
4
- */
5
- import ts from "typescript";
6
- /**
7
- * JSON Schema representation used throughout the compiler.
8
- * Extended with OpenAPI and vendor-specific properties.
9
- */
10
- export interface JsonSchema {
11
- type?: string | string[];
12
- properties?: Record<string, JsonSchema>;
13
- required?: string[];
14
- items?: JsonSchema;
15
- enum?: (string | number | boolean)[];
16
- $ref?: string;
17
- nullable?: boolean;
18
- description?: string;
19
- default?: unknown;
20
- examples?: unknown[];
21
- example?: unknown;
22
- anyOf?: JsonSchema[];
23
- oneOf?: JsonSchema[];
24
- allOf?: JsonSchema[];
25
- discriminator?: DiscriminatorObject;
26
- additionalProperties?: boolean | JsonSchema;
27
- unevaluatedProperties?: boolean | JsonSchema;
28
- format?: string;
29
- pattern?: string;
30
- minimum?: number;
31
- maximum?: number;
32
- exclusiveMinimum?: number;
33
- exclusiveMaximum?: number;
34
- minLength?: number;
35
- maxLength?: number;
36
- minItems?: number;
37
- maxItems?: number;
38
- minProperties?: number;
39
- maxProperties?: number;
40
- multipleOf?: number;
41
- const?: unknown;
42
- uniqueItems?: boolean;
43
- title?: string;
44
- readOnly?: boolean;
45
- "x-metal-orm-entity"?: string;
46
- "x-metal-orm-mode"?: string;
47
- "x-metal-orm-rel"?: Record<string, unknown>;
48
- "x-ts-type"?: string;
49
- }
50
- /**
51
- * OpenAPI discriminator object for polymorphism support.
52
- */
53
- export interface DiscriminatorObject {
54
- propertyName: string;
55
- mapping?: Record<string, string>;
56
- }
57
- /**
58
- * Context object passed through schema generation functions.
59
- * Provides access to type checker, component registry, and generation options.
60
- */
61
- export interface SchemaContext {
62
- checker: ts.TypeChecker;
63
- components: Map<string, JsonSchema>;
64
- typeStack: Set<ts.Type>;
65
- typeNameStack: string[];
66
- mode?: "request" | "response";
67
- propertyName?: string;
68
- typeParameterSubstitutions?: Map<string, ts.Type>;
69
- }
70
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OA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AAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC;IACxB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0BAA0B,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;CACnD"}
@@ -1,70 +0,0 @@
1
- /**
2
- * Union type handling module.
3
- * Converts TypeScript union types to JSON Schema anyOf/oneOf constructs.
4
- */
5
- import ts from "typescript";
6
- import type { JsonSchema, DiscriminatorObject, SchemaContext } from "./types.js";
7
- /**
8
- * Handles TypeScript union types and converts them to JSON Schema.
9
- * Creates anyOf schemas with optional discriminator for union members.
10
- *
11
- * @param type - The union 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 handleUnion(type: ts.UnionType, ctx: SchemaContext, typeNode?: ts.TypeNode): JsonSchema;
17
- /**
18
- * Detects if a union type forms a discriminated union.
19
- * A discriminated union has a common property with literal values that can be used for discrimination.
20
- *
21
- * @param types - The constituent types of the union
22
- * @param ctx - The schema generation context
23
- * @param branches - The generated schemas for each branch (unused in current impl)
24
- * @returns Discriminator object if discriminated union detected, null otherwise
25
- */
26
- export declare function detectDiscriminatedUnion(types: readonly ts.Type[], ctx: SchemaContext, _branches: JsonSchema[]): DiscriminatorObject | null;
27
- /**
28
- * Finds property names that are common across all types in a union.
29
- *
30
- * @param checker - TypeScript type checker for property lookup
31
- * @param types - The types to analyze
32
- * @returns Array of property names present in all types
33
- */
34
- export declare function findCommonPropertyNames(checker: ts.TypeChecker, types: readonly ts.Type[]): string[];
35
- /**
36
- * Checks if a property is required (non-optional) in a given type.
37
- *
38
- * @param checker - TypeScript type checker for symbol analysis
39
- * @param type - The type to check
40
- * @param propName - The property name to check
41
- * @returns True if the property is required
42
- */
43
- export declare function isRequiredProperty(checker: ts.TypeChecker, type: ts.Type, propName: string): boolean;
44
- /**
45
- * Gets the literal string values of a property across a type.
46
- * Used for detecting discriminated unions.
47
- *
48
- * @param checker - TypeScript type checker for property type analysis
49
- * @param type - The type to check
50
- * @param propName - The property name to get values for
51
- * @returns Set of literal values, or null if not a literal union
52
- */
53
- export declare function getPropertyLiteralValues(checker: ts.TypeChecker, type: ts.Type, propName: string): Set<string> | null;
54
- /**
55
- * Checks if multiple sets are pairwise disjoint (have no common elements).
56
- *
57
- * @param sets - Array of sets to check for disjointness
58
- * @returns True if all sets are pairwise disjoint
59
- */
60
- export declare function areSetsDisjoint(sets: Array<Set<string>>): boolean;
61
- /**
62
- * Gets the schema name for a union branch type.
63
- * Used for discriminator mapping.
64
- *
65
- * @param type - The type to get name for
66
- * @param ctx - The schema generation context
67
- * @returns The schema name, or generated anonymous name
68
- */
69
- export declare function getBranchSchemaName(type: ts.Type, ctx: SchemaContext): string;
70
- //# sourceMappingURL=unionHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unionHandler.d.ts","sourceRoot":"","sources":["../../../src/compiler/schema/unionHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGjF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,EAAE,CAAC,SAAS,EAClB,GAAG,EAAE,aAAa,EAClB,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,GACrB,UAAU,CA6DZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,EACzB,GAAG,EAAE,aAAa,EAClB,SAAS,EAAE,UAAU,EAAE,GACtB,mBAAmB,GAAG,IAAI,CA0B5B;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,MAAM,EAAE,CAOpG;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAapG;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAoBrH;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CASjE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM,CAY7E"}
@@ -1,35 +0,0 @@
1
- /**
2
- * Deduplication transformation for removing duplicate type definitions.
3
- * Merges identical types and updates references.
4
- */
5
- import type { Graph, NodeId } from "../graph/types.js";
6
- import type { NodeTransformer } from "../ir/visitor.js";
7
- /**
8
- * Type similarity comparison result
9
- */
10
- interface TypeSimilarity {
11
- score: number;
12
- identical: boolean;
13
- }
14
- /**
15
- * Deduplication transformation result
16
- */
17
- export interface DeduplicationResult {
18
- mergedNodes: Map<NodeId, NodeId>;
19
- removedCount: number;
20
- duplicatesFound: number;
21
- }
22
- /**
23
- * Type deduplication transformer
24
- */
25
- export declare function createDeduplicationTransformer(): NodeTransformer;
26
- /**
27
- * Apply deduplication to graph
28
- */
29
- export declare function applyDeduplication(graph: Graph): DeduplicationResult;
30
- /**
31
- * Find structurally similar types
32
- */
33
- export declare function findSimilarTypes(graph: Graph, threshold?: number): Array<[NodeId, NodeId, TypeSimilarity]>;
34
- export {};
35
- //# sourceMappingURL=dedup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dedup.d.ts","sourceRoot":"","sources":["../../../src/compiler/transform/dedup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAGV,KAAK,EACL,MAAM,EACP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxE;;GAEG;AACH,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,eAAe,CAkBhE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,mBAAmB,CA+CpE;AA0CD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,SAAS,GAAE,MAAY,GACtB,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC,CAwBzC"}
@@ -1,50 +0,0 @@
1
- /**
2
- * Flattening transformation for simplifying nested type structures.
3
- * Flattens deeply nested object types into shallower structures.
4
- */
5
- import type { Graph, NodeId } from "../graph/types.js";
6
- import type { NodeTransformer } from "../ir/visitor.js";
7
- /**
8
- * Flattening configuration
9
- */
10
- export interface FlattenConfig {
11
- maxNestingLevel: number;
12
- preserveNaming: boolean;
13
- prefix: string;
14
- mergeOverlapping: boolean;
15
- maxProperties: number;
16
- }
17
- /**
18
- * Default flattening configuration
19
- */
20
- export declare const DEFAULT_FLATTEN_CONFIG: FlattenConfig;
21
- /**
22
- * Flattening transformation result
23
- */
24
- export interface FlattenResult {
25
- flattenedNodes: NodeId[];
26
- propertiesFlattened: number;
27
- conflictsResolved: number;
28
- }
29
- /**
30
- * Create flattening transformer
31
- */
32
- export declare function createFlattenTransformer(config?: Partial<FlattenConfig>): NodeTransformer;
33
- /**
34
- * Apply flattening to graph
35
- */
36
- export declare function applyFlattening(graph: Graph, config?: Partial<FlattenConfig>): FlattenResult;
37
- /**
38
- * Find deeply nested types that could benefit from flattening
39
- */
40
- export declare function findNestedTypes(graph: Graph, config?: Partial<FlattenConfig>): NodeId[];
41
- /**
42
- * Analyze flattening impact on the graph
43
- */
44
- export declare function analyzeFlatteningImpact(graph: Graph, config?: Partial<FlattenConfig>): {
45
- nodesAffected: number;
46
- propertiesFlattened: number;
47
- avgNestingLevelBefore: number;
48
- avgNestingLevelAfter: number;
49
- };
50
- //# sourceMappingURL=flatten.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../src/compiler/transform/flatten.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAGV,KAAK,EACL,MAAM,EACP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAMpC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,GAAE,OAAO,CAAC,aAAa,CAAM,GAClC,eAAe,CAajB;AA4BD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,MAAM,GAAE,OAAO,CAAC,aAAa,CAAM,GAClC,aAAa,CAwBf;AAuHD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,MAAM,GAAE,OAAO,CAAC,aAAa,CAAM,GAClC,MAAM,EAAE,CAqBV;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,KAAK,EACZ,MAAM,GAAE,OAAO,CAAC,aAAa,CAAM,GAClC;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CA0BA"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Graph transformations
3
- */
4
- export * from './dedup.js';
5
- export * from './inline.js';
6
- export * from './flatten.js';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/compiler/transform/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -1,46 +0,0 @@
1
- /**
2
- * Reference inlining transformation.
3
- * Inlines small type definitions to reduce schema complexity.
4
- */
5
- import type { AnyNode, Graph, NodeId } from "../graph/types.js";
6
- import type { VisitorContext } from "../ir/visitor.js";
7
- /**
8
- * Inlining configuration
9
- */
10
- export interface InliningConfig {
11
- maxDepth: number;
12
- maxNodes: number;
13
- inlinePrimitives: boolean;
14
- inlineSmallTypes: boolean;
15
- smallTypeThreshold: number;
16
- excludePatterns: RegExp[];
17
- }
18
- /**
19
- * Default inlining configuration
20
- */
21
- export declare const DEFAULT_INLINING_CONFIG: InliningConfig;
22
- /**
23
- * Inlining transformation result
24
- */
25
- export interface InliningResult {
26
- inlinedNodes: NodeId[];
27
- inlinedEdges: number;
28
- nodesRemoved: number;
29
- }
30
- /**
31
- * Create inlining transformer with custom config
32
- */
33
- export declare function createInliningTransformer(config?: Partial<InliningConfig>): (node: AnyNode, context: VisitorContext) => AnyNode | null;
34
- /**
35
- * Apply inlining to graph
36
- */
37
- export declare function applyInlining(graph: Graph, config?: Partial<InliningConfig>): InliningResult;
38
- /**
39
- * Calculate inlining depth for a node
40
- */
41
- export declare function calculateInliningDepth(graph: Graph, nodeId: NodeId, visited?: Set<NodeId>): number;
42
- /**
43
- * Find potential inline candidates
44
- */
45
- export declare function findInlineCandidates(graph: Graph, config?: Partial<InliningConfig>): NodeId[];
46
- //# sourceMappingURL=inline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../../src/compiler/transform/inline.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,MAAM,EAEP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAg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