@geekmidas/cli 10.0.0-alpha.10 → 10.0.0-alpha.101
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 +315 -414
- 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-Br97xgs_.mjs +1031 -0
- package/dist/EndpointGenerator-Br97xgs_.mjs.map +1 -0
- package/dist/EndpointGenerator-By5_tYE9.cjs +1090 -0
- package/dist/EndpointGenerator-By5_tYE9.cjs.map +1 -0
- package/dist/GoDaddyProvider-BOuLf_Py.cjs +388 -0
- package/dist/GoDaddyProvider-BOuLf_Py.cjs.map +1 -0
- package/dist/GoDaddyProvider-u9MF-Dqk.mjs +388 -0
- package/dist/GoDaddyProvider-u9MF-Dqk.mjs.map +1 -0
- package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-BNpS9aRJ.mjs} +29 -25
- package/dist/HostingerProvider-BNpS9aRJ.mjs.map +1 -0
- package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-DR1iws1P.cjs} +29 -25
- package/dist/HostingerProvider-DR1iws1P.cjs.map +1 -0
- package/dist/LegacyStateStore-DWmHGNgH.cjs +124 -0
- package/dist/LegacyStateStore-DWmHGNgH.cjs.map +1 -0
- package/dist/LegacyStateStore-vhkx7Bbq.mjs +124 -0
- package/dist/LegacyStateStore-vhkx7Bbq.mjs.map +1 -0
- package/dist/LocalStateStore-BVKDADoG.cjs +178 -0
- package/dist/LocalStateStore-BVKDADoG.cjs.map +1 -0
- package/dist/LocalStateStore-FVsg0UoM.mjs +167 -0
- package/dist/LocalStateStore-FVsg0UoM.mjs.map +1 -0
- package/dist/OpenApiTsGenerator-BgSX_Z-e.cjs +541 -0
- package/dist/OpenApiTsGenerator-BgSX_Z-e.cjs.map +1 -0
- package/dist/OpenApiTsGenerator-C8aTX--y.mjs +536 -0
- package/dist/OpenApiTsGenerator-C8aTX--y.mjs.map +1 -0
- package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-Bllus2NR.cjs} +21 -22
- package/dist/Route53Provider-Bllus2NR.cjs.map +1 -0
- package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-QXxjkZO1.mjs} +13 -13
- package/dist/Route53Provider-QXxjkZO1.mjs.map +1 -0
- package/dist/S3StateStore-B8seZUsw.mjs +223 -0
- package/dist/S3StateStore-B8seZUsw.mjs.map +1 -0
- package/dist/S3StateStore-B_2gE9Un.cjs +222 -0
- package/dist/S3StateStore-B_2gE9Un.cjs.map +1 -0
- package/dist/SSMStateStore-CTDEI5Bi.cjs +204 -0
- package/dist/SSMStateStore-CTDEI5Bi.cjs.map +1 -0
- package/dist/SSMStateStore-DGTbBomw.mjs +205 -0
- package/dist/SSMStateStore-DGTbBomw.mjs.map +1 -0
- package/dist/SubscriberGenerator-1-IsjIwF.mjs +449 -0
- package/dist/SubscriberGenerator-1-IsjIwF.mjs.map +1 -0
- package/dist/SubscriberGenerator-BlIOdbi-.cjs +490 -0
- package/dist/SubscriberGenerator-BlIOdbi-.cjs.map +1 -0
- package/dist/add-BB2tLVc2.cjs +720 -0
- package/dist/add-BB2tLVc2.cjs.map +1 -0
- package/dist/add-CIbhGE5v.mjs +718 -0
- package/dist/add-CIbhGE5v.mjs.map +1 -0
- package/dist/appPorts-C9z9Pzn9.mjs +223 -0
- package/dist/appPorts-C9z9Pzn9.mjs.map +1 -0
- package/dist/appPorts-Cu79hJF6.cjs +264 -0
- package/dist/appPorts-Cu79hJF6.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-Bgj5Vi_L.mjs → backup-provisioner-C8DnCmxK.mjs} +11 -8
- package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
- package/dist/{backup-provisioner-BrsHwYG0.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-BY1OmV1e.cjs → bundler-Ba6BER3w.cjs} +38 -35
- package/dist/bundler-Ba6BER3w.cjs.map +1 -0
- package/dist/{bundler-Be8Zg4Wd.mjs → bundler-CHjRYVKh.mjs} +36 -32
- package/dist/bundler-CHjRYVKh.mjs.map +1 -0
- package/dist/cli-CtlqYRlN.cjs +71 -0
- package/dist/cli-CtlqYRlN.cjs.map +1 -0
- package/dist/cli-DOlkhrsh.mjs +71 -0
- package/dist/cli-DOlkhrsh.mjs.map +1 -0
- package/dist/compose-FDP_TaFt.mjs +3154 -0
- package/dist/compose-FDP_TaFt.mjs.map +1 -0
- package/dist/compose-uAWLy-nR.cjs +3267 -0
- package/dist/compose-uAWLy-nR.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-DDda4Mmm.cjs +272 -0
- package/dist/credentialSchemas-DDda4Mmm.cjs.map +1 -0
- package/dist/credentialSchemas-DvitraL-.mjs +237 -0
- package/dist/credentialSchemas-DvitraL-.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-BeGP5eDh.mjs +495 -0
- package/dist/databases-BeGP5eDh.mjs.map +1 -0
- package/dist/databases-DGALFDG3.cjs +598 -0
- package/dist/databases-DGALFDG3.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 +653 -0
- package/dist/deploy/public.d.cts.map +1 -0
- package/dist/deploy/public.d.mts +653 -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-DUUc3jV9.cjs +2390 -0
- package/dist/deploy-DUUc3jV9.cjs.map +1 -0
- package/dist/deploy-DgZxTnGS.mjs +2317 -0
- package/dist/deploy-DgZxTnGS.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-BfhVW_kT.cjs +600 -0
- package/dist/discover-BfhVW_kT.cjs.map +1 -0
- package/dist/discover-CvTtV5ZD.d.cts +108 -0
- package/dist/discover-CvTtV5ZD.d.cts.map +1 -0
- package/dist/discover-W2kab9Lc.d.mts +108 -0
- package/dist/discover-W2kab9Lc.d.mts.map +1 -0
- package/dist/discover-kziEht4W.mjs +527 -0
- package/dist/discover-kziEht4W.mjs.map +1 -0
- package/dist/dns-DDDCfj75.mjs +926 -0
- package/dist/dns-DDDCfj75.mjs.map +1 -0
- package/dist/dns-DnE_02tB.cjs +1057 -0
- package/dist/dns-DnE_02tB.cjs.map +1 -0
- package/dist/dokploy-BrfdeVEu.cjs +38 -0
- package/dist/dokploy-BrfdeVEu.cjs.map +1 -0
- package/dist/dokploy-DBlGSdnb.mjs +38 -0
- package/dist/dokploy-DBlGSdnb.mjs.map +1 -0
- package/dist/drivers-BLU1fNs_.cjs +200 -0
- package/dist/drivers-BLU1fNs_.cjs.map +1 -0
- package/dist/drivers-C08LL4E8.mjs +177 -0
- package/dist/drivers-C08LL4E8.mjs.map +1 -0
- package/dist/{emit-CiZS_5Ub.mjs → emit-C1e8qD08.mjs} +13 -26
- package/dist/emit-C1e8qD08.mjs.map +1 -0
- package/dist/{emit-CbcRolsa.cjs → emit-Dmc1nvdS.cjs} +31 -57
- package/dist/emit-Dmc1nvdS.cjs.map +1 -0
- package/dist/encryption-CeW3xpE1.cjs +90 -0
- package/dist/encryption-CeW3xpE1.cjs.map +1 -0
- package/dist/encryption-DC8zsh2s.mjs +89 -0
- package/dist/encryption-DC8zsh2s.mjs.map +1 -0
- package/dist/engine-BXxvcxVq.cjs +3195 -0
- package/dist/engine-BXxvcxVq.cjs.map +1 -0
- package/dist/engine-z0UClzE9.mjs +3082 -0
- package/dist/engine-z0UClzE9.mjs.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-DJgO5z37.mjs +829 -0
- package/dist/github-DJgO5z37.mjs.map +1 -0
- package/dist/github-DWoFgxtl.cjs +829 -0
- package/dist/github-DWoFgxtl.cjs.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-C6e-ULLx.d.mts → index-8OfpOtSI.d.cts} +39 -24
- package/dist/index-8OfpOtSI.d.cts.map +1 -0
- package/dist/{index-CR5urhWX.d.cts → index-Dpji6Bxq.d.mts} +39 -24
- package/dist/index-Dpji6Bxq.d.mts.map +1 -0
- package/dist/index.cjs +10022 -12718
- 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 +10648 -13356
- 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-B1OjPwUY.cjs +181 -0
- package/dist/migrate-B1OjPwUY.cjs.map +1 -0
- package/dist/migrate-CWSCkzu3.cjs +271 -0
- package/dist/migrate-CWSCkzu3.cjs.map +1 -0
- package/dist/migrate-DIVxoju6.mjs +266 -0
- package/dist/migrate-DIVxoju6.mjs.map +1 -0
- package/dist/migrate-DoI2hWNH.mjs +181 -0
- package/dist/migrate-DoI2hWNH.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/ready-BtxiI7Qb.cjs +403 -0
- package/dist/ready-BtxiI7Qb.cjs.map +1 -0
- package/dist/ready-CzHNHhI6.mjs +374 -0
- package/dist/ready-CzHNHhI6.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-CFs8C_1a.mjs → reconcile--I7V4Klj.mjs} +4 -7
- package/dist/reconcile--I7V4Klj.mjs.map +1 -0
- package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
- package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
- package/dist/resolve-WAwYMN6q.cjs +316 -0
- package/dist/resolve-WAwYMN6q.cjs.map +1 -0
- package/dist/resolve-pmXIdi9j.mjs +263 -0
- package/dist/resolve-pmXIdi9j.mjs.map +1 -0
- package/dist/rollback-CLtwbByg.mjs +136 -0
- package/dist/rollback-CLtwbByg.mjs.map +1 -0
- package/dist/rollback-Cz8F9xSB.cjs +165 -0
- package/dist/rollback-Cz8F9xSB.cjs.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 +47 -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 +48 -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-C6VJQVtG.cjs → schemas-BCwKKA42.mjs} +958 -1842
- package/dist/schemas-BCwKKA42.mjs.map +1 -0
- package/dist/{workspace-zoqRbihZ.mjs → schemas-BQ_v0lEX.cjs} +1048 -1658
- 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-BHKUAExH.mjs +8148 -0
- package/dist/seeds-BHKUAExH.mjs.map +1 -0
- package/dist/seeds-Dk4WHhjU.cjs +9115 -0
- package/dist/seeds-Dk4WHhjU.cjs.map +1 -0
- package/dist/sniffer-BjBZ01PE.cjs +1998 -0
- package/dist/sniffer-BjBZ01PE.cjs.map +1 -0
- package/dist/sniffer-CaXl51vO.mjs +1825 -0
- package/dist/sniffer-CaXl51vO.mjs.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/stages-DJrOYLZ-.mjs +176 -0
- package/dist/stages-DJrOYLZ-.mjs.map +1 -0
- package/dist/stages-_3RVNG83.cjs +176 -0
- package/dist/stages-_3RVNG83.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-Bs_lNQhL.mjs +85 -0
- package/dist/terminal-Bs_lNQhL.mjs.map +1 -0
- package/dist/terminal-CsQz4oT0.cjs +85 -0
- package/dist/terminal-CsQz4oT0.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-BLo7zv7S.cjs +0 -3
- package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
- package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
- package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
- package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
- package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
- package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
- package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
- package/dist/LocalStateProvider-Bn6tS-oL.mjs +0 -42
- package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
- package/dist/LocalStateProvider-Db9SEjyH.cjs +0 -43
- package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
- package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
- package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
- package/dist/SSMStateProvider-BRt2py-A.mjs +0 -66
- package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
- package/dist/SSMStateProvider-DyX8s9HI.cjs +0 -66
- package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
- package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
- package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
- package/dist/bundler-BY1OmV1e.cjs.map +0 -1
- package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
- package/dist/chunk-Duj1WY3L.mjs +0 -7
- package/dist/config-BZ1F0WuA.cjs +0 -462
- package/dist/config-BZ1F0WuA.cjs.map +0 -1
- package/dist/config-DVVph9yz.mjs +0 -402
- package/dist/config-DVVph9yz.mjs.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-Xamqe_NJ.cjs +0 -2681
- package/dist/credentials-Xamqe_NJ.cjs.map +0 -1
- package/dist/credentials-dP8vRVRv.mjs +0 -2549
- package/dist/credentials-dP8vRVRv.mjs.map +0 -1
- package/dist/discover-CAlFgYec.mjs +0 -229
- package/dist/discover-CAlFgYec.mjs.map +0 -1
- package/dist/discover-DTmFeloL.cjs +0 -271
- package/dist/discover-DTmFeloL.cjs.map +0 -1
- package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
- package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
- package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
- package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
- package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
- package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
- package/dist/emit-CbcRolsa.cjs.map +0 -1
- package/dist/emit-CiZS_5Ub.mjs.map +0 -1
- package/dist/encryption-C6jaU0hE.cjs +0 -54
- package/dist/encryption-C6jaU0hE.cjs.map +0 -1
- package/dist/encryption-CHzzeR8a.cjs +0 -4
- package/dist/encryption-CQUncu7v.mjs +0 -3
- package/dist/encryption-D-abyhZx.mjs +0 -42
- package/dist/encryption-D-abyhZx.mjs.map +0 -1
- package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
- package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
- package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
- package/dist/fullstack-secrets-D1o9-G5l.mjs.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/index-C6e-ULLx.d.mts.map +0 -1
- package/dist/index-CR5urhWX.d.cts.map +0 -1
- package/dist/openapi-SjsgARie.cjs +0 -2075
- package/dist/openapi-SjsgARie.cjs.map +0 -1
- package/dist/openapi-Xx0A7Wg0.mjs +0 -2021
- package/dist/openapi-Xx0A7Wg0.mjs.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-CFs8C_1a.mjs.map +0 -1
- package/dist/reconcile-D0pimNiy.cjs.map +0 -1
- package/dist/setup-BA8ciTPU.mjs +0 -11
- package/dist/setup-BsZvZP6f.cjs +0 -11
- package/dist/setup-C8KOx8_8.mjs +0 -443
- package/dist/setup-C8KOx8_8.mjs.map +0 -1
- package/dist/setup-hC6hI86f.cjs +0 -473
- package/dist/setup-hC6hI86f.cjs.map +0 -1
- package/dist/storage-BJmzYxt8.cjs +0 -363
- package/dist/storage-BJmzYxt8.cjs.map +0 -1
- package/dist/storage-BM9hGpgv.cjs +0 -7
- package/dist/storage-Bi24WfoW.mjs +0 -297
- package/dist/storage-Bi24WfoW.mjs.map +0 -1
- package/dist/storage-CYlGwWTj.mjs +0 -3
- package/dist/sync-CmEuNZsB.mjs +0 -76
- package/dist/sync-CmEuNZsB.mjs.map +0 -1
- package/dist/sync-D306yOWu.cjs +0 -4
- package/dist/sync-SizaChmC.cjs +0 -93
- package/dist/sync-SizaChmC.cjs.map +0 -1
- package/dist/sync-hOqAWHR6.mjs +0 -3
- package/dist/types-6pkp2RRj.d.mts +0 -2220
- package/dist/types-6pkp2RRj.d.mts.map +0 -1
- package/dist/types-Y3fKQSAK.d.cts +0 -2220
- package/dist/types-Y3fKQSAK.d.cts.map +0 -1
- package/dist/workspace-BzrG_2SI.mjs +0 -8
- package/dist/workspace-C6VJQVtG.cjs.map +0 -1
- package/dist/workspace-XXtNhqJl.cjs +0 -9
- package/dist/workspace-zoqRbihZ.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { r as discover } from "../discover-kziEht4W.mjs";
|
|
2
|
+
import { t as SECRETS_DIR_ENV } from "../sandbox-CbVB7uOD.mjs";
|
|
3
|
+
import { a as registerAdjacentTsconfig, n as answer, r as errorData } from "../workerRuntime-CsOyBRx2.mjs";
|
|
4
|
+
import { a as liveCredentials, r as inspectLive } from "../credentialSchemas-DvitraL-.mjs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { readFile, readdir } from "node:fs/promises";
|
|
7
|
+
//#region src/sandbox/credentials-worker.ts
|
|
8
|
+
/**
|
|
9
|
+
* Loads a project's constructs in a sandbox and answers with what their
|
|
10
|
+
* credentials schemas say, as data: each schema as JSON Schema, and whether
|
|
11
|
+
* each value it was handed passes.
|
|
12
|
+
*
|
|
13
|
+
* Usage (by `inspectCredentials` under a sandbox, never by hand):
|
|
14
|
+
* node --import=<tsx> credentials-worker.ts '{"patterns":[…],"cwd":"…"}'
|
|
15
|
+
*
|
|
16
|
+
* The schemas are the project's code, which is why they run here. Each value
|
|
17
|
+
* arrives as a file in `GKM_SECRETS_DIR` named by its key, is read into this
|
|
18
|
+
* process's memory only, and never comes back: an answer carries issue paths
|
|
19
|
+
* and messages, not values.
|
|
20
|
+
*/
|
|
21
|
+
/** Every secret file the sandbox mounted, by name. */
|
|
22
|
+
async function mountedSecrets() {
|
|
23
|
+
const dir = process.env[SECRETS_DIR_ENV];
|
|
24
|
+
if (!dir) return {};
|
|
25
|
+
const secrets = {};
|
|
26
|
+
for (const name of await readdir(dir)) secrets[name] = (await readFile(join(dir, name), "utf8")).trim();
|
|
27
|
+
return secrets;
|
|
28
|
+
}
|
|
29
|
+
async function main() {
|
|
30
|
+
try {
|
|
31
|
+
const request = JSON.parse(process.argv[2] ?? "{}");
|
|
32
|
+
await registerAdjacentTsconfig();
|
|
33
|
+
const sources = {};
|
|
34
|
+
const manifest = await discover({
|
|
35
|
+
patterns: request.patterns,
|
|
36
|
+
cwd: request.cwd,
|
|
37
|
+
sources
|
|
38
|
+
});
|
|
39
|
+
const inspection = await inspectLive(liveCredentials(manifest, sources), await mountedSecrets());
|
|
40
|
+
answer({
|
|
41
|
+
reason: "inspected",
|
|
42
|
+
...inspection
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
answer({
|
|
46
|
+
reason: "failed",
|
|
47
|
+
error: errorData(error)
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
main();
|
|
52
|
+
//#endregion
|
|
53
|
+
export {};
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=credentials-worker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials-worker.mjs","names":[],"sources":["../../src/sandbox/credentials-worker.ts"],"sourcesContent":["/**\n * Loads a project's constructs in a sandbox and answers with what their\n * credentials schemas say, as data: each schema as JSON Schema, and whether\n * each value it was handed passes.\n *\n * Usage (by `inspectCredentials` under a sandbox, never by hand):\n * node --import=<tsx> credentials-worker.ts '{\"patterns\":[…],\"cwd\":\"…\"}'\n *\n * The schemas are the project's code, which is why they run here. Each value\n * arrives as a file in `GKM_SECRETS_DIR` named by its key, is read into this\n * process's memory only, and never comes back: an answer carries issue paths\n * and messages, not values.\n */\n\nimport { readdir, readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { type ConstructSource, discover } from '../reconcile/discover';\nimport { inspectLive, liveCredentials } from '../secrets/credentialSchemas';\nimport { SECRETS_DIR_ENV } from './sandbox';\nimport { answer, errorData, registerAdjacentTsconfig } from './workerRuntime';\n\n/** Every secret file the sandbox mounted, by name. */\nasync function mountedSecrets(): Promise<Record<string, string>> {\n\tconst dir = process.env[SECRETS_DIR_ENV];\n\tif (!dir) return {};\n\n\tconst secrets: Record<string, string> = {};\n\tfor (const name of await readdir(dir)) {\n\t\tsecrets[name] = (await readFile(join(dir, name), 'utf8')).trim();\n\t}\n\treturn secrets;\n}\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\tpatterns: string[];\n\t\t\tcwd: string;\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\tconst sources: Record<string, ConstructSource> = {};\n\t\tconst manifest = await discover({\n\t\t\tpatterns: request.patterns,\n\t\t\tcwd: request.cwd,\n\t\t\tsources,\n\t\t});\n\n\t\tconst inspection = await inspectLive(\n\t\t\tliveCredentials(manifest, sources),\n\t\t\tawait mountedSecrets(),\n\t\t);\n\t\tanswer({ reason: 'inspected', ...inspection });\n\t} catch (error) {\n\t\tanswer({ reason: 'failed', error: errorData(error) });\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,eAAe,iBAAkD;CAChE,MAAM,MAAM,QAAQ,IAAI;CACxB,IAAI,CAAC,KAAK,OAAO,CAAC;CAElB,MAAM,UAAkC,CAAC;CACzC,KAAK,MAAM,QAAQ,MAAM,QAAQ,GAAG,GACnC,QAAQ,SAAS,MAAM,SAAS,KAAK,KAAK,IAAI,GAAG,MAAM,EAAA,CAAG,KAAK;CAEhE,OAAO;AACR;AAEA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAIlD,MAAM,yBAAyB;EAE/B,MAAM,UAA2C,CAAC;EAClD,MAAM,WAAW,MAAM,SAAS;GAC/B,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;EACD,CAAC;EAED,MAAM,aAAa,MAAM,YACxB,gBAAgB,UAAU,OAAO,GACjC,MAAM,eAAe,CACtB;EACA,OAAO;GAAE,QAAQ;GAAa,GAAG;EAAW,CAAC;CAC9C,SAAS,OAAO;EACf,OAAO;GAAE,QAAQ;GAAU,OAAO,UAAU,KAAK;EAAE,CAAC;CACrD;AACD;AAEK,KAAK"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const require_discover = require("../discover-BfhVW_kT.cjs");
|
|
2
|
+
const require_workerRuntime = require("../workerRuntime-BXfhbe13.cjs");
|
|
3
|
+
//#region src/sandbox/discover-worker.ts
|
|
4
|
+
/**
|
|
5
|
+
* Discovers a project's constructs in a sandbox and answers with the
|
|
6
|
+
* manifest as data.
|
|
7
|
+
*
|
|
8
|
+
* Usage (by `discover` under a sandbox, never by hand):
|
|
9
|
+
* node --import=<tsx> discover-worker.ts '{"patterns":[…],"cwd":"…"}'
|
|
10
|
+
*
|
|
11
|
+
* Discovery imports every construct module — the project's code — which is
|
|
12
|
+
* why it runs here rather than in the deploy. Its warnings go to stderr, where
|
|
13
|
+
* the host passes them on.
|
|
14
|
+
*/
|
|
15
|
+
async function main() {
|
|
16
|
+
try {
|
|
17
|
+
const request = JSON.parse(process.argv[2] ?? "{}");
|
|
18
|
+
await require_workerRuntime.registerAdjacentTsconfig();
|
|
19
|
+
const runnables = {};
|
|
20
|
+
const background = {};
|
|
21
|
+
const manifest = await require_discover.discover({
|
|
22
|
+
patterns: request.patterns,
|
|
23
|
+
cwd: request.cwd,
|
|
24
|
+
runnables,
|
|
25
|
+
background
|
|
26
|
+
});
|
|
27
|
+
const paths = require_workerRuntime.liveValuePaths(manifest);
|
|
28
|
+
require_workerRuntime.answer(paths.length > 0 ? {
|
|
29
|
+
reason: "live",
|
|
30
|
+
paths
|
|
31
|
+
} : {
|
|
32
|
+
reason: "discovered",
|
|
33
|
+
manifest,
|
|
34
|
+
runnables,
|
|
35
|
+
background
|
|
36
|
+
});
|
|
37
|
+
} catch (error) {
|
|
38
|
+
require_workerRuntime.answer({
|
|
39
|
+
reason: "failed",
|
|
40
|
+
error: require_workerRuntime.errorData(error)
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
main();
|
|
45
|
+
//#endregion
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=discover-worker.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover-worker.cjs","names":["registerAdjacentTsconfig","discover","liveValuePaths","errorData"],"sources":["../../src/sandbox/discover-worker.ts"],"sourcesContent":["/**\n * Discovers a project's constructs in a sandbox and answers with the\n * manifest as data.\n *\n * Usage (by `discover` under a sandbox, never by hand):\n * node --import=<tsx> discover-worker.ts '{\"patterns\":[…],\"cwd\":\"…\"}'\n *\n * Discovery imports every construct module — the project's code — which is\n * why it runs here rather than in the deploy. Its warnings go to stderr, where\n * the host passes them on.\n */\n\nimport { discover } from '../reconcile/discover';\nimport {\n\tanswer,\n\terrorData,\n\tliveValuePaths,\n\tregisterAdjacentTsconfig,\n} from './workerRuntime';\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\tpatterns: string[];\n\t\t\tcwd: string;\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\tconst runnables: Record<string, string[]> = {};\n\t\tconst background: Record<string, string[]> = {};\n\t\tconst manifest = await discover({\n\t\t\tpatterns: request.patterns,\n\t\t\tcwd: request.cwd,\n\t\t\trunnables,\n\t\t\tbackground,\n\t\t});\n\n\t\tconst paths = liveValuePaths(manifest);\n\t\tanswer(\n\t\t\tpaths.length > 0\n\t\t\t\t? { reason: 'live', paths }\n\t\t\t\t: { reason: 'discovered', manifest, runnables, background },\n\t\t);\n\t} catch (error) {\n\t\tanswer({ reason: 'failed', error: errorData(error) });\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;AAoBA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAIlD,MAAMA,sBAAAA,yBAAyB;EAE/B,MAAM,YAAsC,CAAC;EAC7C,MAAM,aAAuC,CAAC;EAC9C,MAAM,WAAW,MAAMC,iBAAAA,SAAS;GAC/B,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;GACA;EACD,CAAC;EAED,MAAM,QAAQC,sBAAAA,eAAe,QAAQ;EACrC,sBAAA,OACC,MAAM,SAAS,IACZ;GAAE,QAAQ;GAAQ;EAAM,IACxB;GAAE,QAAQ;GAAc;GAAU;GAAW;EAAW,CAC5D;CACD,SAAS,OAAO;EACf,sBAAA,OAAO;GAAE,QAAQ;GAAU,OAAOC,sBAAAA,UAAU,KAAK;EAAE,CAAC;CACrD;AACD;AAEK,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { r as discover } from "../discover-kziEht4W.mjs";
|
|
2
|
+
import { a as registerAdjacentTsconfig, i as liveValuePaths, n as answer, r as errorData } from "../workerRuntime-CsOyBRx2.mjs";
|
|
3
|
+
//#region src/sandbox/discover-worker.ts
|
|
4
|
+
/**
|
|
5
|
+
* Discovers a project's constructs in a sandbox and answers with the
|
|
6
|
+
* manifest as data.
|
|
7
|
+
*
|
|
8
|
+
* Usage (by `discover` under a sandbox, never by hand):
|
|
9
|
+
* node --import=<tsx> discover-worker.ts '{"patterns":[…],"cwd":"…"}'
|
|
10
|
+
*
|
|
11
|
+
* Discovery imports every construct module — the project's code — which is
|
|
12
|
+
* why it runs here rather than in the deploy. Its warnings go to stderr, where
|
|
13
|
+
* the host passes them on.
|
|
14
|
+
*/
|
|
15
|
+
async function main() {
|
|
16
|
+
try {
|
|
17
|
+
const request = JSON.parse(process.argv[2] ?? "{}");
|
|
18
|
+
await registerAdjacentTsconfig();
|
|
19
|
+
const runnables = {};
|
|
20
|
+
const background = {};
|
|
21
|
+
const manifest = await discover({
|
|
22
|
+
patterns: request.patterns,
|
|
23
|
+
cwd: request.cwd,
|
|
24
|
+
runnables,
|
|
25
|
+
background
|
|
26
|
+
});
|
|
27
|
+
const paths = liveValuePaths(manifest);
|
|
28
|
+
answer(paths.length > 0 ? {
|
|
29
|
+
reason: "live",
|
|
30
|
+
paths
|
|
31
|
+
} : {
|
|
32
|
+
reason: "discovered",
|
|
33
|
+
manifest,
|
|
34
|
+
runnables,
|
|
35
|
+
background
|
|
36
|
+
});
|
|
37
|
+
} catch (error) {
|
|
38
|
+
answer({
|
|
39
|
+
reason: "failed",
|
|
40
|
+
error: errorData(error)
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
main();
|
|
45
|
+
//#endregion
|
|
46
|
+
export {};
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=discover-worker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover-worker.mjs","names":[],"sources":["../../src/sandbox/discover-worker.ts"],"sourcesContent":["/**\n * Discovers a project's constructs in a sandbox and answers with the\n * manifest as data.\n *\n * Usage (by `discover` under a sandbox, never by hand):\n * node --import=<tsx> discover-worker.ts '{\"patterns\":[…],\"cwd\":\"…\"}'\n *\n * Discovery imports every construct module — the project's code — which is\n * why it runs here rather than in the deploy. Its warnings go to stderr, where\n * the host passes them on.\n */\n\nimport { discover } from '../reconcile/discover';\nimport {\n\tanswer,\n\terrorData,\n\tliveValuePaths,\n\tregisterAdjacentTsconfig,\n} from './workerRuntime';\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\tpatterns: string[];\n\t\t\tcwd: string;\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\tconst runnables: Record<string, string[]> = {};\n\t\tconst background: Record<string, string[]> = {};\n\t\tconst manifest = await discover({\n\t\t\tpatterns: request.patterns,\n\t\t\tcwd: request.cwd,\n\t\t\trunnables,\n\t\t\tbackground,\n\t\t});\n\n\t\tconst paths = liveValuePaths(manifest);\n\t\tanswer(\n\t\t\tpaths.length > 0\n\t\t\t\t? { reason: 'live', paths }\n\t\t\t\t: { reason: 'discovered', manifest, runnables, background },\n\t\t);\n\t} catch (error) {\n\t\tanswer({ reason: 'failed', error: errorData(error) });\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;AAoBA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAIlD,MAAM,yBAAyB;EAE/B,MAAM,YAAsC,CAAC;EAC7C,MAAM,aAAuC,CAAC;EAC9C,MAAM,WAAW,MAAM,SAAS;GAC/B,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;GACA;EACD,CAAC;EAED,MAAM,QAAQ,eAAe,QAAQ;EACrC,OACC,MAAM,SAAS,IACZ;GAAE,QAAQ;GAAQ;EAAM,IACxB;GAAE,QAAQ;GAAc;GAAU;GAAW;EAAW,CAC5D;CACD,SAAS,OAAO;EACf,OAAO;GAAE,QAAQ;GAAU,OAAO,UAAU,KAAK;EAAE,CAAC;CACrD;AACD;AAEK,KAAK"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const require_discover = require("../discover-BfhVW_kT.cjs");
|
|
2
|
+
const require_sandbox = require("../sandbox-CHv3OYXg.cjs");
|
|
3
|
+
const require_workerRuntime = require("../workerRuntime-BXfhbe13.cjs");
|
|
4
|
+
const require_databases = require("../databases-DGALFDG3.cjs");
|
|
5
|
+
let node_path = require("node:path");
|
|
6
|
+
let node_fs_promises = require("node:fs/promises");
|
|
7
|
+
//#region src/sandbox/migrate-worker.ts
|
|
8
|
+
/**
|
|
9
|
+
* Applies a deployed stage's migrations, then runs its seeds, in a sandbox —
|
|
10
|
+
* what `gkm seed` runs, against URLs the deploy hands it as secret files.
|
|
11
|
+
*
|
|
12
|
+
* Usage (by the Dokploy target's release, never by hand):
|
|
13
|
+
* node --import=<tsx> migrate-worker.ts '{"root":"…","stage":"…","manifest":{…},"patterns":[…]}'
|
|
14
|
+
*
|
|
15
|
+
* Migrations and seeds are the project's own code, which is why they run
|
|
16
|
+
* here rather than in the deploy. Each owner URL arrives as a file in `GKM_SECRETS_DIR`,
|
|
17
|
+
* named by its key, and is read into this process's memory only: never into
|
|
18
|
+
* `process.env`, where a child the migration starts would inherit it.
|
|
19
|
+
*/
|
|
20
|
+
/** Every secret file the sandbox mounted, by name. */
|
|
21
|
+
async function mountedSecrets() {
|
|
22
|
+
const dir = process.env[require_sandbox.SECRETS_DIR_ENV];
|
|
23
|
+
if (!dir) return {};
|
|
24
|
+
const secrets = {};
|
|
25
|
+
for (const name of await (0, node_fs_promises.readdir)(dir)) secrets[name] = (await (0, node_fs_promises.readFile)((0, node_path.join)(dir, name), "utf8")).trim();
|
|
26
|
+
return secrets;
|
|
27
|
+
}
|
|
28
|
+
async function main() {
|
|
29
|
+
try {
|
|
30
|
+
const request = JSON.parse(process.argv[2] ?? "{}");
|
|
31
|
+
await require_workerRuntime.registerAdjacentTsconfig();
|
|
32
|
+
const sources = {};
|
|
33
|
+
if (request.patterns.length > 0) await require_discover.discover({
|
|
34
|
+
patterns: request.patterns,
|
|
35
|
+
cwd: request.root,
|
|
36
|
+
sources
|
|
37
|
+
});
|
|
38
|
+
const options = {
|
|
39
|
+
root: request.root,
|
|
40
|
+
manifest: request.manifest,
|
|
41
|
+
sources,
|
|
42
|
+
env: await mountedSecrets()
|
|
43
|
+
};
|
|
44
|
+
const runs = await require_databases.migrateDatabases(options);
|
|
45
|
+
const seeds = await require_databases.seedDatabases({
|
|
46
|
+
...options,
|
|
47
|
+
stage: request.stage
|
|
48
|
+
});
|
|
49
|
+
require_workerRuntime.answer({
|
|
50
|
+
reason: "migrated",
|
|
51
|
+
runs: runs.map(({ target, applied }) => ({
|
|
52
|
+
construct: target.id,
|
|
53
|
+
migrations: target.migrations,
|
|
54
|
+
applied
|
|
55
|
+
})),
|
|
56
|
+
seeds: seeds.map(({ target, seeded }) => ({
|
|
57
|
+
construct: target.id,
|
|
58
|
+
seeds: target.seeds,
|
|
59
|
+
seeded
|
|
60
|
+
}))
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
require_workerRuntime.answer({
|
|
64
|
+
reason: "failed",
|
|
65
|
+
error: {
|
|
66
|
+
...require_workerRuntime.errorData(error),
|
|
67
|
+
...error instanceof require_databases.SeedFailed ? { cause: require_workerRuntime.errorData(error.cause) } : {}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
main();
|
|
73
|
+
//#endregion
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=migrate-worker.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-worker.cjs","names":["SECRETS_DIR_ENV","readdir","readFile","join","registerAdjacentTsconfig","discover","migrateDatabases","seedDatabases","errorData","SeedFailed"],"sources":["../../src/sandbox/migrate-worker.ts"],"sourcesContent":["/**\n * Applies a deployed stage's migrations, then runs its seeds, in a sandbox —\n * what `gkm seed` runs, against URLs the deploy hands it as secret files.\n *\n * Usage (by the Dokploy target's release, never by hand):\n * node --import=<tsx> migrate-worker.ts '{\"root\":\"…\",\"stage\":\"…\",\"manifest\":{…},\"patterns\":[…]}'\n *\n * Migrations and seeds are the project's own code, which is why they run\n * here rather than in the deploy. Each owner URL arrives as a file in `GKM_SECRETS_DIR`,\n * named by its key, and is read into this process's memory only: never into\n * `process.env`, where a child the migration starts would inherit it.\n */\n\nimport { readdir, readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport type { ConstructManifest } from '@geekmidas/manifest';\nimport {\n\tmigrateDatabases,\n\tSeedFailed,\n\tseedDatabases,\n} from '../migrate/databases';\nimport { type ConstructSource, discover } from '../reconcile/discover';\nimport { SECRETS_DIR_ENV } from './sandbox';\nimport { answer, errorData, registerAdjacentTsconfig } from './workerRuntime';\n\n/** Every secret file the sandbox mounted, by name. */\nasync function mountedSecrets(): Promise<Record<string, string>> {\n\tconst dir = process.env[SECRETS_DIR_ENV];\n\tif (!dir) return {};\n\n\tconst secrets: Record<string, string> = {};\n\tfor (const name of await readdir(dir)) {\n\t\tsecrets[name] = (await readFile(join(dir, name), 'utf8')).trim();\n\t}\n\treturn secrets;\n}\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\troot: string;\n\t\t\tstage: string;\n\t\t\tmanifest: ConstructManifest;\n\t\t\tpatterns: string[];\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\t// Where each construct is declared, so a migration runs with the Kysely\n\t\t// its own file resolves. The manifest itself is the deploy's: what it\n\t\t// provisioned is what gets migrated, not a second reading of the files.\n\t\tconst sources: Record<string, ConstructSource> = {};\n\t\tif (request.patterns.length > 0) {\n\t\t\tawait discover({\n\t\t\t\tpatterns: request.patterns,\n\t\t\t\tcwd: request.root,\n\t\t\t\tsources,\n\t\t\t});\n\t\t}\n\n\t\tconst options = {\n\t\t\troot: request.root,\n\t\t\tmanifest: request.manifest,\n\t\t\tsources,\n\t\t\tenv: await mountedSecrets(),\n\t\t};\n\t\tconst runs = await migrateDatabases(options);\n\t\t// Every seed, every time, after the schema it was written for.\n\t\tconst seeds = await seedDatabases({ ...options, stage: request.stage });\n\n\t\tanswer({\n\t\t\treason: 'migrated',\n\t\t\truns: runs.map(({ target, applied }) => ({\n\t\t\t\tconstruct: target.id,\n\t\t\t\tmigrations: target.migrations,\n\t\t\t\tapplied,\n\t\t\t})),\n\t\t\tseeds: seeds.map(({ target, seeded }) => ({\n\t\t\t\tconstruct: target.id,\n\t\t\t\tseeds: target.seeds,\n\t\t\t\tseeded,\n\t\t\t})),\n\t\t});\n\t} catch (error) {\n\t\t// A seed's cause is the database's error — an Error, which `errorData`\n\t\t// leaves out — and it is what says what to fix.\n\t\tanswer({\n\t\t\treason: 'failed',\n\t\t\terror: {\n\t\t\t\t...errorData(error),\n\t\t\t\t...(error instanceof SeedFailed\n\t\t\t\t\t? { cause: errorData(error.cause) }\n\t\t\t\t\t: {}),\n\t\t\t},\n\t\t});\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,eAAe,iBAAkD;CAChE,MAAM,MAAM,QAAQ,IAAIA,gBAAAA;CACxB,IAAI,CAAC,KAAK,OAAO,CAAC;CAElB,MAAM,UAAkC,CAAC;CACzC,KAAK,MAAM,QAAQ,OAAA,GAAMC,iBAAAA,QAAAA,CAAQ,GAAG,GACnC,QAAQ,SAAS,OAAA,GAAMC,iBAAAA,SAAAA,EAAAA,GAASC,UAAAA,KAAAA,CAAK,KAAK,IAAI,GAAG,MAAM,EAAA,CAAG,KAAK;CAEhE,OAAO;AACR;AAEA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAMlD,MAAMC,sBAAAA,yBAAyB;EAK/B,MAAM,UAA2C,CAAC;EAClD,IAAI,QAAQ,SAAS,SAAS,GAC7B,MAAMC,iBAAAA,SAAS;GACd,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;EACD,CAAC;EAGF,MAAM,UAAU;GACf,MAAM,QAAQ;GACd,UAAU,QAAQ;GAClB;GACA,KAAK,MAAM,eAAe;EAC3B;EACA,MAAM,OAAO,MAAMC,kBAAAA,iBAAiB,OAAO;EAE3C,MAAM,QAAQ,MAAMC,kBAAAA,cAAc;GAAE,GAAG;GAAS,OAAO,QAAQ;EAAM,CAAC;EAEtE,sBAAA,OAAO;GACN,QAAQ;GACR,MAAM,KAAK,KAAK,EAAE,QAAQ,eAAe;IACxC,WAAW,OAAO;IAClB,YAAY,OAAO;IACnB;GACD,EAAE;GACF,OAAO,MAAM,KAAK,EAAE,QAAQ,cAAc;IACzC,WAAW,OAAO;IAClB,OAAO,OAAO;IACd;GACD,EAAE;EACH,CAAC;CACF,SAAS,OAAO;EAGf,sBAAA,OAAO;GACN,QAAQ;GACR,OAAO;IACN,GAAGC,sBAAAA,UAAU,KAAK;IAClB,GAAI,iBAAiBC,kBAAAA,aAClB,EAAE,OAAOD,sBAAAA,UAAU,MAAM,KAAK,EAAE,IAChC,CAAC;GACL;EACD,CAAC;CACF;AACD;AAEK,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { r as discover } from "../discover-kziEht4W.mjs";
|
|
2
|
+
import { t as SECRETS_DIR_ENV } from "../sandbox-CbVB7uOD.mjs";
|
|
3
|
+
import { a as registerAdjacentTsconfig, n as answer, r as errorData } from "../workerRuntime-CsOyBRx2.mjs";
|
|
4
|
+
import { o as SeedFailed, p as seedDatabases, u as migrateDatabases } from "../databases-BeGP5eDh.mjs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { readFile, readdir } from "node:fs/promises";
|
|
7
|
+
//#region src/sandbox/migrate-worker.ts
|
|
8
|
+
/**
|
|
9
|
+
* Applies a deployed stage's migrations, then runs its seeds, in a sandbox —
|
|
10
|
+
* what `gkm seed` runs, against URLs the deploy hands it as secret files.
|
|
11
|
+
*
|
|
12
|
+
* Usage (by the Dokploy target's release, never by hand):
|
|
13
|
+
* node --import=<tsx> migrate-worker.ts '{"root":"…","stage":"…","manifest":{…},"patterns":[…]}'
|
|
14
|
+
*
|
|
15
|
+
* Migrations and seeds are the project's own code, which is why they run
|
|
16
|
+
* here rather than in the deploy. Each owner URL arrives as a file in `GKM_SECRETS_DIR`,
|
|
17
|
+
* named by its key, and is read into this process's memory only: never into
|
|
18
|
+
* `process.env`, where a child the migration starts would inherit it.
|
|
19
|
+
*/
|
|
20
|
+
/** Every secret file the sandbox mounted, by name. */
|
|
21
|
+
async function mountedSecrets() {
|
|
22
|
+
const dir = process.env[SECRETS_DIR_ENV];
|
|
23
|
+
if (!dir) return {};
|
|
24
|
+
const secrets = {};
|
|
25
|
+
for (const name of await readdir(dir)) secrets[name] = (await readFile(join(dir, name), "utf8")).trim();
|
|
26
|
+
return secrets;
|
|
27
|
+
}
|
|
28
|
+
async function main() {
|
|
29
|
+
try {
|
|
30
|
+
const request = JSON.parse(process.argv[2] ?? "{}");
|
|
31
|
+
await registerAdjacentTsconfig();
|
|
32
|
+
const sources = {};
|
|
33
|
+
if (request.patterns.length > 0) await discover({
|
|
34
|
+
patterns: request.patterns,
|
|
35
|
+
cwd: request.root,
|
|
36
|
+
sources
|
|
37
|
+
});
|
|
38
|
+
const options = {
|
|
39
|
+
root: request.root,
|
|
40
|
+
manifest: request.manifest,
|
|
41
|
+
sources,
|
|
42
|
+
env: await mountedSecrets()
|
|
43
|
+
};
|
|
44
|
+
const runs = await migrateDatabases(options);
|
|
45
|
+
const seeds = await seedDatabases({
|
|
46
|
+
...options,
|
|
47
|
+
stage: request.stage
|
|
48
|
+
});
|
|
49
|
+
answer({
|
|
50
|
+
reason: "migrated",
|
|
51
|
+
runs: runs.map(({ target, applied }) => ({
|
|
52
|
+
construct: target.id,
|
|
53
|
+
migrations: target.migrations,
|
|
54
|
+
applied
|
|
55
|
+
})),
|
|
56
|
+
seeds: seeds.map(({ target, seeded }) => ({
|
|
57
|
+
construct: target.id,
|
|
58
|
+
seeds: target.seeds,
|
|
59
|
+
seeded
|
|
60
|
+
}))
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
answer({
|
|
64
|
+
reason: "failed",
|
|
65
|
+
error: {
|
|
66
|
+
...errorData(error),
|
|
67
|
+
...error instanceof SeedFailed ? { cause: errorData(error.cause) } : {}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
main();
|
|
73
|
+
//#endregion
|
|
74
|
+
export {};
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=migrate-worker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-worker.mjs","names":[],"sources":["../../src/sandbox/migrate-worker.ts"],"sourcesContent":["/**\n * Applies a deployed stage's migrations, then runs its seeds, in a sandbox —\n * what `gkm seed` runs, against URLs the deploy hands it as secret files.\n *\n * Usage (by the Dokploy target's release, never by hand):\n * node --import=<tsx> migrate-worker.ts '{\"root\":\"…\",\"stage\":\"…\",\"manifest\":{…},\"patterns\":[…]}'\n *\n * Migrations and seeds are the project's own code, which is why they run\n * here rather than in the deploy. Each owner URL arrives as a file in `GKM_SECRETS_DIR`,\n * named by its key, and is read into this process's memory only: never into\n * `process.env`, where a child the migration starts would inherit it.\n */\n\nimport { readdir, readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport type { ConstructManifest } from '@geekmidas/manifest';\nimport {\n\tmigrateDatabases,\n\tSeedFailed,\n\tseedDatabases,\n} from '../migrate/databases';\nimport { type ConstructSource, discover } from '../reconcile/discover';\nimport { SECRETS_DIR_ENV } from './sandbox';\nimport { answer, errorData, registerAdjacentTsconfig } from './workerRuntime';\n\n/** Every secret file the sandbox mounted, by name. */\nasync function mountedSecrets(): Promise<Record<string, string>> {\n\tconst dir = process.env[SECRETS_DIR_ENV];\n\tif (!dir) return {};\n\n\tconst secrets: Record<string, string> = {};\n\tfor (const name of await readdir(dir)) {\n\t\tsecrets[name] = (await readFile(join(dir, name), 'utf8')).trim();\n\t}\n\treturn secrets;\n}\n\nasync function main(): Promise<void> {\n\ttry {\n\t\tconst request = JSON.parse(process.argv[2] ?? '{}') as {\n\t\t\troot: string;\n\t\t\tstage: string;\n\t\t\tmanifest: ConstructManifest;\n\t\t\tpatterns: string[];\n\t\t};\n\t\tawait registerAdjacentTsconfig();\n\n\t\t// Where each construct is declared, so a migration runs with the Kysely\n\t\t// its own file resolves. The manifest itself is the deploy's: what it\n\t\t// provisioned is what gets migrated, not a second reading of the files.\n\t\tconst sources: Record<string, ConstructSource> = {};\n\t\tif (request.patterns.length > 0) {\n\t\t\tawait discover({\n\t\t\t\tpatterns: request.patterns,\n\t\t\t\tcwd: request.root,\n\t\t\t\tsources,\n\t\t\t});\n\t\t}\n\n\t\tconst options = {\n\t\t\troot: request.root,\n\t\t\tmanifest: request.manifest,\n\t\t\tsources,\n\t\t\tenv: await mountedSecrets(),\n\t\t};\n\t\tconst runs = await migrateDatabases(options);\n\t\t// Every seed, every time, after the schema it was written for.\n\t\tconst seeds = await seedDatabases({ ...options, stage: request.stage });\n\n\t\tanswer({\n\t\t\treason: 'migrated',\n\t\t\truns: runs.map(({ target, applied }) => ({\n\t\t\t\tconstruct: target.id,\n\t\t\t\tmigrations: target.migrations,\n\t\t\t\tapplied,\n\t\t\t})),\n\t\t\tseeds: seeds.map(({ target, seeded }) => ({\n\t\t\t\tconstruct: target.id,\n\t\t\t\tseeds: target.seeds,\n\t\t\t\tseeded,\n\t\t\t})),\n\t\t});\n\t} catch (error) {\n\t\t// A seed's cause is the database's error — an Error, which `errorData`\n\t\t// leaves out — and it is what says what to fix.\n\t\tanswer({\n\t\t\treason: 'failed',\n\t\t\terror: {\n\t\t\t\t...errorData(error),\n\t\t\t\t...(error instanceof SeedFailed\n\t\t\t\t\t? { cause: errorData(error.cause) }\n\t\t\t\t\t: {}),\n\t\t\t},\n\t\t});\n\t}\n}\n\nvoid main();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,eAAe,iBAAkD;CAChE,MAAM,MAAM,QAAQ,IAAI;CACxB,IAAI,CAAC,KAAK,OAAO,CAAC;CAElB,MAAM,UAAkC,CAAC;CACzC,KAAK,MAAM,QAAQ,MAAM,QAAQ,GAAG,GACnC,QAAQ,SAAS,MAAM,SAAS,KAAK,KAAK,IAAI,GAAG,MAAM,EAAA,CAAG,KAAK;CAEhE,OAAO;AACR;AAEA,eAAe,OAAsB;CACpC,IAAI;EACH,MAAM,UAAU,KAAK,MAAM,QAAQ,KAAK,MAAM,IAAI;EAMlD,MAAM,yBAAyB;EAK/B,MAAM,UAA2C,CAAC;EAClD,IAAI,QAAQ,SAAS,SAAS,GAC7B,MAAM,SAAS;GACd,UAAU,QAAQ;GAClB,KAAK,QAAQ;GACb;EACD,CAAC;EAGF,MAAM,UAAU;GACf,MAAM,QAAQ;GACd,UAAU,QAAQ;GAClB;GACA,KAAK,MAAM,eAAe;EAC3B;EACA,MAAM,OAAO,MAAM,iBAAiB,OAAO;EAE3C,MAAM,QAAQ,MAAM,cAAc;GAAE,GAAG;GAAS,OAAO,QAAQ;EAAM,CAAC;EAEtE,OAAO;GACN,QAAQ;GACR,MAAM,KAAK,KAAK,EAAE,QAAQ,eAAe;IACxC,WAAW,OAAO;IAClB,YAAY,OAAO;IACnB;GACD,EAAE;GACF,OAAO,MAAM,KAAK,EAAE,QAAQ,cAAc;IACzC,WAAW,OAAO;IAClB,OAAO,OAAO;IACd;GACD,EAAE;EACH,CAAC;CACF,SAAS,OAAO;EAGf,OAAO;GACN,QAAQ;GACR,OAAO;IACN,GAAG,UAAU,KAAK;IAClB,GAAI,iBAAiB,aAClB,EAAE,OAAO,UAAU,MAAM,KAAK,EAAE,IAChC,CAAC;GACL;EACD,CAAC;CACF;AACD;AAEK,KAAK"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jt as GkmError } from "./types-HqVPddRK.mjs";
|
|
2
|
+
//#region src/sandbox/sandbox.d.ts
|
|
3
|
+
/** Where a command's output goes. */
|
|
4
|
+
type SandboxOutput = 'capture' | 'inherit' | 'stderr' | 'ignore';
|
|
5
|
+
interface SandboxExecOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Where the command runs: the project root or a directory below it, as an
|
|
8
|
+
* absolute path or relative to the root. Anywhere else is refused with
|
|
9
|
+
* {@link SandboxCwdEscape}.
|
|
10
|
+
*/
|
|
11
|
+
cwd: string;
|
|
12
|
+
/**
|
|
13
|
+
* The command's whole environment. Nothing of the host's is added to it:
|
|
14
|
+
* start from {@link Sandbox.env} and add what the step needs.
|
|
15
|
+
*/
|
|
16
|
+
env: Readonly<Record<string, string>>;
|
|
17
|
+
/**
|
|
18
|
+
* How long the command may run before it is killed. Required: a step that
|
|
19
|
+
* waits forever — a sniffed entry that opens a server, a build stuck on a
|
|
20
|
+
* prompt — would otherwise hold the deploy, and its lock, forever.
|
|
21
|
+
*/
|
|
22
|
+
timeoutMs: number;
|
|
23
|
+
/**
|
|
24
|
+
* Files the command can read, by name. Mounted in a directory of their own
|
|
25
|
+
* — named by `GKM_SECRETS_DIR` in the command's environment — and removed
|
|
26
|
+
* when it exits. Never set as variables, which every child inherits, a
|
|
27
|
+
* crash report prints and `/proc/<pid>/environ` shows.
|
|
28
|
+
*/
|
|
29
|
+
secrets?: Readonly<Record<string, string>>;
|
|
30
|
+
/**
|
|
31
|
+
* `capture` (the default) returns stdout and stderr in the result;
|
|
32
|
+
* `inherit` gives the command the host's terminal; `stderr` sends both
|
|
33
|
+
* streams to the host's stderr; `ignore` discards them.
|
|
34
|
+
*/
|
|
35
|
+
output?: SandboxOutput;
|
|
36
|
+
/** Kills the command when aborted; `exec` rejects with the signal's reason. */
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}
|
|
39
|
+
/** How a command ended. A non-zero exit is a result, not an error. */
|
|
40
|
+
interface SandboxResult {
|
|
41
|
+
exitCode: number | null;
|
|
42
|
+
signal: string | null;
|
|
43
|
+
/** What it wrote to stdout, when its output was captured. */
|
|
44
|
+
stdout: string;
|
|
45
|
+
/** What it wrote to stderr, when its output was captured. */
|
|
46
|
+
stderr: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Runs a command against the project, and nothing else of the host's.
|
|
50
|
+
*
|
|
51
|
+
* `exec` resolves with the result however the command exited. It rejects
|
|
52
|
+
* with {@link CommandTimedOut} once the timeout passes — after the command is
|
|
53
|
+
* gone — with {@link SandboxCwdEscape} for a directory outside the project,
|
|
54
|
+
* with the signal's reason when aborted, and with the spawn error when the
|
|
55
|
+
* program cannot be started.
|
|
56
|
+
*/
|
|
57
|
+
interface Sandbox {
|
|
58
|
+
/** The project: the directory every command runs at or below. */
|
|
59
|
+
readonly root: string;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the code it runs is kept from the host: its files, its
|
|
62
|
+
* processes, its memory.
|
|
63
|
+
*
|
|
64
|
+
* An isolating sandbox shares nothing but what crosses `exec`, so a config
|
|
65
|
+
* reaches the deploy as data — a live object in it (a custom state store,
|
|
66
|
+
* an inline target) cannot cross, and is refused with
|
|
67
|
+
* `ConfigObjectNotSerializable`. A non-isolating one, like
|
|
68
|
+
* {@link LocalSandbox}, runs on the host as the host's user; a project
|
|
69
|
+
* whose config holds live objects is then loaded in-process as before,
|
|
70
|
+
* because a project trusted to run there is trusted to do that.
|
|
71
|
+
*/
|
|
72
|
+
readonly isolating: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The environment a command starts from: what any program needs to run
|
|
75
|
+
* here — `PATH`, `HOME`, the locale — and no credential.
|
|
76
|
+
*/
|
|
77
|
+
readonly env: Readonly<Record<string, string>>;
|
|
78
|
+
exec(command: string, args: readonly string[], options: SandboxExecOptions): Promise<SandboxResult>;
|
|
79
|
+
}
|
|
80
|
+
/** The variable naming the directory a command's secrets are mounted in. */
|
|
81
|
+
declare const SECRETS_DIR_ENV = "GKM_SECRETS_DIR";
|
|
82
|
+
/** A command was asked to run outside the project. */
|
|
83
|
+
declare class SandboxCwdEscape extends GkmError {
|
|
84
|
+
readonly cwd: string;
|
|
85
|
+
readonly root: string;
|
|
86
|
+
constructor(cwd: string, root: string);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* `cwd` as an absolute directory inside `root`, or {@link SandboxCwdEscape}.
|
|
90
|
+
*
|
|
91
|
+
* Symlinks are resolved on both sides first, so a link inside the project
|
|
92
|
+
* that points out of it is an escape, and a project reached through a link
|
|
93
|
+
* (`/tmp` on macOS) is still itself. For a sandbox of a host's own to call
|
|
94
|
+
* before it runs anything.
|
|
95
|
+
*/
|
|
96
|
+
declare function confineCwd(root: string, cwd: string): string;
|
|
97
|
+
/** A secret's file name: one path segment, so it cannot be written elsewhere. */
|
|
98
|
+
declare class SecretNameInvalid extends GkmError {
|
|
99
|
+
readonly secretName: string;
|
|
100
|
+
constructor(secretName: string);
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
export { SandboxOutput as a, confineCwd as c, SandboxExecOptions as i, Sandbox as n, SandboxResult as o, SandboxCwdEscape as r, SecretNameInvalid as s, SECRETS_DIR_ENV as t };
|
|
104
|
+
//# sourceMappingURL=sandbox-C4g1eG31.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-C4g1eG31.d.mts","names":[],"sources":["../src/sandbox/sandbox.ts"],"mappings":";;;KA8BY;UAEK;;;;;;EAMhB;;;;;EAKA,KAAK,SAAS;;;;;;EAMd;;;;;;;EAOA,UAAU,SAAS;;;;;;EAMnB,SAAS;;EAET,SAAS;;;UAIO;EAChB;EACA;;EAEA;;EAEA;;;;;;;;;;;UAYgB;;WAEP;;;;;;;;;;;;;WAaA;;;;;WAKA,KAAK,SAAS;EACvB,KACC,iBACA,yBACA,SAAS,qBACP,QAAQ;;;cAIC;;cAGA,yBAAyB;WAE3B;WACA;EAFV,YACU,aACA;;;;;;;;;;iBAwBK,WAAW,cAAc;;cAU5B,0BAA0B;WACjB;EAArB,YAAqB"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
const require_errors = require("./errors-DMC4Umsb.cjs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
let node_fs = require("node:fs");
|
|
4
|
+
let node_async_hooks = require("node:async_hooks");
|
|
5
|
+
//#region src/sandbox/sandbox.ts
|
|
6
|
+
/**
|
|
7
|
+
* Where a deploy runs the project's own code.
|
|
8
|
+
*
|
|
9
|
+
* A deploy holds credentials — Dokploy's token, a registry login, an AWS key —
|
|
10
|
+
* and loading `gkm.config.ts`, sniffing an app's environment and building it
|
|
11
|
+
* all execute code from the repository being deployed. On a developer's own
|
|
12
|
+
* laptop that is the developer's code. On a CI job for a fork, or a shared
|
|
13
|
+
* build runner, it is not, and that code should not be able to read the
|
|
14
|
+
* credentials used to deploy it, hang the deploy, or reach outside the
|
|
15
|
+
* checkout.
|
|
16
|
+
*
|
|
17
|
+
* So every step that runs project code goes through a `Sandbox`: one call,
|
|
18
|
+
* with an argument array rather than a shell line, the complete environment
|
|
19
|
+
* the step needs rather than the host's, a timeout it cannot outlive, secrets
|
|
20
|
+
* as files rather than variables, and a working directory inside the project.
|
|
21
|
+
* The steps that need credentials — provisioning, pushing, releasing — are
|
|
22
|
+
* the deploy's own code and never run in one.
|
|
23
|
+
*
|
|
24
|
+
* `LocalSandbox` is the default: a child process on this machine with an
|
|
25
|
+
* allowlisted environment. A host that builds repositories it does not trust
|
|
26
|
+
* passes its own — a container per build, a VM — through `deploy()`'s
|
|
27
|
+
* `sandbox`.
|
|
28
|
+
*/
|
|
29
|
+
/** The variable naming the directory a command's secrets are mounted in. */
|
|
30
|
+
const SECRETS_DIR_ENV = "GKM_SECRETS_DIR";
|
|
31
|
+
/** A command was asked to run outside the project. */
|
|
32
|
+
var SandboxCwdEscape = class extends require_errors.GkmError {
|
|
33
|
+
cwd;
|
|
34
|
+
root;
|
|
35
|
+
constructor(cwd, root) {
|
|
36
|
+
super(`Refusing to run in '${cwd}': it is outside the project at '${root}'. A sandboxed step only runs inside the project it was given — check the app paths in gkm.config.ts for \`..\` or an absolute path.`);
|
|
37
|
+
this.cwd = cwd;
|
|
38
|
+
this.root = root;
|
|
39
|
+
this.name = "SandboxCwdEscape";
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/** A path with its symlinks resolved where it exists — `/tmp` is `/private/tmp`. */
|
|
43
|
+
function real(path) {
|
|
44
|
+
return (0, node_fs.existsSync)(path) ? (0, node_fs.realpathSync)(path) : path;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* `cwd` as an absolute directory inside `root`, or {@link SandboxCwdEscape}.
|
|
48
|
+
*
|
|
49
|
+
* Symlinks are resolved on both sides first, so a link inside the project
|
|
50
|
+
* that points out of it is an escape, and a project reached through a link
|
|
51
|
+
* (`/tmp` on macOS) is still itself. For a sandbox of a host's own to call
|
|
52
|
+
* before it runs anything.
|
|
53
|
+
*/
|
|
54
|
+
function confineCwd(root, cwd) {
|
|
55
|
+
const absolute = (0, node_path.resolve)(root, cwd);
|
|
56
|
+
const from = (0, node_path.relative)(real((0, node_path.resolve)(root)), real(absolute));
|
|
57
|
+
if (from === ".." || from.startsWith(`..${node_path.sep}`) || (0, node_path.isAbsolute)(from)) throw new SandboxCwdEscape(cwd, root);
|
|
58
|
+
return absolute;
|
|
59
|
+
}
|
|
60
|
+
/** A secret's file name: one path segment, so it cannot be written elsewhere. */
|
|
61
|
+
var SecretNameInvalid = class extends require_errors.GkmError {
|
|
62
|
+
secretName;
|
|
63
|
+
constructor(secretName) {
|
|
64
|
+
super(`'${secretName}' cannot be a secret's name: it becomes a file name in the secrets directory, so it must be one segment of letters, digits, '.', '-' or '_' and not start with '.'.`);
|
|
65
|
+
this.secretName = secretName;
|
|
66
|
+
this.name = "SecretNameInvalid";
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const SECRET_NAME = /^[A-Za-z0-9_-][A-Za-z0-9._-]*$/;
|
|
70
|
+
/** Every secret name, checked before anything is written. */
|
|
71
|
+
function assertSecretNames(secrets) {
|
|
72
|
+
for (const name of Object.keys(secrets ?? {})) if (!SECRET_NAME.test(name)) throw new SecretNameInvalid(name);
|
|
73
|
+
}
|
|
74
|
+
const active = new node_async_hooks.AsyncLocalStorage();
|
|
75
|
+
/**
|
|
76
|
+
* Run `fn` with `sandbox` as the one its steps use.
|
|
77
|
+
*
|
|
78
|
+
* Per run rather than global, as `withOutput` routes a run's lines: two
|
|
79
|
+
* deploys in one host process each build in their own sandbox. A step deep in
|
|
80
|
+
* the engine — discovering constructs, sniffing an app — asks
|
|
81
|
+
* {@link activeSandbox} rather than every function between `deploy()` and it
|
|
82
|
+
* taking one more parameter.
|
|
83
|
+
*/
|
|
84
|
+
function withSandbox(sandbox, fn) {
|
|
85
|
+
return active.run({
|
|
86
|
+
sandbox,
|
|
87
|
+
answers: /* @__PURE__ */ new Map()
|
|
88
|
+
}, fn);
|
|
89
|
+
}
|
|
90
|
+
/** The sandbox of the run this is part of, if it was started with one. */
|
|
91
|
+
function activeSandbox() {
|
|
92
|
+
return active.getStore()?.sandbox;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* `ask()`'s answer, asked once per run.
|
|
96
|
+
*
|
|
97
|
+
* A deploy loads its config and discovers its constructs from several places
|
|
98
|
+
* — the first load, the engine, the Dockerfile generator — and in a sandbox
|
|
99
|
+
* each was a child process of its own, for the same answer: the checkout does
|
|
100
|
+
* not change while it deploys. Within a run in `sandbox`, the first answer
|
|
101
|
+
* for `key` is the one every later ask gets. Outside one, or for another
|
|
102
|
+
* sandbox, `ask()` runs each time.
|
|
103
|
+
*/
|
|
104
|
+
function oncePerRun(sandbox, key, ask) {
|
|
105
|
+
const run = active.getStore();
|
|
106
|
+
if (!run || run.sandbox !== sandbox) return ask();
|
|
107
|
+
let answer = run.answers.get(key);
|
|
108
|
+
if (!answer) {
|
|
109
|
+
answer = ask();
|
|
110
|
+
run.answers.set(key, answer);
|
|
111
|
+
answer.catch(() => run.answers.delete(key));
|
|
112
|
+
}
|
|
113
|
+
return answer;
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
Object.defineProperty(exports, "SECRETS_DIR_ENV", {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function() {
|
|
119
|
+
return SECRETS_DIR_ENV;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(exports, "SandboxCwdEscape", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function() {
|
|
125
|
+
return SandboxCwdEscape;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
Object.defineProperty(exports, "SecretNameInvalid", {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: function() {
|
|
131
|
+
return SecretNameInvalid;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
Object.defineProperty(exports, "activeSandbox", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function() {
|
|
137
|
+
return activeSandbox;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
Object.defineProperty(exports, "assertSecretNames", {
|
|
141
|
+
enumerable: true,
|
|
142
|
+
get: function() {
|
|
143
|
+
return assertSecretNames;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(exports, "confineCwd", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function() {
|
|
149
|
+
return confineCwd;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
Object.defineProperty(exports, "oncePerRun", {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
get: function() {
|
|
155
|
+
return oncePerRun;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
Object.defineProperty(exports, "withSandbox", {
|
|
159
|
+
enumerable: true,
|
|
160
|
+
get: function() {
|
|
161
|
+
return withSandbox;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=sandbox-CHv3OYXg.cjs.map
|