@geekmidas/cli 10.0.0-alpha.12 → 10.0.0-alpha.120
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.
- package/README.md +310 -377
- package/bin/adjacent-tsconfig.mjs +46 -8
- package/bin/gkm.mjs +11 -3
- package/bin/owning-tsconfig-jsx-register.mjs +18 -0
- package/bin/owning-tsconfig-jsx.mjs +108 -0
- package/dist/EndpointGenerator-BDa6pPgE.cjs +1090 -0
- package/dist/EndpointGenerator-BDa6pPgE.cjs.map +1 -0
- package/dist/EndpointGenerator-CP_z_E3e.mjs +1031 -0
- package/dist/EndpointGenerator-CP_z_E3e.mjs.map +1 -0
- package/dist/GoDaddyProvider-3C8U_tVu.cjs +388 -0
- package/dist/GoDaddyProvider-3C8U_tVu.cjs.map +1 -0
- package/dist/GoDaddyProvider-D0MQoOM4.mjs +388 -0
- package/dist/GoDaddyProvider-D0MQoOM4.mjs.map +1 -0
- package/dist/{HostingerProvider-BcyFRbqV.mjs → HostingerProvider-BNpS9aRJ.mjs} +29 -25
- package/dist/HostingerProvider-BNpS9aRJ.mjs.map +1 -0
- package/dist/{HostingerProvider-BOvsgATO.cjs → HostingerProvider-DR1iws1P.cjs} +29 -25
- package/dist/HostingerProvider-DR1iws1P.cjs.map +1 -0
- package/dist/LegacyStateStore-CRi7TosX.mjs +124 -0
- package/dist/LegacyStateStore-CRi7TosX.mjs.map +1 -0
- package/dist/LegacyStateStore-DHsoQGOo.cjs +124 -0
- package/dist/LegacyStateStore-DHsoQGOo.cjs.map +1 -0
- package/dist/LocalStateStore-BQXTkeoS.cjs +178 -0
- package/dist/LocalStateStore-BQXTkeoS.cjs.map +1 -0
- package/dist/LocalStateStore-Dkth0jXX.mjs +167 -0
- package/dist/LocalStateStore-Dkth0jXX.mjs.map +1 -0
- package/dist/OpenApiTsGenerator-CsrukCE-.mjs +536 -0
- package/dist/OpenApiTsGenerator-CsrukCE-.mjs.map +1 -0
- package/dist/OpenApiTsGenerator-FNhY7Ssz.cjs +541 -0
- package/dist/OpenApiTsGenerator-FNhY7Ssz.cjs.map +1 -0
- package/dist/{Route53Provider-CH9XH7bz.cjs → Route53Provider-Bllus2NR.cjs} +21 -22
- package/dist/Route53Provider-Bllus2NR.cjs.map +1 -0
- package/dist/{Route53Provider-C0xmer8U.mjs → Route53Provider-QXxjkZO1.mjs} +13 -13
- package/dist/Route53Provider-QXxjkZO1.mjs.map +1 -0
- package/dist/S3StateStore-DGKZgyKz.cjs +222 -0
- package/dist/S3StateStore-DGKZgyKz.cjs.map +1 -0
- package/dist/S3StateStore-pZZnLLBd.mjs +223 -0
- package/dist/S3StateStore-pZZnLLBd.mjs.map +1 -0
- package/dist/SSMStateStore-CZRMERDA.mjs +205 -0
- package/dist/SSMStateStore-CZRMERDA.mjs.map +1 -0
- package/dist/SSMStateStore-DzkyjQ5D.cjs +204 -0
- package/dist/SSMStateStore-DzkyjQ5D.cjs.map +1 -0
- package/dist/SubscriberGenerator-C8CPxrCK.cjs +592 -0
- package/dist/SubscriberGenerator-C8CPxrCK.cjs.map +1 -0
- package/dist/SubscriberGenerator-y3pncae_.mjs +533 -0
- package/dist/SubscriberGenerator-y3pncae_.mjs.map +1 -0
- package/dist/add-C0kXOsWS.mjs +717 -0
- package/dist/add-C0kXOsWS.mjs.map +1 -0
- package/dist/add-Df8cmz0H.cjs +719 -0
- package/dist/add-Df8cmz0H.cjs.map +1 -0
- package/dist/appPorts-BoXMwolc.mjs +249 -0
- package/dist/appPorts-BoXMwolc.mjs.map +1 -0
- package/dist/appPorts-IW-OZmRi.cjs +296 -0
- package/dist/appPorts-IW-OZmRi.cjs.map +1 -0
- package/dist/aws-8QQ8n-t6.mjs +89 -0
- package/dist/aws-8QQ8n-t6.mjs.map +1 -0
- package/dist/aws-DY9NqQIT.cjs +100 -0
- package/dist/aws-DY9NqQIT.cjs.map +1 -0
- package/dist/awsStore-Bx5nCFnS.mjs +121 -0
- package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
- package/dist/awsStore-u3ehhMoY.cjs +138 -0
- package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
- package/dist/{backup-provisioner-DXXg6FIL.mjs → backup-provisioner-C8DnCmxK.mjs} +11 -8
- package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
- package/dist/{backup-provisioner-cE2PuCTb.cjs → backup-provisioner-oDEsPj02.cjs} +22 -20
- package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
- package/dist/backups/runner.cjs +519 -0
- package/dist/backups/runner.cjs.map +1 -0
- package/dist/backups/runner.d.cts +102 -0
- package/dist/backups/runner.d.cts.map +1 -0
- package/dist/backups/runner.d.mts +102 -0
- package/dist/backups/runner.d.mts.map +1 -0
- package/dist/backups/runner.mjs +506 -0
- package/dist/backups/runner.mjs.map +1 -0
- package/dist/{bundler-Bux2iF-v.mjs → bundler-B-I4Du99.mjs} +35 -16
- package/dist/bundler-B-I4Du99.mjs.map +1 -0
- package/dist/{bundler-BMekgx7a.cjs → bundler-Dx_grUmc.cjs} +37 -19
- package/dist/bundler-Dx_grUmc.cjs.map +1 -0
- package/dist/cli-Cd9exatJ.cjs +71 -0
- package/dist/cli-Cd9exatJ.cjs.map +1 -0
- package/dist/cli-DL7GxGAe.mjs +71 -0
- package/dist/cli-DL7GxGAe.mjs.map +1 -0
- package/dist/compose-C43c03WZ.mjs +3284 -0
- package/dist/compose-C43c03WZ.mjs.map +1 -0
- package/dist/compose-Mdgea4Yt.cjs +3427 -0
- package/dist/compose-Mdgea4Yt.cjs.map +1 -0
- package/dist/config-D48erO2j.d.mts +269 -0
- package/dist/config-D48erO2j.d.mts.map +1 -0
- package/dist/config-DHDtsQrB.d.cts +269 -0
- package/dist/config-DHDtsQrB.d.cts.map +1 -0
- package/dist/config.cjs +421 -11
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +4 -120
- package/dist/config.d.mts +4 -120
- package/dist/config.mjs +405 -4
- package/dist/config.mjs.map +1 -0
- package/dist/credentialSchemas-B67WJOOm.cjs +272 -0
- package/dist/credentialSchemas-B67WJOOm.cjs.map +1 -0
- package/dist/credentialSchemas-DDOLRCLF.mjs +237 -0
- package/dist/credentialSchemas-DDOLRCLF.mjs.map +1 -0
- package/dist/credentials-B5N5yKk6.mjs +267 -0
- package/dist/credentials-B5N5yKk6.mjs.map +1 -0
- package/dist/credentials-Zqr3QQYB.cjs +350 -0
- package/dist/credentials-Zqr3QQYB.cjs.map +1 -0
- package/dist/databases-BPOgTn1u.mjs +522 -0
- package/dist/databases-BPOgTn1u.mjs.map +1 -0
- package/dist/databases-fOaoBInm.cjs +625 -0
- package/dist/databases-fOaoBInm.cjs.map +1 -0
- package/dist/define-6poNqm5O.mjs +106 -0
- package/dist/define-6poNqm5O.mjs.map +1 -0
- package/dist/define-crmMcXFS.cjs +153 -0
- package/dist/define-crmMcXFS.cjs.map +1 -0
- package/dist/deploy/public.cjs +212 -0
- package/dist/deploy/public.cjs.map +1 -0
- package/dist/deploy/public.d.cts +654 -0
- package/dist/deploy/public.d.cts.map +1 -0
- package/dist/deploy/public.d.mts +654 -0
- package/dist/deploy/public.d.mts.map +1 -0
- package/dist/deploy/public.mjs +145 -0
- package/dist/deploy/public.mjs.map +1 -0
- package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
- package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
- package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
- package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
- package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
- package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
- package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
- package/dist/deploy/sniffer-hooks.cjs +13 -7
- package/dist/deploy/sniffer-hooks.cjs.map +1 -1
- package/dist/deploy/sniffer-hooks.d.cts +1 -2
- package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
- package/dist/deploy/sniffer-hooks.d.mts +1 -2
- package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
- package/dist/deploy/sniffer-hooks.mjs +10 -3
- package/dist/deploy/sniffer-hooks.mjs.map +1 -1
- package/dist/deploy/sniffer-loader.cjs +16 -7
- package/dist/deploy/sniffer-loader.cjs.map +1 -1
- package/dist/deploy/sniffer-loader.d.cts +1 -1
- package/dist/deploy/sniffer-loader.d.mts +1 -1
- package/dist/deploy/sniffer-loader.mjs +14 -3
- package/dist/deploy/sniffer-loader.mjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +11 -11
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
- package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
- package/dist/deploy/sniffer-routes-worker.mjs +4 -4
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
- package/dist/deploy/sniffer-worker.cjs +15 -6
- package/dist/deploy/sniffer-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-worker.d.cts +1 -3
- package/dist/deploy/sniffer-worker.d.cts.map +1 -1
- package/dist/deploy/sniffer-worker.d.mts +1 -3
- package/dist/deploy/sniffer-worker.d.mts.map +1 -1
- package/dist/deploy/sniffer-worker.mjs +15 -4
- package/dist/deploy/sniffer-worker.mjs.map +1 -1
- package/dist/deploy-BMM2hx-K.cjs +2401 -0
- package/dist/deploy-BMM2hx-K.cjs.map +1 -0
- package/dist/deploy-D5YhwDng.mjs +2328 -0
- package/dist/deploy-D5YhwDng.mjs.map +1 -0
- package/dist/derive-B4vDpzgP.mjs +150 -0
- package/dist/derive-B4vDpzgP.mjs.map +1 -0
- package/dist/derive-DAbo49sm.cjs +161 -0
- package/dist/derive-DAbo49sm.cjs.map +1 -0
- package/dist/discover-C5roJuc9.mjs +560 -0
- package/dist/discover-C5roJuc9.mjs.map +1 -0
- package/dist/discover-CSW_BMWa.d.cts +125 -0
- package/dist/discover-CSW_BMWa.d.cts.map +1 -0
- package/dist/discover-DozUKs8f.cjs +639 -0
- package/dist/discover-DozUKs8f.cjs.map +1 -0
- package/dist/discover-xtT7fgWg.d.mts +125 -0
- package/dist/discover-xtT7fgWg.d.mts.map +1 -0
- package/dist/dns-BIYf20p7.cjs +1057 -0
- package/dist/dns-BIYf20p7.cjs.map +1 -0
- package/dist/dns-agf2VCdV.mjs +926 -0
- package/dist/dns-agf2VCdV.mjs.map +1 -0
- package/dist/dokploy-2p4PK6ej.mjs +38 -0
- package/dist/dokploy-2p4PK6ej.mjs.map +1 -0
- package/dist/dokploy-BANMTroy.cjs +38 -0
- package/dist/dokploy-BANMTroy.cjs.map +1 -0
- package/dist/drivers-BjGDYfnC.mjs +195 -0
- package/dist/drivers-BjGDYfnC.mjs.map +1 -0
- package/dist/drivers-DbjiYpW6.cjs +224 -0
- package/dist/drivers-DbjiYpW6.cjs.map +1 -0
- package/dist/eas-CNi16SoO.cjs +337 -0
- package/dist/eas-CNi16SoO.cjs.map +1 -0
- package/dist/eas-iT2JDHCh.mjs +334 -0
- package/dist/eas-iT2JDHCh.mjs.map +1 -0
- package/dist/{emit-CIlvnDvV.mjs → emit-C1e8qD08.mjs} +13 -26
- package/dist/emit-C1e8qD08.mjs.map +1 -0
- package/dist/{emit-CUD1BWls.cjs → emit-Dmc1nvdS.cjs} +31 -57
- package/dist/emit-Dmc1nvdS.cjs.map +1 -0
- package/dist/encryption-DkXVbyZc.mjs +89 -0
- package/dist/encryption-DkXVbyZc.mjs.map +1 -0
- package/dist/encryption-d2lLtkYx.cjs +90 -0
- package/dist/encryption-d2lLtkYx.cjs.map +1 -0
- package/dist/engine-CatKW6E-.mjs +3089 -0
- package/dist/engine-CatKW6E-.mjs.map +1 -0
- package/dist/engine-DlEHexED.cjs +3202 -0
- package/dist/engine-DlEHexED.cjs.map +1 -0
- package/dist/errors-D8Gwp5kU.mjs +23 -0
- package/dist/errors-D8Gwp5kU.mjs.map +1 -0
- package/dist/errors-DMC4Umsb.cjs +34 -0
- package/dist/errors-DMC4Umsb.cjs.map +1 -0
- package/dist/github-BAeaC1Pl.cjs +833 -0
- package/dist/github-BAeaC1Pl.cjs.map +1 -0
- package/dist/github-DErsqKGN.mjs +832 -0
- package/dist/github-DErsqKGN.mjs.map +1 -0
- package/dist/googlePlay-BVcfFWRO.cjs +931 -0
- package/dist/googlePlay-BVcfFWRO.cjs.map +1 -0
- package/dist/googlePlay-BXJ5ZjMK.mjs +931 -0
- package/dist/googlePlay-BXJ5ZjMK.mjs.map +1 -0
- package/dist/identity-CBXr4wNi.mjs +129 -0
- package/dist/identity-CBXr4wNi.mjs.map +1 -0
- package/dist/identity-CbLfgQNT.cjs +182 -0
- package/dist/identity-CbLfgQNT.cjs.map +1 -0
- package/dist/{index-BzJ7QJ9c.d.mts → index-8OfpOtSI.d.cts} +39 -20
- package/dist/index-8OfpOtSI.d.cts.map +1 -0
- package/dist/{index-CfMjtdVC.d.cts → index-Dpji6Bxq.d.mts} +39 -20
- package/dist/index-Dpji6Bxq.d.mts.map +1 -0
- package/dist/index.cjs +14291 -11898
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +13938 -11560
- package/dist/index.mjs.map +1 -1
- package/dist/local-BwC2v2Y8.mjs +224 -0
- package/dist/local-BwC2v2Y8.mjs.map +1 -0
- package/dist/local-DNhnkugT.cjs +241 -0
- package/dist/local-DNhnkugT.cjs.map +1 -0
- package/dist/migrate-Bb1MmGHl.mjs +181 -0
- package/dist/migrate-Bb1MmGHl.mjs.map +1 -0
- package/dist/migrate-D79GI0XM.cjs +271 -0
- package/dist/migrate-D79GI0XM.cjs.map +1 -0
- package/dist/migrate-L4a273dY.cjs +181 -0
- package/dist/migrate-L4a273dY.cjs.map +1 -0
- package/dist/migrate-s4QizIoM.mjs +266 -0
- package/dist/migrate-s4QizIoM.mjs.map +1 -0
- package/dist/openapi.cjs +214 -10
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.d.cts +38 -17
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +38 -17
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +208 -5
- package/dist/openapi.mjs.map +1 -0
- package/dist/projectBucket-BBbQ1lHF.cjs +263 -0
- package/dist/projectBucket-BBbQ1lHF.cjs.map +1 -0
- package/dist/projectBucket-C_DN4WzF.mjs +222 -0
- package/dist/projectBucket-C_DN4WzF.mjs.map +1 -0
- package/dist/provider-BqpjG9QM.cjs +57 -0
- package/dist/provider-BqpjG9QM.cjs.map +1 -0
- package/dist/provider-CEOKk8NS.mjs +46 -0
- package/dist/provider-CEOKk8NS.mjs.map +1 -0
- package/dist/publish-CcTlmJT6.mjs +123 -0
- package/dist/publish-CcTlmJT6.mjs.map +1 -0
- package/dist/publish-ydscCYsW.cjs +124 -0
- package/dist/publish-ydscCYsW.cjs.map +1 -0
- package/dist/ready-BFFP838V.cjs +404 -0
- package/dist/ready-BFFP838V.cjs.map +1 -0
- package/dist/ready-BOfogqzr.mjs +375 -0
- package/dist/ready-BOfogqzr.mjs.map +1 -0
- package/dist/reconcile/public.cjs +3 -5
- package/dist/reconcile/public.d.cts +11 -87
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +11 -87
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -4
- package/dist/{reconcile-BI0tWkwz.mjs → reconcile--I7V4Klj.mjs} +4 -7
- package/dist/reconcile--I7V4Klj.mjs.map +1 -0
- package/dist/{reconcile-Bhw5fmKu.cjs → reconcile-CuCQBa5-.cjs} +5 -8
- package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
- package/dist/resolve-BLp2trep.mjs +263 -0
- package/dist/resolve-BLp2trep.mjs.map +1 -0
- package/dist/resolve-BgL-brF9.cjs +316 -0
- package/dist/resolve-BgL-brF9.cjs.map +1 -0
- package/dist/rollback-2cyLXEH1.cjs +165 -0
- package/dist/rollback-2cyLXEH1.cjs.map +1 -0
- package/dist/rollback-DwqZ8zzj.mjs +136 -0
- package/dist/rollback-DwqZ8zzj.mjs.map +1 -0
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
- package/dist/run-BJLIerMM.mjs +133 -0
- package/dist/run-BJLIerMM.mjs.map +1 -0
- package/dist/run-fVZ-rLnc.cjs +174 -0
- package/dist/run-fVZ-rLnc.cjs.map +1 -0
- package/dist/runtime-ACdfK59n.d.cts +82 -0
- package/dist/runtime-ACdfK59n.d.cts.map +1 -0
- package/dist/runtime-YyQuekxi.d.mts +82 -0
- package/dist/runtime-YyQuekxi.d.mts.map +1 -0
- package/dist/s3-CrPoA89T.cjs +215 -0
- package/dist/s3-CrPoA89T.cjs.map +1 -0
- package/dist/s3-DQXZdmCM.mjs +215 -0
- package/dist/s3-DQXZdmCM.mjs.map +1 -0
- package/dist/sandbox/config-worker.cjs +43 -0
- package/dist/sandbox/config-worker.cjs.map +1 -0
- package/dist/sandbox/config-worker.d.cts +1 -0
- package/dist/sandbox/config-worker.d.mts +1 -0
- package/dist/sandbox/config-worker.mjs +44 -0
- package/dist/sandbox/config-worker.mjs.map +1 -0
- package/dist/sandbox/credentials-worker.cjs +54 -0
- package/dist/sandbox/credentials-worker.cjs.map +1 -0
- package/dist/sandbox/credentials-worker.d.cts +1 -0
- package/dist/sandbox/credentials-worker.d.mts +1 -0
- package/dist/sandbox/credentials-worker.mjs +55 -0
- package/dist/sandbox/credentials-worker.mjs.map +1 -0
- package/dist/sandbox/discover-worker.cjs +50 -0
- package/dist/sandbox/discover-worker.cjs.map +1 -0
- package/dist/sandbox/discover-worker.d.cts +1 -0
- package/dist/sandbox/discover-worker.d.mts +1 -0
- package/dist/sandbox/discover-worker.mjs +51 -0
- package/dist/sandbox/discover-worker.mjs.map +1 -0
- package/dist/sandbox/migrate-worker.cjs +75 -0
- package/dist/sandbox/migrate-worker.cjs.map +1 -0
- package/dist/sandbox/migrate-worker.d.cts +1 -0
- package/dist/sandbox/migrate-worker.d.mts +1 -0
- package/dist/sandbox/migrate-worker.mjs +76 -0
- package/dist/sandbox/migrate-worker.mjs.map +1 -0
- package/dist/sandbox-C4g1eG31.d.mts +104 -0
- package/dist/sandbox-C4g1eG31.d.mts.map +1 -0
- package/dist/sandbox-CHv3OYXg.cjs +165 -0
- package/dist/sandbox-CHv3OYXg.cjs.map +1 -0
- package/dist/sandbox-CbVB7uOD.mjs +118 -0
- package/dist/sandbox-CbVB7uOD.mjs.map +1 -0
- package/dist/sandbox-CdKgQ3XU.d.cts +104 -0
- package/dist/sandbox-CdKgQ3XU.d.cts.map +1 -0
- package/dist/{workspace-DPV7FtAv.cjs → schemas-BCwKKA42.mjs} +958 -1816
- package/dist/schemas-BCwKKA42.mjs.map +1 -0
- package/dist/{workspace-CtnZnWsa.mjs → schemas-BQ_v0lEX.cjs} +1048 -1626
- package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
- package/dist/secretsManager-CQORubp9.mjs +97 -0
- package/dist/secretsManager-CQORubp9.mjs.map +1 -0
- package/dist/secretsManager-RAGcEDX1.cjs +108 -0
- package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
- package/dist/seeds-C2w4UqVP.cjs +9347 -0
- package/dist/seeds-C2w4UqVP.cjs.map +1 -0
- package/dist/seeds-Cwtv-U9-.mjs +8350 -0
- package/dist/seeds-Cwtv-U9-.mjs.map +1 -0
- package/dist/serverSetup-CKs4K9gD.cjs +630 -0
- package/dist/serverSetup-CKs4K9gD.cjs.map +1 -0
- package/dist/serverSetup-P68H5Lal.mjs +630 -0
- package/dist/serverSetup-P68H5Lal.mjs.map +1 -0
- package/dist/sniffer-8C4q6Szd.mjs +1825 -0
- package/dist/sniffer-8C4q6Szd.mjs.map +1 -0
- package/dist/sniffer-CF7wNxMo.cjs +1998 -0
- package/dist/sniffer-CF7wNxMo.cjs.map +1 -0
- package/dist/sst-B-Uz4cvm.cjs +464 -0
- package/dist/sst-B-Uz4cvm.cjs.map +1 -0
- package/dist/sst-C1pxbFEd.mjs +441 -0
- package/dist/sst-C1pxbFEd.mjs.map +1 -0
- package/dist/stage-BvM_u2z4.mjs +302 -0
- package/dist/stage-BvM_u2z4.mjs.map +1 -0
- package/dist/stage-DEQJGW3r.cjs +313 -0
- package/dist/stage-DEQJGW3r.cjs.map +1 -0
- package/dist/stages-Cb9rqRbN.mjs +190 -0
- package/dist/stages-Cb9rqRbN.mjs.map +1 -0
- package/dist/stages-D4SnG5yl.cjs +190 -0
- package/dist/stages-D4SnG5yl.cjs.map +1 -0
- package/dist/target/public.cjs +15 -0
- package/dist/target/public.d.cts +28 -0
- package/dist/target/public.d.cts.map +1 -0
- package/dist/target/public.d.mts +28 -0
- package/dist/target/public.d.mts.map +1 -0
- package/dist/target/public.mjs +4 -0
- package/dist/terminal-CW_dWeTe.mjs +85 -0
- package/dist/terminal-CW_dWeTe.mjs.map +1 -0
- package/dist/terminal-DJlqcW_U.cjs +85 -0
- package/dist/terminal-DJlqcW_U.cjs.map +1 -0
- package/dist/types-B6UXlEkf.d.cts +7650 -0
- package/dist/types-B6UXlEkf.d.cts.map +1 -0
- package/dist/types-HqVPddRK.d.mts +7649 -0
- package/dist/types-HqVPddRK.d.mts.map +1 -0
- package/dist/utils-D2Nk1Nv2.cjs +205 -0
- package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
- package/dist/utils-D_fxUqvU.mjs +156 -0
- package/dist/utils-D_fxUqvU.mjs.map +1 -0
- package/dist/vitest.cjs +65 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +29 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +29 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +65 -0
- package/dist/vitest.mjs.map +1 -0
- package/dist/workerRuntime-BXfhbe13.cjs +108 -0
- package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
- package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
- package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
- package/dist/workspace/index.cjs +8 -4
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -3
- package/dist/workspace-BwqQnool.cjs +2806 -0
- package/dist/workspace-BwqQnool.cjs.map +1 -0
- package/dist/workspace-D1QbNd55.mjs +2394 -0
- package/dist/workspace-D1QbNd55.mjs.map +1 -0
- package/package.json +54 -22
- package/dist/CachedStateProvider-BEBl2wQT.cjs +0 -60
- package/dist/CachedStateProvider-BEBl2wQT.cjs.map +0 -1
- package/dist/CachedStateProvider-C-8wtlto.mjs +0 -3
- package/dist/CachedStateProvider-Co4n5Wvs.mjs +0 -54
- package/dist/CachedStateProvider-Co4n5Wvs.mjs.map +0 -1
- package/dist/CachedStateProvider-DqhGpzsm.cjs +0 -3
- package/dist/HostingerProvider-BOvsgATO.cjs.map +0 -1
- package/dist/HostingerProvider-BcyFRbqV.mjs.map +0 -1
- package/dist/LocalStateProvider-Bq-0C0sg.mjs +0 -42
- package/dist/LocalStateProvider-Bq-0C0sg.mjs.map +0 -1
- package/dist/LocalStateProvider-yjXZXZDM.cjs +0 -43
- package/dist/LocalStateProvider-yjXZXZDM.cjs.map +0 -1
- package/dist/Route53Provider-C0xmer8U.mjs.map +0 -1
- package/dist/Route53Provider-CH9XH7bz.cjs.map +0 -1
- package/dist/SSMStateProvider-CXtNgPfy.cjs +0 -66
- package/dist/SSMStateProvider-CXtNgPfy.cjs.map +0 -1
- package/dist/SSMStateProvider-DOZifZfE.mjs +0 -66
- package/dist/SSMStateProvider-DOZifZfE.mjs.map +0 -1
- package/dist/backup-provisioner-DXXg6FIL.mjs.map +0 -1
- package/dist/backup-provisioner-cE2PuCTb.cjs.map +0 -1
- package/dist/bundler-BMekgx7a.cjs.map +0 -1
- package/dist/bundler-Bux2iF-v.mjs.map +0 -1
- package/dist/chunk-Duj1WY3L.mjs +0 -7
- package/dist/config-DTsVjKZD.mjs +0 -402
- package/dist/config-DTsVjKZD.mjs.map +0 -1
- package/dist/config-RYR9j6EF.cjs +0 -462
- package/dist/config-RYR9j6EF.cjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.map +0 -1
- package/dist/credentials-B5zRHdAl.mjs +0 -141
- package/dist/credentials-B5zRHdAl.mjs.map +0 -1
- package/dist/credentials-BapzjyV5.cjs +0 -195
- package/dist/credentials-BapzjyV5.cjs.map +0 -1
- package/dist/credentials-DQRvPz2S.cjs +0 -2769
- package/dist/credentials-DQRvPz2S.cjs.map +0 -1
- package/dist/credentials-jMJC63qs.mjs +0 -2625
- package/dist/credentials-jMJC63qs.mjs.map +0 -1
- package/dist/discover-BYHQwQqu.mjs +0 -242
- package/dist/discover-BYHQwQqu.mjs.map +0 -1
- package/dist/discover-DmW9Bscc.cjs +0 -290
- package/dist/discover-DmW9Bscc.cjs.map +0 -1
- package/dist/dokploy-api-5cK2InBm.cjs +0 -3
- package/dist/dokploy-api-D2Ny4Jrc.mjs +0 -3
- package/dist/dokploy-api-pdaBryoY.mjs +0 -706
- package/dist/dokploy-api-pdaBryoY.mjs.map +0 -1
- package/dist/dokploy-api-zqKe9lHH.cjs +0 -718
- package/dist/dokploy-api-zqKe9lHH.cjs.map +0 -1
- package/dist/emit-CIlvnDvV.mjs.map +0 -1
- package/dist/emit-CUD1BWls.cjs.map +0 -1
- package/dist/encryption-D2pL3tHH.cjs +0 -54
- package/dist/encryption-D2pL3tHH.cjs.map +0 -1
- package/dist/encryption-YDsXXi6w.mjs +0 -3
- package/dist/encryption-_4zwjOAR.mjs +0 -42
- package/dist/encryption-_4zwjOAR.mjs.map +0 -1
- package/dist/encryption-sQ2Oxx0d.cjs +0 -4
- package/dist/fullstack-secrets-B6KBHf-g.mjs +0 -87
- package/dist/fullstack-secrets-B6KBHf-g.mjs.map +0 -1
- package/dist/fullstack-secrets-DL8v0y4D.cjs +0 -99
- package/dist/fullstack-secrets-DL8v0y4D.cjs.map +0 -1
- package/dist/generator-CNzBw7g5.cjs +0 -289
- package/dist/generator-CNzBw7g5.cjs.map +0 -1
- package/dist/generator-VE2JrFlY.mjs +0 -253
- package/dist/generator-VE2JrFlY.mjs.map +0 -1
- package/dist/github-BThvbf2W.cjs +0 -197
- package/dist/github-BThvbf2W.cjs.map +0 -1
- package/dist/github-DpMZurEK.mjs +0 -196
- package/dist/github-DpMZurEK.mjs.map +0 -1
- package/dist/index-BzJ7QJ9c.d.mts.map +0 -1
- package/dist/index-CfMjtdVC.d.cts.map +0 -1
- package/dist/keystore-C9rint2E.cjs +0 -101
- package/dist/keystore-C9rint2E.cjs.map +0 -1
- package/dist/keystore-TxeYM7an.mjs +0 -83
- package/dist/keystore-TxeYM7an.mjs.map +0 -1
- package/dist/openapi-Bs3-5q_r.mjs +0 -2021
- package/dist/openapi-Bs3-5q_r.mjs.map +0 -1
- package/dist/openapi-DWLTsYLL.cjs +0 -2075
- package/dist/openapi-DWLTsYLL.cjs.map +0 -1
- package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
- package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
- package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
- package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
- package/dist/openapi-react-query.cjs +0 -4
- package/dist/openapi-react-query.d.cts +0 -11
- package/dist/openapi-react-query.d.cts.map +0 -1
- package/dist/openapi-react-query.d.mts +0 -11
- package/dist/openapi-react-query.d.mts.map +0 -1
- package/dist/openapi-react-query.mjs +0 -4
- package/dist/reconcile-BI0tWkwz.mjs.map +0 -1
- package/dist/reconcile-Bhw5fmKu.cjs.map +0 -1
- package/dist/setup-BmLoNrDX.mjs +0 -12
- package/dist/setup-BrR1_xGy.cjs +0 -12
- package/dist/setup-BsNR2LBG.cjs +0 -467
- package/dist/setup-BsNR2LBG.cjs.map +0 -1
- package/dist/setup-D5-JMknk.mjs +0 -437
- package/dist/setup-D5-JMknk.mjs.map +0 -1
- package/dist/storage-B020InPW.mjs +0 -222
- package/dist/storage-B020InPW.mjs.map +0 -1
- package/dist/storage-CSNplaJn.cjs +0 -282
- package/dist/storage-CSNplaJn.cjs.map +0 -1
- package/dist/storage-DGBzMLZa.mjs +0 -4
- package/dist/storage-DlVol_oj.cjs +0 -8
- package/dist/sync-0ILCb-1S.cjs +0 -93
- package/dist/sync-0ILCb-1S.cjs.map +0 -1
- package/dist/sync-CzHXiR9c.mjs +0 -76
- package/dist/sync-CzHXiR9c.mjs.map +0 -1
- package/dist/sync-DYENfOt4.cjs +0 -4
- package/dist/sync-HAau6h_R.mjs +0 -3
- package/dist/types-DVIx8I1N.d.mts +0 -1950
- package/dist/types-DVIx8I1N.d.mts.map +0 -1
- package/dist/types-PMP_qXRY.d.cts +0 -1950
- package/dist/types-PMP_qXRY.d.cts.map +0 -1
- package/dist/workspace-Cji6lE8E.cjs +0 -10
- package/dist/workspace-CkJAtRIX.mjs +0 -9
- package/dist/workspace-CtnZnWsa.mjs.map +0 -1
- package/dist/workspace-DPV7FtAv.cjs.map +0 -1
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
const require_errors = require("./errors-DMC4Umsb.cjs");
|
|
2
|
+
const require_EndpointGenerator = require("./EndpointGenerator-BDa6pPgE.cjs");
|
|
3
|
+
const require_discover = require("./discover-DozUKs8f.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/subscriberRoute.ts
|
|
213
|
+
/**
|
|
214
|
+
* Where SNS pushes a topic subscriber's messages, on the server that runs it:
|
|
215
|
+
* named after the subscriber's export.
|
|
216
|
+
*
|
|
217
|
+
* One definition for both sides — the generated server mounts the route, and
|
|
218
|
+
* the stack exposes exactly these paths on a worker's host — so the path the
|
|
219
|
+
* edge lets through and the path the worker answers cannot drift.
|
|
220
|
+
*/
|
|
221
|
+
const SUBSCRIBER_ROUTE_PREFIX = "/__gkm/subscribers/";
|
|
222
|
+
/** The route a subscriber's pushes arrive on. */
|
|
223
|
+
function subscriberRoute(exportName) {
|
|
224
|
+
return `${SUBSCRIBER_ROUTE_PREFIX}${exportName}`;
|
|
225
|
+
}
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/generators/SubscriberGenerator.ts
|
|
228
|
+
var SubscriberGenerator = class extends require_discover.ConstructGenerator {
|
|
229
|
+
isConstruct(value) {
|
|
230
|
+
return _geekmidas_constructs_subscribers.Subscriber.isSubscriber(value);
|
|
231
|
+
}
|
|
232
|
+
async build(context, constructs, outputDir, options) {
|
|
233
|
+
const target = options?.target ?? "aws";
|
|
234
|
+
const logger = console;
|
|
235
|
+
const subscriberInfos = [];
|
|
236
|
+
if (target === "server") {
|
|
237
|
+
await this.generateServerSubscribersFile(outputDir, constructs, context.eventsBackends?.includes("sns") ?? false);
|
|
238
|
+
logger.log(`Generated server subscribers file with ${constructs.length} subscribers (polling mode)`);
|
|
239
|
+
return subscriberInfos;
|
|
240
|
+
}
|
|
241
|
+
if (constructs.length === 0) return subscriberInfos;
|
|
242
|
+
const subscribersDir = (0, node_path.join)(outputDir, "subscribers");
|
|
243
|
+
await (0, node_fs_promises.mkdir)(subscribersDir, { recursive: true });
|
|
244
|
+
for (const { key, construct, path } of constructs) {
|
|
245
|
+
const handlerFile = await this.generateSubscriberHandler(subscribersDir, path.relative, key, construct, context, construct.owner);
|
|
246
|
+
subscriberInfos.push({
|
|
247
|
+
name: key,
|
|
248
|
+
handler: (0, node_path.relative)(options?.root ?? process.cwd(), handlerFile).replace(/\.ts$/, ".handler"),
|
|
249
|
+
subscribedEvents: construct.subscribedEvents || [],
|
|
250
|
+
...construct.topicName ? {
|
|
251
|
+
transport: "topic",
|
|
252
|
+
topic: construct.topicName
|
|
253
|
+
} : {},
|
|
254
|
+
timeout: construct.timeout,
|
|
255
|
+
memorySize: construct.memorySize,
|
|
256
|
+
environment: await construct.getEnvironment({ markOptional: context.markOptional }),
|
|
257
|
+
dependencies: construct.constructs
|
|
258
|
+
});
|
|
259
|
+
logger.log(`Generated subscriber handler: ${key}`);
|
|
260
|
+
}
|
|
261
|
+
return subscriberInfos;
|
|
262
|
+
}
|
|
263
|
+
async generateSubscriberHandler(outputDir, sourceFile, exportName, _subscriber, context, owner) {
|
|
264
|
+
const handlerFileName = `${exportName}.ts`;
|
|
265
|
+
const handlerPath = (0, node_path.join)(outputDir, handlerFileName);
|
|
266
|
+
const importPath = (0, node_path.relative)((0, node_path.dirname)(handlerPath), sourceFile).replace(/\.ts$/, ".js");
|
|
267
|
+
const runtime = require_EndpointGenerator.runtimeFor(context, (0, node_path.dirname)(handlerPath), owner);
|
|
268
|
+
const content = `import { AWSLambdaSubscriber } from '@geekmidas/constructs/aws';
|
|
269
|
+
import { ${exportName} } from '${importPath}';
|
|
270
|
+
${runtime.imports}
|
|
271
|
+
${context.storageDrivers?.imports ?? ""}
|
|
272
|
+
${runtime.bindings}
|
|
273
|
+
${context.storageDrivers?.setup ? `\n// The handler registers the drivers its target needs.\n${context.storageDrivers.setup}\n` : ""}
|
|
274
|
+
const adapter = new AWSLambdaSubscriber(envParser, ${exportName});
|
|
275
|
+
|
|
276
|
+
export const handler = adapter.handler;
|
|
277
|
+
`;
|
|
278
|
+
await (0, node_fs_promises.writeFile)(handlerPath, content);
|
|
279
|
+
return handlerPath;
|
|
280
|
+
}
|
|
281
|
+
async generateServerSubscribersFile(outputDir, subscribers, push) {
|
|
282
|
+
await (0, node_fs_promises.mkdir)(outputDir, { recursive: true });
|
|
283
|
+
const subscribersPath = (0, node_path.join)(outputDir, "subscribers.ts");
|
|
284
|
+
if (subscribers.length === 0) {
|
|
285
|
+
await (0, node_fs_promises.writeFile)(subscribersPath, `/**
|
|
286
|
+
* Generated subscribers setup — this app declares none.
|
|
287
|
+
*/
|
|
288
|
+
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
289
|
+
import type { Logger } from '@geekmidas/logger';
|
|
290
|
+
|
|
291
|
+
export async function setupSubscribers(
|
|
292
|
+
_app: unknown,
|
|
293
|
+
_envParser: EnvironmentParser<any>,
|
|
294
|
+
_logger: Logger,
|
|
295
|
+
): Promise<(port: number) => Promise<void>> {
|
|
296
|
+
return async () => {};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export function subscribersStatus(): { failed: string[]; connections: unknown[] } {
|
|
300
|
+
return { failed: [], connections: [] };
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export async function stopSubscribers(): Promise<void> {}
|
|
304
|
+
`);
|
|
305
|
+
return subscribersPath;
|
|
306
|
+
}
|
|
307
|
+
const importsByFile = /* @__PURE__ */ new Map();
|
|
308
|
+
for (const { path, key } of subscribers) {
|
|
309
|
+
const importPath = (0, node_path.relative)((0, node_path.dirname)(subscribersPath), path.relative).replace(/\.ts$/, ".js");
|
|
310
|
+
importsByFile.set(importPath, [...importsByFile.get(importPath) ?? [], key]);
|
|
311
|
+
}
|
|
312
|
+
const content = `/**
|
|
313
|
+
* Generated subscribers setup.
|
|
314
|
+
*
|
|
315
|
+
* Each subscriber is run against the topic it is bound to, through that
|
|
316
|
+
* topic's own connection string:
|
|
317
|
+
*
|
|
318
|
+
* - **sns://** — pushed, not polled. The subscriber gets an HTTP route on this
|
|
319
|
+
* server, and the route is subscribed to the topic with a filter policy of
|
|
320
|
+
* the events it named, so SNS fans out to each subscriber. The route runs the
|
|
321
|
+
* subscriber through the same adaptor a Lambda subscription does.
|
|
322
|
+
* - **anything else** (pgboss://, rabbitmq://, sqs://) — polled. On pg-boss
|
|
323
|
+
* each subscriber drains a queue of its own, \`<topic>/<subscriber>\`, so
|
|
324
|
+
* every subscriber sees every event; replicas of one subscriber share it.
|
|
325
|
+
*
|
|
326
|
+
* GKM_SUBSCRIBERS=off (\`gkm dev --no-subscribers\`) runs none of them.
|
|
327
|
+
* GKM_SUBSCRIBER_PUSH_URL is the address SNS pushes to; against the local
|
|
328
|
+
* emulator it defaults to this server through host.docker.internal.
|
|
329
|
+
*/
|
|
330
|
+
import { connect } from 'node:net';
|
|
331
|
+
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
332
|
+
import type { Logger } from '@geekmidas/logger';
|
|
333
|
+
import { EventConnectionFactory, Subscriber } from '@geekmidas/events';
|
|
334
|
+
import type { EventConnection } from '@geekmidas/events';
|
|
335
|
+
import { ServiceDiscovery } from '@geekmidas/services';
|
|
336
|
+
${Array.from(importsByFile.entries()).map(([importPath, exports]) => `import { ${exports.join(", ")} } from '${importPath}';`).join("\n")}
|
|
337
|
+
|
|
338
|
+
const subscribers = [
|
|
339
|
+
${subscribers.map(({ key, construct }) => {
|
|
340
|
+
const connectionKey = construct.topicName ? (0, _geekmidas_manifest.provideKey)((0, _geekmidas_manifest.canonicalId)(construct.topicName), "publisherConnectionString") : void 0;
|
|
341
|
+
return ` { id: '${key}', subscriber: ${key}, topic: ${construct.topicName ? `'${construct.topicName}'` : "undefined"}, connectionKey: ${connectionKey ? `'${connectionKey}'` : "undefined"} },`;
|
|
342
|
+
}).join("\n")}
|
|
343
|
+
];
|
|
344
|
+
|
|
345
|
+
// What was opened, and what could not be: a worker's health check reads both,
|
|
346
|
+
// and its shutdown closes what was opened.
|
|
347
|
+
const connections = new Map<string, EventConnection>();
|
|
348
|
+
const failed: string[] = [];
|
|
349
|
+
|
|
350
|
+
/** The route a subscriber's pushes arrive on. */
|
|
351
|
+
export const SUBSCRIBER_ROUTE = (id: string) => \`${SUBSCRIBER_ROUTE_PREFIX}\${id}\`;
|
|
352
|
+
|
|
353
|
+
/** Resolves once something is accepting connections on the port. */
|
|
354
|
+
async function listening(port: number): Promise<void> {
|
|
355
|
+
for (let attempt = 0; attempt < 100; attempt++) {
|
|
356
|
+
const open = await new Promise<boolean>((resolve) => {
|
|
357
|
+
const socket = connect(port, '127.0.0.1');
|
|
358
|
+
socket.once('connect', () => { socket.end(); resolve(true); });
|
|
359
|
+
socket.once('error', () => resolve(false));
|
|
360
|
+
});
|
|
361
|
+
if (open) return;
|
|
362
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Mount each pushed subscriber's route and start each polled one. Returns what
|
|
368
|
+
* to run once the server is listening: subscribing a route makes SNS send its
|
|
369
|
+
* confirmation at once, so the route has to be reachable first.
|
|
370
|
+
*/
|
|
371
|
+
export async function setupSubscribers(
|
|
372
|
+
app: { post: (path: string, handler: (c: any) => unknown) => unknown },
|
|
373
|
+
envParser: EnvironmentParser<any>,
|
|
374
|
+
logger: Logger,
|
|
375
|
+
): Promise<(port: number) => Promise<void>> {
|
|
376
|
+
if (process.env.GKM_SUBSCRIBERS === 'off') {
|
|
377
|
+
logger.info('Subscribers are off (--no-subscribers)');
|
|
378
|
+
return async () => {};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
|
|
382
|
+
const afterListening: ((port: number) => Promise<void>)[] = [];
|
|
383
|
+
|
|
384
|
+
for (const { id, subscriber, topic, connectionKey } of subscribers) {
|
|
385
|
+
const events = subscriber.subscribedEvents || [];
|
|
386
|
+
if (events.length === 0) {
|
|
387
|
+
logger.warn({ subscriber: id }, 'Subscriber has no subscribed events, skipping');
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
const connectionString = connectionKey ? process.env[connectionKey] : undefined;
|
|
391
|
+
if (!connectionString) {
|
|
392
|
+
logger.error(
|
|
393
|
+
{ subscriber: id, connectionKey },
|
|
394
|
+
'No connection string for the topic this subscriber is bound to',
|
|
395
|
+
);
|
|
396
|
+
failed.push(id);
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
try {
|
|
401
|
+
${push ? ` if (connectionString.startsWith('sns:')) {
|
|
402
|
+
const { SNSConnection, snsUrl, subscribeHttpEndpoint } = await import('@geekmidas/events/sns');
|
|
403
|
+
const { SnsPushSubscriberAdaptor } = await import('@geekmidas/constructs/subscribers');
|
|
404
|
+
const address = snsUrl.parse(connectionString);
|
|
405
|
+
const route = SUBSCRIBER_ROUTE(id);
|
|
406
|
+
const adaptor = new SnsPushSubscriberAdaptor(envParser, subscriber, {
|
|
407
|
+
topicArn: address.topicArn,
|
|
408
|
+
// An emulator signs nothing. Decided by the address this server was
|
|
409
|
+
// configured with, never by anything a request says about itself.
|
|
410
|
+
verify: !address.endpoint,
|
|
411
|
+
...(address.endpoint ? { emulatorEndpoint: address.endpoint } : {}),
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
app.post(route, async (c: any) => {
|
|
415
|
+
const body = JSON.parse(await c.req.text());
|
|
416
|
+
const response = await adaptor.handle(body);
|
|
417
|
+
return c.json(response.body, response.status);
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
afterListening.push(async (port) => {
|
|
421
|
+
const base =
|
|
422
|
+
process.env.GKM_SUBSCRIBER_PUSH_URL ??
|
|
423
|
+
(address.endpoint ? \`http://host.docker.internal:\${port}\` : undefined);
|
|
424
|
+
if (!base) {
|
|
425
|
+
logger.error(
|
|
426
|
+
{ subscriber: id },
|
|
427
|
+
'Set GKM_SUBSCRIBER_PUSH_URL to the public URL of this worker, which SNS pushes to',
|
|
428
|
+
);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
const connection = await SNSConnection.fromConnectionString(connectionString);
|
|
432
|
+
await subscribeHttpEndpoint(connection, {
|
|
433
|
+
endpoint: new URL(route, base).toString(),
|
|
434
|
+
events,
|
|
435
|
+
});
|
|
436
|
+
logger.info({ subscriber: id, events }, 'Subscriber subscribed for push');
|
|
437
|
+
});
|
|
438
|
+
continue;
|
|
439
|
+
}
|
|
440
|
+
` : ` if (connectionString.startsWith('sns:')) {
|
|
441
|
+
// Built for a broker other than SNS, so this entry registered no SNS
|
|
442
|
+
// driver and has no push route to offer.
|
|
443
|
+
logger.error(
|
|
444
|
+
{ subscriber: id, connectionKey },
|
|
445
|
+
'This build has no SNS driver: it was built for a target whose broker is not SNS',
|
|
446
|
+
);
|
|
447
|
+
failed.push(id);
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
`}
|
|
451
|
+
|
|
452
|
+
let connection = connections.get(connectionString);
|
|
453
|
+
if (!connection) {
|
|
454
|
+
connection = await EventConnectionFactory.fromConnectionString(connectionString);
|
|
455
|
+
connections.set(connectionString, connection);
|
|
456
|
+
}
|
|
457
|
+
// Named, so a broker with one address for everything (pg-boss) gives
|
|
458
|
+
// this subscriber a queue of its own: fan-out, not competition.
|
|
459
|
+
const eventSubscriber = await Subscriber.fromConnection(connection, {
|
|
460
|
+
topic,
|
|
461
|
+
subscription: id,
|
|
462
|
+
});
|
|
463
|
+
const services = subscriber.services.length > 0
|
|
464
|
+
? await serviceDiscovery.register(subscriber.services)
|
|
465
|
+
: {};
|
|
466
|
+
// The subscriber's database — the worker's, or its own — as \`db\`. A
|
|
467
|
+
// pushed subscriber gets it from the adaptor above instead.
|
|
468
|
+
const db = subscriber.databaseService
|
|
469
|
+
? (await serviceDiscovery.register([subscriber.databaseService]))[
|
|
470
|
+
subscriber.databaseService.serviceName
|
|
471
|
+
]
|
|
472
|
+
: undefined;
|
|
473
|
+
|
|
474
|
+
await eventSubscriber.subscribe(events, async (event) => {
|
|
475
|
+
try {
|
|
476
|
+
await subscriber.handler({
|
|
477
|
+
events: [event],
|
|
478
|
+
services: services as any,
|
|
479
|
+
logger: subscriber.logger,
|
|
480
|
+
db,
|
|
481
|
+
} as any);
|
|
482
|
+
} catch (error) {
|
|
483
|
+
logger.error({ err: error, event, subscriber: id }, 'Failed to process event');
|
|
484
|
+
// Rethrown so the transport keeps the event for a retry — as a queue
|
|
485
|
+
// consumer's failure does, and as a pushed subscriber's 500 does.
|
|
486
|
+
throw error;
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
logger.info({ subscriber: id, events }, 'Subscriber started polling');
|
|
490
|
+
} catch (error) {
|
|
491
|
+
// The message too: a missing module's code alone does not say which.
|
|
492
|
+
logger.error(
|
|
493
|
+
{ err: error, subscriber: id },
|
|
494
|
+
'Failed to set up subscriber',
|
|
495
|
+
);
|
|
496
|
+
failed.push(id);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
return async (port) => {
|
|
501
|
+
if (afterListening.length === 0) return;
|
|
502
|
+
await listening(port);
|
|
503
|
+
for (const subscribe of afterListening) {
|
|
504
|
+
await subscribe(port).catch((error) => {
|
|
505
|
+
logger.error({ err: error }, 'Failed to subscribe for push');
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/** The subscribers that could not start, and the connections that did. */
|
|
512
|
+
export function subscribersStatus(): { failed: string[]; connections: EventConnection[] } {
|
|
513
|
+
return { failed: [...failed], connections: [...connections.values()] };
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Stop polling, let the events in flight finish, and close each broker
|
|
518
|
+
* connection — pg-boss's graceful stop does all three. The caller bounds it.
|
|
519
|
+
*/
|
|
520
|
+
export async function stopSubscribers(): Promise<void> {
|
|
521
|
+
const open = [...connections.values()];
|
|
522
|
+
connections.clear();
|
|
523
|
+
await Promise.all(open.map((connection) => connection.close()));
|
|
524
|
+
}
|
|
525
|
+
`;
|
|
526
|
+
await (0, node_fs_promises.writeFile)(subscribersPath, content);
|
|
527
|
+
return subscribersPath;
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
//#endregion
|
|
531
|
+
Object.defineProperty(exports, "DEFAULT_CACHE", {
|
|
532
|
+
enumerable: true,
|
|
533
|
+
get: function() {
|
|
534
|
+
return DEFAULT_CACHE;
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
Object.defineProperty(exports, "DEFAULT_EVENTS", {
|
|
538
|
+
enumerable: true,
|
|
539
|
+
get: function() {
|
|
540
|
+
return DEFAULT_EVENTS;
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
Object.defineProperty(exports, "DEFAULT_STORAGE", {
|
|
544
|
+
enumerable: true,
|
|
545
|
+
get: function() {
|
|
546
|
+
return DEFAULT_STORAGE;
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
Object.defineProperty(exports, "SubscriberGenerator", {
|
|
550
|
+
enumerable: true,
|
|
551
|
+
get: function() {
|
|
552
|
+
return SubscriberGenerator;
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
Object.defineProperty(exports, "assertTestCredentials", {
|
|
556
|
+
enumerable: true,
|
|
557
|
+
get: function() {
|
|
558
|
+
return assertTestCredentials;
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
Object.defineProperty(exports, "holdsEveryCache", {
|
|
562
|
+
enumerable: true,
|
|
563
|
+
get: function() {
|
|
564
|
+
return holdsEveryCache;
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
Object.defineProperty(exports, "isCacheBackend", {
|
|
568
|
+
enumerable: true,
|
|
569
|
+
get: function() {
|
|
570
|
+
return isCacheBackend;
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
Object.defineProperty(exports, "readCredentialFakes", {
|
|
574
|
+
enumerable: true,
|
|
575
|
+
get: function() {
|
|
576
|
+
return readCredentialFakes;
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
Object.defineProperty(exports, "readFakes", {
|
|
580
|
+
enumerable: true,
|
|
581
|
+
get: function() {
|
|
582
|
+
return readFakes;
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
Object.defineProperty(exports, "subscriberRoute", {
|
|
586
|
+
enumerable: true,
|
|
587
|
+
get: function() {
|
|
588
|
+
return subscriberRoute;
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
//# sourceMappingURL=SubscriberGenerator-C8CPxrCK.cjs.map
|