@geekmidas/cli 10.0.0-alpha.11 → 10.0.0-alpha.110

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 (501) hide show
  1. package/README.md +315 -414
  2. package/bin/adjacent-tsconfig.mjs +46 -8
  3. package/bin/gkm.mjs +11 -3
  4. package/bin/owning-tsconfig-jsx-register.mjs +18 -0
  5. package/bin/owning-tsconfig-jsx.mjs +108 -0
  6. package/dist/EndpointGenerator-BwbYTMtB.cjs +1090 -0
  7. package/dist/EndpointGenerator-BwbYTMtB.cjs.map +1 -0
  8. package/dist/EndpointGenerator-CvLX8bpx.mjs +1031 -0
  9. package/dist/EndpointGenerator-CvLX8bpx.mjs.map +1 -0
  10. package/dist/GoDaddyProvider-CjeOduia.mjs +388 -0
  11. package/dist/GoDaddyProvider-CjeOduia.mjs.map +1 -0
  12. package/dist/GoDaddyProvider-qNUzTXI7.cjs +388 -0
  13. package/dist/GoDaddyProvider-qNUzTXI7.cjs.map +1 -0
  14. package/dist/{HostingerProvider-BcyFRbqV.mjs → HostingerProvider-BNpS9aRJ.mjs} +29 -25
  15. package/dist/HostingerProvider-BNpS9aRJ.mjs.map +1 -0
  16. package/dist/{HostingerProvider-BOvsgATO.cjs → HostingerProvider-DR1iws1P.cjs} +29 -25
  17. package/dist/HostingerProvider-DR1iws1P.cjs.map +1 -0
  18. package/dist/LegacyStateStore-MxiSu7KJ.cjs +124 -0
  19. package/dist/LegacyStateStore-MxiSu7KJ.cjs.map +1 -0
  20. package/dist/LegacyStateStore-pgscYsiG.mjs +124 -0
  21. package/dist/LegacyStateStore-pgscYsiG.mjs.map +1 -0
  22. package/dist/LocalStateStore-BcvyKbAw.mjs +167 -0
  23. package/dist/LocalStateStore-BcvyKbAw.mjs.map +1 -0
  24. package/dist/LocalStateStore-Bm8Vmwjb.cjs +178 -0
  25. package/dist/LocalStateStore-Bm8Vmwjb.cjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-BD6ZOQ51.cjs +541 -0
  27. package/dist/OpenApiTsGenerator-BD6ZOQ51.cjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-DXXFXSbO.mjs +536 -0
  29. package/dist/OpenApiTsGenerator-DXXFXSbO.mjs.map +1 -0
  30. package/dist/{Route53Provider-CH9XH7bz.cjs → Route53Provider-Bllus2NR.cjs} +21 -22
  31. package/dist/Route53Provider-Bllus2NR.cjs.map +1 -0
  32. package/dist/{Route53Provider-C0xmer8U.mjs → Route53Provider-QXxjkZO1.mjs} +13 -13
  33. package/dist/Route53Provider-QXxjkZO1.mjs.map +1 -0
  34. package/dist/S3StateStore-DXHSBVsV.cjs +222 -0
  35. package/dist/S3StateStore-DXHSBVsV.cjs.map +1 -0
  36. package/dist/S3StateStore-H2XsAzpJ.mjs +223 -0
  37. package/dist/S3StateStore-H2XsAzpJ.mjs.map +1 -0
  38. package/dist/SSMStateStore-BLPSNl-U.cjs +204 -0
  39. package/dist/SSMStateStore-BLPSNl-U.cjs.map +1 -0
  40. package/dist/SSMStateStore-CENciQEM.mjs +205 -0
  41. package/dist/SSMStateStore-CENciQEM.mjs.map +1 -0
  42. package/dist/SubscriberGenerator-CeH7wbYt.cjs +571 -0
  43. package/dist/SubscriberGenerator-CeH7wbYt.cjs.map +1 -0
  44. package/dist/SubscriberGenerator-DHnIYwUU.mjs +518 -0
  45. package/dist/SubscriberGenerator-DHnIYwUU.mjs.map +1 -0
  46. package/dist/add-Cdg1kEqN.cjs +719 -0
  47. package/dist/add-Cdg1kEqN.cjs.map +1 -0
  48. package/dist/add-snhdVmR-.mjs +717 -0
  49. package/dist/add-snhdVmR-.mjs.map +1 -0
  50. package/dist/appPorts-BoXMwolc.mjs +249 -0
  51. package/dist/appPorts-BoXMwolc.mjs.map +1 -0
  52. package/dist/appPorts-IW-OZmRi.cjs +296 -0
  53. package/dist/appPorts-IW-OZmRi.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-DXXg6FIL.mjs → backup-provisioner-C8DnCmxK.mjs} +11 -8
  63. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  64. package/dist/{backup-provisioner-cE2PuCTb.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-CaTGtiaO.cjs → bundler-B4GDxImV.cjs} +38 -35
  75. package/dist/bundler-B4GDxImV.cjs.map +1 -0
  76. package/dist/{bundler-S3ek7ea-.mjs → bundler-Wd9H4QLJ.mjs} +36 -32
  77. package/dist/bundler-Wd9H4QLJ.mjs.map +1 -0
  78. package/dist/cli-BZYz55tO.cjs +71 -0
  79. package/dist/cli-BZYz55tO.cjs.map +1 -0
  80. package/dist/cli-BzrDSNSg.mjs +71 -0
  81. package/dist/cli-BzrDSNSg.mjs.map +1 -0
  82. package/dist/compose-DN9zySvQ.cjs +3330 -0
  83. package/dist/compose-DN9zySvQ.cjs.map +1 -0
  84. package/dist/compose-Gsd1Nq7R.mjs +3187 -0
  85. package/dist/compose-Gsd1Nq7R.mjs.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-Cf5Pf8VE.mjs +237 -0
  97. package/dist/credentialSchemas-Cf5Pf8VE.mjs.map +1 -0
  98. package/dist/credentialSchemas-D_VUCDUh.cjs +272 -0
  99. package/dist/credentialSchemas-D_VUCDUh.cjs.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-CFvq8daZ.cjs +2390 -0
  163. package/dist/deploy-CFvq8daZ.cjs.map +1 -0
  164. package/dist/deploy-H2S8_mTx.mjs +2317 -0
  165. package/dist/deploy-H2S8_mTx.mjs.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-Bsr7HjqJ.cjs +616 -0
  171. package/dist/discover-Bsr7HjqJ.cjs.map +1 -0
  172. package/dist/discover-Ca8U75dl.mjs +537 -0
  173. package/dist/discover-Ca8U75dl.mjs.map +1 -0
  174. package/dist/discover-CvTtV5ZD.d.cts +108 -0
  175. package/dist/discover-CvTtV5ZD.d.cts.map +1 -0
  176. package/dist/discover-W2kab9Lc.d.mts +108 -0
  177. package/dist/discover-W2kab9Lc.d.mts.map +1 -0
  178. package/dist/dns-BdETzP10.cjs +1057 -0
  179. package/dist/dns-BdETzP10.cjs.map +1 -0
  180. package/dist/dns-pFMShDqW.mjs +926 -0
  181. package/dist/dns-pFMShDqW.mjs.map +1 -0
  182. package/dist/dokploy-HioAjP7K.cjs +38 -0
  183. package/dist/dokploy-HioAjP7K.cjs.map +1 -0
  184. package/dist/dokploy-oDJbnvCb.mjs +38 -0
  185. package/dist/dokploy-oDJbnvCb.mjs.map +1 -0
  186. package/dist/drivers-D11JHxrD.mjs +177 -0
  187. package/dist/drivers-D11JHxrD.mjs.map +1 -0
  188. package/dist/drivers-GKaA6ITM.cjs +200 -0
  189. package/dist/drivers-GKaA6ITM.cjs.map +1 -0
  190. package/dist/{emit-CIlvnDvV.mjs → emit-C1e8qD08.mjs} +13 -26
  191. package/dist/emit-C1e8qD08.mjs.map +1 -0
  192. package/dist/{emit-CUD1BWls.cjs → emit-Dmc1nvdS.cjs} +31 -57
  193. package/dist/emit-Dmc1nvdS.cjs.map +1 -0
  194. package/dist/encryption-D5pDJyp2.mjs +89 -0
  195. package/dist/encryption-D5pDJyp2.mjs.map +1 -0
  196. package/dist/encryption-DVCxD-gV.cjs +90 -0
  197. package/dist/encryption-DVCxD-gV.cjs.map +1 -0
  198. package/dist/engine-BaJGPzte.cjs +3196 -0
  199. package/dist/engine-BaJGPzte.cjs.map +1 -0
  200. package/dist/engine-CfAKgr2_.mjs +3083 -0
  201. package/dist/engine-CfAKgr2_.mjs.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-D902Vwr9.cjs +829 -0
  207. package/dist/github-D902Vwr9.cjs.map +1 -0
  208. package/dist/github-E-ZxqFPq.mjs +829 -0
  209. package/dist/github-E-ZxqFPq.mjs.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-Ayxg_DQY.d.mts → index-8OfpOtSI.d.cts} +39 -24
  215. package/dist/index-8OfpOtSI.d.cts.map +1 -0
  216. package/dist/{index-CR5urhWX.d.cts → index-Dpji6Bxq.d.mts} +39 -24
  217. package/dist/index-Dpji6Bxq.d.mts.map +1 -0
  218. package/dist/index.cjs +13764 -12651
  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 +13654 -12553
  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-BZ0GnSZQ.mjs +181 -0
  229. package/dist/migrate-BZ0GnSZQ.mjs.map +1 -0
  230. package/dist/migrate-CTqhWtev.cjs +271 -0
  231. package/dist/migrate-CTqhWtev.cjs.map +1 -0
  232. package/dist/migrate-DCXwHcWX.mjs +266 -0
  233. package/dist/migrate-DCXwHcWX.mjs.map +1 -0
  234. package/dist/migrate-Df81ew0k.cjs +181 -0
  235. package/dist/migrate-Df81ew0k.cjs.map +1 -0
  236. package/dist/openapi.cjs +214 -10
  237. package/dist/openapi.cjs.map +1 -0
  238. package/dist/openapi.d.cts +38 -17
  239. package/dist/openapi.d.cts.map +1 -1
  240. package/dist/openapi.d.mts +38 -17
  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-BMFjxBYA.cjs +404 -0
  253. package/dist/ready-BMFjxBYA.cjs.map +1 -0
  254. package/dist/ready-CIt5SOtg.mjs +375 -0
  255. package/dist/ready-CIt5SOtg.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-C13ERt1U.mjs → reconcile--I7V4Klj.mjs} +4 -7
  263. package/dist/reconcile--I7V4Klj.mjs.map +1 -0
  264. package/dist/{reconcile-CYMhFSYy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
  265. package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
  266. package/dist/resolve-BMpPd8x3.mjs +263 -0
  267. package/dist/resolve-BMpPd8x3.mjs.map +1 -0
  268. package/dist/resolve-D043YmW9.cjs +316 -0
  269. package/dist/resolve-D043YmW9.cjs.map +1 -0
  270. package/dist/rollback-CBiYsQ3T.cjs +165 -0
  271. package/dist/rollback-CBiYsQ3T.cjs.map +1 -0
  272. package/dist/rollback-CDs_XNb0.mjs +136 -0
  273. package/dist/rollback-CDs_XNb0.mjs.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/{workspace-C-a3G_U0.cjs → schemas-BCwKKA42.mjs} +958 -1868
  321. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  322. package/dist/{workspace-DaEX7FEg.mjs → schemas-BQ_v0lEX.cjs} +1048 -1678
  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-BjcO4DDa.mjs +8194 -0
  329. package/dist/seeds-BjcO4DDa.mjs.map +1 -0
  330. package/dist/seeds-DNqRA1aQ.cjs +9173 -0
  331. package/dist/seeds-DNqRA1aQ.cjs.map +1 -0
  332. package/dist/sniffer-DipSS8r8.cjs +1998 -0
  333. package/dist/sniffer-DipSS8r8.cjs.map +1 -0
  334. package/dist/sniffer-b0XPmSyT.mjs +1825 -0
  335. package/dist/sniffer-b0XPmSyT.mjs.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/stage-C_y2UovO.cjs +266 -0
  341. package/dist/stage-C_y2UovO.cjs.map +1 -0
  342. package/dist/stage-DrDmZusd.mjs +266 -0
  343. package/dist/stage-DrDmZusd.mjs.map +1 -0
  344. package/dist/stages-DJrOYLZ-.mjs +176 -0
  345. package/dist/stages-DJrOYLZ-.mjs.map +1 -0
  346. package/dist/stages-_3RVNG83.cjs +176 -0
  347. package/dist/stages-_3RVNG83.cjs.map +1 -0
  348. package/dist/target/public.cjs +15 -0
  349. package/dist/target/public.d.cts +28 -0
  350. package/dist/target/public.d.cts.map +1 -0
  351. package/dist/target/public.d.mts +28 -0
  352. package/dist/target/public.d.mts.map +1 -0
  353. package/dist/target/public.mjs +4 -0
  354. package/dist/terminal-CvRLxz6g.mjs +85 -0
  355. package/dist/terminal-CvRLxz6g.mjs.map +1 -0
  356. package/dist/terminal-D_NRPW4W.cjs +85 -0
  357. package/dist/terminal-D_NRPW4W.cjs.map +1 -0
  358. package/dist/types-B6UXlEkf.d.cts +7650 -0
  359. package/dist/types-B6UXlEkf.d.cts.map +1 -0
  360. package/dist/types-HqVPddRK.d.mts +7649 -0
  361. package/dist/types-HqVPddRK.d.mts.map +1 -0
  362. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  363. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  364. package/dist/utils-D_fxUqvU.mjs +156 -0
  365. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  366. package/dist/vitest.cjs +65 -0
  367. package/dist/vitest.cjs.map +1 -0
  368. package/dist/vitest.d.cts +29 -0
  369. package/dist/vitest.d.cts.map +1 -0
  370. package/dist/vitest.d.mts +29 -0
  371. package/dist/vitest.d.mts.map +1 -0
  372. package/dist/vitest.mjs +65 -0
  373. package/dist/vitest.mjs.map +1 -0
  374. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  375. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  376. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  377. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  378. package/dist/workspace/index.cjs +8 -4
  379. package/dist/workspace/index.d.cts +3 -3
  380. package/dist/workspace/index.d.mts +3 -3
  381. package/dist/workspace/index.mjs +2 -3
  382. package/dist/workspace-BwqQnool.cjs +2806 -0
  383. package/dist/workspace-BwqQnool.cjs.map +1 -0
  384. package/dist/workspace-D1QbNd55.mjs +2394 -0
  385. package/dist/workspace-D1QbNd55.mjs.map +1 -0
  386. package/package.json +54 -22
  387. package/dist/CachedStateProvider-BEBl2wQT.cjs +0 -60
  388. package/dist/CachedStateProvider-BEBl2wQT.cjs.map +0 -1
  389. package/dist/CachedStateProvider-C-8wtlto.mjs +0 -3
  390. package/dist/CachedStateProvider-Co4n5Wvs.mjs +0 -54
  391. package/dist/CachedStateProvider-Co4n5Wvs.mjs.map +0 -1
  392. package/dist/CachedStateProvider-DqhGpzsm.cjs +0 -3
  393. package/dist/HostingerProvider-BOvsgATO.cjs.map +0 -1
  394. package/dist/HostingerProvider-BcyFRbqV.mjs.map +0 -1
  395. package/dist/LocalStateProvider-Bq-0C0sg.mjs +0 -42
  396. package/dist/LocalStateProvider-Bq-0C0sg.mjs.map +0 -1
  397. package/dist/LocalStateProvider-yjXZXZDM.cjs +0 -43
  398. package/dist/LocalStateProvider-yjXZXZDM.cjs.map +0 -1
  399. package/dist/Route53Provider-C0xmer8U.mjs.map +0 -1
  400. package/dist/Route53Provider-CH9XH7bz.cjs.map +0 -1
  401. package/dist/SSMStateProvider-CXtNgPfy.cjs +0 -66
  402. package/dist/SSMStateProvider-CXtNgPfy.cjs.map +0 -1
  403. package/dist/SSMStateProvider-DOZifZfE.mjs +0 -66
  404. package/dist/SSMStateProvider-DOZifZfE.mjs.map +0 -1
  405. package/dist/backup-provisioner-DXXg6FIL.mjs.map +0 -1
  406. package/dist/backup-provisioner-cE2PuCTb.cjs.map +0 -1
  407. package/dist/bundler-CaTGtiaO.cjs.map +0 -1
  408. package/dist/bundler-S3ek7ea-.mjs.map +0 -1
  409. package/dist/chunk-Duj1WY3L.mjs +0 -7
  410. package/dist/config-B0L2tvvC.mjs +0 -402
  411. package/dist/config-B0L2tvvC.mjs.map +0 -1
  412. package/dist/config-HhDpJmLO.cjs +0 -462
  413. package/dist/config-HhDpJmLO.cjs.map +0 -1
  414. package/dist/config.d.cts.map +0 -1
  415. package/dist/config.d.mts.map +0 -1
  416. package/dist/credentials-B2Pyh3bJ.cjs +0 -2681
  417. package/dist/credentials-B2Pyh3bJ.cjs.map +0 -1
  418. package/dist/credentials-B5zRHdAl.mjs +0 -141
  419. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  420. package/dist/credentials-BapzjyV5.cjs +0 -195
  421. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  422. package/dist/credentials-CZrys9C5.mjs +0 -2549
  423. package/dist/credentials-CZrys9C5.mjs.map +0 -1
  424. package/dist/discover-CAlFgYec.mjs +0 -229
  425. package/dist/discover-CAlFgYec.mjs.map +0 -1
  426. package/dist/discover-DTmFeloL.cjs +0 -271
  427. package/dist/discover-DTmFeloL.cjs.map +0 -1
  428. package/dist/dokploy-api-5cK2InBm.cjs +0 -3
  429. package/dist/dokploy-api-D2Ny4Jrc.mjs +0 -3
  430. package/dist/dokploy-api-pdaBryoY.mjs +0 -706
  431. package/dist/dokploy-api-pdaBryoY.mjs.map +0 -1
  432. package/dist/dokploy-api-zqKe9lHH.cjs +0 -718
  433. package/dist/dokploy-api-zqKe9lHH.cjs.map +0 -1
  434. package/dist/emit-CIlvnDvV.mjs.map +0 -1
  435. package/dist/emit-CUD1BWls.cjs.map +0 -1
  436. package/dist/encryption-D2pL3tHH.cjs +0 -54
  437. package/dist/encryption-D2pL3tHH.cjs.map +0 -1
  438. package/dist/encryption-YDsXXi6w.mjs +0 -3
  439. package/dist/encryption-_4zwjOAR.mjs +0 -42
  440. package/dist/encryption-_4zwjOAR.mjs.map +0 -1
  441. package/dist/encryption-sQ2Oxx0d.cjs +0 -4
  442. package/dist/fullstack-secrets-D6MyHhQP.cjs +0 -111
  443. package/dist/fullstack-secrets-D6MyHhQP.cjs.map +0 -1
  444. package/dist/fullstack-secrets-METaRLS1.mjs +0 -87
  445. package/dist/fullstack-secrets-METaRLS1.mjs.map +0 -1
  446. package/dist/generator-CNzBw7g5.cjs +0 -289
  447. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  448. package/dist/generator-VE2JrFlY.mjs +0 -253
  449. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  450. package/dist/github-BrvaPkFf.cjs +0 -197
  451. package/dist/github-BrvaPkFf.cjs.map +0 -1
  452. package/dist/github-CrpsXSfV.mjs +0 -196
  453. package/dist/github-CrpsXSfV.mjs.map +0 -1
  454. package/dist/index-Ayxg_DQY.d.mts.map +0 -1
  455. package/dist/index-CR5urhWX.d.cts.map +0 -1
  456. package/dist/keystore-C9rint2E.cjs +0 -101
  457. package/dist/keystore-C9rint2E.cjs.map +0 -1
  458. package/dist/keystore-TxeYM7an.mjs +0 -83
  459. package/dist/keystore-TxeYM7an.mjs.map +0 -1
  460. package/dist/openapi-DaKlTKxz.cjs +0 -2075
  461. package/dist/openapi-DaKlTKxz.cjs.map +0 -1
  462. package/dist/openapi-react-query-BKH334Ug.cjs +0 -173
  463. package/dist/openapi-react-query-BKH334Ug.cjs.map +0 -1
  464. package/dist/openapi-react-query-DoR5CmzQ.mjs +0 -167
  465. package/dist/openapi-react-query-DoR5CmzQ.mjs.map +0 -1
  466. package/dist/openapi-react-query.cjs +0 -4
  467. package/dist/openapi-react-query.d.cts +0 -11
  468. package/dist/openapi-react-query.d.cts.map +0 -1
  469. package/dist/openapi-react-query.d.mts +0 -11
  470. package/dist/openapi-react-query.d.mts.map +0 -1
  471. package/dist/openapi-react-query.mjs +0 -4
  472. package/dist/openapi-y1d7Kalt.mjs +0 -2021
  473. package/dist/openapi-y1d7Kalt.mjs.map +0 -1
  474. package/dist/reconcile-C13ERt1U.mjs.map +0 -1
  475. package/dist/reconcile-CYMhFSYy.cjs.map +0 -1
  476. package/dist/setup-BWgMs4gg.mjs +0 -12
  477. package/dist/setup-DOv92pIu.cjs +0 -473
  478. package/dist/setup-DOv92pIu.cjs.map +0 -1
  479. package/dist/setup-DQo_h_yK.mjs +0 -443
  480. package/dist/setup-DQo_h_yK.mjs.map +0 -1
  481. package/dist/setup-lCx_DcUo.cjs +0 -12
  482. package/dist/storage-B020InPW.mjs +0 -222
  483. package/dist/storage-B020InPW.mjs.map +0 -1
  484. package/dist/storage-CSNplaJn.cjs +0 -282
  485. package/dist/storage-CSNplaJn.cjs.map +0 -1
  486. package/dist/storage-DGBzMLZa.mjs +0 -4
  487. package/dist/storage-DlVol_oj.cjs +0 -8
  488. package/dist/sync-0ILCb-1S.cjs +0 -93
  489. package/dist/sync-0ILCb-1S.cjs.map +0 -1
  490. package/dist/sync-CzHXiR9c.mjs +0 -76
  491. package/dist/sync-CzHXiR9c.mjs.map +0 -1
  492. package/dist/sync-DYENfOt4.cjs +0 -4
  493. package/dist/sync-HAau6h_R.mjs +0 -3
  494. package/dist/types-CL7jPFM2.d.mts +0 -2220
  495. package/dist/types-CL7jPFM2.d.mts.map +0 -1
  496. package/dist/types-Y3fKQSAK.d.cts +0 -2220
  497. package/dist/types-Y3fKQSAK.d.cts.map +0 -1
  498. package/dist/workspace-C-a3G_U0.cjs.map +0 -1
  499. package/dist/workspace-DQxxs7Jk.cjs +0 -10
  500. package/dist/workspace-DaEX7FEg.mjs.map +0 -1
  501. package/dist/workspace-DbI580qS.mjs +0 -9
@@ -0,0 +1,571 @@
1
+ const require_errors = require("./errors-DMC4Umsb.cjs");
2
+ const require_EndpointGenerator = require("./EndpointGenerator-BwbYTMtB.cjs");
3
+ const require_discover = require("./discover-Bsr7HjqJ.cjs");
4
+ let node_path = require("node:path");
5
+ let node_fs_promises = require("node:fs/promises");
6
+ let _geekmidas_manifest = require("@geekmidas/manifest");
7
+ let node_url = require("node:url");
8
+ let _geekmidas_constructs_subscribers = require("@geekmidas/constructs/subscribers");
9
+ //#region src/types.ts
10
+ /** Whether `value` names a cache backend. */
11
+ function isCacheBackend(value) {
12
+ return value === "upstash" || value === "elasticache" || value === "db" || value === "redis";
13
+ }
14
+ /**
15
+ * Whether a backend holds every declared cache, a cache declared from a
16
+ * database (`database.cache('Sessions')`) included.
17
+ *
18
+ * Every other backend leaves such a cache where its declaration put it: the
19
+ * declaration is the stronger statement. The stack's own Redis is the
20
+ * exception, because a stack that runs one runs it *for* the cache — a table
21
+ * beside it would be a second cache nobody asked for.
22
+ */
23
+ function holdsEveryCache(backend) {
24
+ return backend === "redis";
25
+ }
26
+ /**
27
+ * The backend a project gets when it says nothing, by where it deploys.
28
+ *
29
+ * Flat defaults could not be right for both: `upstash` on a single box means a
30
+ * SaaS round-trip for a cache the database could have held, and `minio` on AWS
31
+ * means running a bucket beside S3. So the default is a function of the target,
32
+ * and an app that says nothing gets the obvious answer in both places — which
33
+ * is the whole of what "zero config" can mean once there is more than one
34
+ * target.
35
+ *
36
+ * `server` covers Dokploy and a bare host alike: the question these answer is
37
+ * whether the app is next to a managed cloud or next to its own containers, and
38
+ * on that question the two are the same.
39
+ *
40
+ * A per-construct, per-stage override is the layer above this — see
41
+ * `constructs-outstanding.md` — so two buckets in one app can differ. This is
42
+ * only what happens when nobody has said anything at all.
43
+ */
44
+ const DEFAULT_CACHE = {
45
+ aws: "upstash",
46
+ server: "db"
47
+ };
48
+ /**
49
+ * Which broker carries a declared queue or topic, by target.
50
+ *
51
+ * Whether there are events at all is the manifest's answer — a declared
52
+ * `Topic` or `Queue` — so this only ever answers the second question. AWS
53
+ * deploys them to SNS and SQS, and locally the AWS emulator stands in, so the
54
+ * broker a developer runs is the one production has. A server has a Postgres
55
+ * already, and pg-boss keeps its queues there.
56
+ */
57
+ const DEFAULT_EVENTS = {
58
+ aws: "sns",
59
+ server: "pgboss"
60
+ };
61
+ /** Where a bucket lives when nobody said — see {@link DEFAULT_CACHE}. */
62
+ const DEFAULT_STORAGE = {
63
+ aws: "s3",
64
+ server: "minio"
65
+ };
66
+ //#endregion
67
+ //#region src/reconcile/fakes.ts
68
+ /**
69
+ * Fakes, read from where the convention puts them.
70
+ *
71
+ * `test/fakes/<id>.ts` default-exports `fake.app(…)` or `fake.image(…)` for an
72
+ * external API, and `fake.credential(…)` for a credential. The construct never
73
+ * names it — that is what keeps a fake out of a deployed bundle — so this is
74
+ * the one place it is found, by the same rule that finds a database's factory
75
+ * in `test/factories/<id>.ts`.
76
+ */
77
+ /** Where a project keeps its external APIs' fakes, relative to its root. */
78
+ const DEFAULT_FAKES_DIR = "test/fakes";
79
+ /** The marker `fake.app` and `fake.image` set — the same registered symbol. */
80
+ const FAKE = Symbol.for("@geekmidas/constructs/fake");
81
+ /**
82
+ * The fake for every external API the manifest declares, keyed by id.
83
+ *
84
+ * @throws {NoFake} when an external API has no file, since a local stage would
85
+ * otherwise have nothing to call.
86
+ * @throws {NotAFake} when the file's default export is not one.
87
+ */
88
+ async function readFakes(root, manifest) {
89
+ const fakes = {};
90
+ for (const [id, declaration] of Object.entries(manifest)) {
91
+ if (declaration?.kind !== "external-api") continue;
92
+ const file = await fakeFile((0, node_path.join)(root, DEFAULT_FAKES_DIR), id);
93
+ if (!file) throw new NoFake(id, `${fakeBase(root, id)}.ts`);
94
+ const value = await importFake(file);
95
+ if (value.kind === "credential") throw new NotAFake(file);
96
+ fakes[id] = {
97
+ file,
98
+ ...value.kind === "image" ? {
99
+ image: value.image,
100
+ port: value.port
101
+ } : {},
102
+ credentials: JSON.stringify(value.credentials)
103
+ };
104
+ }
105
+ return fakes;
106
+ }
107
+ /**
108
+ * Each credential's fake value, as the JSON `<ID>_CREDENTIALS` holds, keyed by
109
+ * id — for the credentials that have a fake. Unlike an external API's, a
110
+ * credential's fake is optional here: a stage that stores the real value
111
+ * needs none. The test stage's own check (`assertTestCredentials`) is what
112
+ * refuses one with neither.
113
+ *
114
+ * @throws {NotAFake} when the file's default export is not a credential's fake.
115
+ */
116
+ async function readCredentialFakes(root, manifest) {
117
+ const values = {};
118
+ for (const [id, declaration] of Object.entries(manifest)) {
119
+ if (declaration?.kind !== "credential") continue;
120
+ const file = await fakeFile((0, node_path.join)(root, DEFAULT_FAKES_DIR), id);
121
+ if (!file) continue;
122
+ const value = await importFake(file);
123
+ if (value.kind !== "credential") throw new NotAFake(file);
124
+ values[id] = JSON.stringify(value.credentials);
125
+ }
126
+ return values;
127
+ }
128
+ /**
129
+ * A credential the test stage has no value for: no fake, and nothing stored.
130
+ * Raised when the stage is set up, before a test reaches it — not as a schema
131
+ * error inside the handler that first asked.
132
+ */
133
+ var CredentialHasNoTestValue = class extends require_errors.GkmError {
134
+ id;
135
+ key;
136
+ file;
137
+ constructor(id, key, file) {
138
+ super(`'${id}' is a credential, and the test stage has no value for ${key}: no fake, and none stored — a stage set up fresh, as CI's auto-setup does, holds no third party's credentials. Give it a fake: create ${file}, default-exporting fake.credential(…) from @geekmidas/constructs/credential. It is read only by gkm test and gkm dev --fake; a deployed stage still needs the real value (gkm secrets:add --stage <stage>).`);
139
+ this.id = id;
140
+ this.key = key;
141
+ this.file = file;
142
+ this.name = "CredentialHasNoTestValue";
143
+ }
144
+ };
145
+ /**
146
+ * Every credential the test stage must hand its suite, with the value it
147
+ * resolved — a fake's, or one the stage stores.
148
+ *
149
+ * @throws {CredentialHasNoTestValue} for the first one with neither.
150
+ */
151
+ function assertTestCredentials(root, plan, env) {
152
+ const values = {};
153
+ for (const { id, kind, envKey } of plan.resources) {
154
+ if (kind !== "credential") continue;
155
+ const value = env[envKey];
156
+ if (value === void 0) throw new CredentialHasNoTestValue(id, envKey, `${fakeBase(root, id)}.ts`);
157
+ values[envKey] = value;
158
+ }
159
+ return values;
160
+ }
161
+ /** `<root>/test/fakes/<id>`, without an extension. */
162
+ function fakeBase(root, id) {
163
+ return (0, node_path.join)(root, DEFAULT_FAKES_DIR, (0, _geekmidas_manifest.kebabCase)(id));
164
+ }
165
+ /** The first of `<id>.ts`, `.mts`, `.js`, `.mjs` that exists. */
166
+ async function fakeFile(folder, id) {
167
+ const base = (0, node_path.join)(folder, (0, _geekmidas_manifest.kebabCase)(id));
168
+ for (const extension of [
169
+ ".ts",
170
+ ".mts",
171
+ ".js",
172
+ ".mjs"
173
+ ]) {
174
+ const file = `${base}${extension}`;
175
+ if (await (0, node_fs_promises.access)(file).then(() => true, () => false)) return file;
176
+ }
177
+ }
178
+ /**
179
+ * A fake file's default export.
180
+ *
181
+ * @throws {NotAFake} when it is not a fake.
182
+ */
183
+ async function importFake(file) {
184
+ const value = (await import((0, node_url.pathToFileURL)(file).href)).default;
185
+ if (!isFakeExport(value)) throw new NotAFake(file);
186
+ return value;
187
+ }
188
+ function isFakeExport(value) {
189
+ return typeof value === "object" && value !== null && value[FAKE] === true;
190
+ }
191
+ /** An external API with no fake for a local stage to call. */
192
+ var NoFake = class extends require_errors.GkmError {
193
+ id;
194
+ file;
195
+ constructor(id, file) {
196
+ super(`'${id}' is an external API, and a local stage calls its fake rather than the provider — but there is none. Create ${file}, default-exporting fake.app(…) or fake.image(…) from @geekmidas/constructs/external-api.`);
197
+ this.id = id;
198
+ this.file = file;
199
+ this.name = "NoFake";
200
+ }
201
+ };
202
+ /** A file in the fakes folder whose default export is not a fake. */
203
+ var NotAFake = class extends require_errors.GkmError {
204
+ file;
205
+ constructor(file) {
206
+ super(`${file} is where a fake lives, and its default export is not one for its construct. For an external API, export default fake.app(handler, { credentials }) or fake.image(image, { port, credentials }); for a credential, fake.credential(value).`);
207
+ this.file = file;
208
+ this.name = "NotAFake";
209
+ }
210
+ };
211
+ //#endregion
212
+ //#region src/generators/SubscriberGenerator.ts
213
+ var SubscriberGenerator = class extends require_discover.ConstructGenerator {
214
+ isConstruct(value) {
215
+ return _geekmidas_constructs_subscribers.Subscriber.isSubscriber(value);
216
+ }
217
+ async build(context, constructs, outputDir, options) {
218
+ const target = options?.target ?? "aws";
219
+ const logger = console;
220
+ const subscriberInfos = [];
221
+ if (target === "server") {
222
+ await this.generateServerSubscribersFile(outputDir, constructs, context.eventsBackends?.includes("sns") ?? false);
223
+ logger.log(`Generated server subscribers file with ${constructs.length} subscribers (polling mode)`);
224
+ return subscriberInfos;
225
+ }
226
+ if (constructs.length === 0) return subscriberInfos;
227
+ const subscribersDir = (0, node_path.join)(outputDir, "subscribers");
228
+ await (0, node_fs_promises.mkdir)(subscribersDir, { recursive: true });
229
+ for (const { key, construct, path } of constructs) {
230
+ const handlerFile = await this.generateSubscriberHandler(subscribersDir, path.relative, key, construct, context, construct.owner);
231
+ subscriberInfos.push({
232
+ name: key,
233
+ handler: (0, node_path.relative)(options?.root ?? process.cwd(), handlerFile).replace(/\.ts$/, ".handler"),
234
+ subscribedEvents: construct.subscribedEvents || [],
235
+ ...construct.topicName ? {
236
+ transport: "topic",
237
+ topic: construct.topicName
238
+ } : {},
239
+ timeout: construct.timeout,
240
+ memorySize: construct.memorySize,
241
+ environment: await construct.getEnvironment({ markOptional: context.markOptional }),
242
+ dependencies: construct.constructs
243
+ });
244
+ logger.log(`Generated subscriber handler: ${key}`);
245
+ }
246
+ return subscriberInfos;
247
+ }
248
+ async generateSubscriberHandler(outputDir, sourceFile, exportName, _subscriber, context, owner) {
249
+ const handlerFileName = `${exportName}.ts`;
250
+ const handlerPath = (0, node_path.join)(outputDir, handlerFileName);
251
+ const importPath = (0, node_path.relative)((0, node_path.dirname)(handlerPath), sourceFile).replace(/\.ts$/, ".js");
252
+ const runtime = require_EndpointGenerator.runtimeFor(context, (0, node_path.dirname)(handlerPath), owner);
253
+ const content = `import { AWSLambdaSubscriber } from '@geekmidas/constructs/aws';
254
+ import { ${exportName} } from '${importPath}';
255
+ ${runtime.imports}
256
+ ${context.storageDrivers?.imports ?? ""}
257
+ ${runtime.bindings}
258
+ ${context.storageDrivers?.setup ? `\n// The handler registers the drivers its target needs.\n${context.storageDrivers.setup}\n` : ""}
259
+ const adapter = new AWSLambdaSubscriber(envParser, ${exportName});
260
+
261
+ export const handler = adapter.handler;
262
+ `;
263
+ await (0, node_fs_promises.writeFile)(handlerPath, content);
264
+ return handlerPath;
265
+ }
266
+ async generateServerSubscribersFile(outputDir, subscribers, push) {
267
+ await (0, node_fs_promises.mkdir)(outputDir, { recursive: true });
268
+ const subscribersPath = (0, node_path.join)(outputDir, "subscribers.ts");
269
+ if (subscribers.length === 0) {
270
+ await (0, node_fs_promises.writeFile)(subscribersPath, `/**
271
+ * Generated subscribers setup — this app declares none.
272
+ */
273
+ import type { EnvironmentParser } from '@geekmidas/envkit';
274
+ import type { Logger } from '@geekmidas/logger';
275
+
276
+ export async function setupSubscribers(
277
+ _app: unknown,
278
+ _envParser: EnvironmentParser<any>,
279
+ _logger: Logger,
280
+ ): Promise<(port: number) => Promise<void>> {
281
+ return async () => {};
282
+ }
283
+
284
+ export function subscribersStatus(): { failed: string[]; connections: unknown[] } {
285
+ return { failed: [], connections: [] };
286
+ }
287
+
288
+ export async function stopSubscribers(): Promise<void> {}
289
+ `);
290
+ return subscribersPath;
291
+ }
292
+ const importsByFile = /* @__PURE__ */ new Map();
293
+ for (const { path, key } of subscribers) {
294
+ const importPath = (0, node_path.relative)((0, node_path.dirname)(subscribersPath), path.relative).replace(/\.ts$/, ".js");
295
+ importsByFile.set(importPath, [...importsByFile.get(importPath) ?? [], key]);
296
+ }
297
+ const content = `/**
298
+ * Generated subscribers setup.
299
+ *
300
+ * Each subscriber is run against the topic it is bound to, through that
301
+ * topic's own connection string:
302
+ *
303
+ * - **sns://** — pushed, not polled. The subscriber gets an HTTP route on this
304
+ * server, and the route is subscribed to the topic with a filter policy of
305
+ * the events it named, so SNS fans out to each subscriber. The route runs the
306
+ * subscriber through the same adaptor a Lambda subscription does.
307
+ * - **anything else** (pgboss://, rabbitmq://, sqs://) — polled. On pg-boss
308
+ * each subscriber drains a queue of its own, \`<topic>/<subscriber>\`, so
309
+ * every subscriber sees every event; replicas of one subscriber share it.
310
+ *
311
+ * GKM_SUBSCRIBERS=off (\`gkm dev --no-subscribers\`) runs none of them.
312
+ * GKM_SUBSCRIBER_PUSH_URL is the address SNS pushes to; against the local
313
+ * emulator it defaults to this server through host.docker.internal.
314
+ */
315
+ import { connect } from 'node:net';
316
+ import type { EnvironmentParser } from '@geekmidas/envkit';
317
+ import type { Logger } from '@geekmidas/logger';
318
+ import { EventConnectionFactory, Subscriber } from '@geekmidas/events';
319
+ import type { EventConnection } from '@geekmidas/events';
320
+ import { ServiceDiscovery } from '@geekmidas/services';
321
+ ${Array.from(importsByFile.entries()).map(([importPath, exports]) => `import { ${exports.join(", ")} } from '${importPath}';`).join("\n")}
322
+
323
+ const subscribers = [
324
+ ${subscribers.map(({ key, construct }) => {
325
+ const connectionKey = construct.topicName ? (0, _geekmidas_manifest.provideKey)((0, _geekmidas_manifest.canonicalId)(construct.topicName), "publisherConnectionString") : void 0;
326
+ return ` { id: '${key}', subscriber: ${key}, topic: ${construct.topicName ? `'${construct.topicName}'` : "undefined"}, connectionKey: ${connectionKey ? `'${connectionKey}'` : "undefined"} },`;
327
+ }).join("\n")}
328
+ ];
329
+
330
+ // What was opened, and what could not be: a worker's health check reads both,
331
+ // and its shutdown closes what was opened.
332
+ const connections = new Map<string, EventConnection>();
333
+ const failed: string[] = [];
334
+
335
+ /** The route a subscriber's pushes arrive on. */
336
+ export const SUBSCRIBER_ROUTE = (id: string) => \`/__gkm/subscribers/\${id}\`;
337
+
338
+ /** Resolves once something is accepting connections on the port. */
339
+ async function listening(port: number): Promise<void> {
340
+ for (let attempt = 0; attempt < 100; attempt++) {
341
+ const open = await new Promise<boolean>((resolve) => {
342
+ const socket = connect(port, '127.0.0.1');
343
+ socket.once('connect', () => { socket.end(); resolve(true); });
344
+ socket.once('error', () => resolve(false));
345
+ });
346
+ if (open) return;
347
+ await new Promise((resolve) => setTimeout(resolve, 50));
348
+ }
349
+ }
350
+
351
+ /**
352
+ * Mount each pushed subscriber's route and start each polled one. Returns what
353
+ * to run once the server is listening: subscribing a route makes SNS send its
354
+ * confirmation at once, so the route has to be reachable first.
355
+ */
356
+ export async function setupSubscribers(
357
+ app: { post: (path: string, handler: (c: any) => unknown) => unknown },
358
+ envParser: EnvironmentParser<any>,
359
+ logger: Logger,
360
+ ): Promise<(port: number) => Promise<void>> {
361
+ if (process.env.GKM_SUBSCRIBERS === 'off') {
362
+ logger.info('Subscribers are off (--no-subscribers)');
363
+ return async () => {};
364
+ }
365
+
366
+ const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
367
+ const afterListening: ((port: number) => Promise<void>)[] = [];
368
+
369
+ for (const { id, subscriber, topic, connectionKey } of subscribers) {
370
+ const events = subscriber.subscribedEvents || [];
371
+ if (events.length === 0) {
372
+ logger.warn({ subscriber: id }, 'Subscriber has no subscribed events, skipping');
373
+ continue;
374
+ }
375
+ const connectionString = connectionKey ? process.env[connectionKey] : undefined;
376
+ if (!connectionString) {
377
+ logger.error(
378
+ { subscriber: id, connectionKey },
379
+ 'No connection string for the topic this subscriber is bound to',
380
+ );
381
+ failed.push(id);
382
+ continue;
383
+ }
384
+
385
+ try {
386
+ ${push ? ` if (connectionString.startsWith('sns:')) {
387
+ const { SNSConnection, snsUrl, subscribeHttpEndpoint } = await import('@geekmidas/events/sns');
388
+ const { SnsPushSubscriberAdaptor } = await import('@geekmidas/constructs/subscribers');
389
+ const address = snsUrl.parse(connectionString);
390
+ const route = SUBSCRIBER_ROUTE(id);
391
+ const adaptor = new SnsPushSubscriberAdaptor(envParser, subscriber, {
392
+ topicArn: address.topicArn,
393
+ // An emulator signs nothing. Decided by the address this server was
394
+ // configured with, never by anything a request says about itself.
395
+ verify: !address.endpoint,
396
+ ...(address.endpoint ? { emulatorEndpoint: address.endpoint } : {}),
397
+ });
398
+
399
+ app.post(route, async (c: any) => {
400
+ const body = JSON.parse(await c.req.text());
401
+ const response = await adaptor.handle(body);
402
+ return c.json(response.body, response.status);
403
+ });
404
+
405
+ afterListening.push(async (port) => {
406
+ const base =
407
+ process.env.GKM_SUBSCRIBER_PUSH_URL ??
408
+ (address.endpoint ? \`http://host.docker.internal:\${port}\` : undefined);
409
+ if (!base) {
410
+ logger.error(
411
+ { subscriber: id },
412
+ 'Set GKM_SUBSCRIBER_PUSH_URL to the public URL of this worker, which SNS pushes to',
413
+ );
414
+ return;
415
+ }
416
+ const connection = await SNSConnection.fromConnectionString(connectionString);
417
+ await subscribeHttpEndpoint(connection, {
418
+ endpoint: new URL(route, base).toString(),
419
+ events,
420
+ });
421
+ logger.info({ subscriber: id, events }, 'Subscriber subscribed for push');
422
+ });
423
+ continue;
424
+ }
425
+ ` : ` if (connectionString.startsWith('sns:')) {
426
+ // Built for a broker other than SNS, so this entry registered no SNS
427
+ // driver and has no push route to offer.
428
+ logger.error(
429
+ { subscriber: id, connectionKey },
430
+ 'This build has no SNS driver: it was built for a target whose broker is not SNS',
431
+ );
432
+ failed.push(id);
433
+ continue;
434
+ }
435
+ `}
436
+
437
+ let connection = connections.get(connectionString);
438
+ if (!connection) {
439
+ connection = await EventConnectionFactory.fromConnectionString(connectionString);
440
+ connections.set(connectionString, connection);
441
+ }
442
+ // Named, so a broker with one address for everything (pg-boss) gives
443
+ // this subscriber a queue of its own: fan-out, not competition.
444
+ const eventSubscriber = await Subscriber.fromConnection(connection, {
445
+ topic,
446
+ subscription: id,
447
+ });
448
+ const services = subscriber.services.length > 0
449
+ ? await serviceDiscovery.register(subscriber.services)
450
+ : {};
451
+ // The subscriber's database — the worker's, or its own — as \`db\`. A
452
+ // pushed subscriber gets it from the adaptor above instead.
453
+ const db = subscriber.databaseService
454
+ ? (await serviceDiscovery.register([subscriber.databaseService]))[
455
+ subscriber.databaseService.serviceName
456
+ ]
457
+ : undefined;
458
+
459
+ await eventSubscriber.subscribe(events, async (event) => {
460
+ try {
461
+ await subscriber.handler({
462
+ events: [event],
463
+ services: services as any,
464
+ logger: subscriber.logger,
465
+ db,
466
+ } as any);
467
+ } catch (error) {
468
+ logger.error({ err: error, event, subscriber: id }, 'Failed to process event');
469
+ // Rethrown so the transport keeps the event for a retry — as a queue
470
+ // consumer's failure does, and as a pushed subscriber's 500 does.
471
+ throw error;
472
+ }
473
+ });
474
+ logger.info({ subscriber: id, events }, 'Subscriber started polling');
475
+ } catch (error) {
476
+ // The message too: a missing module's code alone does not say which.
477
+ logger.error(
478
+ { err: error, subscriber: id },
479
+ 'Failed to set up subscriber',
480
+ );
481
+ failed.push(id);
482
+ }
483
+ }
484
+
485
+ return async (port) => {
486
+ if (afterListening.length === 0) return;
487
+ await listening(port);
488
+ for (const subscribe of afterListening) {
489
+ await subscribe(port).catch((error) => {
490
+ logger.error({ err: error }, 'Failed to subscribe for push');
491
+ });
492
+ }
493
+ };
494
+ }
495
+
496
+ /** The subscribers that could not start, and the connections that did. */
497
+ export function subscribersStatus(): { failed: string[]; connections: EventConnection[] } {
498
+ return { failed: [...failed], connections: [...connections.values()] };
499
+ }
500
+
501
+ /**
502
+ * Stop polling, let the events in flight finish, and close each broker
503
+ * connection — pg-boss's graceful stop does all three. The caller bounds it.
504
+ */
505
+ export async function stopSubscribers(): Promise<void> {
506
+ const open = [...connections.values()];
507
+ connections.clear();
508
+ await Promise.all(open.map((connection) => connection.close()));
509
+ }
510
+ `;
511
+ await (0, node_fs_promises.writeFile)(subscribersPath, content);
512
+ return subscribersPath;
513
+ }
514
+ };
515
+ //#endregion
516
+ Object.defineProperty(exports, "DEFAULT_CACHE", {
517
+ enumerable: true,
518
+ get: function() {
519
+ return DEFAULT_CACHE;
520
+ }
521
+ });
522
+ Object.defineProperty(exports, "DEFAULT_EVENTS", {
523
+ enumerable: true,
524
+ get: function() {
525
+ return DEFAULT_EVENTS;
526
+ }
527
+ });
528
+ Object.defineProperty(exports, "DEFAULT_STORAGE", {
529
+ enumerable: true,
530
+ get: function() {
531
+ return DEFAULT_STORAGE;
532
+ }
533
+ });
534
+ Object.defineProperty(exports, "SubscriberGenerator", {
535
+ enumerable: true,
536
+ get: function() {
537
+ return SubscriberGenerator;
538
+ }
539
+ });
540
+ Object.defineProperty(exports, "assertTestCredentials", {
541
+ enumerable: true,
542
+ get: function() {
543
+ return assertTestCredentials;
544
+ }
545
+ });
546
+ Object.defineProperty(exports, "holdsEveryCache", {
547
+ enumerable: true,
548
+ get: function() {
549
+ return holdsEveryCache;
550
+ }
551
+ });
552
+ Object.defineProperty(exports, "isCacheBackend", {
553
+ enumerable: true,
554
+ get: function() {
555
+ return isCacheBackend;
556
+ }
557
+ });
558
+ Object.defineProperty(exports, "readCredentialFakes", {
559
+ enumerable: true,
560
+ get: function() {
561
+ return readCredentialFakes;
562
+ }
563
+ });
564
+ Object.defineProperty(exports, "readFakes", {
565
+ enumerable: true,
566
+ get: function() {
567
+ return readFakes;
568
+ }
569
+ });
570
+
571
+ //# sourceMappingURL=SubscriberGenerator-CeH7wbYt.cjs.map