@geekmidas/cli 10.0.0-alpha.1 → 10.0.0-alpha.100

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 (491) hide show
  1. package/README.md +326 -421
  2. package/bin/adjacent-tsconfig.mjs +97 -0
  3. package/bin/gkm.mjs +16 -2
  4. package/bin/owning-tsconfig-jsx-register.mjs +18 -0
  5. package/bin/owning-tsconfig-jsx.mjs +108 -0
  6. package/dist/EndpointGenerator-Br97xgs_.mjs +1031 -0
  7. package/dist/EndpointGenerator-Br97xgs_.mjs.map +1 -0
  8. package/dist/EndpointGenerator-By5_tYE9.cjs +1090 -0
  9. package/dist/EndpointGenerator-By5_tYE9.cjs.map +1 -0
  10. package/dist/GoDaddyProvider-CVnzcWX5.mjs +388 -0
  11. package/dist/GoDaddyProvider-CVnzcWX5.mjs.map +1 -0
  12. package/dist/GoDaddyProvider-DS4Wgu0c.cjs +388 -0
  13. package/dist/GoDaddyProvider-DS4Wgu0c.cjs.map +1 -0
  14. package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-BNpS9aRJ.mjs} +29 -25
  15. package/dist/HostingerProvider-BNpS9aRJ.mjs.map +1 -0
  16. package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-DR1iws1P.cjs} +29 -25
  17. package/dist/HostingerProvider-DR1iws1P.cjs.map +1 -0
  18. package/dist/LegacyStateStore-C2Xlqy4v.mjs +124 -0
  19. package/dist/LegacyStateStore-C2Xlqy4v.mjs.map +1 -0
  20. package/dist/LegacyStateStore-CoHPQMLO.cjs +124 -0
  21. package/dist/LegacyStateStore-CoHPQMLO.cjs.map +1 -0
  22. package/dist/LocalStateStore-BGDzf2f8.cjs +178 -0
  23. package/dist/LocalStateStore-BGDzf2f8.cjs.map +1 -0
  24. package/dist/LocalStateStore-By59pUve.mjs +167 -0
  25. package/dist/LocalStateStore-By59pUve.mjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-BgSX_Z-e.cjs +541 -0
  27. package/dist/OpenApiTsGenerator-BgSX_Z-e.cjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-C8aTX--y.mjs +536 -0
  29. package/dist/OpenApiTsGenerator-C8aTX--y.mjs.map +1 -0
  30. package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-Bllus2NR.cjs} +21 -22
  31. package/dist/Route53Provider-Bllus2NR.cjs.map +1 -0
  32. package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-QXxjkZO1.mjs} +13 -13
  33. package/dist/Route53Provider-QXxjkZO1.mjs.map +1 -0
  34. package/dist/S3StateStore-CU485pYn.mjs +223 -0
  35. package/dist/S3StateStore-CU485pYn.mjs.map +1 -0
  36. package/dist/S3StateStore-Re4LfDTl.cjs +222 -0
  37. package/dist/S3StateStore-Re4LfDTl.cjs.map +1 -0
  38. package/dist/SSMStateStore-BquRBbUG.mjs +205 -0
  39. package/dist/SSMStateStore-BquRBbUG.mjs.map +1 -0
  40. package/dist/SSMStateStore-CLX4Dm5d.cjs +204 -0
  41. package/dist/SSMStateStore-CLX4Dm5d.cjs.map +1 -0
  42. package/dist/SubscriberGenerator-1-IsjIwF.mjs +449 -0
  43. package/dist/SubscriberGenerator-1-IsjIwF.mjs.map +1 -0
  44. package/dist/SubscriberGenerator-BlIOdbi-.cjs +490 -0
  45. package/dist/SubscriberGenerator-BlIOdbi-.cjs.map +1 -0
  46. package/dist/add-Blv6Q_YA.mjs +718 -0
  47. package/dist/add-Blv6Q_YA.mjs.map +1 -0
  48. package/dist/add-C6RhiCBX.cjs +720 -0
  49. package/dist/add-C6RhiCBX.cjs.map +1 -0
  50. package/dist/appPorts-C9z9Pzn9.mjs +223 -0
  51. package/dist/appPorts-C9z9Pzn9.mjs.map +1 -0
  52. package/dist/appPorts-Cu79hJF6.cjs +264 -0
  53. package/dist/appPorts-Cu79hJF6.cjs.map +1 -0
  54. package/dist/aws-8QQ8n-t6.mjs +89 -0
  55. package/dist/aws-8QQ8n-t6.mjs.map +1 -0
  56. package/dist/aws-DY9NqQIT.cjs +100 -0
  57. package/dist/aws-DY9NqQIT.cjs.map +1 -0
  58. package/dist/awsStore-Bx5nCFnS.mjs +121 -0
  59. package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
  60. package/dist/awsStore-u3ehhMoY.cjs +138 -0
  61. package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
  62. package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-C8DnCmxK.mjs} +11 -8
  63. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  64. package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-oDEsPj02.cjs} +22 -20
  65. package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
  66. package/dist/backups/runner.cjs +519 -0
  67. package/dist/backups/runner.cjs.map +1 -0
  68. package/dist/backups/runner.d.cts +102 -0
  69. package/dist/backups/runner.d.cts.map +1 -0
  70. package/dist/backups/runner.d.mts +102 -0
  71. package/dist/backups/runner.d.mts.map +1 -0
  72. package/dist/backups/runner.mjs +506 -0
  73. package/dist/backups/runner.mjs.map +1 -0
  74. package/dist/{bundler-Be8Zg4Wd.mjs → bundler-Cquc0e8N.mjs} +36 -32
  75. package/dist/bundler-Cquc0e8N.mjs.map +1 -0
  76. package/dist/{bundler-BY1OmV1e.cjs → bundler-DAeBIOlG.cjs} +38 -35
  77. package/dist/bundler-DAeBIOlG.cjs.map +1 -0
  78. package/dist/cli-DbeqYBTs.cjs +71 -0
  79. package/dist/cli-DbeqYBTs.cjs.map +1 -0
  80. package/dist/cli-tWfeiYmO.mjs +71 -0
  81. package/dist/cli-tWfeiYmO.mjs.map +1 -0
  82. package/dist/compose-BftbEv0b.mjs +3154 -0
  83. package/dist/compose-BftbEv0b.mjs.map +1 -0
  84. package/dist/compose-C_mfrSVH.cjs +3267 -0
  85. package/dist/compose-C_mfrSVH.cjs.map +1 -0
  86. package/dist/config-D48erO2j.d.mts +269 -0
  87. package/dist/config-D48erO2j.d.mts.map +1 -0
  88. package/dist/config-DHDtsQrB.d.cts +269 -0
  89. package/dist/config-DHDtsQrB.d.cts.map +1 -0
  90. package/dist/config.cjs +421 -11
  91. package/dist/config.cjs.map +1 -0
  92. package/dist/config.d.cts +4 -120
  93. package/dist/config.d.mts +4 -120
  94. package/dist/config.mjs +405 -4
  95. package/dist/config.mjs.map +1 -0
  96. package/dist/credentialSchemas-DDda4Mmm.cjs +272 -0
  97. package/dist/credentialSchemas-DDda4Mmm.cjs.map +1 -0
  98. package/dist/credentialSchemas-DvitraL-.mjs +237 -0
  99. package/dist/credentialSchemas-DvitraL-.mjs.map +1 -0
  100. package/dist/credentials-B5N5yKk6.mjs +267 -0
  101. package/dist/credentials-B5N5yKk6.mjs.map +1 -0
  102. package/dist/credentials-Zqr3QQYB.cjs +350 -0
  103. package/dist/credentials-Zqr3QQYB.cjs.map +1 -0
  104. package/dist/databases-BeGP5eDh.mjs +495 -0
  105. package/dist/databases-BeGP5eDh.mjs.map +1 -0
  106. package/dist/databases-DGALFDG3.cjs +598 -0
  107. package/dist/databases-DGALFDG3.cjs.map +1 -0
  108. package/dist/define-6poNqm5O.mjs +106 -0
  109. package/dist/define-6poNqm5O.mjs.map +1 -0
  110. package/dist/define-crmMcXFS.cjs +153 -0
  111. package/dist/define-crmMcXFS.cjs.map +1 -0
  112. package/dist/deploy/public.cjs +212 -0
  113. package/dist/deploy/public.cjs.map +1 -0
  114. package/dist/deploy/public.d.cts +653 -0
  115. package/dist/deploy/public.d.cts.map +1 -0
  116. package/dist/deploy/public.d.mts +653 -0
  117. package/dist/deploy/public.d.mts.map +1 -0
  118. package/dist/deploy/public.mjs +145 -0
  119. package/dist/deploy/public.mjs.map +1 -0
  120. package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
  121. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  122. package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
  123. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  124. package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
  125. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  126. package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
  127. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  128. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  129. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  130. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  131. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  132. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  133. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  134. package/dist/deploy/sniffer-hooks.cjs +13 -7
  135. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  136. package/dist/deploy/sniffer-hooks.d.cts +1 -2
  137. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  138. package/dist/deploy/sniffer-hooks.d.mts +1 -2
  139. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  140. package/dist/deploy/sniffer-hooks.mjs +10 -3
  141. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  142. package/dist/deploy/sniffer-loader.cjs +16 -7
  143. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  144. package/dist/deploy/sniffer-loader.d.cts +1 -1
  145. package/dist/deploy/sniffer-loader.d.mts +1 -1
  146. package/dist/deploy/sniffer-loader.mjs +14 -3
  147. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  148. package/dist/deploy/sniffer-routes-worker.cjs +11 -11
  149. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  150. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  151. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  152. package/dist/deploy/sniffer-routes-worker.mjs +4 -4
  153. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  154. package/dist/deploy/sniffer-worker.cjs +15 -6
  155. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  156. package/dist/deploy/sniffer-worker.d.cts +1 -3
  157. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  158. package/dist/deploy/sniffer-worker.d.mts +1 -3
  159. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  160. package/dist/deploy/sniffer-worker.mjs +15 -4
  161. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  162. package/dist/deploy-BSilGXuR.mjs +2317 -0
  163. package/dist/deploy-BSilGXuR.mjs.map +1 -0
  164. package/dist/deploy-CktQpmpU.cjs +2390 -0
  165. package/dist/deploy-CktQpmpU.cjs.map +1 -0
  166. package/dist/derive-B4vDpzgP.mjs +150 -0
  167. package/dist/derive-B4vDpzgP.mjs.map +1 -0
  168. package/dist/derive-DAbo49sm.cjs +161 -0
  169. package/dist/derive-DAbo49sm.cjs.map +1 -0
  170. package/dist/discover-BfhVW_kT.cjs +600 -0
  171. package/dist/discover-BfhVW_kT.cjs.map +1 -0
  172. package/dist/discover-CvTtV5ZD.d.cts +108 -0
  173. package/dist/discover-CvTtV5ZD.d.cts.map +1 -0
  174. package/dist/discover-W2kab9Lc.d.mts +108 -0
  175. package/dist/discover-W2kab9Lc.d.mts.map +1 -0
  176. package/dist/discover-kziEht4W.mjs +527 -0
  177. package/dist/discover-kziEht4W.mjs.map +1 -0
  178. package/dist/dns-CQZQL3gj.mjs +926 -0
  179. package/dist/dns-CQZQL3gj.mjs.map +1 -0
  180. package/dist/dns-KPxvcCdL.cjs +1057 -0
  181. package/dist/dns-KPxvcCdL.cjs.map +1 -0
  182. package/dist/dokploy-B7eMa6Pa.cjs +38 -0
  183. package/dist/dokploy-B7eMa6Pa.cjs.map +1 -0
  184. package/dist/dokploy-Dguhz3Uo.mjs +38 -0
  185. package/dist/dokploy-Dguhz3Uo.mjs.map +1 -0
  186. package/dist/drivers-BLU1fNs_.cjs +200 -0
  187. package/dist/drivers-BLU1fNs_.cjs.map +1 -0
  188. package/dist/drivers-C08LL4E8.mjs +177 -0
  189. package/dist/drivers-C08LL4E8.mjs.map +1 -0
  190. package/dist/{emit-CiZS_5Ub.mjs → emit-C1e8qD08.mjs} +13 -26
  191. package/dist/emit-C1e8qD08.mjs.map +1 -0
  192. package/dist/{emit-CbcRolsa.cjs → emit-Dmc1nvdS.cjs} +31 -57
  193. package/dist/emit-Dmc1nvdS.cjs.map +1 -0
  194. package/dist/encryption-CixpDF6e.mjs +89 -0
  195. package/dist/encryption-CixpDF6e.mjs.map +1 -0
  196. package/dist/encryption-DrhCX7G6.cjs +90 -0
  197. package/dist/encryption-DrhCX7G6.cjs.map +1 -0
  198. package/dist/engine-32gL2ju3.mjs +3082 -0
  199. package/dist/engine-32gL2ju3.mjs.map +1 -0
  200. package/dist/engine-CQgycl7o.cjs +3195 -0
  201. package/dist/engine-CQgycl7o.cjs.map +1 -0
  202. package/dist/errors-D8Gwp5kU.mjs +23 -0
  203. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  204. package/dist/errors-DMC4Umsb.cjs +34 -0
  205. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  206. package/dist/github-DYQ5wvod.mjs +829 -0
  207. package/dist/github-DYQ5wvod.mjs.map +1 -0
  208. package/dist/github-DkSCUoWS.cjs +829 -0
  209. package/dist/github-DkSCUoWS.cjs.map +1 -0
  210. package/dist/identity-CBXr4wNi.mjs +129 -0
  211. package/dist/identity-CBXr4wNi.mjs.map +1 -0
  212. package/dist/identity-CbLfgQNT.cjs +182 -0
  213. package/dist/identity-CbLfgQNT.cjs.map +1 -0
  214. package/dist/{index-BThUzEIp.d.mts → index-8OfpOtSI.d.cts} +39 -24
  215. package/dist/index-8OfpOtSI.d.cts.map +1 -0
  216. package/dist/{index-CHB4tSzX.d.cts → index-Dpji6Bxq.d.mts} +39 -24
  217. package/dist/index-Dpji6Bxq.d.mts.map +1 -0
  218. package/dist/index.cjs +10483 -11859
  219. package/dist/index.cjs.map +1 -1
  220. package/dist/index.d.cts +1 -1
  221. package/dist/index.d.mts +1 -1
  222. package/dist/index.mjs +10527 -11915
  223. package/dist/index.mjs.map +1 -1
  224. package/dist/local-BwC2v2Y8.mjs +224 -0
  225. package/dist/local-BwC2v2Y8.mjs.map +1 -0
  226. package/dist/local-DNhnkugT.cjs +241 -0
  227. package/dist/local-DNhnkugT.cjs.map +1 -0
  228. package/dist/migrate-BoJxKbfR.mjs +181 -0
  229. package/dist/migrate-BoJxKbfR.mjs.map +1 -0
  230. package/dist/migrate-CJTyeBul.cjs +271 -0
  231. package/dist/migrate-CJTyeBul.cjs.map +1 -0
  232. package/dist/migrate-CxmkvMbw.mjs +266 -0
  233. package/dist/migrate-CxmkvMbw.mjs.map +1 -0
  234. package/dist/migrate-ISBZNDKU.cjs +181 -0
  235. package/dist/migrate-ISBZNDKU.cjs.map +1 -0
  236. package/dist/openapi.cjs +214 -8
  237. package/dist/openapi.cjs.map +1 -0
  238. package/dist/openapi.d.cts +72 -15
  239. package/dist/openapi.d.cts.map +1 -1
  240. package/dist/openapi.d.mts +72 -15
  241. package/dist/openapi.d.mts.map +1 -1
  242. package/dist/openapi.mjs +208 -5
  243. package/dist/openapi.mjs.map +1 -0
  244. package/dist/projectBucket-BBbQ1lHF.cjs +263 -0
  245. package/dist/projectBucket-BBbQ1lHF.cjs.map +1 -0
  246. package/dist/projectBucket-C_DN4WzF.mjs +222 -0
  247. package/dist/projectBucket-C_DN4WzF.mjs.map +1 -0
  248. package/dist/provider-BqpjG9QM.cjs +57 -0
  249. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  250. package/dist/provider-CEOKk8NS.mjs +46 -0
  251. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  252. package/dist/ready-BtxiI7Qb.cjs +403 -0
  253. package/dist/ready-BtxiI7Qb.cjs.map +1 -0
  254. package/dist/ready-CzHNHhI6.mjs +374 -0
  255. package/dist/ready-CzHNHhI6.mjs.map +1 -0
  256. package/dist/reconcile/public.cjs +3 -5
  257. package/dist/reconcile/public.d.cts +11 -87
  258. package/dist/reconcile/public.d.cts.map +1 -1
  259. package/dist/reconcile/public.d.mts +11 -87
  260. package/dist/reconcile/public.d.mts.map +1 -1
  261. package/dist/reconcile/public.mjs +3 -4
  262. package/dist/{reconcile-CFs8C_1a.mjs → reconcile--I7V4Klj.mjs} +4 -7
  263. package/dist/reconcile--I7V4Klj.mjs.map +1 -0
  264. package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
  265. package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
  266. package/dist/resolve-Bei6BMbw.mjs +263 -0
  267. package/dist/resolve-Bei6BMbw.mjs.map +1 -0
  268. package/dist/resolve-qm7FrBj_.cjs +316 -0
  269. package/dist/resolve-qm7FrBj_.cjs.map +1 -0
  270. package/dist/rollback-BJ3H4kQ8.mjs +136 -0
  271. package/dist/rollback-BJ3H4kQ8.mjs.map +1 -0
  272. package/dist/rollback-Bt4xRXtq.cjs +165 -0
  273. package/dist/rollback-Bt4xRXtq.cjs.map +1 -0
  274. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  275. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
  276. package/dist/run-BJLIerMM.mjs +133 -0
  277. package/dist/run-BJLIerMM.mjs.map +1 -0
  278. package/dist/run-fVZ-rLnc.cjs +174 -0
  279. package/dist/run-fVZ-rLnc.cjs.map +1 -0
  280. package/dist/runtime-ACdfK59n.d.cts +82 -0
  281. package/dist/runtime-ACdfK59n.d.cts.map +1 -0
  282. package/dist/runtime-YyQuekxi.d.mts +82 -0
  283. package/dist/runtime-YyQuekxi.d.mts.map +1 -0
  284. package/dist/s3-CrPoA89T.cjs +215 -0
  285. package/dist/s3-CrPoA89T.cjs.map +1 -0
  286. package/dist/s3-DQXZdmCM.mjs +215 -0
  287. package/dist/s3-DQXZdmCM.mjs.map +1 -0
  288. package/dist/sandbox/config-worker.cjs +43 -0
  289. package/dist/sandbox/config-worker.cjs.map +1 -0
  290. package/dist/sandbox/config-worker.d.cts +1 -0
  291. package/dist/sandbox/config-worker.d.mts +1 -0
  292. package/dist/sandbox/config-worker.mjs +44 -0
  293. package/dist/sandbox/config-worker.mjs.map +1 -0
  294. package/dist/sandbox/credentials-worker.cjs +54 -0
  295. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  296. package/dist/sandbox/credentials-worker.d.cts +1 -0
  297. package/dist/sandbox/credentials-worker.d.mts +1 -0
  298. package/dist/sandbox/credentials-worker.mjs +55 -0
  299. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  300. package/dist/sandbox/discover-worker.cjs +47 -0
  301. package/dist/sandbox/discover-worker.cjs.map +1 -0
  302. package/dist/sandbox/discover-worker.d.cts +1 -0
  303. package/dist/sandbox/discover-worker.d.mts +1 -0
  304. package/dist/sandbox/discover-worker.mjs +48 -0
  305. package/dist/sandbox/discover-worker.mjs.map +1 -0
  306. package/dist/sandbox/migrate-worker.cjs +75 -0
  307. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  308. package/dist/sandbox/migrate-worker.d.cts +1 -0
  309. package/dist/sandbox/migrate-worker.d.mts +1 -0
  310. package/dist/sandbox/migrate-worker.mjs +76 -0
  311. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  312. package/dist/sandbox-C4g1eG31.d.mts +104 -0
  313. package/dist/sandbox-C4g1eG31.d.mts.map +1 -0
  314. package/dist/sandbox-CHv3OYXg.cjs +165 -0
  315. package/dist/sandbox-CHv3OYXg.cjs.map +1 -0
  316. package/dist/sandbox-CbVB7uOD.mjs +118 -0
  317. package/dist/sandbox-CbVB7uOD.mjs.map +1 -0
  318. package/dist/sandbox-CdKgQ3XU.d.cts +104 -0
  319. package/dist/sandbox-CdKgQ3XU.d.cts.map +1 -0
  320. package/dist/schemas-BCwKKA42.mjs +5961 -0
  321. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  322. package/dist/schemas-BQ_v0lEX.cjs +6068 -0
  323. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  324. package/dist/secretsManager-CQORubp9.mjs +97 -0
  325. package/dist/secretsManager-CQORubp9.mjs.map +1 -0
  326. package/dist/secretsManager-RAGcEDX1.cjs +108 -0
  327. package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
  328. package/dist/seeds-CHIPcMrY.cjs +9115 -0
  329. package/dist/seeds-CHIPcMrY.cjs.map +1 -0
  330. package/dist/seeds-E4nUeXTl.mjs +8148 -0
  331. package/dist/seeds-E4nUeXTl.mjs.map +1 -0
  332. package/dist/sniffer-bUiSXLMj.mjs +1825 -0
  333. package/dist/sniffer-bUiSXLMj.mjs.map +1 -0
  334. package/dist/sniffer-n3TkX6JD.cjs +1998 -0
  335. package/dist/sniffer-n3TkX6JD.cjs.map +1 -0
  336. package/dist/sst-B-Uz4cvm.cjs +464 -0
  337. package/dist/sst-B-Uz4cvm.cjs.map +1 -0
  338. package/dist/sst-C1pxbFEd.mjs +441 -0
  339. package/dist/sst-C1pxbFEd.mjs.map +1 -0
  340. package/dist/stages-DJrOYLZ-.mjs +176 -0
  341. package/dist/stages-DJrOYLZ-.mjs.map +1 -0
  342. package/dist/stages-_3RVNG83.cjs +176 -0
  343. package/dist/stages-_3RVNG83.cjs.map +1 -0
  344. package/dist/target/public.cjs +15 -0
  345. package/dist/target/public.d.cts +28 -0
  346. package/dist/target/public.d.cts.map +1 -0
  347. package/dist/target/public.d.mts +28 -0
  348. package/dist/target/public.d.mts.map +1 -0
  349. package/dist/target/public.mjs +4 -0
  350. package/dist/terminal-Bs_lNQhL.mjs +85 -0
  351. package/dist/terminal-Bs_lNQhL.mjs.map +1 -0
  352. package/dist/terminal-CsQz4oT0.cjs +85 -0
  353. package/dist/terminal-CsQz4oT0.cjs.map +1 -0
  354. package/dist/types-B6UXlEkf.d.cts +7650 -0
  355. package/dist/types-B6UXlEkf.d.cts.map +1 -0
  356. package/dist/types-HqVPddRK.d.mts +7649 -0
  357. package/dist/types-HqVPddRK.d.mts.map +1 -0
  358. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  359. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  360. package/dist/utils-D_fxUqvU.mjs +156 -0
  361. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  362. package/dist/vitest.cjs +65 -0
  363. package/dist/vitest.cjs.map +1 -0
  364. package/dist/vitest.d.cts +29 -0
  365. package/dist/vitest.d.cts.map +1 -0
  366. package/dist/vitest.d.mts +29 -0
  367. package/dist/vitest.d.mts.map +1 -0
  368. package/dist/vitest.mjs +65 -0
  369. package/dist/vitest.mjs.map +1 -0
  370. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  371. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  372. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  373. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  374. package/dist/workspace/index.cjs +8 -4
  375. package/dist/workspace/index.d.cts +3 -3
  376. package/dist/workspace/index.d.mts +3 -3
  377. package/dist/workspace/index.mjs +2 -3
  378. package/dist/workspace-BwqQnool.cjs +2806 -0
  379. package/dist/workspace-BwqQnool.cjs.map +1 -0
  380. package/dist/workspace-D1QbNd55.mjs +2394 -0
  381. package/dist/workspace-D1QbNd55.mjs.map +1 -0
  382. package/package.json +73 -40
  383. package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
  384. package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
  385. package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
  386. package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
  387. package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
  388. package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
  389. package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
  390. package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
  391. package/dist/LocalStateProvider-Bn6tS-oL.mjs +0 -42
  392. package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
  393. package/dist/LocalStateProvider-Db9SEjyH.cjs +0 -43
  394. package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
  395. package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
  396. package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
  397. package/dist/SSMStateProvider-BRt2py-A.mjs +0 -66
  398. package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
  399. package/dist/SSMStateProvider-DyX8s9HI.cjs +0 -66
  400. package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
  401. package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
  402. package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
  403. package/dist/bundler-BY1OmV1e.cjs.map +0 -1
  404. package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
  405. package/dist/chunk-Duj1WY3L.mjs +0 -7
  406. package/dist/config-D8o6I_7Z.mjs +0 -469
  407. package/dist/config-D8o6I_7Z.mjs.map +0 -1
  408. package/dist/config-DbPE1KXF.cjs +0 -535
  409. package/dist/config-DbPE1KXF.cjs.map +0 -1
  410. package/dist/config.d.cts.map +0 -1
  411. package/dist/config.d.mts.map +0 -1
  412. package/dist/credentials-B5zRHdAl.mjs +0 -141
  413. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  414. package/dist/credentials-BapzjyV5.cjs +0 -195
  415. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  416. package/dist/credentials-Dh0Q6HzY.mjs +0 -2548
  417. package/dist/credentials-Dh0Q6HzY.mjs.map +0 -1
  418. package/dist/credentials-K961ThG3.cjs +0 -2680
  419. package/dist/credentials-K961ThG3.cjs.map +0 -1
  420. package/dist/discover-CAlFgYec.mjs +0 -229
  421. package/dist/discover-CAlFgYec.mjs.map +0 -1
  422. package/dist/discover-DTmFeloL.cjs +0 -271
  423. package/dist/discover-DTmFeloL.cjs.map +0 -1
  424. package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
  425. package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
  426. package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
  427. package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
  428. package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
  429. package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
  430. package/dist/emit-CbcRolsa.cjs.map +0 -1
  431. package/dist/emit-CiZS_5Ub.mjs.map +0 -1
  432. package/dist/encryption-C6jaU0hE.cjs +0 -54
  433. package/dist/encryption-C6jaU0hE.cjs.map +0 -1
  434. package/dist/encryption-CHzzeR8a.cjs +0 -4
  435. package/dist/encryption-CQUncu7v.mjs +0 -3
  436. package/dist/encryption-D-abyhZx.mjs +0 -42
  437. package/dist/encryption-D-abyhZx.mjs.map +0 -1
  438. package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
  439. package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
  440. package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
  441. package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
  442. package/dist/generator-CNzBw7g5.cjs +0 -289
  443. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  444. package/dist/generator-VE2JrFlY.mjs +0 -253
  445. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  446. package/dist/index-BThUzEIp.d.mts.map +0 -1
  447. package/dist/index-CHB4tSzX.d.cts.map +0 -1
  448. package/dist/openapi-CgpMWMmM.mjs +0 -1962
  449. package/dist/openapi-CgpMWMmM.mjs.map +0 -1
  450. package/dist/openapi-CljONd_M.cjs +0 -1998
  451. package/dist/openapi-CljONd_M.cjs.map +0 -1
  452. package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
  453. package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
  454. package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
  455. package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
  456. package/dist/openapi-react-query.cjs +0 -4
  457. package/dist/openapi-react-query.d.cts +0 -11
  458. package/dist/openapi-react-query.d.cts.map +0 -1
  459. package/dist/openapi-react-query.d.mts +0 -11
  460. package/dist/openapi-react-query.d.mts.map +0 -1
  461. package/dist/openapi-react-query.mjs +0 -4
  462. package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
  463. package/dist/reconcile-D0pimNiy.cjs.map +0 -1
  464. package/dist/setup-CJiQM2pX.cjs +0 -473
  465. package/dist/setup-CJiQM2pX.cjs.map +0 -1
  466. package/dist/setup-DMtU3p41.cjs +0 -11
  467. package/dist/setup-DOsYueeQ.mjs +0 -443
  468. package/dist/setup-DOsYueeQ.mjs.map +0 -1
  469. package/dist/setup-DSutDAlt.mjs +0 -11
  470. package/dist/storage-BJmzYxt8.cjs +0 -363
  471. package/dist/storage-BJmzYxt8.cjs.map +0 -1
  472. package/dist/storage-BM9hGpgv.cjs +0 -7
  473. package/dist/storage-Bi24WfoW.mjs +0 -297
  474. package/dist/storage-Bi24WfoW.mjs.map +0 -1
  475. package/dist/storage-CYlGwWTj.mjs +0 -3
  476. package/dist/sync-CmEuNZsB.mjs +0 -76
  477. package/dist/sync-CmEuNZsB.mjs.map +0 -1
  478. package/dist/sync-D306yOWu.cjs +0 -4
  479. package/dist/sync-SizaChmC.cjs +0 -93
  480. package/dist/sync-SizaChmC.cjs.map +0 -1
  481. package/dist/sync-hOqAWHR6.mjs +0 -3
  482. package/dist/types-C-arnQ1r.d.mts +0 -2184
  483. package/dist/types-C-arnQ1r.d.mts.map +0 -1
  484. package/dist/types-abJQuk7m.d.cts +0 -2184
  485. package/dist/types-abJQuk7m.d.cts.map +0 -1
  486. package/dist/workspace-7FqprxuJ.mjs +0 -4323
  487. package/dist/workspace-7FqprxuJ.mjs.map +0 -1
  488. package/dist/workspace-8acupeaI.cjs +0 -9
  489. package/dist/workspace-XvqO9jIv.cjs +0 -4472
  490. package/dist/workspace-XvqO9jIv.cjs.map +0 -1
  491. package/dist/workspace-yP5AHnrn.mjs +0 -8
@@ -1,1998 +0,0 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_discover = require('./discover-DTmFeloL.cjs');
3
- const require_config = require('./config-DbPE1KXF.cjs');
4
- const node_path = require_chunk.__toESM(require("node:path"));
5
- const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
6
- const node_child_process = require_chunk.__toESM(require("node:child_process"));
7
- const __geekmidas_constructs_endpoints = require_chunk.__toESM(require("@geekmidas/constructs/endpoints"));
8
- const node_url = require_chunk.__toESM(require("node:url"));
9
- const __geekmidas_schema_conversion = require_chunk.__toESM(require("@geekmidas/schema/conversion"));
10
-
11
- //#region src/build/endpoint-analyzer.ts
12
- /**
13
- * Analyze an endpoint to extract its features
14
- */
15
- function analyzeEndpointFeatures(endpoint) {
16
- return {
17
- hasAuth: !!endpoint.authorizer,
18
- hasServices: endpoint.services.length > 0,
19
- hasDatabase: !!endpoint.databaseService,
20
- hasBodyValidation: !!endpoint.input?.body,
21
- hasQueryValidation: !!endpoint.input?.query,
22
- hasParamValidation: !!endpoint.input?.params,
23
- hasAudits: (endpoint.audits?.length ?? 0) > 0,
24
- hasEvents: (endpoint.events?.length ?? 0) > 0,
25
- hasRateLimit: !!endpoint.rateLimit,
26
- hasRls: !!endpoint.rlsConfig && !endpoint.rlsBypass,
27
- hasOutputValidation: !!endpoint.outputSchema
28
- };
29
- }
30
- /**
31
- * Determine the optimization tier for an endpoint based on its features
32
- */
33
- function determineEndpointTier(features) {
34
- const { hasAuth, hasServices, hasDatabase, hasAudits, hasEvents, hasRateLimit, hasRls } = features;
35
- if (!hasAuth && !hasServices && !hasDatabase && !hasAudits && !hasEvents && !hasRateLimit && !hasRls) return "minimal";
36
- if (hasAudits || hasRls || hasRateLimit) return "full";
37
- return "standard";
38
- }
39
- /**
40
- * Perform complete analysis of an endpoint
41
- */
42
- function analyzeEndpoint(endpoint, exportName) {
43
- const features = analyzeEndpointFeatures(endpoint);
44
- const tier = determineEndpointTier(features);
45
- return {
46
- route: endpoint.route,
47
- method: endpoint.method,
48
- exportName,
49
- features,
50
- tier,
51
- serviceNames: endpoint.services.map((s) => s.serviceName),
52
- databaseServiceName: endpoint.databaseService?.serviceName
53
- };
54
- }
55
- /**
56
- * Generate a summary of endpoint analysis for logging
57
- */
58
- function summarizeAnalysis(analyses) {
59
- const byTier = {
60
- minimal: 0,
61
- standard: 0,
62
- full: 0
63
- };
64
- const byFeature = {
65
- hasAuth: 0,
66
- hasServices: 0,
67
- hasDatabase: 0,
68
- hasBodyValidation: 0,
69
- hasQueryValidation: 0,
70
- hasParamValidation: 0,
71
- hasAudits: 0,
72
- hasEvents: 0,
73
- hasRateLimit: 0,
74
- hasRls: 0,
75
- hasOutputValidation: 0
76
- };
77
- for (const analysis of analyses) {
78
- byTier[analysis.tier]++;
79
- for (const [feature, enabled] of Object.entries(analysis.features)) if (enabled) byFeature[feature]++;
80
- }
81
- return {
82
- total: analyses.length,
83
- byTier,
84
- byFeature
85
- };
86
- }
87
-
88
- //#endregion
89
- //#region src/build/handler-templates.ts
90
- /**
91
- * Generate validator references for an endpoint
92
- */
93
- function generateValidators(exportName, features) {
94
- const validators = [];
95
- if (features.hasBodyValidation) validators.push(`validateBody(${exportName})`);
96
- if (features.hasQueryValidation) validators.push(`validateQuery(${exportName})`);
97
- if (features.hasParamValidation) validators.push(`validateParams(${exportName})`);
98
- return validators.length > 0 ? `\n ${validators.join(",\n ")},` : "";
99
- }
100
- /**
101
- * Generate a minimal handler (near-raw-Hono performance)
102
- *
103
- * Used for: Health checks, public endpoints with no services
104
- */
105
- function generateMinimalHandler(analysis) {
106
- const { exportName, features } = analysis;
107
- const method = analysis.method.toLowerCase();
108
- const validators = generateValidators(exportName, features);
109
- const hasValidators = validators.length > 0;
110
- if (!hasValidators && !features.hasOutputValidation) return `
111
- // Minimal handler: ${analysis.route} (${analysis.method})
112
- app.${method}('${analysis.route}', async (c) => {
113
- const result = await ${exportName}.handler(
114
- {
115
- services: {},
116
- logger,
117
- body: undefined,
118
- query: undefined,
119
- params: undefined,
120
- session: undefined,
121
- header: Endpoint.createHeaders(c.req.header()),
122
- cookie: Endpoint.createCookies(c.req.header().cookie),
123
- auditor: undefined,
124
- db: undefined,
125
- } as any,
126
- { getMetadata: () => ({}) } as any,
127
- );
128
- return c.json(result, ${exportName}.status as any);
129
- });`;
130
- return `
131
- // Minimal handler with validation: ${analysis.route} (${analysis.method})
132
- app.${method}('${analysis.route}',${validators}
133
- async (c) => {
134
- const result = await ${exportName}.handler(
135
- {
136
- services: {},
137
- logger,
138
- body: ${features.hasBodyValidation ? "(c.req.valid as any)('json')" : "undefined"},
139
- query: ${features.hasQueryValidation ? "(c.req.valid as any)('query')" : "undefined"},
140
- params: ${features.hasParamValidation ? "(c.req.valid as any)('param')" : "undefined"},
141
- session: undefined,
142
- header: Endpoint.createHeaders(c.req.header()),
143
- cookie: Endpoint.createCookies(c.req.header().cookie),
144
- auditor: undefined,
145
- db: undefined,
146
- } as any,
147
- { getMetadata: () => ({}) } as any,
148
- );
149
- ${features.hasOutputValidation ? `const output = await ${exportName}.parseOutput(result);
150
- return c.json(output, ${exportName}.status as any);` : `return c.json(result, ${exportName}.status as any);`}
151
- }
152
- );`;
153
- }
154
- /**
155
- * Generate a standard handler (auth and/or services)
156
- *
157
- * Used for: Authenticated endpoints, endpoints with services
158
- */
159
- function generateStandardHandler(analysis) {
160
- const { exportName, features } = analysis;
161
- const method = analysis.method.toLowerCase();
162
- const validators = generateValidators(exportName, features);
163
- let serviceResolution = "";
164
- if (features.hasServices || features.hasDatabase) serviceResolution = `
165
- const services = await serviceDiscovery.register(${exportName}.services);
166
- ${features.hasDatabase ? `const db = ${exportName}.databaseService
167
- ? (await serviceDiscovery.register([${exportName}.databaseService]) as any)[${exportName}.databaseService.serviceName]
168
- : undefined;` : "const db = undefined;"}`;
169
- else serviceResolution = `
170
- const services = {};
171
- const db = undefined;`;
172
- let authCode = "";
173
- if (features.hasAuth) authCode = `
174
- // Authentication
175
- const session = await ${exportName}.getSession({
176
- services,
177
- logger,
178
- header,
179
- cookie,
180
- ...(db !== undefined && { db }),
181
- } as any);
182
-
183
- const isAuthorized = await ${exportName}.authorize({
184
- header,
185
- cookie,
186
- services,
187
- logger,
188
- session,
189
- } as any);
190
-
191
- if (!isAuthorized) {
192
- return c.json({ error: 'Unauthorized' }, 401);
193
- }`;
194
- let eventCode = "";
195
- if (features.hasEvents) eventCode = `
196
- // Publish events on success
197
- if (Endpoint.isSuccessStatus(${exportName}.status)) {
198
- await (publishConstructEvents as any)(
199
- ${exportName},
200
- result,
201
- serviceDiscovery,
202
- logger,
203
- );
204
- }`;
205
- return `
206
- // Standard handler: ${analysis.route} (${analysis.method})
207
- app.${method}('${analysis.route}',${validators}
208
- async (c) => {
209
- const headerValues = c.req.header();
210
- const header = Endpoint.createHeaders(headerValues);
211
- const cookie = Endpoint.createCookies(headerValues.cookie);
212
- ${serviceResolution}
213
- ${authCode}
214
-
215
- const responseBuilder = new ResponseBuilder();
216
- const result = await ${exportName}.handler(
217
- {
218
- services,
219
- logger,
220
- body: ${features.hasBodyValidation ? "(c.req.valid as any)('json')" : "undefined"},
221
- query: ${features.hasQueryValidation ? "(c.req.valid as any)('query')" : "undefined"},
222
- params: ${features.hasParamValidation ? "(c.req.valid as any)('param')" : "undefined"},
223
- session: ${features.hasAuth ? "session" : "undefined"},
224
- header,
225
- cookie,
226
- auditor: undefined,
227
- db,
228
- } as any,
229
- responseBuilder,
230
- );
231
-
232
- let data = result;
233
- let metadata = responseBuilder.getMetadata();
234
-
235
- if (Endpoint.hasMetadata(result)) {
236
- data = result.data;
237
- metadata = result.metadata;
238
- }
239
-
240
- ${features.hasOutputValidation ? `const output = ${exportName}.outputSchema
241
- ? await ${exportName}.parseOutput(data)
242
- : data;` : "const output = data;"}
243
- ${eventCode}
244
-
245
- const status = (metadata.status ?? ${exportName}.status) as any;
246
- return c.json(output, status);
247
- }
248
- );`;
249
- }
250
- /**
251
- * Generate validators.ts - Shared validator middleware factories
252
- */
253
- function generateValidatorsFile(analyses) {
254
- const needsBody = analyses.some((a) => a.features.hasBodyValidation);
255
- const needsQuery = analyses.some((a) => a.features.hasQueryValidation);
256
- const needsParams = analyses.some((a) => a.features.hasParamValidation);
257
- if (!needsBody && !needsQuery && !needsParams) return `// No validators needed for this build\nexport {};\n`;
258
- const exports$1 = [];
259
- const factories = [];
260
- if (needsBody) {
261
- exports$1.push("validateBody");
262
- factories.push(`
263
- export const validateBody = (endpoint: any) =>
264
- validator('json', async (value, c) => {
265
- if (!endpoint.input?.body) return undefined;
266
- const parsed = await Endpoint.validate(endpoint.input.body, value);
267
- if (parsed.issues) return c.json(parsed.issues, 422);
268
- return parsed.value;
269
- });`);
270
- }
271
- if (needsQuery) {
272
- exports$1.push("validateQuery");
273
- factories.push(`
274
- export const validateQuery = (endpoint: any) =>
275
- validator('query', async (_, c) => {
276
- if (!endpoint.input?.query) return undefined;
277
- const rawQuery = Object.fromEntries(new URL(c.req.url).searchParams);
278
- const parsed = await Endpoint.validate(endpoint.input.query, rawQuery);
279
- if (parsed.issues) return c.json(parsed.issues, 422);
280
- return parsed.value;
281
- });`);
282
- }
283
- if (needsParams) {
284
- exports$1.push("validateParams");
285
- factories.push(`
286
- export const validateParams = (endpoint: any) =>
287
- validator('param', async (params, c) => {
288
- if (!endpoint.input?.params) return undefined;
289
- const parsed = await Endpoint.validate(endpoint.input.params, params);
290
- if (parsed.issues) return c.json(parsed.issues, 422);
291
- return parsed.value;
292
- });`);
293
- }
294
- return `/**
295
- * Generated validator middleware factories
296
- * Shared across all endpoint tiers that need validation
297
- */
298
- import { validator } from 'hono/validator';
299
- import { Endpoint } from '@geekmidas/constructs/endpoints';
300
- ${factories.join("\n")}
301
- `;
302
- }
303
- /**
304
- * Generate a standalone minimal endpoint file
305
- */
306
- function generateMinimalEndpointFile(analysis, endpointImport) {
307
- const { exportName, features } = analysis;
308
- const needsValidators = features.hasBodyValidation || features.hasQueryValidation || features.hasParamValidation;
309
- const validatorImport = needsValidators ? generateValidatorImportsForEndpoint(analysis) : "";
310
- const handler = generateMinimalHandler(analysis);
311
- return `/**
312
- * Minimal endpoint: ${analysis.route} (${analysis.method})
313
- * Near-raw-Hono performance
314
- */
315
- import type { Hono } from 'hono';
316
- import type { Logger } from '@geekmidas/logger';
317
- import { Endpoint } from '@geekmidas/constructs/endpoints';
318
- ${validatorImport}
319
- import { ${exportName} } from '${endpointImport.importPath}';
320
-
321
- export function setup${capitalize(exportName)}(
322
- app: Hono,
323
- logger: Logger,
324
- ): void {
325
- ${handler}
326
- }
327
- `;
328
- }
329
- /**
330
- * Generate a standalone standard endpoint file
331
- */
332
- function generateStandardEndpointFile(analysis, endpointImport) {
333
- const { exportName, features } = analysis;
334
- const needsValidators = features.hasBodyValidation || features.hasQueryValidation || features.hasParamValidation;
335
- const validatorImport = needsValidators ? generateValidatorImportsForEndpoint(analysis) : "";
336
- const eventsImport = features.hasEvents ? `import { publishConstructEvents } from '@geekmidas/constructs/endpoints';` : "";
337
- const handler = generateStandardHandler(analysis);
338
- return `/**
339
- * Standard endpoint: ${analysis.route} (${analysis.method})
340
- * Auth and/or services enabled
341
- */
342
- import type { Hono } from 'hono';
343
- import type { Logger } from '@geekmidas/logger';
344
- import type { ServiceDiscovery } from '@geekmidas/services';
345
- import { Endpoint, ResponseBuilder } from '@geekmidas/constructs/endpoints';
346
- ${eventsImport}
347
- ${validatorImport}
348
- import { ${exportName} } from '${endpointImport.importPath}';
349
-
350
- export function setup${capitalize(exportName)}(
351
- app: Hono,
352
- serviceDiscovery: ServiceDiscovery<any, any>,
353
- logger: Logger,
354
- ): void {
355
- ${handler}
356
- }
357
- `;
358
- }
359
- /**
360
- * Generate a standalone full endpoint file
361
- */
362
- function generateFullEndpointFile(analysis, endpointImport) {
363
- const { exportName } = analysis;
364
- return `/**
365
- * Full endpoint: ${analysis.route} (${analysis.method})
366
- * Complex features: audits, RLS, rate limiting
367
- */
368
- import type { Hono } from 'hono';
369
- import type { ServiceDiscovery } from '@geekmidas/services';
370
- import { HonoEndpoint } from '@geekmidas/constructs/hono';
371
- import { ${exportName} } from '${endpointImport.importPath}';
372
-
373
- export function setup${capitalize(exportName)}(
374
- app: Hono,
375
- serviceDiscovery: ServiceDiscovery<any, any>,
376
- openApiOptions: any,
377
- ): void {
378
- HonoEndpoint.addRoutes([${exportName}] as any, serviceDiscovery, app, openApiOptions);
379
- }
380
- `;
381
- }
382
- /**
383
- * Generate tier index file that imports and calls all endpoint setup functions
384
- */
385
- function generateTierIndexFile(tier, analyses) {
386
- const tierEndpoints = analyses.filter((a) => a.tier === tier);
387
- if (tierEndpoints.length === 0) {
388
- if (tier === "minimal") return `// No minimal-tier endpoints in this build
389
- import type { Hono } from 'hono';
390
- import type { Logger } from '@geekmidas/logger';
391
-
392
- export function setupMinimalEndpoints(
393
- _app: Hono,
394
- _logger: Logger,
395
- ): void {
396
- // No minimal endpoints
397
- }
398
- `;
399
- if (tier === "standard") return `// No standard-tier endpoints in this build
400
- import type { Hono } from 'hono';
401
- import type { Logger } from '@geekmidas/logger';
402
- import type { ServiceDiscovery } from '@geekmidas/services';
403
-
404
- export function setupStandardEndpoints(
405
- _app: Hono,
406
- _serviceDiscovery: ServiceDiscovery<any, any>,
407
- _logger: Logger,
408
- ): void {
409
- // No standard endpoints
410
- }
411
- `;
412
- return `// No full-tier endpoints in this build
413
- import type { Hono } from 'hono';
414
- import type { ServiceDiscovery } from '@geekmidas/services';
415
-
416
- export function setupFullEndpoints(
417
- _app: Hono,
418
- _serviceDiscovery: ServiceDiscovery<any, any>,
419
- _enableOpenApi: boolean,
420
- ): void {
421
- // No full endpoints
422
- }
423
- `;
424
- }
425
- const imports = tierEndpoints.map((a) => `import { setup${capitalize(a.exportName)} } from './${a.exportName}.js';`).join("\n");
426
- if (tier === "minimal") {
427
- const calls$1 = tierEndpoints.map((a) => ` setup${capitalize(a.exportName)}(app, logger);`).join("\n");
428
- return `/**
429
- * Minimal-tier endpoint index (${tierEndpoints.length} endpoints)
430
- * Near-raw-Hono performance
431
- */
432
- import type { Hono } from 'hono';
433
- import type { Logger } from '@geekmidas/logger';
434
- ${imports}
435
-
436
- export function setupMinimalEndpoints(
437
- app: Hono,
438
- logger: Logger,
439
- ): void {
440
- ${calls$1}
441
- }
442
- `;
443
- }
444
- if (tier === "standard") {
445
- const calls$1 = tierEndpoints.map((a) => ` setup${capitalize(a.exportName)}(app, serviceDiscovery, logger);`).join("\n");
446
- return `/**
447
- * Standard-tier endpoint index (${tierEndpoints.length} endpoints)
448
- * Auth and/or services enabled
449
- */
450
- import type { Hono } from 'hono';
451
- import type { Logger } from '@geekmidas/logger';
452
- import type { ServiceDiscovery } from '@geekmidas/services';
453
- ${imports}
454
-
455
- export function setupStandardEndpoints(
456
- app: Hono,
457
- serviceDiscovery: ServiceDiscovery<any, any>,
458
- logger: Logger,
459
- ): void {
460
- ${calls$1}
461
- }
462
- `;
463
- }
464
- const calls = tierEndpoints.map((a) => ` setup${capitalize(a.exportName)}(app, serviceDiscovery, openApiOptions);`).join("\n");
465
- return `/**
466
- * Full-tier endpoint index (${tierEndpoints.length} endpoints)
467
- * Complex features: audits, RLS, rate limiting
468
- */
469
- import type { Hono } from 'hono';
470
- import type { ServiceDiscovery } from '@geekmidas/services';
471
- ${imports}
472
-
473
- export function setupFullEndpoints(
474
- app: Hono,
475
- serviceDiscovery: ServiceDiscovery<any, any>,
476
- enableOpenApi: boolean,
477
- ): void {
478
- const openApiOptions: any = enableOpenApi ? {
479
- docsPath: '/__docs',
480
- openApiOptions: {
481
- title: 'API Documentation',
482
- version: '1.0.0',
483
- description: 'Generated API documentation'
484
- }
485
- } : { docsPath: false };
486
-
487
- ${calls}
488
- }
489
- `;
490
- }
491
- /**
492
- * Generate validator imports for a single endpoint
493
- */
494
- function generateValidatorImportsForEndpoint(analysis) {
495
- const imports = [];
496
- if (analysis.features.hasBodyValidation) imports.push("validateBody");
497
- if (analysis.features.hasQueryValidation) imports.push("validateQuery");
498
- if (analysis.features.hasParamValidation) imports.push("validateParams");
499
- if (imports.length === 0) return "";
500
- return `import { ${imports.join(", ")} } from '../validators.js';`;
501
- }
502
- /**
503
- * Capitalize first letter
504
- */
505
- function capitalize(str) {
506
- return str.charAt(0).toUpperCase() + str.slice(1);
507
- }
508
- /**
509
- * Generate all endpoint files with nested folder structure (per-endpoint files)
510
- */
511
- function generateEndpointFilesNested(analyses, endpointImports) {
512
- const files = {
513
- "validators.ts": generateValidatorsFile(analyses),
514
- "minimal/index.ts": generateTierIndexFile("minimal", analyses),
515
- "standard/index.ts": generateTierIndexFile("standard", analyses),
516
- "full/index.ts": generateTierIndexFile("full", analyses),
517
- "index.ts": generateNestedIndexFile(analyses)
518
- };
519
- for (const analysis of analyses) {
520
- const endpointImport = endpointImports.find((i) => i.exportName === analysis.exportName);
521
- if (!endpointImport) continue;
522
- const fileName = `${analysis.tier}/${analysis.exportName}.ts`;
523
- switch (analysis.tier) {
524
- case "minimal":
525
- files[fileName] = generateMinimalEndpointFile(analysis, endpointImport);
526
- break;
527
- case "standard":
528
- files[fileName] = generateStandardEndpointFile(analysis, endpointImport);
529
- break;
530
- case "full":
531
- files[fileName] = generateFullEndpointFile(analysis, endpointImport);
532
- break;
533
- }
534
- }
535
- return files;
536
- }
537
- /**
538
- * Generate index.ts for nested structure
539
- */
540
- function generateNestedIndexFile(analyses) {
541
- const minimalCount = analyses.filter((a) => a.tier === "minimal").length;
542
- const standardCount = analyses.filter((a) => a.tier === "standard").length;
543
- const fullCount = analyses.filter((a) => a.tier === "full").length;
544
- return `/**
545
- * Generated optimized endpoints
546
- *
547
- * Build-time optimization tiers:
548
- * - minimal: ${minimalCount} endpoints (near-raw-Hono)
549
- * - standard: ${standardCount} endpoints (auth/services)
550
- * - full: ${fullCount} endpoints (audits/rls/rate-limit)
551
- */
552
- import type { EnvironmentParser } from '@geekmidas/envkit';
553
- import type { Logger } from '@geekmidas/logger';
554
- import type { Hono } from 'hono';
555
- import { ServiceDiscovery } from '@geekmidas/services';
556
- import { setupMinimalEndpoints } from './minimal/index.js';
557
- import { setupStandardEndpoints } from './standard/index.js';
558
- import { setupFullEndpoints } from './full/index.js';
559
-
560
- export async function setupEndpoints(
561
- app: Hono,
562
- envParser: EnvironmentParser<any>,
563
- logger: Logger,
564
- enableOpenApi: boolean = false,
565
- ): Promise<void> {
566
- const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
567
-
568
- // Minimal handlers (${minimalCount} endpoints) - near-raw-Hono performance
569
- setupMinimalEndpoints(app, logger);
570
-
571
- // Standard handlers (${standardCount} endpoints) - auth/services
572
- setupStandardEndpoints(app, serviceDiscovery, logger);
573
-
574
- // Full handlers (${fullCount} endpoints) - audits/rls/rate-limit
575
- setupFullEndpoints(app, serviceDiscovery, enableOpenApi);
576
-
577
- // Add Swagger UI if OpenAPI is enabled
578
- if (enableOpenApi) {
579
- try {
580
- const { swaggerUI } = await import('@hono/swagger-ui');
581
- app.get('/__docs/ui', swaggerUI({ url: '/__docs' }));
582
- } catch {
583
- // @hono/swagger-ui not installed, skip Swagger UI
584
- }
585
- }
586
- }
587
- `;
588
- }
589
-
590
- //#endregion
591
- //#region src/generators/EndpointGenerator.ts
592
- /**
593
- * How a generated entry gets its logger and environment parser.
594
- *
595
- * From the surface it serves, when there is one: the surface holds both as
596
- * *objects*, and discovery already recorded which module declares it, so the
597
- * entry imports that module and reads them off it.
598
- *
599
- * The alternative — the shape this replaces — was naming both in config as
600
- * module paths, `envParser: './config/env#envParser'`, and printing an import
601
- * for each. Two strings per app, checked by nothing, describing files the
602
- * surface was already holding the contents of.
603
- *
604
- * Falls back to the configured paths for an app that declares no surface.
605
- */
606
- function runtimeFor(context, fromDir) {
607
- const module$1 = context.surface?.module;
608
- if (module$1) {
609
- const specifier = importSpecifier(fromDir, module$1.specifier);
610
- return {
611
- imports: `import { ${module$1.exportName} as __surface } from '${specifier}';`,
612
- bindings: [
613
- "// What this surface was declared with. Objects, not module paths:",
614
- "// the entry imports the surface, so there is nothing to print.",
615
- "const envParser = __surface.envParser;",
616
- "const logger = __surface.logger;"
617
- ].join("\n")
618
- };
619
- }
620
- return {
621
- imports: [`import ${context.envParserImportPattern} from '${importSpecifier(fromDir, context.envParserPath)}';`, `import ${context.loggerImportPattern} from '${importSpecifier(fromDir, context.loggerPath)}';`].join("\n"),
622
- bindings: ""
623
- };
624
- }
625
- /** A relative specifier ESM will accept: always prefixed, never bare. */
626
- function importSpecifier(fromDir, target) {
627
- const rel = (0, node_path.relative)(fromDir, target).replace(/\.ts$/, ".js");
628
- return rel.startsWith(".") ? rel : `./${rel}`;
629
- }
630
- /**
631
- * CORS for a surface, derived rather than hand-written.
632
- *
633
- * Who may call a surface is already in the graph — every construct that
634
- * declared an edge to it — and reaches the process as one comma-separated
635
- * value. An application that maintained this by hand maintained a list that was
636
- * wrong in two directions at once: it trusted origins nothing was serving, and
637
- * it could not name hosts a deploy had not chosen yet.
638
- *
639
- * Only the parts a graph cannot answer are configurable, and every one has a
640
- * default: a surface that says nothing about CORS still gets it.
641
- */
642
- function corsFor(surface) {
643
- if (!surface) return {
644
- imports: "",
645
- setup: ""
646
- };
647
- const cors = surface.cors ?? {};
648
- const allowHeaders = [
649
- "content-type",
650
- "authorization",
651
- ...cors.allowHeaders ?? []
652
- ];
653
- return {
654
- imports: `import { cors } from 'hono/cors';`,
655
- setup: `
656
- // Who may call ${surface.id}, read off the graph rather than listed here.
657
- {
658
- const { origins } = envParser
659
- .create((get) => ({
660
- origins: get('${surface.trustedOriginsKey}')
661
- .string()
662
- .default('')
663
- .transform((value: string) =>
664
- value.split(',').map((origin) => origin.trim()).filter(Boolean),
665
- ),
666
- }))
667
- .parse();
668
-
669
- honoApp.use('*', cors({
670
- origin: origins,
671
- allowMethods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],
672
- allowHeaders: ${JSON.stringify(allowHeaders)},${cors.exposeHeaders ? `\n exposeHeaders: ${JSON.stringify(cors.exposeHeaders)},` : ""}
673
- credentials: ${cors.credentials ?? true},
674
- maxAge: ${cors.maxAge ?? 86400},
675
- }));
676
- }
677
- `
678
- };
679
- }
680
- var EndpointGenerator = class extends require_discover.ConstructGenerator {
681
- isConstruct(value) {
682
- return __geekmidas_constructs_endpoints.Endpoint.isEndpoint(value);
683
- }
684
- async build(context, constructs, outputDir, options) {
685
- const provider = options?.provider || "aws-apigatewayv2";
686
- const enableOpenApi = options?.enableOpenApi || false;
687
- const logger = console;
688
- const routes = [];
689
- if (constructs.length === 0) return routes;
690
- if (provider === "server") {
691
- await this.generateEndpointsFile(outputDir, constructs, context);
692
- const appFile = await this.generateAppFile(outputDir, context);
693
- routes.push({
694
- path: "*",
695
- method: "ALL",
696
- handler: (0, node_path.relative)(process.cwd(), appFile),
697
- authorizer: "none"
698
- });
699
- logger.log(`Generated server with ${constructs.length} endpoints${enableOpenApi ? " (OpenAPI enabled)" : ""}`);
700
- } else if (provider === "aws-lambda") {
701
- const routesDir = (0, node_path.join)(outputDir, "routes");
702
- await (0, node_fs_promises.mkdir)(routesDir, { recursive: true });
703
- for (const { key, construct, path } of constructs) {
704
- const handlerFile = await this.generateHandlerFile(routesDir, path.relative, key, "aws-apigatewayv2", construct, context);
705
- const routeInfo = {
706
- path: construct._path,
707
- method: construct.method,
708
- handler: (0, node_path.relative)(process.cwd(), handlerFile).replace(/\.ts$/, ".handler"),
709
- timeout: construct.timeout,
710
- memorySize: construct.memorySize,
711
- environment: await construct.getEnvironment({ markOptional: context.markOptional }),
712
- dependencies: construct.constructs,
713
- authorizer: construct.authorizer?.name ?? "none"
714
- };
715
- routes.push(routeInfo);
716
- logger.log(`Generated handler for ${routeInfo.method} ${routeInfo.path}`);
717
- }
718
- } else for (const { key, construct, path } of constructs) {
719
- const handlerFile = await this.generateHandlerFile(outputDir, path.relative, key, provider, construct, context);
720
- const routeInfo = {
721
- path: construct._path,
722
- method: construct.method,
723
- handler: (0, node_path.relative)(process.cwd(), handlerFile).replace(/\.ts$/, ".handler"),
724
- timeout: construct.timeout,
725
- memorySize: construct.memorySize,
726
- environment: await construct.getEnvironment({ markOptional: context.markOptional }),
727
- dependencies: construct.constructs,
728
- authorizer: construct.authorizer?.name ?? "none"
729
- };
730
- routes.push(routeInfo);
731
- logger.log(`Generated handler for ${routeInfo.method} ${routeInfo.path}`);
732
- }
733
- return routes;
734
- }
735
- async generateHandlerFile(outputDir, sourceFile, exportName, provider, _endpoint, context) {
736
- const handlerFileName = `${exportName}.ts`;
737
- const handlerPath = (0, node_path.join)(outputDir, handlerFileName);
738
- const relativePath = (0, node_path.relative)((0, node_path.dirname)(handlerPath), sourceFile);
739
- const importPath = relativePath.replace(/\.ts$/, ".js");
740
- let content;
741
- switch (provider) {
742
- case "aws-apigatewayv1":
743
- content = this.generateAWSApiGatewayV1Handler(importPath, exportName, context.storageDrivers);
744
- break;
745
- case "aws-apigatewayv2":
746
- content = this.generateAWSApiGatewayV2Handler(importPath, exportName, context.storageDrivers);
747
- break;
748
- case "server":
749
- content = this.generateServerHandler(importPath, exportName);
750
- break;
751
- default: throw new Error(`Unsupported provider: ${provider}`);
752
- }
753
- await (0, node_fs_promises.writeFile)(handlerPath, content);
754
- return handlerPath;
755
- }
756
- async generateEndpointsFile(outputDir, endpoints, context) {
757
- const endpointsFileName = "endpoints.ts";
758
- const endpointsPath = (0, node_path.join)(outputDir, endpointsFileName);
759
- const importsByFile = /* @__PURE__ */ new Map();
760
- for (const { path, key } of endpoints) {
761
- const relativePath = (0, node_path.relative)((0, node_path.dirname)(endpointsPath), path.relative);
762
- const importPath = relativePath.replace(/\.ts$/, ".js");
763
- if (!importsByFile.has(importPath)) importsByFile.set(importPath, []);
764
- importsByFile.get(importPath)?.push(key);
765
- }
766
- const endpointImports = Array.from(importsByFile.entries()).map(([importPath, exports$1]) => `import { ${exports$1.join(", ")} } from '${importPath}';`).join("\n");
767
- const allExportNames = endpoints.map(({ key }) => key);
768
- if (context.production?.enabled && context.production.optimizedHandlers) return this.generateOptimizedEndpointsFile(endpointsPath, endpoints, endpointImports, allExportNames);
769
- const content = `import type { EnvironmentParser } from '@geekmidas/envkit';
770
- import type { Logger } from '@geekmidas/logger';
771
- import { HonoEndpoint } from '@geekmidas/constructs/hono';
772
- import { Endpoint } from '@geekmidas/constructs/endpoints';
773
- import { ServiceDiscovery } from '@geekmidas/services';
774
- import type { Hono } from 'hono';
775
- ${endpointImports}
776
-
777
- export const endpoints: Endpoint<any, any, any, any, any, any, any, any, any, any, any, any, any, any>[] = [
778
- ${allExportNames.join(",\n ")}
779
- ];
780
-
781
- export async function setupEndpoints(
782
- app: Hono,
783
- envParser: EnvironmentParser<any>,
784
- logger: Logger,
785
- enableOpenApi: boolean = true,
786
- ): Promise<void> {
787
- const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
788
-
789
- // Configure OpenAPI options based on enableOpenApi flag
790
- const openApiOptions: any = enableOpenApi ? {
791
- docsPath: '/__docs',
792
- openApiOptions: {
793
- title: 'API Documentation',
794
- version: '1.0.0',
795
- description: 'Generated API documentation'
796
- }
797
- } : { docsPath: false };
798
-
799
- HonoEndpoint.addRoutes(endpoints, serviceDiscovery, app, openApiOptions);
800
-
801
- // Add Swagger UI if OpenAPI is enabled
802
- if (enableOpenApi) {
803
- try {
804
- const { swaggerUI } = await import('@hono/swagger-ui');
805
- app.get('/__docs/ui', swaggerUI({ url: '/__docs' }));
806
- } catch {
807
- // @hono/swagger-ui not installed, skip Swagger UI
808
- }
809
- }
810
- }
811
- `;
812
- await (0, node_fs_promises.writeFile)(endpointsPath, content);
813
- return endpointsPath;
814
- }
815
- /**
816
- * Generate optimized endpoints files with nested folder structure (per-endpoint files)
817
- */
818
- async generateOptimizedEndpointsFile(endpointsPath, endpoints, _endpointImports, _allExportNames) {
819
- const logger = console;
820
- const outputDir = (0, node_path.dirname)(endpointsPath);
821
- const endpointsDir = (0, node_path.join)(outputDir, "endpoints");
822
- await (0, node_fs_promises.mkdir)((0, node_path.join)(endpointsDir, "minimal"), { recursive: true });
823
- await (0, node_fs_promises.mkdir)((0, node_path.join)(endpointsDir, "standard"), { recursive: true });
824
- await (0, node_fs_promises.mkdir)((0, node_path.join)(endpointsDir, "full"), { recursive: true });
825
- const analyses = endpoints.map(({ key, construct }) => analyzeEndpoint(construct, key));
826
- const endpointImports = endpoints.map(({ key, path }) => {
827
- const tierDir = (0, node_path.join)(endpointsDir, "standard");
828
- const relativePath = (0, node_path.relative)(tierDir, path.relative);
829
- const importPath = relativePath.replace(/\.ts$/, ".js");
830
- return {
831
- exportName: key,
832
- importPath
833
- };
834
- });
835
- const summary = summarizeAnalysis(analyses);
836
- logger.log(`\n📊 Endpoint Analysis:`);
837
- logger.log(` Total: ${summary.total} endpoints`);
838
- logger.log(` - Minimal (near-raw-Hono): ${summary.byTier.minimal} endpoints`);
839
- logger.log(` - Standard (auth/services): ${summary.byTier.standard} endpoints`);
840
- logger.log(` - Full (audits/rls/rate-limit): ${summary.byTier.full} endpoints`);
841
- const files = generateEndpointFilesNested(analyses, endpointImports);
842
- for (const [filename, content] of Object.entries(files)) {
843
- const filePath = (0, node_path.join)(endpointsDir, filename);
844
- await (0, node_fs_promises.mkdir)((0, node_path.dirname)(filePath), { recursive: true });
845
- await (0, node_fs_promises.writeFile)(filePath, content);
846
- }
847
- const endpointFiles = Object.keys(files).filter((f) => !f.endsWith("index.ts") && !f.endsWith("validators.ts")).length;
848
- const indexFiles = Object.keys(files).filter((f) => f.endsWith("index.ts")).length;
849
- logger.log(` Generated ${endpointFiles} endpoint files + ${indexFiles} index files + validators.ts`);
850
- return (0, node_path.join)(endpointsDir, "index.ts");
851
- }
852
- async generateAppFile(outputDir, context) {
853
- if (context.production?.enabled) return this.generateProductionAppFile(outputDir, context);
854
- const appFileName = "app.ts";
855
- const appPath = (0, node_path.join)(outputDir, appFileName);
856
- const runtime = runtimeFor(context, (0, node_path.dirname)(appPath));
857
- const telescopeEnabled = context.telescope?.enabled;
858
- const telescopeWebSocketEnabled = context.telescope?.websocket;
859
- const usesExternalTelescope = !!context.telescope?.telescopePath;
860
- const studioEnabled = context.studio?.enabled;
861
- const usesExternalStudio = !!context.studio?.studioPath;
862
- const studioFromDatabase = !usesExternalStudio && !!context.studio?.database;
863
- const telescopeFromSurface = !!context.surface?.module && !usesExternalTelescope;
864
- let telescopeImports = "";
865
- if (telescopeEnabled) if (telescopeFromSurface) telescopeImports = "import { createMiddleware, createUI } from '@geekmidas/telescope/hono';";
866
- else if (usesExternalTelescope) {
867
- const relativeTelescopePath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.telescope?.telescopePath);
868
- telescopeImports = `import ${context.telescope?.telescopeImportPattern} from '${relativeTelescopePath}';
869
- import { createMiddleware, createUI } from '@geekmidas/telescope/hono';`;
870
- } else telescopeImports = `import { Telescope, InMemoryStorage } from '@geekmidas/telescope';
871
- import { createMiddleware, createUI } from '@geekmidas/telescope/hono';`;
872
- let studioImports = "";
873
- if (studioEnabled) if (usesExternalStudio) {
874
- const relativeStudioPath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.studio?.studioPath);
875
- studioImports = `import ${context.studio?.studioImportPattern} from '${relativeStudioPath}';
876
- import { createStudioApp } from '@geekmidas/studio/server/hono';`;
877
- } else if (studioFromDatabase) {
878
- const dbSpecifier = importSpecifier((0, node_path.dirname)(appPath), context.studio.database.specifier);
879
- studioImports = `import { snifferContext } from '@geekmidas/constructs';
880
- import { Direction, InMemoryMonitoringStorage, Studio } from '@geekmidas/studio';
881
- import { ${context.studio.database.exportName} as __studioDb } from '${dbSpecifier}';
882
- import { createStudioApp } from '@geekmidas/studio/server/hono';`;
883
- } else studioImports = "";
884
- const cors = corsFor(context.surface);
885
- let hooksImports = "";
886
- let beforeSetupCall = "";
887
- let afterSetupCall = "";
888
- if (context.hooks?.serverHooksPath) {
889
- const relativeHooksPath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.hooks.serverHooksPath);
890
- hooksImports = `import * as serverHooks from '${relativeHooksPath}';`;
891
- beforeSetupCall = `
892
- // Call beforeSetup hook if defined
893
- if (typeof serverHooks.beforeSetup === 'function') {
894
- await serverHooks.beforeSetup(honoApp, { envParser, logger });
895
- }
896
- `;
897
- afterSetupCall = `
898
- // Call afterSetup hook if defined
899
- if (typeof serverHooks.afterSetup === 'function') {
900
- await serverHooks.afterSetup(honoApp, { envParser, logger });
901
- }
902
- `;
903
- }
904
- const telescopeWebSocketSetupCode = telescopeWebSocketEnabled ? `
905
- // Setup WebSocket for real-time telescope updates
906
- try {
907
- const { createNodeWebSocket } = await import('@hono/node-ws');
908
- const { injectWebSocket, upgradeWebSocket } = createNodeWebSocket({ app: honoApp });
909
- // Add WebSocket route directly to main app (sub-app routes don't support WS upgrade)
910
- honoApp.get('${context.telescope?.path}/ws', upgradeWebSocket(() => ({
911
- onOpen: (_event: Event, ws: any) => {
912
- telescope.addWsClient(ws);
913
- },
914
- onClose: (_event: Event, ws: any) => {
915
- telescope.removeWsClient(ws);
916
- },
917
- onMessage: (event: MessageEvent, ws: any) => {
918
- try {
919
- const data = JSON.parse(event.data);
920
- if (data.type === 'ping') {
921
- ws.send(JSON.stringify({ type: 'pong' }));
922
- }
923
- } catch {
924
- // Ignore invalid messages
925
- }
926
- },
927
- })));
928
- // Store injectWebSocket for server entry to call after serve()
929
- (honoApp as any).__injectWebSocket = injectWebSocket;
930
- logger.info('Telescope WebSocket enabled');
931
- } catch (e) {
932
- logger.warn({ error: e }, 'WebSocket support not available - install @hono/node-ws for real-time updates');
933
- }
934
- ` : "";
935
- let telescopeSetup = "";
936
- if (telescopeEnabled) if (telescopeFromSurface || usesExternalTelescope) telescopeSetup = `
937
- ${telescopeWebSocketSetupCode}
938
- // Add telescope middleware (before endpoints to capture all requests)
939
- honoApp.use('*', createMiddleware(telescope));
940
-
941
- // Mount telescope UI
942
- const telescopeUI = createUI(telescope);
943
- honoApp.route('${context.telescope?.path}', telescopeUI);
944
- `;
945
- else telescopeSetup = `
946
- // Setup Telescope for debugging/monitoring
947
- const telescopeStorage = new InMemoryStorage({ maxEntries: ${context.telescope?.maxEntries} });
948
- const telescope = new Telescope({
949
- enabled: true,
950
- path: '${context.telescope?.path}',
951
- ignorePatterns: ${JSON.stringify(context.telescope?.ignore)},
952
- recordBody: ${context.telescope?.recordBody},
953
- storage: telescopeStorage,
954
- });
955
- ${telescopeWebSocketSetupCode}
956
- // Add telescope middleware (before endpoints to capture all requests)
957
- honoApp.use('*', createMiddleware(telescope));
958
-
959
- // Mount telescope UI
960
- const telescopeUI = createUI(telescope);
961
- honoApp.route('${context.telescope?.path}', telescopeUI);
962
- `;
963
- let studioSetup = "";
964
- if (studioEnabled && studioFromDatabase) studioSetup = `
965
- // Studio, built from the declared database. The client comes from the
966
- // construct, so what you inspect is by definition what the handlers write to.
967
- const studio = new Studio({
968
- monitoring: { storage: new InMemoryMonitoringStorage({ maxEntries: 100 }) },
969
- data: {
970
- db: await __studioDb.service.register({ envParser, context: snifferContext }),
971
- cursor: { field: 'id', direction: Direction.Desc },
972
- },
973
- enabled: true,
974
- });
975
-
976
- const studioApp = createStudioApp(studio);
977
- honoApp.route('${context.studio?.path}', studioApp);
978
- `;
979
- else if (studioEnabled && usesExternalStudio) studioSetup = `
980
- // Mount Studio data browser UI
981
- const studioApp = createStudioApp(studio);
982
- honoApp.route('${context.studio?.path}', studioApp);
983
- `;
984
- const content = `/**
985
- * Generated server application
986
- *
987
- * ⚠️ WARNING: This is for LOCAL DEVELOPMENT ONLY
988
- * The subscriber polling mechanism is not production-ready.
989
- * For production, use AWS Lambda with SQS/SNS event sources.
990
- */
991
- import { Hono } from 'hono';
992
- import type { Hono as HonoType } from 'hono';
993
- import { setupEndpoints } from './endpoints.js';
994
- import { setupSubscribers } from './subscribers.js';
995
- import { setupQueues } from './queues.js';
996
- ${runtime.imports}
997
- ${telescopeImports}
998
- ${studioImports}
999
- ${hooksImports}
1000
- ${cors.imports}
1001
- ${context.storageDrivers?.imports ?? ""}
1002
-
1003
- ${runtime.bindings}
1004
- ${telescopeFromSurface ? "const telescope = __surface.telescope;" : ""}
1005
-
1006
- ${context.storageDrivers?.setup ? `// Which storage drivers exist is the entry point's decision: the scheme in
1007
- // each injected URL picks one, so no construct and no application module names
1008
- // a provider.
1009
- ${context.storageDrivers.setup}
1010
- ` : ""}
1011
- export interface ServerApp {
1012
- app: HonoType;
1013
- start: (options?: {
1014
- port?: number;
1015
- serve: (app: HonoType, port: number) => void | Promise<void>;
1016
- }) => Promise<void>;
1017
- }
1018
-
1019
- /**
1020
- * Create and configure the Hono application
1021
- *
1022
- * @param app - Optional Hono app instance to configure (creates new one if not provided)
1023
- * @param enableOpenApi - Enable OpenAPI documentation (default: true)
1024
- * @returns Server app with configured Hono app and start function
1025
- *
1026
- * @example
1027
- * // With Bun
1028
- * import { createApp } from './.gkm/server/app.js';
1029
- *
1030
- * const { app, start } = await createApp();
1031
- *
1032
- * await start({
1033
- * port: 3000,
1034
- * serve: (app, port) => {
1035
- * Bun.serve({ port, fetch: app.fetch });
1036
- * }
1037
- * });
1038
- *
1039
- * @example
1040
- * // With Node.js (using @hono/node-server)
1041
- * import { serve } from '@hono/node-server';
1042
- * import { createApp } from './.gkm/server/app.js';
1043
- *
1044
- * const { app, start } = await createApp();
1045
- *
1046
- * await start({
1047
- * port: 3000,
1048
- * serve: (app, port) => {
1049
- * serve({ fetch: app.fetch, port });
1050
- * }
1051
- * });
1052
- */
1053
- export async function createApp(app?: HonoType, enableOpenApi: boolean = true): Promise<ServerApp> {
1054
- const honoApp = app || new Hono();
1055
- ${telescopeSetup}${cors.setup}${beforeSetupCall}${studioSetup}
1056
- // Setup HTTP endpoints
1057
- await setupEndpoints(honoApp, envParser, logger, enableOpenApi);
1058
- ${afterSetupCall}
1059
-
1060
- return {
1061
- app: honoApp,
1062
- async start(options) {
1063
- if (!options?.serve) {
1064
- throw new Error(
1065
- 'serve function is required. Pass a serve function for your runtime:\\n' +
1066
- ' - Bun: (app, port) => Bun.serve({ port, fetch: app.fetch })\\n' +
1067
- ' - Node: (app, port) => serve({ fetch: app.fetch, port })'
1068
- );
1069
- }
1070
-
1071
- const port = options.port ?? 3000;
1072
-
1073
- // Start subscribers in background (non-blocking, local development only)
1074
- await setupSubscribers(envParser, logger).catch((error) => {
1075
- logger.error({ error }, 'Failed to start subscribers');
1076
- });
1077
-
1078
- // Start queue workers in background (non-blocking, local development only)
1079
- await setupQueues(envParser, logger).catch((error) => {
1080
- logger.error({ error }, 'Failed to start queue workers');
1081
- });
1082
-
1083
- logger.info({ port }, 'Starting server');
1084
-
1085
- // Start HTTP server using provided serve function
1086
- await options.serve(honoApp, port);
1087
-
1088
- logger.info({ port }, 'Server started');
1089
- }
1090
- };
1091
- }
1092
-
1093
- // Default export for convenience
1094
- export default createApp;
1095
- `;
1096
- await (0, node_fs_promises.writeFile)(appPath, content);
1097
- return appPath;
1098
- }
1099
- /**
1100
- * One Lambda, one endpoint — and no environment import.
1101
- *
1102
- * The endpoint was built from its surface, so it carries the parser the
1103
- * adaptor needs. This used to read
1104
- * `import { envParser } from '../../config/env'`, a line the build wrote
1105
- * because a generator can print a module specifier and cannot print an
1106
- * object. Nothing has to be printed now, which is also why nothing has to be
1107
- * named in config.
1108
- */
1109
- generateAWSApiGatewayV1Handler(importPath, exportName, drivers) {
1110
- return `import { AmazonApiGatewayV1Endpoint } from '@geekmidas/constructs/aws';
1111
- import { ${exportName} } from '${importPath}';
1112
- ${drivers?.imports ?? ""}
1113
- ${drivers?.setup ? `\n// The handler registers the drivers its target needs.\n${drivers.setup}\n` : ""}
1114
- const adapter = new AmazonApiGatewayV1Endpoint(${exportName});
1115
-
1116
- export const handler = adapter.handler;
1117
- `;
1118
- }
1119
- /**
1120
- * One Lambda, one endpoint — and no environment import.
1121
- *
1122
- * The endpoint was built from its surface, so it carries the parser the
1123
- * adaptor needs. This used to read
1124
- * `import { envParser } from '../../config/env'`, a line the build wrote
1125
- * because a generator can print a module specifier and cannot print an
1126
- * object. Nothing has to be printed now, which is also why nothing has to be
1127
- * named in config.
1128
- */
1129
- generateAWSApiGatewayV2Handler(importPath, exportName, drivers) {
1130
- return `import { AmazonApiGatewayV2Endpoint } from '@geekmidas/constructs/aws';
1131
- import { ${exportName} } from '${importPath}';
1132
- ${drivers?.imports ?? ""}
1133
- ${drivers?.setup ? `\n// The handler registers the drivers its target needs.\n${drivers.setup}\n` : ""}
1134
- const adapter = new AmazonApiGatewayV2Endpoint(${exportName});
1135
-
1136
- export const handler = adapter.handler;
1137
- `;
1138
- }
1139
- generateServerHandler(importPath, exportName) {
1140
- return `import { ${exportName} } from '${importPath}';
1141
-
1142
- // Server handler - implement based on your server framework
1143
- export const handler = ${exportName};
1144
- `;
1145
- }
1146
- /**
1147
- * Generate a production-optimized app.ts file
1148
- * No dev tools (Telescope, Studio, WebSocket), includes health checks and graceful shutdown
1149
- */
1150
- async generateProductionAppFile(outputDir, context) {
1151
- const appFileName = "app.ts";
1152
- const appPath = (0, node_path.join)(outputDir, appFileName);
1153
- const relativeLoggerPath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.loggerPath);
1154
- const relativeEnvParserPath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.envParserPath);
1155
- const production = context.production;
1156
- const healthCheckPath = production.healthCheck;
1157
- const enableGracefulShutdown = production.gracefulShutdown;
1158
- const enableOpenApi = production.openapi;
1159
- const includeSubscribers = production.subscribers === "include";
1160
- const cors = corsFor(context.surface);
1161
- let hooksImports = "";
1162
- let beforeSetupCall = "";
1163
- let afterSetupCall = "";
1164
- if (context.hooks?.serverHooksPath) {
1165
- const relativeHooksPath = (0, node_path.relative)((0, node_path.dirname)(appPath), context.hooks.serverHooksPath);
1166
- hooksImports = `import * as serverHooks from '${relativeHooksPath}';`;
1167
- beforeSetupCall = `
1168
- // Call beforeSetup hook if defined
1169
- if (typeof serverHooks.beforeSetup === 'function') {
1170
- await serverHooks.beforeSetup(honoApp, { envParser, logger });
1171
- }
1172
- `;
1173
- afterSetupCall = `
1174
- // Call afterSetup hook if defined
1175
- if (typeof serverHooks.afterSetup === 'function') {
1176
- await serverHooks.afterSetup(honoApp, { envParser, logger });
1177
- }
1178
- `;
1179
- }
1180
- const subscriberSetup = includeSubscribers ? `
1181
- // Start subscribers in background
1182
- await setupSubscribers(envParser, logger).catch((error) => {
1183
- logger.error({ error }, 'Failed to start subscribers');
1184
- });
1185
-
1186
- // Start queue workers in background
1187
- await setupQueues(envParser, logger).catch((error) => {
1188
- logger.error({ error }, 'Failed to start queue workers');
1189
- });
1190
- ` : "";
1191
- const subscriberImport = includeSubscribers ? `import { setupSubscribers } from './subscribers.js';
1192
- import { setupQueues } from './queues.js';` : "";
1193
- const gracefulShutdownCode = enableGracefulShutdown ? `
1194
- // Graceful shutdown handling
1195
- let isShuttingDown = false;
1196
-
1197
- const shutdown = async () => {
1198
- if (isShuttingDown) return;
1199
- isShuttingDown = true;
1200
- logger.info('Graceful shutdown initiated');
1201
- // Allow in-flight requests to complete (30s timeout)
1202
- setTimeout(() => process.exit(0), 30000);
1203
- };
1204
-
1205
- process.on('SIGTERM', shutdown);
1206
- process.on('SIGINT', shutdown);
1207
- ` : "";
1208
- const endpointsImportPath = production.optimizedHandlers ? "./endpoints/index.js" : "./endpoints.js";
1209
- const content = `/**
1210
- * Generated production server application
1211
- *
1212
- * This is a production-optimized build without dev tools.
1213
- * - No Telescope debugging dashboard
1214
- * - No Studio database browser
1215
- * - No WebSocket updates
1216
- * - Includes health checks and graceful shutdown
1217
- */
1218
- import { Hono } from 'hono';
1219
- import type { Hono as HonoType } from 'hono';
1220
- import { setupEndpoints } from '${endpointsImportPath}';
1221
- ${subscriberImport}
1222
- import ${context.envParserImportPattern} from '${relativeEnvParserPath}';
1223
- import ${context.loggerImportPattern} from '${relativeLoggerPath}';
1224
- ${hooksImports}
1225
- ${cors.imports}
1226
- ${context.storageDrivers?.imports ?? ""}
1227
-
1228
- ${context.storageDrivers?.setup ? `// The entry point registers the drivers its target needs.
1229
- ${context.storageDrivers.setup}
1230
- ` : ""}
1231
- export interface ServerApp {
1232
- app: HonoType;
1233
- start: (options?: {
1234
- port?: number;
1235
- serve: (app: HonoType, port: number) => void | Promise<void>;
1236
- }) => Promise<void>;
1237
- }
1238
-
1239
- /**
1240
- * Create and configure the production Hono application
1241
- */
1242
- export async function createApp(app?: HonoType): Promise<ServerApp> {
1243
- const honoApp = app || new Hono();
1244
-
1245
- // Health check endpoint (always first)
1246
- honoApp.get('${healthCheckPath}', (c) => c.json({ status: 'ok', timestamp: Date.now() }));
1247
- honoApp.get('/ready', (c) => c.json({ ready: true }));
1248
- ${cors.setup}${beforeSetupCall}
1249
- // Setup HTTP endpoints (OpenAPI: ${enableOpenApi})
1250
- await setupEndpoints(honoApp, envParser, logger, ${enableOpenApi});
1251
- ${afterSetupCall}
1252
- return {
1253
- app: honoApp,
1254
- async start(options) {
1255
- if (!options?.serve) {
1256
- throw new Error(
1257
- 'serve function is required. Pass a serve function for your runtime:\\n' +
1258
- ' - Bun: (app, port) => Bun.serve({ port, fetch: app.fetch })\\n' +
1259
- ' - Node: (app, port) => serve({ fetch: app.fetch, port })'
1260
- );
1261
- }
1262
-
1263
- const port = options.port ?? Number(process.env.PORT) ?? 3000;
1264
- ${gracefulShutdownCode}${subscriberSetup}
1265
- logger.info({ port }, 'Starting production server');
1266
-
1267
- // Start HTTP server using provided serve function
1268
- await options.serve(honoApp, port);
1269
-
1270
- logger.info({ port }, 'Production server started');
1271
- }
1272
- };
1273
- }
1274
-
1275
- // Default export for convenience
1276
- export default createApp;
1277
- `;
1278
- await (0, node_fs_promises.writeFile)(appPath, content);
1279
- await this.generateProductionServerEntry(outputDir);
1280
- return appPath;
1281
- }
1282
- /**
1283
- * Generate production server.ts entry point
1284
- */
1285
- async generateProductionServerEntry(outputDir) {
1286
- const serverPath = (0, node_path.join)(outputDir, "server.ts");
1287
- const content = `#!/usr/bin/env node
1288
- /**
1289
- * Production server entry point
1290
- * Generated by 'gkm build --provider server --production'
1291
- */
1292
- import { serve } from '@hono/node-server';
1293
- import { createApp } from './app.js';
1294
-
1295
- const port = Number(process.env.PORT) || 3000;
1296
-
1297
- const { start } = await createApp();
1298
-
1299
- await start({
1300
- port,
1301
- serve: (app, port) => { serve({ fetch: app.fetch, port }); },
1302
- });
1303
- `;
1304
- await (0, node_fs_promises.writeFile)(serverPath, content);
1305
- }
1306
- };
1307
-
1308
- //#endregion
1309
- //#region src/generators/OpenApiTsGenerator.ts
1310
- /**
1311
- * Generates TypeScript OpenAPI module from endpoints.
1312
- * Outputs:
1313
- * - securitySchemes: typed security scheme definitions
1314
- * - endpointAuth: runtime map of endpoints to auth requirements
1315
- * - paths: TypeScript interface for type-safe fetcher
1316
- * - schema interfaces: reusable TypeScript types from Zod/Valibot schemas
1317
- */
1318
- var OpenApiTsGenerator = class {
1319
- async generate(endpoints, options = {}) {
1320
- const { title = "API", version = "1.0.0", description } = options;
1321
- const endpointInfos = await this.extractEndpointInfos(endpoints);
1322
- const securitySchemes = this.collectSecuritySchemes(endpointInfos);
1323
- const endpointAuth = this.buildEndpointAuthMap(endpointInfos);
1324
- const schemaInterfaces = await this.generateSchemaInterfaces(endpointInfos);
1325
- const pathsInterface = await this.generatePathsInterface(endpointInfos);
1326
- return this.buildModule({
1327
- title,
1328
- version,
1329
- description,
1330
- securitySchemes,
1331
- endpointAuth,
1332
- schemaInterfaces,
1333
- pathsInterface
1334
- });
1335
- }
1336
- async extractEndpointInfos(endpoints) {
1337
- return endpoints.map((ep) => {
1338
- const route = ep.route.replace(/:(\w+)/g, "{$1}");
1339
- const method = ep.method.toUpperCase();
1340
- const securityScheme = ep.authorizer?.securityScheme;
1341
- return {
1342
- endpoint: `${method} ${route}`,
1343
- route,
1344
- method,
1345
- authorizerName: ep.authorizer?.name ?? null,
1346
- authorizerType: ep.authorizer?.type ?? null,
1347
- securityScheme: securityScheme ?? null,
1348
- input: ep.input,
1349
- output: ep.outputSchema,
1350
- description: ep.description,
1351
- tags: ep.tags,
1352
- operationId: ep.operationId,
1353
- responseType: ep.responseType ?? "application/json"
1354
- };
1355
- });
1356
- }
1357
- collectSecuritySchemes(endpointInfos) {
1358
- const schemes = /* @__PURE__ */ new Map();
1359
- for (const info of endpointInfos) if (info.authorizerName && !schemes.has(info.authorizerName)) {
1360
- const scheme = info.securityScheme ?? (info.authorizerType ? this.mapAuthorizerToSecurityScheme(info.authorizerType, info.authorizerName) : null);
1361
- if (scheme) schemes.set(info.authorizerName, {
1362
- name: info.authorizerName,
1363
- type: scheme.type,
1364
- scheme
1365
- });
1366
- }
1367
- return Array.from(schemes.values());
1368
- }
1369
- mapAuthorizerToSecurityScheme(type, _name) {
1370
- switch (type.toLowerCase()) {
1371
- case "jwt":
1372
- case "bearer": return {
1373
- type: "http",
1374
- scheme: "bearer",
1375
- bearerFormat: "JWT"
1376
- };
1377
- case "iam":
1378
- case "aws-sigv4":
1379
- case "sigv4": return {
1380
- type: "apiKey",
1381
- in: "header",
1382
- name: "Authorization",
1383
- "x-amazon-apigateway-authtype": "awsSigv4"
1384
- };
1385
- case "apikey":
1386
- case "api-key": return {
1387
- type: "apiKey",
1388
- in: "header",
1389
- name: "X-API-Key"
1390
- };
1391
- case "oauth2": return {
1392
- type: "oauth2",
1393
- flows: {}
1394
- };
1395
- case "oidc":
1396
- case "openidconnect": return {
1397
- type: "openIdConnect",
1398
- openIdConnectUrl: ""
1399
- };
1400
- default: return {
1401
- type: "http",
1402
- scheme: "bearer"
1403
- };
1404
- }
1405
- }
1406
- buildEndpointAuthMap(endpointInfos) {
1407
- const authMap = {};
1408
- for (const info of endpointInfos) authMap[info.endpoint] = info.authorizerName;
1409
- return authMap;
1410
- }
1411
- async generateSchemaInterfaces(endpointInfos) {
1412
- const interfaces = [];
1413
- const generatedNames = /* @__PURE__ */ new Set();
1414
- const collectedDefs = /* @__PURE__ */ new Map();
1415
- for (const info of endpointInfos) {
1416
- const baseName = this.getSchemaBaseName(info);
1417
- if (info.input?.body) {
1418
- const name = await this.getSchemaName(info.input.body, `${baseName}Input`);
1419
- if (!generatedNames.has(name)) {
1420
- const schema = await this.schemaToInterfaceWithDefs(info.input.body, name, collectedDefs);
1421
- if (schema) {
1422
- interfaces.push(schema);
1423
- generatedNames.add(name);
1424
- }
1425
- }
1426
- }
1427
- if (info.input?.params) {
1428
- const name = await this.getSchemaName(info.input.params, `${baseName}Params`);
1429
- if (!generatedNames.has(name)) {
1430
- const schema = await this.schemaToInterfaceWithDefs(info.input.params, name, collectedDefs);
1431
- if (schema) {
1432
- interfaces.push(schema);
1433
- generatedNames.add(name);
1434
- }
1435
- }
1436
- }
1437
- if (info.input?.query) {
1438
- const name = await this.getSchemaName(info.input.query, `${baseName}Query`);
1439
- if (!generatedNames.has(name)) {
1440
- const schema = await this.schemaToInterfaceWithDefs(info.input.query, name, collectedDefs);
1441
- if (schema) {
1442
- interfaces.push(schema);
1443
- generatedNames.add(name);
1444
- }
1445
- }
1446
- }
1447
- if (info.output) {
1448
- const name = await this.getSchemaName(info.output, `${baseName}Output`);
1449
- if (!generatedNames.has(name)) {
1450
- const schema = await this.schemaToInterfaceWithDefs(info.output, name, collectedDefs);
1451
- if (schema) {
1452
- interfaces.push(schema);
1453
- generatedNames.add(name);
1454
- }
1455
- }
1456
- }
1457
- }
1458
- const registrySchemas = await (0, __geekmidas_schema_conversion.getRegisteredZodJsonSchemas)();
1459
- for (const [rawName, rawSchema] of Object.entries(registrySchemas)) {
1460
- const defName = this.pascalCase(rawName);
1461
- if (collectedDefs.has(defName) || generatedNames.has(defName)) continue;
1462
- const { id: _id, $defs: _defs,...rest } = rawSchema;
1463
- collectedDefs.set(defName, rest);
1464
- }
1465
- for (const [defName, defSchema] of collectedDefs) if (!generatedNames.has(defName)) {
1466
- const interfaceStr = this.jsonSchemaToInterface(defSchema, defName);
1467
- interfaces.push(interfaceStr);
1468
- generatedNames.add(defName);
1469
- }
1470
- return interfaces.join("\n\n");
1471
- }
1472
- /**
1473
- * Get the name for a schema, using metadata `id` if available,
1474
- * otherwise falling back to the provided default name.
1475
- */
1476
- async getSchemaName(schema, defaultName) {
1477
- try {
1478
- const metadata = await (0, __geekmidas_schema_conversion.getSchemaMetadata)(schema);
1479
- if (metadata?.id) return this.pascalCase(metadata.id);
1480
- } catch {}
1481
- return defaultName;
1482
- }
1483
- getSchemaBaseName(info) {
1484
- if (info.operationId) return this.pascalCase(info.operationId);
1485
- const routeParts = info.route.replace(/[{}]/g, "").split("/").filter(Boolean).map((part) => this.pascalCase(part));
1486
- return `${this.pascalCase(info.method.toLowerCase())}${routeParts.join("")}`;
1487
- }
1488
- pascalCase(str) {
1489
- return str.replace(/[-_](.)/g, (_, c) => c.toUpperCase()).replace(/^./, (c) => c.toUpperCase());
1490
- }
1491
- /**
1492
- * Convert schema to interface while collecting $defs for nested schemas
1493
- * with .meta({ id: 'X' }).
1494
- */
1495
- async schemaToInterfaceWithDefs(schema, name, collectedDefs) {
1496
- try {
1497
- const vendor = schema["~standard"]?.vendor;
1498
- if (!vendor || !(vendor in __geekmidas_schema_conversion.StandardSchemaJsonSchema)) return null;
1499
- const toJsonSchema = __geekmidas_schema_conversion.StandardSchemaJsonSchema[vendor];
1500
- const jsonSchema = await toJsonSchema(schema);
1501
- if (!jsonSchema) return null;
1502
- if (jsonSchema.$defs && typeof jsonSchema.$defs === "object") {
1503
- for (const [defName, defSchema] of Object.entries(jsonSchema.$defs)) if (!collectedDefs.has(defName)) {
1504
- const { id,...schemaWithoutId } = defSchema;
1505
- collectedDefs.set(defName, schemaWithoutId);
1506
- }
1507
- }
1508
- const { $defs,...schemaWithoutDefs } = jsonSchema;
1509
- return this.jsonSchemaToInterface(schemaWithoutDefs, name);
1510
- } catch {
1511
- return null;
1512
- }
1513
- }
1514
- jsonSchemaToInterface(schema, name) {
1515
- if (schema.type !== "object" || !schema.properties) {
1516
- const typeStr = this.jsonSchemaTypeToTs(schema);
1517
- return `export type ${name} = ${typeStr};`;
1518
- }
1519
- const props = [];
1520
- const required = new Set(schema.required || []);
1521
- for (const [propName, propSchema] of Object.entries(schema.properties)) {
1522
- const isRequired = required.has(propName);
1523
- const typeStr = this.jsonSchemaTypeToTs(propSchema);
1524
- const optionalMark = isRequired ? "" : "?";
1525
- props.push(` ${propName}${optionalMark}: ${typeStr};`);
1526
- }
1527
- return `export interface ${name} {\n${props.join("\n")}\n}`;
1528
- }
1529
- jsonSchemaTypeToTs(schema) {
1530
- if (!schema) return "unknown";
1531
- if (schema.$ref) {
1532
- const refName = schema.$ref.split("/").pop() || "unknown";
1533
- return refName;
1534
- }
1535
- if (schema.anyOf) return schema.anyOf.map((s) => this.jsonSchemaTypeToTs(s)).join(" | ");
1536
- if (schema.oneOf) return schema.oneOf.map((s) => this.jsonSchemaTypeToTs(s)).join(" | ");
1537
- if (schema.allOf) return schema.allOf.map((s) => this.jsonSchemaTypeToTs(s)).join(" & ");
1538
- switch (schema.type) {
1539
- case "string":
1540
- if (schema.enum) return schema.enum.map((e) => `'${e}'`).join(" | ");
1541
- return "string";
1542
- case "number":
1543
- case "integer": return "number";
1544
- case "boolean": return "boolean";
1545
- case "null": return "null";
1546
- case "array":
1547
- if (schema.items) return `Array<${this.jsonSchemaTypeToTs(schema.items)}>`;
1548
- return "Array<unknown>";
1549
- case "object":
1550
- if (schema.properties) {
1551
- const props = [];
1552
- const required = new Set(schema.required || []);
1553
- for (const [propName, propSchema] of Object.entries(schema.properties)) {
1554
- const isRequired = required.has(propName);
1555
- const typeStr = this.jsonSchemaTypeToTs(propSchema);
1556
- const optionalMark = isRequired ? "" : "?";
1557
- props.push(`${propName}${optionalMark}: ${typeStr}`);
1558
- }
1559
- return `{ ${props.join("; ")} }`;
1560
- }
1561
- if (schema.additionalProperties) {
1562
- const valueType = this.jsonSchemaTypeToTs(schema.additionalProperties);
1563
- return `Record<string, ${valueType}>`;
1564
- }
1565
- return "Record<string, unknown>";
1566
- default: return "unknown";
1567
- }
1568
- }
1569
- async generatePathsInterface(endpointInfos) {
1570
- const pathGroups = /* @__PURE__ */ new Map();
1571
- for (const info of endpointInfos) {
1572
- const existing = pathGroups.get(info.route) || [];
1573
- existing.push(info);
1574
- pathGroups.set(info.route, existing);
1575
- }
1576
- const pathEntries = [];
1577
- for (const [route, infos] of pathGroups) {
1578
- const methodEntries = [];
1579
- for (const info of infos) {
1580
- const methodDef = await this.generateMethodDefinition(info);
1581
- methodEntries.push(` ${info.method.toLowerCase()}: ${methodDef};`);
1582
- }
1583
- const firstWithParams = infos.find((i) => i.input?.params);
1584
- let paramsEntry = "";
1585
- if (firstWithParams?.input?.params) {
1586
- const paramsName = await this.getSchemaName(firstWithParams.input.params, `${this.getSchemaBaseName(firstWithParams)}Params`);
1587
- paramsEntry = `\n parameters: {\n path: ${paramsName};\n };`;
1588
- }
1589
- pathEntries.push(` '${route}': {${paramsEntry}\n${methodEntries.join("\n")}\n };`);
1590
- }
1591
- return `export interface paths {\n${pathEntries.join("\n")}\n}`;
1592
- }
1593
- async generateMethodDefinition(info) {
1594
- const parts = [];
1595
- const baseName = this.getSchemaBaseName(info);
1596
- if (info.input?.body) {
1597
- const bodyName = await this.getSchemaName(info.input.body, `${baseName}Input`);
1598
- parts.push(`requestBody: {
1599
- content: {
1600
- 'application/json': ${bodyName};
1601
- };
1602
- }`);
1603
- }
1604
- if (info.input?.query) {
1605
- const queryName = await this.getSchemaName(info.input.query, `${baseName}Query`);
1606
- parts.push(`parameters: {
1607
- query: ${queryName};
1608
- }`);
1609
- }
1610
- const outputName = info.output ? await this.getSchemaName(info.output, `${baseName}Output`) : "unknown";
1611
- parts.push(`responses: {
1612
- 200: {
1613
- content: {
1614
- '${info.responseType}': ${outputName};
1615
- };
1616
- };
1617
- }`);
1618
- return `{\n ${parts.join(";\n ")};\n }`;
1619
- }
1620
- buildModule(params) {
1621
- const { title, version, description, securitySchemes, endpointAuth, schemaInterfaces, pathsInterface } = params;
1622
- const securitySchemesObj = securitySchemes.reduce((acc, s) => {
1623
- acc[s.name] = s.scheme;
1624
- return acc;
1625
- }, {});
1626
- const schemeNames = securitySchemes.map((s) => `'${s.name}'`).join(" | ");
1627
- const hasSecuritySchemes = schemeNames.length > 0;
1628
- const createApiSection = hasSecuritySchemes ? `
1629
- // ============================================================
1630
- // API Client Factory
1631
- // ============================================================
1632
-
1633
- import {
1634
- createAuthAwareFetcher,
1635
- type AuthStrategy,
1636
- } from '@geekmidas/client/auth-fetcher';
1637
- import { createEndpointHooks } from '@geekmidas/client/endpoint-hooks';
1638
- import type { QueryClient } from '@tanstack/react-query';
1639
-
1640
- /**
1641
- * Options for creating the API client.
1642
- */
1643
- export interface CreateApiOptions {
1644
- /** Base URL for all API requests (required) */
1645
- baseURL: string;
1646
- /** Auth strategies for each security scheme used in this API */
1647
- authStrategies: Record<SecuritySchemeId, AuthStrategy>;
1648
- /** Optional React Query client instance */
1649
- queryClient?: QueryClient;
1650
- /** Optional request interceptor */
1651
- onRequest?: (config: RequestInit) => RequestInit | Promise<RequestInit>;
1652
- }
1653
-
1654
- /**
1655
- * Create a type-safe API client with authentication and React Query hooks.
1656
- *
1657
- * @example
1658
- * \`\`\`typescript
1659
- * const api = createApi({
1660
- * baseURL: 'https://api.example.com',
1661
- * authStrategies: {
1662
- * jwt: { type: 'bearer', tokenProvider },
1663
- * },
1664
- * });
1665
- *
1666
- * // Imperative fetch
1667
- * const user = await api('GET /users/{id}', { params: { id: '123' } });
1668
- *
1669
- * // React Query hooks
1670
- * const { data } = api.useQuery('GET /users/{id}', { params: { id: '123' } });
1671
- * const mutation = api.useMutation('POST /users');
1672
- * \`\`\`
1673
- */
1674
- export function createApi(options: CreateApiOptions) {
1675
- const fetcher = createAuthAwareFetcher<paths, typeof endpointAuth, typeof securitySchemes>({
1676
- baseURL: options.baseURL,
1677
- endpointAuth,
1678
- securitySchemes,
1679
- authStrategies: options.authStrategies,
1680
- onRequest: options.onRequest,
1681
- });
1682
-
1683
- const hooks = createEndpointHooks<paths>(fetcher, { queryClient: options.queryClient });
1684
-
1685
- return Object.assign(fetcher, hooks);
1686
- }
1687
- ` : `
1688
- // ============================================================
1689
- // API Client Factory
1690
- // ============================================================
1691
-
1692
- import { createTypedFetcher, type FetcherOptions } from '@geekmidas/client/fetcher';
1693
- import { createEndpointHooks } from '@geekmidas/client/endpoint-hooks';
1694
- import type { QueryClient } from '@tanstack/react-query';
1695
-
1696
- /**
1697
- * Options for creating the API client.
1698
- */
1699
- export interface CreateApiOptions extends Omit<FetcherOptions, 'baseURL'> {
1700
- /** Base URL for all API requests (required) */
1701
- baseURL: string;
1702
- /** Optional React Query client instance */
1703
- queryClient?: QueryClient;
1704
- }
1705
-
1706
- /**
1707
- * Create a type-safe API client with React Query hooks.
1708
- *
1709
- * @example
1710
- * \`\`\`typescript
1711
- * const api = createApi({
1712
- * baseURL: 'https://api.example.com',
1713
- * });
1714
- *
1715
- * // Imperative fetch
1716
- * const data = await api('GET /health');
1717
- *
1718
- * // React Query hooks
1719
- * const { data } = api.useQuery('GET /health');
1720
- * \`\`\`
1721
- */
1722
- export function createApi(options: CreateApiOptions) {
1723
- const { queryClient, ...fetcherOptions } = options;
1724
- const request = createTypedFetcher<paths>(fetcherOptions);
1725
-
1726
- const hooks = createEndpointHooks<paths>(request, { queryClient });
1727
-
1728
- return Object.assign(request, hooks);
1729
- }
1730
- `;
1731
- return `// Auto-generated by @geekmidas/cli - DO NOT EDIT
1732
-
1733
- // ============================================================
1734
- // Security Scheme Type
1735
- // ============================================================
1736
-
1737
- interface SecuritySchemeObject {
1738
- type: 'apiKey' | 'http' | 'mutualTLS' | 'oauth2' | 'openIdConnect';
1739
- description?: string;
1740
- name?: string;
1741
- in?: 'query' | 'header' | 'cookie';
1742
- scheme?: string;
1743
- bearerFormat?: string;
1744
- flows?: Record<string, unknown>;
1745
- openIdConnectUrl?: string;
1746
- [key: string]: unknown;
1747
- }
1748
-
1749
- // ============================================================
1750
- // API Info
1751
- // ============================================================
1752
-
1753
- export const apiInfo = {
1754
- title: '${title}',
1755
- version: '${version}',${description ? `\n description: '${description.replace(/'/g, "\\'")}',` : ""}
1756
- } as const;
1757
-
1758
- // ============================================================
1759
- // Security Schemes
1760
- // ============================================================
1761
-
1762
- /**
1763
- * Available security schemes for this API.
1764
- * Maps authorizer names to OpenAPI security scheme definitions.
1765
- */
1766
- export const securitySchemes = ${JSON.stringify(securitySchemesObj, null, 2).replace(/"([a-zA-Z_$][a-zA-Z0-9_$]*)":/g, "$1:")} as const satisfies Record<string, SecuritySchemeObject>;
1767
-
1768
- export type SecuritySchemeId = ${schemeNames || "never"};
1769
-
1770
- // ============================================================
1771
- // Endpoint Authentication Map
1772
- // ============================================================
1773
-
1774
- /**
1775
- * Runtime map of endpoints to their required authentication scheme.
1776
- * \`null\` indicates a public endpoint (no auth required).
1777
- */
1778
- export const endpointAuth = ${JSON.stringify(endpointAuth, null, 2).replace(/"([^"]+)":/g, "'$1':")} as const satisfies Record<string, SecuritySchemeId | null>;
1779
-
1780
- export type EndpointString = keyof typeof endpointAuth;
1781
-
1782
- export type AuthenticatedEndpoint = {
1783
- [K in EndpointString]: typeof endpointAuth[K] extends null ? never : K;
1784
- }[EndpointString];
1785
-
1786
- export type PublicEndpoint = {
1787
- [K in EndpointString]: typeof endpointAuth[K] extends null ? K : never;
1788
- }[EndpointString];
1789
-
1790
- // ============================================================
1791
- // Schema Definitions
1792
- // ============================================================
1793
-
1794
- ${schemaInterfaces}
1795
-
1796
- // ============================================================
1797
- // OpenAPI Paths
1798
- // ============================================================
1799
-
1800
- ${pathsInterface}
1801
- ${createApiSection}
1802
- `;
1803
- }
1804
- };
1805
-
1806
- //#endregion
1807
- //#region src/workspace/client-generator.ts
1808
- /**
1809
- * Normalize routes to an array of patterns.
1810
- * Handles string, string[], and PartitionedRoutes (extracts paths).
1811
- * @internal Exported for use in dev command
1812
- */
1813
- function normalizeRoutes(routes) {
1814
- if (!routes) return [];
1815
- if (require_discover.isPartitionedRoutes(routes)) return Array.isArray(routes.paths) ? routes.paths : [routes.paths];
1816
- return Array.isArray(routes) ? routes : [routes];
1817
- }
1818
-
1819
- //#endregion
1820
- //#region src/openapi.ts
1821
- /**
1822
- * Default output path for generated OpenAPI client (used for single-app configs)
1823
- */
1824
- const OPENAPI_OUTPUT_PATH = "./.gkm/openapi.ts";
1825
- /**
1826
- * Resolve OpenAPI config from GkmConfig
1827
- */
1828
- function resolveOpenApiConfig(config) {
1829
- if (config.openapi === false) return { enabled: false };
1830
- if (config.openapi === true || config.openapi === void 0) return {
1831
- enabled: true,
1832
- title: "API Documentation",
1833
- version: "1.0.0",
1834
- description: "Auto-generated API documentation from endpoints"
1835
- };
1836
- return {
1837
- enabled: config.openapi.enabled !== false,
1838
- title: config.openapi.title || "API Documentation",
1839
- version: config.openapi.version || "1.0.0",
1840
- description: config.openapi.description || "Auto-generated API documentation from endpoints"
1841
- };
1842
- }
1843
- /**
1844
- * Generate OpenAPI spec from endpoints
1845
- * @returns Object with output path and endpoint count, or null if disabled
1846
- */
1847
- async function generateOpenApi(config, options = {}) {
1848
- const logger = options.silent ? { log: () => {} } : console;
1849
- const openApiConfig = resolveOpenApiConfig(config);
1850
- if (!openApiConfig.enabled) return null;
1851
- const endpointGenerator = new EndpointGenerator();
1852
- const loadedEndpoints = await endpointGenerator.load(config.routes, void 0, options.bustCache);
1853
- if (loadedEndpoints.length === 0) {
1854
- logger.log("No valid endpoints found for OpenAPI generation");
1855
- return null;
1856
- }
1857
- const endpoints = loadedEndpoints.map(({ construct }) => construct);
1858
- const outputPath = (0, node_path.join)(process.cwd(), OPENAPI_OUTPUT_PATH);
1859
- await (0, node_fs_promises.mkdir)((0, node_path.dirname)(outputPath), { recursive: true });
1860
- const tsGenerator = new OpenApiTsGenerator();
1861
- const tsContent = await tsGenerator.generate(endpoints, {
1862
- title: openApiConfig.title,
1863
- version: openApiConfig.version,
1864
- description: openApiConfig.description
1865
- });
1866
- await (0, node_fs_promises.writeFile)(outputPath, tsContent);
1867
- logger.log(`📄 OpenAPI client generated: ${OPENAPI_OUTPUT_PATH}`);
1868
- return {
1869
- outputPath,
1870
- endpointCount: loadedEndpoints.length
1871
- };
1872
- }
1873
- async function openapiCommand(options = {}) {
1874
- const logger = console;
1875
- try {
1876
- const loadedConfig = await require_config.loadWorkspaceConfig(options.cwd);
1877
- if (loadedConfig.type === "single") {
1878
- const config = loadedConfig.raw;
1879
- if (!config.openapi) config.openapi = { enabled: true };
1880
- const result = await generateOpenApi(config);
1881
- if (result) logger.log(`Found ${result.endpointCount} endpoints`);
1882
- } else {
1883
- const { workspace } = loadedConfig;
1884
- const workspaceRoot = workspace.root;
1885
- const backendApps = Object.entries(workspace.apps).filter(([_, app]) => app.type === "backend" && app.routes !== void 0 && app.openapi !== false && (typeof app.openapi !== "object" || app.openapi.enabled !== false));
1886
- if (backendApps.length === 0) {
1887
- logger.log("No backend apps with OpenAPI enabled found");
1888
- return;
1889
- }
1890
- if (options.app) {
1891
- const entry = backendApps.find(([name]) => name === options.app);
1892
- if (!entry) throw new Error(`App "${options.app}" not found or has OpenAPI disabled`);
1893
- const [appName, app] = entry;
1894
- const result = await generateOpenApiForApp(workspaceRoot, appName, app);
1895
- if (result) logger.log(`📄 [${appName}] Generated OpenAPI (${result.endpointCount} endpoints)`);
1896
- return;
1897
- }
1898
- for (const [appName, app] of backendApps) {
1899
- if (app.type !== "backend" || !app.routes) continue;
1900
- const appPath = (0, node_path.join)(workspaceRoot, app.path);
1901
- await runOpenApiInSubprocess(appPath, appName);
1902
- }
1903
- }
1904
- } catch (error) {
1905
- throw new Error(`OpenAPI generation failed: ${error.message}`);
1906
- }
1907
- }
1908
- /**
1909
- * Generate OpenAPI for a single named app within a workspace.
1910
- * Runs in-process. The caller is responsible for ensuring `process.cwd()`
1911
- * is the app's directory so tsx loads the app's tsconfig path aliases.
1912
- */
1913
- async function generateOpenApiForApp(workspaceRoot, _appName, app) {
1914
- if (app.type !== "backend" || !app.routes) return null;
1915
- const appPath = (0, node_path.join)(workspaceRoot, app.path);
1916
- const routes = normalizeRoutes(app.routes);
1917
- const routesGlob = routes.map((r) => (0, node_path.join)(appPath, r));
1918
- const gkmConfig = {
1919
- routes: routesGlob,
1920
- envParser: app.envParser || "",
1921
- logger: app.logger || "",
1922
- openapi: app.openapi
1923
- };
1924
- return generateOpenApi(gkmConfig, { silent: true });
1925
- }
1926
- /**
1927
- * Resolve the gkm bin path. Tests can override via `GKM_BIN_PATH` env var
1928
- * to avoid depending on the built dist.
1929
- */
1930
- function resolveGkmBinPath() {
1931
- if (process.env.GKM_BIN_PATH) return process.env.GKM_BIN_PATH;
1932
- return (0, node_url.fileURLToPath)(new URL("../bin/gkm.mjs", require("url").pathToFileURL(__filename).href));
1933
- }
1934
- /**
1935
- * Spawn a subprocess that runs `gkm openapi --app <name>` with `cwd` set to
1936
- * the app's directory. Inherits `NODE_OPTIONS` (which already contains
1937
- * `--import tsx`), so the child gets a fresh tsx instance whose tsconfig
1938
- * discovery picks up the app's tsconfig path aliases.
1939
- */
1940
- async function runOpenApiInSubprocess(appCwd, appName) {
1941
- const binPath = resolveGkmBinPath();
1942
- await new Promise((resolve, reject) => {
1943
- const child = (0, node_child_process.spawn)(process.execPath, [
1944
- binPath,
1945
- "openapi",
1946
- "--app",
1947
- appName
1948
- ], {
1949
- cwd: appCwd,
1950
- stdio: "inherit",
1951
- env: process.env
1952
- });
1953
- child.on("error", reject);
1954
- child.on("close", (code) => {
1955
- if (code === 0) resolve();
1956
- else reject(new Error(`OpenAPI generation for app "${appName}" exited with code ${code}`));
1957
- });
1958
- });
1959
- }
1960
-
1961
- //#endregion
1962
- Object.defineProperty(exports, 'EndpointGenerator', {
1963
- enumerable: true,
1964
- get: function () {
1965
- return EndpointGenerator;
1966
- }
1967
- });
1968
- Object.defineProperty(exports, 'OPENAPI_OUTPUT_PATH', {
1969
- enumerable: true,
1970
- get: function () {
1971
- return OPENAPI_OUTPUT_PATH;
1972
- }
1973
- });
1974
- Object.defineProperty(exports, 'generateOpenApi', {
1975
- enumerable: true,
1976
- get: function () {
1977
- return generateOpenApi;
1978
- }
1979
- });
1980
- Object.defineProperty(exports, 'normalizeRoutes', {
1981
- enumerable: true,
1982
- get: function () {
1983
- return normalizeRoutes;
1984
- }
1985
- });
1986
- Object.defineProperty(exports, 'openapiCommand', {
1987
- enumerable: true,
1988
- get: function () {
1989
- return openapiCommand;
1990
- }
1991
- });
1992
- Object.defineProperty(exports, 'resolveOpenApiConfig', {
1993
- enumerable: true,
1994
- get: function () {
1995
- return resolveOpenApiConfig;
1996
- }
1997
- });
1998
- //# sourceMappingURL=openapi-CljONd_M.cjs.map