appos 0.3.5-0 → 0.3.6-0

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 (281) hide show
  1. package/dist/bin/main.mjs +2 -2
  2. package/dist/exports/api/adapter-C2mMJKvG.mjs +1504 -0
  3. package/dist/exports/api/{auth-schema.mjs → auth-schema-CON4yFFY.mjs} +2 -3
  4. package/dist/exports/api/bun-sqlite-dialect-CPpPZa23.mjs +155 -0
  5. package/dist/exports/{cli/_virtual/rolldown_runtime.mjs → api/chunk-CyXqrcp_.mjs} +14 -1
  6. package/dist/exports/api/conditions-DjBAWfiK.mjs +116 -0
  7. package/dist/exports/api/dialect-CUUD24Ge.mjs +72 -0
  8. package/dist/exports/api/env-CwT3zhez.mjs +1 -0
  9. package/dist/exports/api/esm-_hkVMulx.mjs +15816 -0
  10. package/dist/exports/api/event-BHFSE6hY.mjs +20983 -0
  11. package/dist/exports/api/extract-blob-metadata-BMgUEPcW.mjs +4 -0
  12. package/dist/exports/api/extract-blob-metadata-_9RUEwoU.mjs +9818 -0
  13. package/dist/exports/api/generate-image-variant-DOIzj1wJ.mjs +4 -0
  14. package/dist/exports/api/generate-image-variant-DxOPoGAk.mjs +118 -0
  15. package/dist/exports/api/generate-preview-CvTFuq58.mjs +160 -0
  16. package/dist/exports/api/generate-preview-Dk3coswZ.mjs +4 -0
  17. package/dist/exports/api/index.d.mts +7347 -20
  18. package/dist/exports/api/index.mjs +146856 -18
  19. package/dist/exports/api/kysely-adapter-CmP2TbkS.mjs +296 -0
  20. package/dist/exports/api/memory-adapter-BzhRhLFK.mjs +212 -0
  21. package/dist/exports/api/node-sqlite-dialect-Bl5suBxl.mjs +155 -0
  22. package/dist/exports/api/orm-CMqufD21.mjs +153690 -0
  23. package/dist/exports/api/orm-DXqYuKvB.d.mts +11 -0
  24. package/dist/exports/api/orm.d.mts +2 -11
  25. package/dist/exports/api/orm.mjs +4 -42
  26. package/dist/exports/api/pdf-YxB2Hm1p.mjs +25822 -0
  27. package/dist/exports/api/purge-attachment-Cf6KH2Jv.mjs +34 -0
  28. package/dist/exports/api/purge-attachment-DIuil7ps.mjs +4 -0
  29. package/dist/exports/{cli/api/workflows/purge-audit-logs.mjs → api/purge-audit-logs-z6j_Pu47.mjs} +3 -3
  30. package/dist/exports/{cli/api/workflows/purge-unattached-blobs.mjs → api/purge-unattached-blobs-B0TfY5Hk.mjs} +1 -1
  31. package/dist/exports/api/react-BYhV5bYt.mjs +1131 -0
  32. package/dist/exports/api/server.node-DyVrQ6cz.mjs +19298 -0
  33. package/dist/exports/api/table-6bTIEqON.mjs +2636 -0
  34. package/dist/exports/api/{workflows/track-db-changes.mjs → track-db-changes-BysaV6nN.mjs} +14 -14
  35. package/dist/exports/api/{workflow.mjs → workflow-BuSWHcX-.mjs} +121 -10
  36. package/dist/exports/api/workflows/auth-schema-BFve3hgZ.mjs +2813 -0
  37. package/dist/exports/api/{_virtual/rolldown_runtime.mjs → workflows/chunk-B36mNPO4.mjs} +5 -1
  38. package/dist/exports/api/workflows/extract-blob-metadata-BcWKvY2K.mjs +9818 -0
  39. package/dist/exports/api/workflows/{generate-image-variant.mjs → generate-image-variant-BAFvL_zV.mjs} +20 -20
  40. package/dist/exports/{cli/api/workflows/generate-preview.mjs → api/workflows/generate-preview-BjlIVYYp.mjs} +6 -6
  41. package/dist/exports/api/workflows/index.d.mts +2011 -1
  42. package/dist/exports/api/workflows/index.mjs +2 -1
  43. package/dist/exports/api/workflows/pdf-DUB8zyIc.mjs +25822 -0
  44. package/dist/exports/{cli/api/workflows/purge-attachment.mjs → api/workflows/purge-attachment-k_sdxTPY.mjs} +3 -3
  45. package/dist/exports/api/workflows/{purge-audit-logs.mjs → purge-audit-logs-zCyWj4Mw.mjs} +12 -3
  46. package/dist/exports/api/workflows/{purge-unattached-blobs.mjs → purge-unattached-blobs-CdsuFAeW.mjs} +1 -1
  47. package/dist/exports/api/workflows/track-db-changes-CiKaI9gT.mjs +20943 -0
  48. package/dist/exports/api/workflows/track-db-changes-DEWQYryO.mjs +4 -0
  49. package/dist/exports/{cli/api/workflow.mjs → api/workflows/workflow-BjM2xCa6.mjs} +23 -3
  50. package/dist/exports/api/workflows/zod-Br0enFWK.mjs +12333 -0
  51. package/dist/exports/api/zod-CdrJdBtV.mjs +12571 -0
  52. package/dist/exports/cli/auth-schema-CNuOqPi-.mjs +2813 -0
  53. package/dist/exports/{api/workflows/_virtual/rolldown_runtime.mjs → cli/chunk-B36mNPO4.mjs} +5 -1
  54. package/dist/exports/cli/extract-blob-metadata-CV1Ke90d.mjs +9818 -0
  55. package/dist/exports/cli/{api/workflows/generate-image-variant.mjs → generate-image-variant-CM1BrVvZ.mjs} +20 -20
  56. package/dist/exports/{api/workflows/generate-preview.mjs → cli/generate-preview-DdHQ3ukz.mjs} +6 -6
  57. package/dist/exports/cli/index.d.mts +2142 -2
  58. package/dist/exports/cli/index.mjs +41 -1
  59. package/dist/exports/cli/pdf-CLUPEIdT.mjs +25822 -0
  60. package/dist/exports/{api/workflows/purge-attachment.mjs → cli/purge-attachment-Dc_J74dG.mjs} +3 -3
  61. package/dist/exports/cli/purge-audit-logs-DFhWh-Bx.mjs +56 -0
  62. package/dist/exports/cli/purge-unattached-blobs-C1MRlM_2.mjs +46 -0
  63. package/dist/exports/cli/track-db-changes-CfneOF2_.mjs +20943 -0
  64. package/dist/exports/{api/workflows/api/workflow.mjs → cli/workflow-DSbbXBMt.mjs} +23 -3
  65. package/dist/exports/cli/zod-7q0_Mtnn.mjs +12333 -0
  66. package/dist/exports/devtools/BaseTanStackRouterDevtoolsPanel-BBz1qLry-DUwdvyLv.js +2090 -0
  67. package/dist/exports/devtools/EIDV623S-B7f6114d.js +2497 -0
  68. package/dist/exports/devtools/FloatingTanStackRouterDevtools-DymJEvfG-BHuQHiRR.js +237 -0
  69. package/dist/exports/devtools/MIMHJGAX-Cb3wf11F.js +10903 -0
  70. package/dist/exports/devtools/Q7LWSL4U-BoEO3rNq.js +37 -0
  71. package/dist/exports/devtools/VLTTJS3N-CIyRc84e.js +44 -0
  72. package/dist/exports/devtools/index.js +1724 -3
  73. package/dist/exports/devtools/utils-YRTCpRgb.js +1670 -0
  74. package/dist/exports/tests/api.d.mts +7354 -5
  75. package/dist/exports/tests/api.mjs +79 -1
  76. package/dist/exports/tests/auth-schema-DUCJw-_2.mjs +1 -0
  77. package/dist/exports/tests/chunk-Cii4FAhs.mjs +1 -0
  78. package/dist/exports/tests/conditions-B0ffVJ5E.mjs +1 -0
  79. package/dist/exports/tests/constants-DHjjg05J.mjs +1 -0
  80. package/dist/exports/tests/dist-D6vgKv3t.mjs +7 -0
  81. package/dist/exports/tests/dist-EfrRkq5c.mjs +296 -0
  82. package/dist/exports/tests/extract-blob-metadata-Dv343Vcn.mjs +169 -0
  83. package/dist/exports/tests/generate-image-variant-cQc8q0kh.mjs +1 -0
  84. package/dist/exports/tests/generate-preview-HaTMd2hS.mjs +1 -0
  85. package/dist/exports/tests/magic-string.es-D6VRmdiF.mjs +14 -0
  86. package/dist/exports/tests/mock-BvkO5nlm.mjs +1 -0
  87. package/dist/exports/tests/mock.mjs +1 -1
  88. package/dist/exports/tests/pdf-BDsS3vjF.mjs +13 -0
  89. package/dist/exports/tests/purge-attachment-D4uOzHRi.mjs +1 -0
  90. package/dist/exports/tests/purge-audit-logs-DiPcc09d.mjs +1 -0
  91. package/dist/exports/tests/purge-unattached-blobs-CqW6tlIC.mjs +1 -0
  92. package/dist/exports/tests/react.mjs +6 -1
  93. package/dist/exports/tests/setup.d.mts +1 -1
  94. package/dist/exports/tests/setup.mjs +34 -1
  95. package/dist/exports/tests/table-CbU04119.mjs +1 -0
  96. package/dist/exports/tests/track-db-changes-Bd4W-P1q.mjs +1 -0
  97. package/dist/exports/tests/vi.2VT5v0um-Cme1b0Dl.mjs +348 -0
  98. package/dist/exports/tests/{api/workflow.mjs → workflow-DwZxTqdH.mjs} +1 -1
  99. package/dist/exports/tests/zod-DcpxsMPz.mjs +23 -0
  100. package/dist/exports/vendors/date.js +13236 -1
  101. package/dist/exports/vendors/toolkit.js +2206 -1
  102. package/dist/exports/vendors/zod.js +12344 -1
  103. package/dist/exports/vite/api-DGRU_RdM.mjs +27 -0
  104. package/dist/exports/vite/build-CxJAu2Bn.mjs +1 -0
  105. package/dist/exports/vite/build2-BMK0OFVt.mjs +16 -0
  106. package/dist/exports/vite/chunk-CxnlK1Zi.mjs +1 -0
  107. package/dist/exports/vite/chunk-PtveFMYu.mjs +1 -0
  108. package/dist/exports/vite/dist-Bxp8DqWh.mjs +114 -0
  109. package/dist/exports/vite/dist-CX51FKbX.mjs +1 -0
  110. package/dist/exports/vite/dist-DcyNr-KR.mjs +1 -0
  111. package/dist/exports/vite/dist-j3-Khlzt.mjs +1 -0
  112. package/dist/exports/vite/experimental-index-3KsfmUbz.mjs +1 -0
  113. package/dist/exports/vite/false-BNJbUKYT.mjs +1 -0
  114. package/dist/exports/vite/false-BvrPEDU6.mjs +1 -0
  115. package/dist/exports/vite/index.d.mts +1 -1
  116. package/dist/exports/vite/index.mjs +26 -1
  117. package/dist/exports/vite/internal-C5cVwRiK.mjs +1 -0
  118. package/dist/exports/vite/jiti-BjSPrFvg.mjs +9 -0
  119. package/dist/exports/vite/lexer-DQCqS3nf-C6xCDOEQ.mjs +3 -0
  120. package/dist/exports/vite/lib-CMv7Sfwa.mjs +1 -0
  121. package/dist/exports/vite/lib-D9TnS-7w.mjs +1 -0
  122. package/dist/exports/vite/lib-DuBRr9dH.mjs +382 -0
  123. package/dist/exports/vite/node-DI8AnY_i.mjs +437 -0
  124. package/dist/exports/vite/postcss-BtmDpj-c.mjs +32 -0
  125. package/dist/exports/vite/postcss-import-Bk_ZCd6c.mjs +5 -0
  126. package/dist/exports/vite/rolldown-build-CNW2eye_-CJNfyXdF.mjs +13 -0
  127. package/dist/exports/vitest/api-CPv6lnxG.mjs +27 -0
  128. package/dist/exports/vitest/build2-28i3OiJ3.mjs +16 -0
  129. package/dist/exports/vitest/chunk-_e2jlDPK.mjs +1 -0
  130. package/dist/exports/vitest/chunk-jwDkFoXW.mjs +1 -0
  131. package/dist/exports/vitest/config.mjs +77 -1
  132. package/dist/exports/vitest/dist-L-OpshPJ.mjs +114 -0
  133. package/dist/exports/vitest/index.mjs +348 -1
  134. package/dist/exports/vitest/jiti-eNGOyHIo.mjs +9 -0
  135. package/dist/exports/vitest/lexer-DQCqS3nf-TWLyIqlY.mjs +3 -0
  136. package/dist/exports/vitest/lib-C3G64csm.mjs +1 -0
  137. package/dist/exports/vitest/magic-string.es-CxM5Ubyl.mjs +14 -0
  138. package/dist/exports/vitest/module-runner-DsF4L04D.mjs +1 -0
  139. package/dist/exports/vitest/postcss-BxLp_Too.mjs +32 -0
  140. package/dist/exports/vitest/postcss-import-5pKj3f5q.mjs +5 -0
  141. package/dist/exports/web/browser-ponyfill-DxTJMXNq.js +443 -0
  142. package/dist/exports/web/chunk-DksrlJLg.js +49 -0
  143. package/dist/exports/web/index.d.ts +2546 -2
  144. package/dist/exports/web/index.js +9295 -6
  145. package/dist/exports/web/plugin-DqTFWG7p.js +250 -0
  146. package/package.json +1 -1
  147. package/dist/exports/api/app-context.d.mts +0 -115
  148. package/dist/exports/api/app-context.mjs +0 -24
  149. package/dist/exports/api/auth-schema.d.mts +0 -4248
  150. package/dist/exports/api/auth.d.mts +0 -402
  151. package/dist/exports/api/auth.mjs +0 -188
  152. package/dist/exports/api/cache.d.mts +0 -44
  153. package/dist/exports/api/cache.mjs +0 -28
  154. package/dist/exports/api/config.d.mts +0 -28
  155. package/dist/exports/api/config.mjs +0 -72
  156. package/dist/exports/api/constants.mjs +0 -92
  157. package/dist/exports/api/container.d.mts +0 -210
  158. package/dist/exports/api/container.mjs +0 -49
  159. package/dist/exports/api/database.d.mts +0 -101
  160. package/dist/exports/api/database.mjs +0 -219
  161. package/dist/exports/api/event.d.mts +0 -235
  162. package/dist/exports/api/event.mjs +0 -236
  163. package/dist/exports/api/i18n.d.mts +0 -34
  164. package/dist/exports/api/i18n.mjs +0 -45
  165. package/dist/exports/api/instrumentation.d.mts +0 -7
  166. package/dist/exports/api/instrumentation.mjs +0 -40
  167. package/dist/exports/api/logger.d.mts +0 -21
  168. package/dist/exports/api/logger.mjs +0 -26
  169. package/dist/exports/api/mailer.d.mts +0 -70
  170. package/dist/exports/api/mailer.mjs +0 -37
  171. package/dist/exports/api/middleware/request-logger.d.mts +0 -24
  172. package/dist/exports/api/middleware.d.mts +0 -39
  173. package/dist/exports/api/middleware.mjs +0 -73
  174. package/dist/exports/api/openapi.d.mts +0 -271
  175. package/dist/exports/api/openapi.mjs +0 -507
  176. package/dist/exports/api/otel.d.mts +0 -40
  177. package/dist/exports/api/otel.mjs +0 -56
  178. package/dist/exports/api/redis.d.mts +0 -34
  179. package/dist/exports/api/redis.mjs +0 -41
  180. package/dist/exports/api/storage-schema.d.mts +0 -707
  181. package/dist/exports/api/storage-schema.mjs +0 -72
  182. package/dist/exports/api/storage.d.mts +0 -506
  183. package/dist/exports/api/storage.mjs +0 -833
  184. package/dist/exports/api/web/auth.mjs +0 -17
  185. package/dist/exports/api/workflow.d.mts +0 -250
  186. package/dist/exports/api/workflows/api/auth-schema.mjs +0 -373
  187. package/dist/exports/api/workflows/api/auth.d.mts +0 -379
  188. package/dist/exports/api/workflows/api/cache.d.mts +0 -44
  189. package/dist/exports/api/workflows/api/config.d.mts +0 -18
  190. package/dist/exports/api/workflows/api/container.d.mts +0 -167
  191. package/dist/exports/api/workflows/api/database.d.mts +0 -47
  192. package/dist/exports/api/workflows/api/event.d.mts +0 -68
  193. package/dist/exports/api/workflows/api/event.mjs +0 -126
  194. package/dist/exports/api/workflows/api/logger.d.mts +0 -21
  195. package/dist/exports/api/workflows/api/mailer.d.mts +0 -70
  196. package/dist/exports/api/workflows/api/orm.d.mts +0 -13
  197. package/dist/exports/api/workflows/api/redis.mjs +0 -3
  198. package/dist/exports/api/workflows/api/storage-schema.d.mts +0 -699
  199. package/dist/exports/api/workflows/api/storage.d.mts +0 -396
  200. package/dist/exports/api/workflows/api/workflow.d.mts +0 -24
  201. package/dist/exports/api/workflows/constants.mjs +0 -23
  202. package/dist/exports/api/workflows/extract-blob-metadata.mjs +0 -132
  203. package/dist/exports/api/workflows/generate-image-variant.d.mts +0 -63
  204. package/dist/exports/api/workflows/track-db-changes.d.mts +0 -72
  205. package/dist/exports/cli/api/auth-schema.mjs +0 -373
  206. package/dist/exports/cli/api/auth.d.mts +0 -379
  207. package/dist/exports/cli/api/cache.d.mts +0 -44
  208. package/dist/exports/cli/api/config.d.mts +0 -18
  209. package/dist/exports/cli/api/container.d.mts +0 -167
  210. package/dist/exports/cli/api/database.d.mts +0 -47
  211. package/dist/exports/cli/api/event.d.mts +0 -68
  212. package/dist/exports/cli/api/event.mjs +0 -126
  213. package/dist/exports/cli/api/logger.d.mts +0 -21
  214. package/dist/exports/cli/api/mailer.d.mts +0 -70
  215. package/dist/exports/cli/api/orm.d.mts +0 -13
  216. package/dist/exports/cli/api/redis.mjs +0 -3
  217. package/dist/exports/cli/api/storage-schema.d.mts +0 -699
  218. package/dist/exports/cli/api/storage.d.mts +0 -396
  219. package/dist/exports/cli/api/workflow.d.mts +0 -2
  220. package/dist/exports/cli/api/workflows/extract-blob-metadata.mjs +0 -132
  221. package/dist/exports/cli/api/workflows/generate-image-variant.d.mts +0 -63
  222. package/dist/exports/cli/api/workflows/track-db-changes.mjs +0 -110
  223. package/dist/exports/cli/command.d.mts +0 -56
  224. package/dist/exports/cli/command.mjs +0 -43
  225. package/dist/exports/cli/constants.mjs +0 -23
  226. package/dist/exports/cli/context.d.mts +0 -170
  227. package/dist/exports/tests/_virtual/rolldown_runtime.mjs +0 -1
  228. package/dist/exports/tests/api/app-context.d.mts +0 -115
  229. package/dist/exports/tests/api/app-context.mjs +0 -1
  230. package/dist/exports/tests/api/auth-schema.d.mts +0 -4248
  231. package/dist/exports/tests/api/auth-schema.mjs +0 -1
  232. package/dist/exports/tests/api/auth.d.mts +0 -402
  233. package/dist/exports/tests/api/cache.d.mts +0 -44
  234. package/dist/exports/tests/api/config.d.mts +0 -28
  235. package/dist/exports/tests/api/container.d.mts +0 -210
  236. package/dist/exports/tests/api/database.d.mts +0 -101
  237. package/dist/exports/tests/api/database.mjs +0 -1
  238. package/dist/exports/tests/api/event.d.mts +0 -235
  239. package/dist/exports/tests/api/event.mjs +0 -1
  240. package/dist/exports/tests/api/i18n.d.mts +0 -34
  241. package/dist/exports/tests/api/index.d.mts +0 -26
  242. package/dist/exports/tests/api/logger.d.mts +0 -21
  243. package/dist/exports/tests/api/mailer.d.mts +0 -70
  244. package/dist/exports/tests/api/middleware/error-handler.mjs +0 -1
  245. package/dist/exports/tests/api/middleware/health.mjs +0 -1
  246. package/dist/exports/tests/api/middleware/i18n.mjs +0 -1
  247. package/dist/exports/tests/api/middleware/request-logger.d.mts +0 -24
  248. package/dist/exports/tests/api/middleware/request-logger.mjs +0 -1
  249. package/dist/exports/tests/api/middleware/shutdown.mjs +0 -1
  250. package/dist/exports/tests/api/middleware/timeout.mjs +0 -1
  251. package/dist/exports/tests/api/middleware.d.mts +0 -39
  252. package/dist/exports/tests/api/middleware.mjs +0 -1
  253. package/dist/exports/tests/api/openapi.d.mts +0 -271
  254. package/dist/exports/tests/api/openapi.mjs +0 -1
  255. package/dist/exports/tests/api/orm.d.mts +0 -13
  256. package/dist/exports/tests/api/otel.d.mts +0 -40
  257. package/dist/exports/tests/api/redis.d.mts +0 -34
  258. package/dist/exports/tests/api/redis.mjs +0 -1
  259. package/dist/exports/tests/api/server.mjs +0 -1
  260. package/dist/exports/tests/api/storage-schema.d.mts +0 -707
  261. package/dist/exports/tests/api/storage.d.mts +0 -506
  262. package/dist/exports/tests/api/workflow.d.mts +0 -250
  263. package/dist/exports/tests/api/workflows/extract-blob-metadata.mjs +0 -1
  264. package/dist/exports/tests/api/workflows/generate-image-variant.d.mts +0 -63
  265. package/dist/exports/tests/api/workflows/generate-image-variant.mjs +0 -1
  266. package/dist/exports/tests/api/workflows/generate-preview.mjs +0 -1
  267. package/dist/exports/tests/api/workflows/purge-attachment.mjs +0 -1
  268. package/dist/exports/tests/api/workflows/purge-audit-logs.mjs +0 -1
  269. package/dist/exports/tests/api/workflows/purge-unattached-blobs.mjs +0 -1
  270. package/dist/exports/tests/api/workflows/track-db-changes.mjs +0 -1
  271. package/dist/exports/tests/constants.mjs +0 -1
  272. package/dist/exports/tests/instrumentation.d.mts +0 -7
  273. package/dist/exports/tests/instrumentation.mjs +0 -1
  274. package/dist/exports/web/api/auth.d.ts +0 -125
  275. package/dist/exports/web/api/database.d.ts +0 -4
  276. package/dist/exports/web/api/logger.d.ts +0 -1
  277. package/dist/exports/web/auth.d.ts +0 -2388
  278. package/dist/exports/web/auth.js +0 -75
  279. package/dist/exports/web/i18n.d.ts +0 -42
  280. package/dist/exports/web/i18n.js +0 -45
  281. /package/dist/exports/tests/{api/middleware/youch-handler.mjs → youch-handler-Ch5yf6im.mjs} +0 -0
@@ -1,271 +0,0 @@
1
- import { Container } from "./container.mjs";
2
- import { AppContext } from "./app-context.mjs";
3
- import { z } from "zod";
4
- import { Express, Request, RequestHandler } from "ultimate-express";
5
- import * as _node_modules_zod_openapi_dist_components_B1DX_zYv_mjs0 from "#node_modules/zod-openapi/dist/components-B1DX_zYv.mjs";
6
-
7
- //#region src/api/openapi.d.ts
8
-
9
- /**
10
- * Utility type to enforce exact type matching (no extra properties).
11
- * This uses a tuple check to prevent objects with extra keys from being assigned.
12
- * Arrays are handled specially to avoid treating numeric indices as object keys.
13
- */
14
- type Exact<T, Expected> = [T] extends [Expected] ? [Expected] extends [T] ? T : T extends readonly unknown[] ? Expected extends readonly unknown[] ? T extends readonly (infer TItem)[] ? Expected extends readonly (infer ExpectedItem)[] ? readonly Exact<TItem, ExpectedItem>[] : T : T : { [K in keyof T]: K extends keyof Expected ? Exact<T[K], Expected[K]> : ["Error: unexpected key", K] } : { [K in keyof T]: K extends keyof Expected ? Exact<T[K], Expected[K]> : ["Error: unexpected key", K] } : T;
15
- /**
16
- * Response marker type for Express compatibility.
17
- */
18
- type ResponseMarker<T = unknown> = {
19
- __response: true;
20
- status: number;
21
- data: T;
22
- };
23
- /**
24
- * Define typed response builders based on defined response schemas.
25
- */
26
- declare function defineTypedResponses<TResponses extends Record<number, {
27
- description: string;
28
- schema: z.ZodSchema;
29
- }>>(responses: TResponses): { [K in keyof TResponses as GetMethodName<K>]: K extends number ? TResponses[K]["schema"] extends z.ZodNull ? () => ResponseMarker<null> : <T extends z.infer<TResponses[K]["schema"]>>(data: Exact<T, z.infer<TResponses[K]["schema"]>>) => ResponseMarker<z.infer<TResponses[K]["schema"]>> : never } & {
30
- status: <S extends keyof TResponses & number>(statusCode: S, data: TResponses[S]["schema"] extends z.ZodNull ? undefined : Exact<z.infer<TResponses[S]["schema"]>, z.infer<TResponses[S]["schema"]>>) => ResponseMarker;
31
- };
32
- type GetMethodName<K$1> = K$1 extends 200 ? "ok" : K$1 extends 201 ? "created" : K$1 extends 202 ? "accepted" : K$1 extends 204 ? "noContent" : K$1 extends 400 ? "badRequest" : K$1 extends 401 ? "unauthorized" : K$1 extends 403 ? "forbidden" : K$1 extends 404 ? "notFound" : K$1 extends 409 ? "conflict" : K$1 extends 422 ? "unprocessableEntity" : K$1 extends 500 ? "internalServerError" : never;
33
- /**
34
- * Handler parameters with full type safety for request inputs.
35
- */
36
- type HandlerParams<TParams extends z.ZodSchema | undefined = undefined, TQuery extends z.ZodSchema | undefined = undefined, TBody extends z.ZodSchema | undefined = undefined, THeaders extends z.ZodSchema | undefined = undefined, TResponses extends Record<number, {
37
- description: string;
38
- schema: z.ZodSchema;
39
- }> = Record<number, {
40
- description: string;
41
- schema: z.ZodSchema;
42
- }>> = {
43
- ctx: AppContext;
44
- body: TBody extends z.ZodSchema ? z.infer<TBody> : unknown;
45
- headers: THeaders extends z.ZodSchema ? z.infer<THeaders> : Record<string, string>;
46
- params: TParams extends z.ZodSchema ? z.infer<TParams> : Record<string, unknown>;
47
- query: TQuery extends z.ZodSchema ? z.infer<TQuery> : Record<string, unknown>;
48
- request: Request;
49
- response: ReturnType<typeof defineTypedResponses<TResponses>>;
50
- };
51
- /**
52
- * Helper function to define an OpenAPI endpoint with full type safety.
53
- */
54
- declare function defineOpenAPIEndpoint<TParams extends z.ZodSchema | undefined = undefined, TQuery extends z.ZodSchema | undefined = undefined, TBody extends z.ZodSchema | undefined = undefined, THeaders extends z.ZodSchema | undefined = undefined, TResponses extends Record<number, {
55
- description: string;
56
- schema: z.ZodSchema;
57
- }> = Record<number, {
58
- description: string;
59
- schema: z.ZodSchema;
60
- }>>(spec: {
61
- summary?: string;
62
- description?: string;
63
- params?: TParams;
64
- query?: TQuery;
65
- requestBody?: TBody;
66
- headers?: THeaders;
67
- responses: TResponses;
68
- handler: (params: HandlerParams<TParams, TQuery, TBody, THeaders, TResponses>) => Promise<ResponseMarker>;
69
- }): {
70
- summary?: string;
71
- description?: string;
72
- params?: TParams;
73
- query?: TQuery;
74
- requestBody?: TBody;
75
- headers?: THeaders;
76
- responses: TResponses;
77
- handler: (params: HandlerParams<TParams, TQuery, TBody, THeaders, TResponses>) => Promise<ResponseMarker>;
78
- };
79
- /**
80
- * OpenAPI method specification type (for internal use).
81
- */
82
- type OpenAPIMethodSpec = {
83
- summary?: string;
84
- description?: string;
85
- params?: z.ZodSchema;
86
- query?: z.ZodSchema;
87
- requestBody?: z.ZodSchema;
88
- headers?: z.ZodSchema;
89
- responses: Record<number, {
90
- description: string;
91
- schema: z.ZodSchema;
92
- }>;
93
- handler: (params: HandlerParams<any, any, any, any, any>) => Promise<ResponseMarker>;
94
- };
95
- /**
96
- * Configuration object for defineOpenApi.
97
- */
98
- type DefineOpenAPIConfig = { [K in "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE"]?: OpenAPIMethodSpec };
99
- /**
100
- * OpenAPI configuration for document-level settings
101
- */
102
- type OpenAPIObjectConfigV31 = {
103
- info: {
104
- title: string;
105
- version: string;
106
- description?: string;
107
- contact?: {
108
- name?: string;
109
- email?: string;
110
- url?: string;
111
- };
112
- license?: {
113
- name: string;
114
- url?: string;
115
- };
116
- };
117
- servers?: Array<{
118
- url: string;
119
- description?: string;
120
- }>;
121
- openapi: "3.1.0";
122
- };
123
- /**
124
- * Simplified config input for defineOpenAPIConfig
125
- */
126
- type DefineOpenAPIConfigInput = {
127
- info: OpenAPIObjectConfigV31["info"];
128
- servers?: OpenAPIObjectConfigV31["servers"];
129
- };
130
- /**
131
- * OpenAPI registration format (without path - CLI will add it)
132
- */
133
- type OpenAPIRegistration = {
134
- method: "get" | "post" | "put" | "patch" | "delete" | "head";
135
- summary?: string;
136
- description?: string;
137
- request?: {
138
- params?: z.ZodSchema;
139
- query?: z.ZodSchema;
140
- body?: z.ZodSchema;
141
- headers?: z.ZodSchema;
142
- };
143
- responses: Record<number, {
144
- description: string;
145
- content: {
146
- "application/json": {
147
- schema: z.ZodSchema;
148
- };
149
- };
150
- }>;
151
- };
152
- /**
153
- * Return type for defineOpenAPI function
154
- */
155
- type DefineOpenAPIReturn = {
156
- handlers: Record<string, RequestHandler>;
157
- openAPISpec: OpenAPIRegistration[];
158
- };
159
- /**
160
- * RFC 9457 compliant validation error response
161
- */
162
- type ValidationErrorResponse = {
163
- error: "validation_error";
164
- status: number;
165
- detail: string;
166
- errors: Array<{
167
- field: string;
168
- message: string;
169
- received: unknown;
170
- }>;
171
- };
172
- /**
173
- * Define OpenAPI-based route handlers with full type safety.
174
- *
175
- * @param config Configuration object with HTTP method specifications
176
- * @returns Object containing Express handlers and openAPISpec
177
- *
178
- * @example
179
- * ```typescript
180
- * // Basic usage
181
- * export default defineOpenAPI({
182
- * GET: {
183
- * summary: "Get user by ID",
184
- * params: z.object({ id: z.uuid() }),
185
- * responses: {
186
- * 200: { description: "User data", schema: UserSchema }
187
- * },
188
- * handler: async ({ params, response }) => {
189
- * const user = await getUser(params.id);
190
- * return response.ok(user); // Fully typed!
191
- * }
192
- * },
193
- * POST: {
194
- * summary: "Create user",
195
- * requestBody: CreateUserSchema,
196
- * responses: {
197
- * 201: { description: "User created", schema: UserSchema }
198
- * },
199
- * handler: async ({ body, response }) => {
200
- * const user = await createUser(body);
201
- * return response.created(user); // Fully typed!
202
- * }
203
- * }
204
- * });
205
- * ```
206
- */
207
- declare function defineOpenAPI(config: DefineOpenAPIConfig): DefineOpenAPIReturn;
208
- /**
209
- * Define OpenAPI document configuration with improved DX.
210
- *
211
- * Only allows specifying info and servers objects, ensuring a consistent
212
- * OpenAPI v3.1.0 structure while preventing configuration of other fields.
213
- *
214
- * @param config Configuration object with info and optional servers
215
- * @returns Complete OpenAPI configuration object
216
- *
217
- * @example
218
- * ```typescript
219
- * export const openAPIConfig = defineOpenAPIConfig({
220
- * info: {
221
- * title: "My API",
222
- * version: "1.0.0",
223
- * description: "API v1 - Authentication and core features",
224
- * contact: {
225
- * name: "API Support",
226
- * email: "support@example.com",
227
- * },
228
- * },
229
- * servers: [
230
- * {
231
- * url: process.env.API_URL || "http://localhost:8000",
232
- * description: "API Server",
233
- * },
234
- * ],
235
- * });
236
- * ```
237
- */
238
- declare function defineOpenAPIConfig<TContainer extends Container = Container>(config: (container: TContainer) => DefineOpenAPIConfigInput): (container: TContainer) => OpenAPIObjectConfigV31;
239
- /**
240
- * Route module type for scanned API routes
241
- */
242
- type RouteModule = {
243
- path: string;
244
- filePath: string;
245
- handlers: Record<string, RequestHandler>;
246
- openAPISpec: OpenAPIRegistration[];
247
- version?: string;
248
- };
249
- /**
250
- * Generate complete OpenAPI 3.1.0 document from routes using zod-openapi
251
- */
252
- declare function generateOpenAPIDocument(routes: RouteModule[], version: string, config?: DefineOpenAPIConfigInput): _node_modules_zod_openapi_dist_components_B1DX_zYv_mjs0.it;
253
- /**
254
- * Scan routes directory and convert to Express route paths using remix-flat-routes.
255
- */
256
- declare function scanAPIRoutes(container: Container): Promise<RouteModule[]>;
257
- /**
258
- * Register scanned routes with Express app.
259
- */
260
- declare function registerRoutes(app: Express, routes: RouteModule[]): void;
261
- /**
262
- * Write OpenAPI specs to api/public/openapi directory.
263
- */
264
- declare function writeOpenAPISpecs<TContainer extends Container>(container: TContainer, routes: RouteModule[]): Promise<void>;
265
- /**
266
- * Load and register API routes with Express (convenience function).
267
- * Also auto-generates OpenAPI specs in development mode.
268
- */
269
- declare function loadAndRegisterAPIRoutes<TContainer extends Container>(app: Express): Promise<void>;
270
- //#endregion
271
- export { DefineOpenAPIConfig, DefineOpenAPIConfigInput, DefineOpenAPIReturn, HandlerParams, OpenAPIMethodSpec, OpenAPIObjectConfigV31, OpenAPIRegistration, RouteModule, ValidationErrorResponse, defineOpenAPI, defineOpenAPIConfig, defineOpenAPIEndpoint, defineTypedResponses, generateOpenAPIDocument, loadAndRegisterAPIRoutes, registerRoutes, scanAPIRoutes, writeOpenAPISpecs };