@geekmidas/cli 10.0.0-alpha.141 → 10.0.0-alpha.143
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/dist/{EndpointGenerator-BMRL04ic.mjs → EndpointGenerator-CusLH-9S.mjs} +2 -2
- package/dist/{EndpointGenerator-BMRL04ic.mjs.map → EndpointGenerator-CusLH-9S.mjs.map} +1 -1
- package/dist/{EndpointGenerator-ePscnbwB.cjs → EndpointGenerator-DyLMYClE.cjs} +2 -2
- package/dist/{EndpointGenerator-ePscnbwB.cjs.map → EndpointGenerator-DyLMYClE.cjs.map} +1 -1
- package/dist/{GoDaddyProvider-DxFAueU4.mjs → GoDaddyProvider-BJddaEFo.mjs} +2 -3
- package/dist/{GoDaddyProvider-DxFAueU4.mjs.map → GoDaddyProvider-BJddaEFo.mjs.map} +1 -1
- package/dist/{GoDaddyProvider-hAc0q5s-.cjs → GoDaddyProvider-D-QrclQ0.cjs} +5 -6
- package/dist/{GoDaddyProvider-hAc0q5s-.cjs.map → GoDaddyProvider-D-QrclQ0.cjs.map} +1 -1
- package/dist/{HostingerProvider-DEqpvoiD.cjs → HostingerProvider-CUtGkwa8.cjs} +2 -2
- package/dist/{HostingerProvider-DEqpvoiD.cjs.map → HostingerProvider-CUtGkwa8.cjs.map} +1 -1
- package/dist/{HostingerProvider-CgMuKgO_.mjs → HostingerProvider-DilTLFtw.mjs} +2 -2
- package/dist/{HostingerProvider-CgMuKgO_.mjs.map → HostingerProvider-DilTLFtw.mjs.map} +1 -1
- package/dist/{LegacyStateStore-BPY8Acgs.mjs → LegacyStateStore-lZn6yeNb.mjs} +3 -3
- package/dist/{LegacyStateStore-BPY8Acgs.mjs.map → LegacyStateStore-lZn6yeNb.mjs.map} +1 -1
- package/dist/{LegacyStateStore-BqSVgWi1.cjs → LegacyStateStore-ohe95jlu.cjs} +3 -3
- package/dist/{LegacyStateStore-BqSVgWi1.cjs.map → LegacyStateStore-ohe95jlu.cjs.map} +1 -1
- package/dist/{LocalStateStore-Df4RyGi2.cjs → LocalStateStore-Bs2Yl8IB.cjs} +2 -2
- package/dist/{LocalStateStore-Df4RyGi2.cjs.map → LocalStateStore-Bs2Yl8IB.cjs.map} +1 -1
- package/dist/{LocalStateStore-5pVR26KA.mjs → LocalStateStore-CkpQ3sNu.mjs} +2 -2
- package/dist/{LocalStateStore-5pVR26KA.mjs.map → LocalStateStore-CkpQ3sNu.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-B-PQLx8X.mjs → OpenApiTsGenerator-BTMuu1WS.mjs} +2 -2
- package/dist/{OpenApiTsGenerator-B-PQLx8X.mjs.map → OpenApiTsGenerator-BTMuu1WS.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-BvacdbiG.cjs → OpenApiTsGenerator-CI-tceXV.cjs} +2 -2
- package/dist/{OpenApiTsGenerator-BvacdbiG.cjs.map → OpenApiTsGenerator-CI-tceXV.cjs.map} +1 -1
- package/dist/{S3StateStore-Do1DwEMX.mjs → S3StateStore-BO-TXIC9.mjs} +4 -4
- package/dist/{S3StateStore-Do1DwEMX.mjs.map → S3StateStore-BO-TXIC9.mjs.map} +1 -1
- package/dist/{S3StateStore-uykstvZI.cjs → S3StateStore-CsxqGwKX.cjs} +5 -5
- package/dist/{S3StateStore-uykstvZI.cjs.map → S3StateStore-CsxqGwKX.cjs.map} +1 -1
- package/dist/{SSMStateStore-DQXFWqkE.cjs → SSMStateStore-D85DzsxJ.cjs} +2 -2
- package/dist/{SSMStateStore-DQXFWqkE.cjs.map → SSMStateStore-D85DzsxJ.cjs.map} +1 -1
- package/dist/{SSMStateStore-xQ-Ce91W.mjs → SSMStateStore-DDNpIVIc.mjs} +2 -2
- package/dist/{SSMStateStore-xQ-Ce91W.mjs.map → SSMStateStore-DDNpIVIc.mjs.map} +1 -1
- package/dist/{SubscriberGenerator-DR4Y7ihK.cjs → SubscriberGenerator-BNJyPmXJ.cjs} +3 -3
- package/dist/{SubscriberGenerator-DR4Y7ihK.cjs.map → SubscriberGenerator-BNJyPmXJ.cjs.map} +1 -1
- package/dist/{SubscriberGenerator-DLPH-ynS.mjs → SubscriberGenerator-CzPrixYu.mjs} +3 -3
- package/dist/{SubscriberGenerator-DLPH-ynS.mjs.map → SubscriberGenerator-CzPrixYu.mjs.map} +1 -1
- package/dist/{add-DLkN488n.mjs → add-CRAhswLe.mjs} +8 -7
- package/dist/{add-DLkN488n.mjs.map → add-CRAhswLe.mjs.map} +1 -1
- package/dist/{add-Y_nPkjIf.cjs → add-DiFv_IWD.cjs} +18 -17
- package/dist/{add-Y_nPkjIf.cjs.map → add-DiFv_IWD.cjs.map} +1 -1
- package/dist/apps-CA-048eZ.cjs +5008 -0
- package/dist/apps-CA-048eZ.cjs.map +1 -0
- package/dist/apps-CZ0ydmPQ.mjs +4593 -0
- package/dist/apps-CZ0ydmPQ.mjs.map +1 -0
- package/dist/{bundler-DFyrGST-.mjs → bundler-BIsNVJnB.mjs} +6 -6
- package/dist/{bundler-DFyrGST-.mjs.map → bundler-BIsNVJnB.mjs.map} +1 -1
- package/dist/{bundler-COOvv27I.cjs → bundler-D6Y2bucc.cjs} +9 -9
- package/dist/{bundler-COOvv27I.cjs.map → bundler-D6Y2bucc.cjs.map} +1 -1
- package/dist/{cli-DKsV-Myw.cjs → cli-6xibALWU.cjs} +4 -4
- package/dist/{cli-DKsV-Myw.cjs.map → cli-6xibALWU.cjs.map} +1 -1
- package/dist/{cli-iAX4BQ3t.mjs → cli-QwhW-X12.mjs} +4 -4
- package/dist/{cli-iAX4BQ3t.mjs.map → cli-QwhW-X12.mjs.map} +1 -1
- package/dist/compose-BHsW5nDE.mjs +1554 -0
- package/dist/compose-BHsW5nDE.mjs.map +1 -0
- package/dist/compose-C4kCN2tl.cjs +1895 -0
- package/dist/compose-C4kCN2tl.cjs.map +1 -0
- package/dist/{compose-ofZIpp2q.mjs → compose-E4-ZiWev.mjs} +17 -1828
- package/dist/compose-E4-ZiWev.mjs.map +1 -0
- package/dist/{compose-CGXx22Wy.cjs → compose-S_MY__b2.cjs} +102 -1967
- package/dist/compose-S_MY__b2.cjs.map +1 -0
- package/dist/config-BKpzKP6W.mjs +659 -0
- package/dist/config-BKpzKP6W.mjs.map +1 -0
- package/dist/config-QAqAEgb0.cjs +772 -0
- package/dist/config-QAqAEgb0.cjs.map +1 -0
- package/dist/config.cjs +16 -419
- package/dist/config.mjs +2 -405
- package/dist/{credentialSchemas-DZ2Nh5li.cjs → credentialSchemas-BAklWDna.cjs} +4 -5
- package/dist/{credentialSchemas-DZ2Nh5li.cjs.map → credentialSchemas-BAklWDna.cjs.map} +1 -1
- package/dist/{credentialSchemas-DUCSYl9a.mjs → credentialSchemas-mz9QZTYh.mjs} +2 -3
- package/dist/{credentialSchemas-DUCSYl9a.mjs.map → credentialSchemas-mz9QZTYh.mjs.map} +1 -1
- package/dist/credentials-BnpIwWCS.cjs +2336 -0
- package/dist/credentials-BnpIwWCS.cjs.map +1 -0
- package/dist/credentials-zlJPxBWn.mjs +1851 -0
- package/dist/credentials-zlJPxBWn.mjs.map +1 -0
- package/dist/{databases-P824RTnx.cjs → databases-DawSdqBI.cjs} +2 -2
- package/dist/{databases-P824RTnx.cjs.map → databases-DawSdqBI.cjs.map} +1 -1
- package/dist/{databases-Db48ZIXL.mjs → databases-mzSUFBTw.mjs} +2 -2
- package/dist/{databases-Db48ZIXL.mjs.map → databases-mzSUFBTw.mjs.map} +1 -1
- package/dist/deploy/public.cjs +24 -24
- package/dist/deploy/public.cjs.map +1 -1
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +13 -13
- package/dist/{deploy-BibGpDAz.cjs → deploy-0XI_bemB.cjs} +73 -72
- package/dist/{deploy-BibGpDAz.cjs.map → deploy-0XI_bemB.cjs.map} +1 -1
- package/dist/{deploy-C4QQkHK7.mjs → deploy-DJcEAscO.mjs} +16 -15
- package/dist/{deploy-C4QQkHK7.mjs.map → deploy-DJcEAscO.mjs.map} +1 -1
- package/dist/{discover-yqeJ2Bx7.cjs → discover-CRywE7yc.cjs} +157 -6
- package/dist/discover-CRywE7yc.cjs.map +1 -0
- package/dist/{discover-B2m8ytyq.mjs → discover-DbDrCQ8h.mjs} +117 -8
- package/dist/discover-DbDrCQ8h.mjs.map +1 -0
- package/dist/docker-8gbw63RW.cjs +1514 -0
- package/dist/docker-8gbw63RW.cjs.map +1 -0
- package/dist/docker-C5w9_bWP.mjs +1407 -0
- package/dist/docker-C5w9_bWP.mjs.map +1 -0
- package/dist/{dokploy-pSrsileA.mjs → dokploy-BAjJ7MPB.mjs} +2 -2
- package/dist/{dokploy-pSrsileA.mjs.map → dokploy-BAjJ7MPB.mjs.map} +1 -1
- package/dist/{dokploy-B_VX3nLM.cjs → dokploy-DOYsnbiK.cjs} +2 -2
- package/dist/{dokploy-B_VX3nLM.cjs.map → dokploy-DOYsnbiK.cjs.map} +1 -1
- package/dist/{drivers-C47nm-wB.cjs → drivers-aM87NQJi.cjs} +4 -91
- package/dist/drivers-aM87NQJi.cjs.map +1 -0
- package/dist/{drivers-CDjpjakg.mjs → drivers-uxLBq3e3.mjs} +3 -60
- package/dist/drivers-uxLBq3e3.mjs.map +1 -0
- package/dist/{eas-cSSc8Lex.cjs → eas-Aaj9nbNp.cjs} +6 -6
- package/dist/{eas-cSSc8Lex.cjs.map → eas-Aaj9nbNp.cjs.map} +1 -1
- package/dist/{eas-Bou-_M76.mjs → eas-BpyYdquY.mjs} +3 -3
- package/dist/{eas-Bou-_M76.mjs.map → eas-BpyYdquY.mjs.map} +1 -1
- package/dist/{encryption-Bps9As2D.mjs → encryption-DYFTQaZ3.mjs} +3 -3
- package/dist/{encryption-Bps9As2D.mjs.map → encryption-DYFTQaZ3.mjs.map} +1 -1
- package/dist/{encryption-CElaAwJs.cjs → encryption-K2-9Ei8q.cjs} +6 -6
- package/dist/{encryption-CElaAwJs.cjs.map → encryption-K2-9Ei8q.cjs.map} +1 -1
- package/dist/{engine-CiG7Wfyc.cjs → engine-097i9gWA.cjs} +99 -97
- package/dist/{engine-CiG7Wfyc.cjs.map → engine-097i9gWA.cjs.map} +1 -1
- package/dist/{engine-CXE4UOHj.mjs → engine-CuFkswUS.mjs} +12 -10
- package/dist/{engine-CXE4UOHj.mjs.map → engine-CuFkswUS.mjs.map} +1 -1
- package/dist/{github-CvFJlFWA.mjs → github-DGaK_ulS.mjs} +9 -8
- package/dist/{github-CvFJlFWA.mjs.map → github-DGaK_ulS.mjs.map} +1 -1
- package/dist/{github-BzppIvpw.cjs → github-ZoKihAlP.cjs} +18 -17
- package/dist/{github-BzppIvpw.cjs.map → github-ZoKihAlP.cjs.map} +1 -1
- package/dist/{googlePlay-BJnMCWoa.cjs → googlePlay-BQ-62vre.cjs} +5 -5
- package/dist/{googlePlay-BJnMCWoa.cjs.map → googlePlay-BQ-62vre.cjs.map} +1 -1
- package/dist/{googlePlay-RSe9wOfZ.mjs → googlePlay-hw7Ej5yT.mjs} +5 -5
- package/dist/{googlePlay-RSe9wOfZ.mjs.map → googlePlay-hw7Ej5yT.mjs.map} +1 -1
- package/dist/index.cjs +196 -192
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +70 -66
- package/dist/index.mjs.map +1 -1
- package/dist/{local-B7Zv1NoA.mjs → local-CiJfYdrA.mjs} +3 -3
- package/dist/{local-B7Zv1NoA.mjs.map → local-CiJfYdrA.mjs.map} +1 -1
- package/dist/{local-OPC9BCZt.cjs → local-iC7qJkPl.cjs} +6 -6
- package/dist/{local-OPC9BCZt.cjs.map → local-iC7qJkPl.cjs.map} +1 -1
- package/dist/{migrate-B0nQra2W.mjs → migrate-CbjB-uxl.mjs} +3 -3
- package/dist/{migrate-B0nQra2W.mjs.map → migrate-CbjB-uxl.mjs.map} +1 -1
- package/dist/{migrate-BPCJBL7_.mjs → migrate-DTTn8YcN.mjs} +7 -5
- package/dist/{migrate-BPCJBL7_.mjs.map → migrate-DTTn8YcN.mjs.map} +1 -1
- package/dist/{migrate-BCBs0BMn.cjs → migrate-p1R0CSRw.cjs} +6 -6
- package/dist/{migrate-BCBs0BMn.cjs.map → migrate-p1R0CSRw.cjs.map} +1 -1
- package/dist/{migrate-Dmh5Dbcr.cjs → migrate-wH1DmtjX.cjs} +15 -13
- package/dist/{migrate-Dmh5Dbcr.cjs.map → migrate-wH1DmtjX.cjs.map} +1 -1
- package/dist/notes-CedXKWnt.mjs +399 -0
- package/dist/notes-CedXKWnt.mjs.map +1 -0
- package/dist/notes-ChbE7v2l.cjs +500 -0
- package/dist/notes-ChbE7v2l.cjs.map +1 -0
- package/dist/openapi.cjs +4 -5
- package/dist/openapi.cjs.map +1 -1
- package/dist/openapi.mjs +3 -4
- package/dist/openapi.mjs.map +1 -1
- package/dist/{projectBucket-C_DN4WzF.mjs → projectBucket-2Bw-Qy8D.mjs} +2 -2
- package/dist/{projectBucket-C_DN4WzF.mjs.map → projectBucket-2Bw-Qy8D.mjs.map} +1 -1
- package/dist/{projectBucket-BBbQ1lHF.cjs → projectBucket-CUJYUmt2.cjs} +2 -2
- package/dist/{projectBucket-BBbQ1lHF.cjs.map → projectBucket-CUJYUmt2.cjs.map} +1 -1
- package/dist/{publish-DKy3hn8a.cjs → publish-Byi0cB2N.cjs} +2 -2
- package/dist/{publish-DKy3hn8a.cjs.map → publish-Byi0cB2N.cjs.map} +1 -1
- package/dist/{publish-cthyGGQt.mjs → publish-DDsmxwl-.mjs} +2 -2
- package/dist/{publish-cthyGGQt.mjs.map → publish-DDsmxwl-.mjs.map} +1 -1
- package/dist/{ready-DuU0FXSj.cjs → ready-BNh3zsSn.cjs} +6 -6
- package/dist/{ready-DuU0FXSj.cjs.map → ready-BNh3zsSn.cjs.map} +1 -1
- package/dist/{ready-CGqJ74Kt.mjs → ready-g25dcGzK.mjs} +6 -6
- package/dist/{ready-CGqJ74Kt.mjs.map → ready-g25dcGzK.mjs.map} +1 -1
- package/dist/reconcile/public.cjs +1 -1
- package/dist/reconcile/public.mjs +1 -1
- package/dist/{resolve-AYtMIgoq.cjs → resolve-CT6P86p3.cjs} +4 -4
- package/dist/{resolve-AYtMIgoq.cjs.map → resolve-CT6P86p3.cjs.map} +1 -1
- package/dist/{resolve-BaRqJlqV.mjs → resolve-zHOTcPk4.mjs} +4 -4
- package/dist/{resolve-BaRqJlqV.mjs.map → resolve-zHOTcPk4.mjs.map} +1 -1
- package/dist/{rollback-DqV6t9oo.mjs → rollback-CFowte36.mjs} +8 -8
- package/dist/{rollback-DqV6t9oo.mjs.map → rollback-CFowte36.mjs.map} +1 -1
- package/dist/{rollback-CQ184yFu.cjs → rollback-CYnroE_3.cjs} +11 -11
- package/dist/{rollback-CQ184yFu.cjs.map → rollback-CYnroE_3.cjs.map} +1 -1
- package/dist/{s3-BKnL6YGQ.cjs → s3-82kaV_R0.cjs} +2 -2
- package/dist/{s3-BKnL6YGQ.cjs.map → s3-82kaV_R0.cjs.map} +1 -1
- package/dist/{s3-DW7SLsb8.mjs → s3-D8u9j2C5.mjs} +2 -2
- package/dist/{s3-DW7SLsb8.mjs.map → s3-D8u9j2C5.mjs.map} +1 -1
- package/dist/sandbox/credentials-worker.cjs +3 -4
- package/dist/sandbox/credentials-worker.cjs.map +1 -1
- package/dist/sandbox/credentials-worker.mjs +2 -3
- package/dist/sandbox/credentials-worker.mjs.map +1 -1
- package/dist/sandbox/discover-worker.cjs +1 -1
- package/dist/sandbox/discover-worker.mjs +1 -1
- package/dist/sandbox/migrate-worker.cjs +3 -4
- package/dist/sandbox/migrate-worker.cjs.map +1 -1
- package/dist/sandbox/migrate-worker.mjs +2 -3
- package/dist/sandbox/migrate-worker.mjs.map +1 -1
- package/dist/seeds-B3xvUAQf.cjs +363 -0
- package/dist/seeds-B3xvUAQf.cjs.map +1 -0
- package/dist/seeds-BCC8vAXR.mjs +298 -0
- package/dist/seeds-BCC8vAXR.mjs.map +1 -0
- package/dist/{serverSetup-AfG0-at8.mjs → serverSetup-B621zgYj.mjs} +7 -6
- package/dist/{serverSetup-AfG0-at8.mjs.map → serverSetup-B621zgYj.mjs.map} +1 -1
- package/dist/{serverSetup-Dnw9Kdel.cjs → serverSetup-Cip3ZWdi.cjs} +9 -8
- package/dist/{serverSetup-Dnw9Kdel.cjs.map → serverSetup-Cip3ZWdi.cjs.map} +1 -1
- package/dist/{sniffer-BHhJ8DiC.mjs → sniffer-BO7tNCDc.mjs} +8 -9
- package/dist/{sniffer-BHhJ8DiC.mjs.map → sniffer-BO7tNCDc.mjs.map} +1 -1
- package/dist/{sniffer-taO-AXSk.cjs → sniffer-Dxwe2yS0.cjs} +9 -10
- package/dist/{sniffer-taO-AXSk.cjs.map → sniffer-Dxwe2yS0.cjs.map} +1 -1
- package/dist/{snsSubscriptions-D_IBKhni.mjs → snsSubscriptions-CZlHrll5.mjs} +4 -453
- package/dist/snsSubscriptions-CZlHrll5.mjs.map +1 -0
- package/dist/{snsSubscriptions-CC-WM1zC.cjs → snsSubscriptions-CgWY_alK.cjs} +12 -559
- package/dist/snsSubscriptions-CgWY_alK.cjs.map +1 -0
- package/dist/{sst-Bz2HJlqc.mjs → sst-CnSAHj6j.mjs} +27 -5
- package/dist/sst-CnSAHj6j.mjs.map +1 -0
- package/dist/{sst-lvCHdYsY.cjs → sst-CtOI68mi.cjs} +29 -7
- package/dist/sst-CtOI68mi.cjs.map +1 -0
- package/dist/stack-BCHFuiWH.cjs +2577 -0
- package/dist/stack-BCHFuiWH.cjs.map +1 -0
- package/dist/stack-BrcNDH_E.mjs +2348 -0
- package/dist/stack-BrcNDH_E.mjs.map +1 -0
- package/dist/{stage-dd9dtLfh.mjs → stage-BhjwFQrw.mjs} +7 -7
- package/dist/{stage-dd9dtLfh.mjs.map → stage-BhjwFQrw.mjs.map} +1 -1
- package/dist/{stage-CTibxcpA.cjs → stage-DzH_iWgO.cjs} +13 -13
- package/dist/{stage-CTibxcpA.cjs.map → stage-DzH_iWgO.cjs.map} +1 -1
- package/dist/{stages--icWbhPy.cjs → stages-CFI0OiLj.cjs} +2 -2
- package/dist/{stages--icWbhPy.cjs.map → stages-CFI0OiLj.cjs.map} +1 -1
- package/dist/{stages-CUwSy39f.mjs → stages-DoYa81kN.mjs} +2 -2
- package/dist/{stages-CUwSy39f.mjs.map → stages-DoYa81kN.mjs.map} +1 -1
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.mjs +1 -1
- package/dist/{terminal-DURcYlVX.cjs → terminal-455ZtUjl.cjs} +3 -3
- package/dist/{terminal-DURcYlVX.cjs.map → terminal-455ZtUjl.cjs.map} +1 -1
- package/dist/{terminal-yOZ7kKF9.mjs → terminal-iEkwo0Bq.mjs} +3 -3
- package/dist/{terminal-yOZ7kKF9.mjs.map → terminal-iEkwo0Bq.mjs.map} +1 -1
- package/dist/types-Bl_CwZC9.cjs +90 -0
- package/dist/types-Bl_CwZC9.cjs.map +1 -0
- package/dist/types-Y1NfWlyG.mjs +61 -0
- package/dist/types-Y1NfWlyG.mjs.map +1 -0
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/package.json +15 -15
- package/dist/compose-CGXx22Wy.cjs.map +0 -1
- package/dist/compose-ofZIpp2q.mjs.map +0 -1
- package/dist/config.cjs.map +0 -1
- package/dist/config.mjs.map +0 -1
- package/dist/credentials-D7XJypNd.cjs +0 -520
- package/dist/credentials-D7XJypNd.cjs.map +0 -1
- package/dist/credentials-DpfnUvIR.mjs +0 -395
- package/dist/credentials-DpfnUvIR.mjs.map +0 -1
- package/dist/derive-Cd7Hl3r2.mjs +0 -259
- package/dist/derive-Cd7Hl3r2.mjs.map +0 -1
- package/dist/derive-CgZfoBU2.cjs +0 -282
- package/dist/derive-CgZfoBU2.cjs.map +0 -1
- package/dist/discover-B2m8ytyq.mjs.map +0 -1
- package/dist/discover-yqeJ2Bx7.cjs.map +0 -1
- package/dist/drivers-C47nm-wB.cjs.map +0 -1
- package/dist/drivers-CDjpjakg.mjs.map +0 -1
- package/dist/identity-CBXr4wNi.mjs +0 -129
- package/dist/identity-CBXr4wNi.mjs.map +0 -1
- package/dist/identity-CbLfgQNT.cjs +0 -182
- package/dist/identity-CbLfgQNT.cjs.map +0 -1
- package/dist/sandbox-CHv3OYXg.cjs +0 -165
- package/dist/sandbox-CHv3OYXg.cjs.map +0 -1
- package/dist/sandbox-CbVB7uOD.mjs +0 -118
- package/dist/sandbox-CbVB7uOD.mjs.map +0 -1
- package/dist/seeds-DndMeyzm.cjs +0 -10669
- package/dist/seeds-DndMeyzm.cjs.map +0 -1
- package/dist/seeds-o6x6BTRo.mjs +0 -9534
- package/dist/seeds-o6x6BTRo.mjs.map +0 -1
- package/dist/snsSubscriptions-CC-WM1zC.cjs.map +0 -1
- package/dist/snsSubscriptions-D_IBKhni.mjs.map +0 -1
- package/dist/sst-Bz2HJlqc.mjs.map +0 -1
- package/dist/sst-lvCHdYsY.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity-CBXr4wNi.mjs","names":[],"sources":["../src/deploy/identity.ts"],"sourcesContent":["/**\n * Who a deploy is, on a target it shares with other workspaces.\n *\n * A Dokploy server is one flat namespace of projects, images and Docker\n * service names. Deploys used to identify everything they made by the\n * workspace name alone, so two workspaces called `shop` — or `Shop` and\n * `shop` — deploying to one server landed in the same project, pushed over\n * each other's images and redeployed each other's applications. A\n * `DeployIdentity` is what a deploy names and claims its resources by instead.\n */\n\nimport { kebabCase, scopedName } from '@geekmidas/manifest';\nimport { GkmError } from '../errors';\n\nexport interface DeployIdentity {\n\t/**\n\t * Whose deploy this is — an organisation, a team, a repository. Two\n\t * workspaces with the same name are told apart by it. Defaults to the\n\t * kebab-cased workspace name; set `deploy.namespace` to choose one.\n\t */\n\treadonly namespace: string;\n\t/** The workspace name as the target spells it: lowercase, `[a-z0-9-]`. */\n\treadonly project: string;\n\treadonly stage: string;\n\t/**\n\t * `<namespace>/<project>`: what a Dokploy project is claimed by.\n\t *\n\t * The stage is not part of it because one Dokploy project holds every stage\n\t * of a workspace, each as an environment — the key has to be the same from\n\t * every stage that deploys into it.\n\t */\n\treadonly key: string;\n\t/**\n\t * The prefix every name on the target carries: the project alone in the\n\t * default namespace, `<namespace>-<project>` in any other.\n\t *\n\t * The default adds nothing so that a workspace that never set a namespace\n\t * keeps the names it was already deployed under — a Postgres is found by\n\t * its name, and a new name would be a new, empty database.\n\t */\n\treadonly scope: string;\n}\n\n/** A namespace that cannot be part of a Dokploy name or an image path. */\nexport class DeployNamespaceInvalid extends GkmError {\n\tconstructor(readonly namespace: string) {\n\t\tsuper(\n\t\t\t`deploy.namespace '${namespace}' is not usable as a name: use lowercase letters, digits and single '-' between them (e.g. 'acme' or 'acme-platform') in gkm.config.ts.`,\n\t\t);\n\t\tthis.name = 'DeployNamespaceInvalid';\n\t}\n}\n\n/** A workspace name with nothing a target can name a resource by. */\nexport class DeployProjectNameInvalid extends GkmError {\n\tconstructor(readonly workspaceName: string) {\n\t\tsuper(\n\t\t\t`The workspace name '${workspaceName}' has no letters or digits to name deployed resources by. Set \"name\" in gkm.config.ts.`,\n\t\t);\n\t\tthis.name = 'DeployProjectNameInvalid';\n\t}\n}\n\nconst NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n/**\n * Lowercase `[a-z0-9-]`, runs of anything else collapsed to one `-`: valid as\n * a Docker image path component, a Docker service name and a Dokploy name.\n */\nfunction slug(value: string): string {\n\treturn value\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9]+/g, '-')\n\t\t.replace(/^-+|-+$/g, '');\n}\n\n/** The namespace a workspace is in when it does not name one. */\nexport function defaultNamespace(workspaceName: string): string {\n\treturn slug(kebabCase(workspaceName));\n}\n\n/** What an identity is derived from: a workspace's name and namespace. */\nexport interface IdentitySource {\n\tname: string;\n\tdeploy?: { namespace?: string };\n}\n\nexport function deployIdentity(\n\tworkspace: IdentitySource,\n\tstage: string,\n): DeployIdentity {\n\t// Lowercased rather than kebab-cased: the names a workspace was already\n\t// deployed under were `${stage}-${name}`.toLowerCase(), and this has to\n\t// reproduce them for the databases it finds by name.\n\tconst project = slug(workspace.name);\n\tif (!project) throw new DeployProjectNameInvalid(workspace.name);\n\n\tconst fallback = defaultNamespace(workspace.name);\n\tconst namespace = workspace.deploy?.namespace ?? fallback;\n\tif (!NAME.test(namespace)) throw new DeployNamespaceInvalid(namespace);\n\n\treturn {\n\t\tnamespace,\n\t\tproject,\n\t\tstage,\n\t\tkey: `${namespace}/${project}`,\n\t\tscope: namespace === fallback ? project : `${namespace}-${project}`,\n\t};\n}\n\n/**\n * The token a Dokploy project's description carries to say which identity\n * created it. A project with the right name and no marker belongs to someone\n * else, and a deploy never adopts it.\n */\nexport function ownershipMarker(identity: DeployIdentity): string {\n\treturn `gkm:${identity.key}`;\n}\n\n/** Whether a project description carries `identity`'s marker. */\nexport function isOwnedBy(\n\tdescription: string | null | undefined,\n\tidentity: DeployIdentity,\n): boolean {\n\tconst marker = ownershipMarker(identity);\n\treturn (description ?? '').split(/\\s+/).includes(marker);\n}\n\n/** Any `gkm:` marker a description carries — whoever's it is. */\nexport function markerOf(\n\tdescription: string | null | undefined,\n): string | undefined {\n\treturn (description ?? '').split(/\\s+/).find((t) => t.startsWith('gkm:'));\n}\n\n/** What the Dokploy project is called. */\nexport function projectName(identity: DeployIdentity): string {\n\treturn identity.scope;\n}\n\n/**\n * The repository an app's image is pushed to, below the registry:\n * `<namespace>/<project>-<app>`.\n *\n * The namespace is a path segment of its own so that a registry that maps\n * paths to owners (an organisation's packages, a Harbor project) can grant it\n * as one; the app is joined to the project so the two read as one name.\n */\nexport function imageName(identity: DeployIdentity, app: string): string {\n\treturn `${identity.namespace}/${identity.project}-${slug(kebabCase(app))}`;\n}\n\n/** The full image ref an app is built, pushed and deployed as. */\nexport function imageRef(\n\tidentity: DeployIdentity,\n\tapp: string,\n\tregistry: string | undefined,\n\ttag: string,\n): string {\n\tconst name = imageName(identity, app);\n\treturn registry\n\t\t? `${registry.replace(/\\/+$/, '')}/${name}:${tag}`\n\t\t: `${name}:${tag}`;\n}\n\n/**\n * What one application is called on the target.\n *\n * The same rule the constructs use, through the same `scopedName`, scoped by\n * the stage and the identity: the application beside\n * `production-kitchen-sink-database` is `production-kitchen-sink-api`. A\n * Dokploy application's name is also its Docker service name, which is unique\n * on the whole server, so the namespace has to be in it too — `acme`'s and\n * `globex`'s `shop` would otherwise both run `production-shop-api`.\n *\n * The app id is dropped when it repeats the project, so a project named for its\n * one application is `production-kitchen-sink` rather than\n * `production-kitchen-sink-kitchen-sink`.\n */\nexport function applicationName(identity: DeployIdentity, app: string): string {\n\treturn slug(app) === identity.project\n\t\t? `${identity.stage}-${identity.scope}`\n\t\t: scopedName([identity.stage, identity.scope], app);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAa,yBAAb,cAA4C,SAAS;CAC/B;CAArB,YAAY,WAA4B;EACvC,MACC,qBAAqB,UAAU,wIAChC;EAHoB,KAAA,YAAA;EAIpB,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,2BAAb,cAA8C,SAAS;CACjC;CAArB,YAAY,eAAgC;EAC3C,MACC,uBAAuB,cAAc,uFACtC;EAHoB,KAAA,gBAAA;EAIpB,KAAK,OAAO;CACb;AACD;AAEA,MAAM,OAAO;;;;;AAMb,SAAS,KAAK,OAAuB;CACpC,OAAO,MACL,YAAY,CAAC,CACb,QAAQ,eAAe,GAAG,CAAC,CAC3B,QAAQ,YAAY,EAAE;AACzB;;AAGA,SAAgB,iBAAiB,eAA+B;CAC/D,OAAO,KAAK,UAAU,aAAa,CAAC;AACrC;AAQA,SAAgB,eACf,WACA,OACiB;CAIjB,MAAM,UAAU,KAAK,UAAU,IAAI;CACnC,IAAI,CAAC,SAAS,MAAM,IAAI,yBAAyB,UAAU,IAAI;CAE/D,MAAM,WAAW,iBAAiB,UAAU,IAAI;CAChD,MAAM,YAAY,UAAU,QAAQ,aAAa;CACjD,IAAI,CAAC,KAAK,KAAK,SAAS,GAAG,MAAM,IAAI,uBAAuB,SAAS;CAErE,OAAO;EACN;EACA;EACA;EACA,KAAK,GAAG,UAAU,GAAG;EACrB,OAAO,cAAc,WAAW,UAAU,GAAG,UAAU,GAAG;CAC3D;AACD;;;;;;AAOA,SAAgB,gBAAgB,UAAkC;CACjE,OAAO,OAAO,SAAS;AACxB;;AAGA,SAAgB,UACf,aACA,UACU;CACV,MAAM,SAAS,gBAAgB,QAAQ;CACvC,QAAQ,eAAe,GAAA,CAAI,MAAM,KAAK,CAAC,CAAC,SAAS,MAAM;AACxD;;AAGA,SAAgB,SACf,aACqB;CACrB,QAAQ,eAAe,GAAA,CAAI,MAAM,KAAK,CAAC,CAAC,MAAM,MAAM,EAAE,WAAW,MAAM,CAAC;AACzE;;AAGA,SAAgB,YAAY,UAAkC;CAC7D,OAAO,SAAS;AACjB;;;;;;;;;AAUA,SAAgB,UAAU,UAA0B,KAAqB;CACxE,OAAO,GAAG,SAAS,UAAU,GAAG,SAAS,QAAQ,GAAG,KAAK,UAAU,GAAG,CAAC;AACxE;;AAGA,SAAgB,SACf,UACA,KACA,UACA,KACS;CACT,MAAM,OAAO,UAAU,UAAU,GAAG;CACpC,OAAO,WACJ,GAAG,SAAS,QAAQ,QAAQ,EAAE,EAAE,GAAG,KAAK,GAAG,QAC3C,GAAG,KAAK,GAAG;AACf;;;;;;;;;;;;;;;AAgBA,SAAgB,gBAAgB,UAA0B,KAAqB;CAC9E,OAAO,KAAK,GAAG,MAAM,SAAS,UAC3B,GAAG,SAAS,MAAM,GAAG,SAAS,UAC9B,WAAW,CAAC,SAAS,OAAO,SAAS,KAAK,GAAG,GAAG;AACpD"}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
2
|
-
const require_errors = require("./errors-DMC4Umsb.cjs");
|
|
3
|
-
let _geekmidas_manifest = require("@geekmidas/manifest");
|
|
4
|
-
//#region src/deploy/identity.ts
|
|
5
|
-
/**
|
|
6
|
-
* Who a deploy is, on a target it shares with other workspaces.
|
|
7
|
-
*
|
|
8
|
-
* A Dokploy server is one flat namespace of projects, images and Docker
|
|
9
|
-
* service names. Deploys used to identify everything they made by the
|
|
10
|
-
* workspace name alone, so two workspaces called `shop` — or `Shop` and
|
|
11
|
-
* `shop` — deploying to one server landed in the same project, pushed over
|
|
12
|
-
* each other's images and redeployed each other's applications. A
|
|
13
|
-
* `DeployIdentity` is what a deploy names and claims its resources by instead.
|
|
14
|
-
*/
|
|
15
|
-
var identity_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
16
|
-
DeployNamespaceInvalid: () => DeployNamespaceInvalid,
|
|
17
|
-
DeployProjectNameInvalid: () => DeployProjectNameInvalid,
|
|
18
|
-
applicationName: () => applicationName,
|
|
19
|
-
defaultNamespace: () => defaultNamespace,
|
|
20
|
-
deployIdentity: () => deployIdentity,
|
|
21
|
-
imageName: () => imageName,
|
|
22
|
-
imageRef: () => imageRef,
|
|
23
|
-
isOwnedBy: () => isOwnedBy,
|
|
24
|
-
markerOf: () => markerOf,
|
|
25
|
-
ownershipMarker: () => ownershipMarker,
|
|
26
|
-
projectName: () => projectName
|
|
27
|
-
});
|
|
28
|
-
/** A namespace that cannot be part of a Dokploy name or an image path. */
|
|
29
|
-
var DeployNamespaceInvalid = class extends require_errors.GkmError {
|
|
30
|
-
namespace;
|
|
31
|
-
constructor(namespace) {
|
|
32
|
-
super(`deploy.namespace '${namespace}' is not usable as a name: use lowercase letters, digits and single '-' between them (e.g. 'acme' or 'acme-platform') in gkm.config.ts.`);
|
|
33
|
-
this.namespace = namespace;
|
|
34
|
-
this.name = "DeployNamespaceInvalid";
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
/** A workspace name with nothing a target can name a resource by. */
|
|
38
|
-
var DeployProjectNameInvalid = class extends require_errors.GkmError {
|
|
39
|
-
workspaceName;
|
|
40
|
-
constructor(workspaceName) {
|
|
41
|
-
super(`The workspace name '${workspaceName}' has no letters or digits to name deployed resources by. Set "name" in gkm.config.ts.`);
|
|
42
|
-
this.workspaceName = workspaceName;
|
|
43
|
-
this.name = "DeployProjectNameInvalid";
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
47
|
-
/**
|
|
48
|
-
* Lowercase `[a-z0-9-]`, runs of anything else collapsed to one `-`: valid as
|
|
49
|
-
* a Docker image path component, a Docker service name and a Dokploy name.
|
|
50
|
-
*/
|
|
51
|
-
function slug(value) {
|
|
52
|
-
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
53
|
-
}
|
|
54
|
-
/** The namespace a workspace is in when it does not name one. */
|
|
55
|
-
function defaultNamespace(workspaceName) {
|
|
56
|
-
return slug((0, _geekmidas_manifest.kebabCase)(workspaceName));
|
|
57
|
-
}
|
|
58
|
-
function deployIdentity(workspace, stage) {
|
|
59
|
-
const project = slug(workspace.name);
|
|
60
|
-
if (!project) throw new DeployProjectNameInvalid(workspace.name);
|
|
61
|
-
const fallback = defaultNamespace(workspace.name);
|
|
62
|
-
const namespace = workspace.deploy?.namespace ?? fallback;
|
|
63
|
-
if (!NAME.test(namespace)) throw new DeployNamespaceInvalid(namespace);
|
|
64
|
-
return {
|
|
65
|
-
namespace,
|
|
66
|
-
project,
|
|
67
|
-
stage,
|
|
68
|
-
key: `${namespace}/${project}`,
|
|
69
|
-
scope: namespace === fallback ? project : `${namespace}-${project}`
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* The token a Dokploy project's description carries to say which identity
|
|
74
|
-
* created it. A project with the right name and no marker belongs to someone
|
|
75
|
-
* else, and a deploy never adopts it.
|
|
76
|
-
*/
|
|
77
|
-
function ownershipMarker(identity) {
|
|
78
|
-
return `gkm:${identity.key}`;
|
|
79
|
-
}
|
|
80
|
-
/** Whether a project description carries `identity`'s marker. */
|
|
81
|
-
function isOwnedBy(description, identity) {
|
|
82
|
-
const marker = ownershipMarker(identity);
|
|
83
|
-
return (description ?? "").split(/\s+/).includes(marker);
|
|
84
|
-
}
|
|
85
|
-
/** Any `gkm:` marker a description carries — whoever's it is. */
|
|
86
|
-
function markerOf(description) {
|
|
87
|
-
return (description ?? "").split(/\s+/).find((t) => t.startsWith("gkm:"));
|
|
88
|
-
}
|
|
89
|
-
/** What the Dokploy project is called. */
|
|
90
|
-
function projectName(identity) {
|
|
91
|
-
return identity.scope;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* The repository an app's image is pushed to, below the registry:
|
|
95
|
-
* `<namespace>/<project>-<app>`.
|
|
96
|
-
*
|
|
97
|
-
* The namespace is a path segment of its own so that a registry that maps
|
|
98
|
-
* paths to owners (an organisation's packages, a Harbor project) can grant it
|
|
99
|
-
* as one; the app is joined to the project so the two read as one name.
|
|
100
|
-
*/
|
|
101
|
-
function imageName(identity, app) {
|
|
102
|
-
return `${identity.namespace}/${identity.project}-${slug((0, _geekmidas_manifest.kebabCase)(app))}`;
|
|
103
|
-
}
|
|
104
|
-
/** The full image ref an app is built, pushed and deployed as. */
|
|
105
|
-
function imageRef(identity, app, registry, tag) {
|
|
106
|
-
const name = imageName(identity, app);
|
|
107
|
-
return registry ? `${registry.replace(/\/+$/, "")}/${name}:${tag}` : `${name}:${tag}`;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* What one application is called on the target.
|
|
111
|
-
*
|
|
112
|
-
* The same rule the constructs use, through the same `scopedName`, scoped by
|
|
113
|
-
* the stage and the identity: the application beside
|
|
114
|
-
* `production-kitchen-sink-database` is `production-kitchen-sink-api`. A
|
|
115
|
-
* Dokploy application's name is also its Docker service name, which is unique
|
|
116
|
-
* on the whole server, so the namespace has to be in it too — `acme`'s and
|
|
117
|
-
* `globex`'s `shop` would otherwise both run `production-shop-api`.
|
|
118
|
-
*
|
|
119
|
-
* The app id is dropped when it repeats the project, so a project named for its
|
|
120
|
-
* one application is `production-kitchen-sink` rather than
|
|
121
|
-
* `production-kitchen-sink-kitchen-sink`.
|
|
122
|
-
*/
|
|
123
|
-
function applicationName(identity, app) {
|
|
124
|
-
return slug(app) === identity.project ? `${identity.stage}-${identity.scope}` : (0, _geekmidas_manifest.scopedName)([identity.stage, identity.scope], app);
|
|
125
|
-
}
|
|
126
|
-
//#endregion
|
|
127
|
-
Object.defineProperty(exports, "applicationName", {
|
|
128
|
-
enumerable: true,
|
|
129
|
-
get: function() {
|
|
130
|
-
return applicationName;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
Object.defineProperty(exports, "deployIdentity", {
|
|
134
|
-
enumerable: true,
|
|
135
|
-
get: function() {
|
|
136
|
-
return deployIdentity;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
Object.defineProperty(exports, "identity_exports", {
|
|
140
|
-
enumerable: true,
|
|
141
|
-
get: function() {
|
|
142
|
-
return identity_exports;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
Object.defineProperty(exports, "imageName", {
|
|
146
|
-
enumerable: true,
|
|
147
|
-
get: function() {
|
|
148
|
-
return imageName;
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
Object.defineProperty(exports, "imageRef", {
|
|
152
|
-
enumerable: true,
|
|
153
|
-
get: function() {
|
|
154
|
-
return imageRef;
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
Object.defineProperty(exports, "isOwnedBy", {
|
|
158
|
-
enumerable: true,
|
|
159
|
-
get: function() {
|
|
160
|
-
return isOwnedBy;
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
Object.defineProperty(exports, "markerOf", {
|
|
164
|
-
enumerable: true,
|
|
165
|
-
get: function() {
|
|
166
|
-
return markerOf;
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
Object.defineProperty(exports, "ownershipMarker", {
|
|
170
|
-
enumerable: true,
|
|
171
|
-
get: function() {
|
|
172
|
-
return ownershipMarker;
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
Object.defineProperty(exports, "projectName", {
|
|
176
|
-
enumerable: true,
|
|
177
|
-
get: function() {
|
|
178
|
-
return projectName;
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
//# sourceMappingURL=identity-CbLfgQNT.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identity-CbLfgQNT.cjs","names":["GkmError","kebabCase","scopedName"],"sources":["../src/deploy/identity.ts"],"sourcesContent":["/**\n * Who a deploy is, on a target it shares with other workspaces.\n *\n * A Dokploy server is one flat namespace of projects, images and Docker\n * service names. Deploys used to identify everything they made by the\n * workspace name alone, so two workspaces called `shop` — or `Shop` and\n * `shop` — deploying to one server landed in the same project, pushed over\n * each other's images and redeployed each other's applications. A\n * `DeployIdentity` is what a deploy names and claims its resources by instead.\n */\n\nimport { kebabCase, scopedName } from '@geekmidas/manifest';\nimport { GkmError } from '../errors';\n\nexport interface DeployIdentity {\n\t/**\n\t * Whose deploy this is — an organisation, a team, a repository. Two\n\t * workspaces with the same name are told apart by it. Defaults to the\n\t * kebab-cased workspace name; set `deploy.namespace` to choose one.\n\t */\n\treadonly namespace: string;\n\t/** The workspace name as the target spells it: lowercase, `[a-z0-9-]`. */\n\treadonly project: string;\n\treadonly stage: string;\n\t/**\n\t * `<namespace>/<project>`: what a Dokploy project is claimed by.\n\t *\n\t * The stage is not part of it because one Dokploy project holds every stage\n\t * of a workspace, each as an environment — the key has to be the same from\n\t * every stage that deploys into it.\n\t */\n\treadonly key: string;\n\t/**\n\t * The prefix every name on the target carries: the project alone in the\n\t * default namespace, `<namespace>-<project>` in any other.\n\t *\n\t * The default adds nothing so that a workspace that never set a namespace\n\t * keeps the names it was already deployed under — a Postgres is found by\n\t * its name, and a new name would be a new, empty database.\n\t */\n\treadonly scope: string;\n}\n\n/** A namespace that cannot be part of a Dokploy name or an image path. */\nexport class DeployNamespaceInvalid extends GkmError {\n\tconstructor(readonly namespace: string) {\n\t\tsuper(\n\t\t\t`deploy.namespace '${namespace}' is not usable as a name: use lowercase letters, digits and single '-' between them (e.g. 'acme' or 'acme-platform') in gkm.config.ts.`,\n\t\t);\n\t\tthis.name = 'DeployNamespaceInvalid';\n\t}\n}\n\n/** A workspace name with nothing a target can name a resource by. */\nexport class DeployProjectNameInvalid extends GkmError {\n\tconstructor(readonly workspaceName: string) {\n\t\tsuper(\n\t\t\t`The workspace name '${workspaceName}' has no letters or digits to name deployed resources by. Set \"name\" in gkm.config.ts.`,\n\t\t);\n\t\tthis.name = 'DeployProjectNameInvalid';\n\t}\n}\n\nconst NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n/**\n * Lowercase `[a-z0-9-]`, runs of anything else collapsed to one `-`: valid as\n * a Docker image path component, a Docker service name and a Dokploy name.\n */\nfunction slug(value: string): string {\n\treturn value\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9]+/g, '-')\n\t\t.replace(/^-+|-+$/g, '');\n}\n\n/** The namespace a workspace is in when it does not name one. */\nexport function defaultNamespace(workspaceName: string): string {\n\treturn slug(kebabCase(workspaceName));\n}\n\n/** What an identity is derived from: a workspace's name and namespace. */\nexport interface IdentitySource {\n\tname: string;\n\tdeploy?: { namespace?: string };\n}\n\nexport function deployIdentity(\n\tworkspace: IdentitySource,\n\tstage: string,\n): DeployIdentity {\n\t// Lowercased rather than kebab-cased: the names a workspace was already\n\t// deployed under were `${stage}-${name}`.toLowerCase(), and this has to\n\t// reproduce them for the databases it finds by name.\n\tconst project = slug(workspace.name);\n\tif (!project) throw new DeployProjectNameInvalid(workspace.name);\n\n\tconst fallback = defaultNamespace(workspace.name);\n\tconst namespace = workspace.deploy?.namespace ?? fallback;\n\tif (!NAME.test(namespace)) throw new DeployNamespaceInvalid(namespace);\n\n\treturn {\n\t\tnamespace,\n\t\tproject,\n\t\tstage,\n\t\tkey: `${namespace}/${project}`,\n\t\tscope: namespace === fallback ? project : `${namespace}-${project}`,\n\t};\n}\n\n/**\n * The token a Dokploy project's description carries to say which identity\n * created it. A project with the right name and no marker belongs to someone\n * else, and a deploy never adopts it.\n */\nexport function ownershipMarker(identity: DeployIdentity): string {\n\treturn `gkm:${identity.key}`;\n}\n\n/** Whether a project description carries `identity`'s marker. */\nexport function isOwnedBy(\n\tdescription: string | null | undefined,\n\tidentity: DeployIdentity,\n): boolean {\n\tconst marker = ownershipMarker(identity);\n\treturn (description ?? '').split(/\\s+/).includes(marker);\n}\n\n/** Any `gkm:` marker a description carries — whoever's it is. */\nexport function markerOf(\n\tdescription: string | null | undefined,\n): string | undefined {\n\treturn (description ?? '').split(/\\s+/).find((t) => t.startsWith('gkm:'));\n}\n\n/** What the Dokploy project is called. */\nexport function projectName(identity: DeployIdentity): string {\n\treturn identity.scope;\n}\n\n/**\n * The repository an app's image is pushed to, below the registry:\n * `<namespace>/<project>-<app>`.\n *\n * The namespace is a path segment of its own so that a registry that maps\n * paths to owners (an organisation's packages, a Harbor project) can grant it\n * as one; the app is joined to the project so the two read as one name.\n */\nexport function imageName(identity: DeployIdentity, app: string): string {\n\treturn `${identity.namespace}/${identity.project}-${slug(kebabCase(app))}`;\n}\n\n/** The full image ref an app is built, pushed and deployed as. */\nexport function imageRef(\n\tidentity: DeployIdentity,\n\tapp: string,\n\tregistry: string | undefined,\n\ttag: string,\n): string {\n\tconst name = imageName(identity, app);\n\treturn registry\n\t\t? `${registry.replace(/\\/+$/, '')}/${name}:${tag}`\n\t\t: `${name}:${tag}`;\n}\n\n/**\n * What one application is called on the target.\n *\n * The same rule the constructs use, through the same `scopedName`, scoped by\n * the stage and the identity: the application beside\n * `production-kitchen-sink-database` is `production-kitchen-sink-api`. A\n * Dokploy application's name is also its Docker service name, which is unique\n * on the whole server, so the namespace has to be in it too — `acme`'s and\n * `globex`'s `shop` would otherwise both run `production-shop-api`.\n *\n * The app id is dropped when it repeats the project, so a project named for its\n * one application is `production-kitchen-sink` rather than\n * `production-kitchen-sink-kitchen-sink`.\n */\nexport function applicationName(identity: DeployIdentity, app: string): string {\n\treturn slug(app) === identity.project\n\t\t? `${identity.stage}-${identity.scope}`\n\t\t: scopedName([identity.stage, identity.scope], app);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAa,yBAAb,cAA4CA,eAAAA,SAAS;CAC/B;CAArB,YAAY,WAA4B;EACvC,MACC,qBAAqB,UAAU,wIAChC;EAHoB,KAAA,YAAA;EAIpB,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,2BAAb,cAA8CA,eAAAA,SAAS;CACjC;CAArB,YAAY,eAAgC;EAC3C,MACC,uBAAuB,cAAc,uFACtC;EAHoB,KAAA,gBAAA;EAIpB,KAAK,OAAO;CACb;AACD;AAEA,MAAM,OAAO;;;;;AAMb,SAAS,KAAK,OAAuB;CACpC,OAAO,MACL,YAAY,CAAC,CACb,QAAQ,eAAe,GAAG,CAAC,CAC3B,QAAQ,YAAY,EAAE;AACzB;;AAGA,SAAgB,iBAAiB,eAA+B;CAC/D,OAAO,MAAA,GAAKC,oBAAAA,UAAAA,CAAU,aAAa,CAAC;AACrC;AAQA,SAAgB,eACf,WACA,OACiB;CAIjB,MAAM,UAAU,KAAK,UAAU,IAAI;CACnC,IAAI,CAAC,SAAS,MAAM,IAAI,yBAAyB,UAAU,IAAI;CAE/D,MAAM,WAAW,iBAAiB,UAAU,IAAI;CAChD,MAAM,YAAY,UAAU,QAAQ,aAAa;CACjD,IAAI,CAAC,KAAK,KAAK,SAAS,GAAG,MAAM,IAAI,uBAAuB,SAAS;CAErE,OAAO;EACN;EACA;EACA;EACA,KAAK,GAAG,UAAU,GAAG;EACrB,OAAO,cAAc,WAAW,UAAU,GAAG,UAAU,GAAG;CAC3D;AACD;;;;;;AAOA,SAAgB,gBAAgB,UAAkC;CACjE,OAAO,OAAO,SAAS;AACxB;;AAGA,SAAgB,UACf,aACA,UACU;CACV,MAAM,SAAS,gBAAgB,QAAQ;CACvC,QAAQ,eAAe,GAAA,CAAI,MAAM,KAAK,CAAC,CAAC,SAAS,MAAM;AACxD;;AAGA,SAAgB,SACf,aACqB;CACrB,QAAQ,eAAe,GAAA,CAAI,MAAM,KAAK,CAAC,CAAC,MAAM,MAAM,EAAE,WAAW,MAAM,CAAC;AACzE;;AAGA,SAAgB,YAAY,UAAkC;CAC7D,OAAO,SAAS;AACjB;;;;;;;;;AAUA,SAAgB,UAAU,UAA0B,KAAqB;CACxE,OAAO,GAAG,SAAS,UAAU,GAAG,SAAS,QAAQ,GAAG,MAAA,GAAKA,oBAAAA,UAAAA,CAAU,GAAG,CAAC;AACxE;;AAGA,SAAgB,SACf,UACA,KACA,UACA,KACS;CACT,MAAM,OAAO,UAAU,UAAU,GAAG;CACpC,OAAO,WACJ,GAAG,SAAS,QAAQ,QAAQ,EAAE,EAAE,GAAG,KAAK,GAAG,QAC3C,GAAG,KAAK,GAAG;AACf;;;;;;;;;;;;;;;AAgBA,SAAgB,gBAAgB,UAA0B,KAAqB;CAC9E,OAAO,KAAK,GAAG,MAAM,SAAS,UAC3B,GAAG,SAAS,MAAM,GAAG,SAAS,WAAA,GAC9BC,oBAAAA,WAAAA,CAAW,CAAC,SAAS,OAAO,SAAS,KAAK,GAAG,GAAG;AACpD"}
|
|
@@ -1,165 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-CHv3OYXg.cjs","names":["GkmError","existsSync","realpathSync","resolve","relative","sep","isAbsolute","AsyncLocalStorage"],"sources":["../src/sandbox/sandbox.ts"],"sourcesContent":["/**\n * Where a deploy runs the project's own code.\n *\n * A deploy holds credentials — Dokploy's token, a registry login, an AWS key —\n * and loading `gkm.config.ts`, sniffing an app's environment and building it\n * all execute code from the repository being deployed. On a developer's own\n * laptop that is the developer's code. On a CI job for a fork, or a shared\n * build runner, it is not, and that code should not be able to read the\n * credentials used to deploy it, hang the deploy, or reach outside the\n * checkout.\n *\n * So every step that runs project code goes through a `Sandbox`: one call,\n * with an argument array rather than a shell line, the complete environment\n * the step needs rather than the host's, a timeout it cannot outlive, secrets\n * as files rather than variables, and a working directory inside the project.\n * The steps that need credentials — provisioning, pushing, releasing — are\n * the deploy's own code and never run in one.\n *\n * `LocalSandbox` is the default: a child process on this machine with an\n * allowlisted environment. A host that builds repositories it does not trust\n * passes its own — a container per build, a VM — through `deploy()`'s\n * `sandbox`.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport { existsSync, realpathSync } from 'node:fs';\nimport { isAbsolute, relative, resolve, sep } from 'node:path';\nimport { GkmError } from '../errors';\n\n/** Where a command's output goes. */\nexport type SandboxOutput = 'capture' | 'inherit' | 'stderr' | 'ignore';\n\nexport interface SandboxExecOptions {\n\t/**\n\t * Where the command runs: the project root or a directory below it, as an\n\t * absolute path or relative to the root. Anywhere else is refused with\n\t * {@link SandboxCwdEscape}.\n\t */\n\tcwd: string;\n\t/**\n\t * The command's whole environment. Nothing of the host's is added to it:\n\t * start from {@link Sandbox.env} and add what the step needs.\n\t */\n\tenv: Readonly<Record<string, string>>;\n\t/**\n\t * How long the command may run before it is killed. Required: a step that\n\t * waits forever — a sniffed entry that opens a server, a build stuck on a\n\t * prompt — would otherwise hold the deploy, and its lock, forever.\n\t */\n\ttimeoutMs: number;\n\t/**\n\t * Files the command can read, by name. Mounted in a directory of their own\n\t * — named by `GKM_SECRETS_DIR` in the command's environment — and removed\n\t * when it exits. Never set as variables, which every child inherits, a\n\t * crash report prints and `/proc/<pid>/environ` shows.\n\t */\n\tsecrets?: Readonly<Record<string, string>>;\n\t/**\n\t * `capture` (the default) returns stdout and stderr in the result;\n\t * `inherit` gives the command the host's terminal; `stderr` sends both\n\t * streams to the host's stderr; `ignore` discards them.\n\t */\n\toutput?: SandboxOutput;\n\t/** Kills the command when aborted; `exec` rejects with the signal's reason. */\n\tsignal?: AbortSignal;\n}\n\n/** How a command ended. A non-zero exit is a result, not an error. */\nexport interface SandboxResult {\n\texitCode: number | null;\n\tsignal: string | null;\n\t/** What it wrote to stdout, when its output was captured. */\n\tstdout: string;\n\t/** What it wrote to stderr, when its output was captured. */\n\tstderr: string;\n}\n\n/**\n * Runs a command against the project, and nothing else of the host's.\n *\n * `exec` resolves with the result however the command exited. It rejects\n * with {@link CommandTimedOut} once the timeout passes — after the command is\n * gone — with {@link SandboxCwdEscape} for a directory outside the project,\n * with the signal's reason when aborted, and with the spawn error when the\n * program cannot be started.\n */\nexport interface Sandbox {\n\t/** The project: the directory every command runs at or below. */\n\treadonly root: string;\n\t/**\n\t * Whether the code it runs is kept from the host: its files, its\n\t * processes, its memory.\n\t *\n\t * An isolating sandbox shares nothing but what crosses `exec`, so a config\n\t * reaches the deploy as data — a live object in it (a custom state store,\n\t * an inline target) cannot cross, and is refused with\n\t * `ConfigObjectNotSerializable`. A non-isolating one, like\n\t * {@link LocalSandbox}, runs on the host as the host's user; a project\n\t * whose config holds live objects is then loaded in-process as before,\n\t * because a project trusted to run there is trusted to do that.\n\t */\n\treadonly isolating: boolean;\n\t/**\n\t * The environment a command starts from: what any program needs to run\n\t * here — `PATH`, `HOME`, the locale — and no credential.\n\t */\n\treadonly env: Readonly<Record<string, string>>;\n\texec(\n\t\tcommand: string,\n\t\targs: readonly string[],\n\t\toptions: SandboxExecOptions,\n\t): Promise<SandboxResult>;\n}\n\n/** The variable naming the directory a command's secrets are mounted in. */\nexport const SECRETS_DIR_ENV = 'GKM_SECRETS_DIR';\n\n/** A command was asked to run outside the project. */\nexport class SandboxCwdEscape extends GkmError {\n\tconstructor(\n\t\treadonly cwd: string,\n\t\treadonly root: string,\n\t) {\n\t\tsuper(\n\t\t\t`Refusing to run in '${cwd}': it is outside the project at '${root}'. ` +\n\t\t\t\t'A sandboxed step only runs inside the project it was given — check ' +\n\t\t\t\t'the app paths in gkm.config.ts for `..` or an absolute path.',\n\t\t);\n\t\tthis.name = 'SandboxCwdEscape';\n\t}\n}\n\n/** A path with its symlinks resolved where it exists — `/tmp` is `/private/tmp`. */\nfunction real(path: string): string {\n\treturn existsSync(path) ? realpathSync(path) : path;\n}\n\n/**\n * `cwd` as an absolute directory inside `root`, or {@link SandboxCwdEscape}.\n *\n * Symlinks are resolved on both sides first, so a link inside the project\n * that points out of it is an escape, and a project reached through a link\n * (`/tmp` on macOS) is still itself. For a sandbox of a host's own to call\n * before it runs anything.\n */\nexport function confineCwd(root: string, cwd: string): string {\n\tconst absolute = resolve(root, cwd);\n\tconst from = relative(real(resolve(root)), real(absolute));\n\tif (from === '..' || from.startsWith(`..${sep}`) || isAbsolute(from)) {\n\t\tthrow new SandboxCwdEscape(cwd, root);\n\t}\n\treturn absolute;\n}\n\n/** A secret's file name: one path segment, so it cannot be written elsewhere. */\nexport class SecretNameInvalid extends GkmError {\n\tconstructor(readonly secretName: string) {\n\t\tsuper(\n\t\t\t`'${secretName}' cannot be a secret's name: it becomes a file name in ` +\n\t\t\t\t'the secrets directory, so it must be one segment of letters, digits, ' +\n\t\t\t\t\"'.', '-' or '_' and not start with '.'.\",\n\t\t);\n\t\tthis.name = 'SecretNameInvalid';\n\t}\n}\n\nconst SECRET_NAME = /^[A-Za-z0-9_-][A-Za-z0-9._-]*$/;\n\n/** Every secret name, checked before anything is written. */\nexport function assertSecretNames(\n\tsecrets: Readonly<Record<string, string>> | undefined,\n): void {\n\tfor (const name of Object.keys(secrets ?? {})) {\n\t\tif (!SECRET_NAME.test(name)) throw new SecretNameInvalid(name);\n\t}\n}\n\n/** A run's sandbox, and what its workers already answered. */\ninterface SandboxRun {\n\tsandbox: Sandbox;\n\tanswers: Map<string, Promise<unknown>>;\n}\n\nconst active = new AsyncLocalStorage<SandboxRun>();\n\n/**\n * Run `fn` with `sandbox` as the one its steps use.\n *\n * Per run rather than global, as `withOutput` routes a run's lines: two\n * deploys in one host process each build in their own sandbox. A step deep in\n * the engine — discovering constructs, sniffing an app — asks\n * {@link activeSandbox} rather than every function between `deploy()` and it\n * taking one more parameter.\n */\nexport function withSandbox<T>(sandbox: Sandbox, fn: () => T): T {\n\treturn active.run({ sandbox, answers: new Map() }, fn);\n}\n\n/** The sandbox of the run this is part of, if it was started with one. */\nexport function activeSandbox(): Sandbox | undefined {\n\treturn active.getStore()?.sandbox;\n}\n\n/**\n * `ask()`'s answer, asked once per run.\n *\n * A deploy loads its config and discovers its constructs from several places\n * — the first load, the engine, the Dockerfile generator — and in a sandbox\n * each was a child process of its own, for the same answer: the checkout does\n * not change while it deploys. Within a run in `sandbox`, the first answer\n * for `key` is the one every later ask gets. Outside one, or for another\n * sandbox, `ask()` runs each time.\n */\nexport function oncePerRun<T>(\n\tsandbox: Sandbox,\n\tkey: string,\n\task: () => Promise<T>,\n): Promise<T> {\n\tconst run = active.getStore();\n\tif (!run || run.sandbox !== sandbox) return ask();\n\n\tlet answer = run.answers.get(key) as Promise<T> | undefined;\n\tif (!answer) {\n\t\tanswer = ask();\n\t\trun.answers.set(key, answer);\n\t\t// A failure is not remembered: the next ask tries again.\n\t\tanswer.catch(() => run.answers.delete(key));\n\t}\n\treturn answer;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,MAAa,kBAAkB;;AAG/B,IAAa,mBAAb,cAAsCA,eAAAA,SAAS;CAEpC;CACA;CAFV,YACC,KACA,MACC;EACD,MACC,uBAAuB,IAAI,mCAAmC,KAAK,qIAGpE;EAPS,KAAA,MAAA;EACA,KAAA,OAAA;EAOT,KAAK,OAAO;CACb;AACD;;AAGA,SAAS,KAAK,MAAsB;CACnC,QAAA,GAAOC,QAAAA,WAAAA,CAAW,IAAI,KAAA,GAAIC,QAAAA,aAAAA,CAAa,IAAI,IAAI;AAChD;;;;;;;;;AAUA,SAAgB,WAAW,MAAc,KAAqB;CAC7D,MAAM,YAAA,GAAWC,UAAAA,QAAAA,CAAQ,MAAM,GAAG;CAClC,MAAM,QAAA,GAAOC,UAAAA,SAAAA,CAAS,MAAA,GAAKD,UAAAA,QAAAA,CAAQ,IAAI,CAAC,GAAG,KAAK,QAAQ,CAAC;CACzD,IAAI,SAAS,QAAQ,KAAK,WAAW,KAAKE,UAAAA,KAAK,MAAA,GAAKC,UAAAA,WAAAA,CAAW,IAAI,GAClE,MAAM,IAAI,iBAAiB,KAAK,IAAI;CAErC,OAAO;AACR;;AAGA,IAAa,oBAAb,cAAuCN,eAAAA,SAAS;CAC1B;CAArB,YAAY,YAA6B;EACxC,MACC,IAAI,WAAW,oKAGhB;EALoB,KAAA,aAAA;EAMpB,KAAK,OAAO;CACb;AACD;AAEA,MAAM,cAAc;;AAGpB,SAAgB,kBACf,SACO;CACP,KAAK,MAAM,QAAQ,OAAO,KAAK,WAAW,CAAC,CAAC,GAC3C,IAAI,CAAC,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,kBAAkB,IAAI;AAE/D;AAQA,MAAM,SAAS,IAAIO,iBAAAA,kBAA8B;;;;;;;;;;AAWjD,SAAgB,YAAe,SAAkB,IAAgB;CAChE,OAAO,OAAO,IAAI;EAAE;EAAS,yBAAS,IAAI,IAAI;CAAE,GAAG,EAAE;AACtD;;AAGA,SAAgB,gBAAqC;CACpD,OAAO,OAAO,SAAS,CAAC,EAAE;AAC3B;;;;;;;;;;;AAYA,SAAgB,WACf,SACA,KACA,KACa;CACb,MAAM,MAAM,OAAO,SAAS;CAC5B,IAAI,CAAC,OAAO,IAAI,YAAY,SAAS,OAAO,IAAI;CAEhD,IAAI,SAAS,IAAI,QAAQ,IAAI,GAAG;CAChC,IAAI,CAAC,QAAQ;EACZ,SAAS,IAAI;EACb,IAAI,QAAQ,IAAI,KAAK,MAAM;EAE3B,OAAO,YAAY,IAAI,QAAQ,OAAO,GAAG,CAAC;CAC3C;CACA,OAAO;AACR"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
|
|
2
|
-
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
3
|
-
import { existsSync, realpathSync } from "node:fs";
|
|
4
|
-
import { AsyncLocalStorage } from "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 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 existsSync(path) ? 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 = resolve(root, cwd);
|
|
56
|
-
const from = relative(real(resolve(root)), real(absolute));
|
|
57
|
-
if (from === ".." || from.startsWith(`..${sep}`) || 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 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 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
|
-
export { assertSecretNames as a, withSandbox as c, activeSandbox as i, SandboxCwdEscape as n, confineCwd as o, SecretNameInvalid as r, oncePerRun as s, SECRETS_DIR_ENV as t };
|
|
117
|
-
|
|
118
|
-
//# sourceMappingURL=sandbox-CbVB7uOD.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-CbVB7uOD.mjs","names":[],"sources":["../src/sandbox/sandbox.ts"],"sourcesContent":["/**\n * Where a deploy runs the project's own code.\n *\n * A deploy holds credentials — Dokploy's token, a registry login, an AWS key —\n * and loading `gkm.config.ts`, sniffing an app's environment and building it\n * all execute code from the repository being deployed. On a developer's own\n * laptop that is the developer's code. On a CI job for a fork, or a shared\n * build runner, it is not, and that code should not be able to read the\n * credentials used to deploy it, hang the deploy, or reach outside the\n * checkout.\n *\n * So every step that runs project code goes through a `Sandbox`: one call,\n * with an argument array rather than a shell line, the complete environment\n * the step needs rather than the host's, a timeout it cannot outlive, secrets\n * as files rather than variables, and a working directory inside the project.\n * The steps that need credentials — provisioning, pushing, releasing — are\n * the deploy's own code and never run in one.\n *\n * `LocalSandbox` is the default: a child process on this machine with an\n * allowlisted environment. A host that builds repositories it does not trust\n * passes its own — a container per build, a VM — through `deploy()`'s\n * `sandbox`.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport { existsSync, realpathSync } from 'node:fs';\nimport { isAbsolute, relative, resolve, sep } from 'node:path';\nimport { GkmError } from '../errors';\n\n/** Where a command's output goes. */\nexport type SandboxOutput = 'capture' | 'inherit' | 'stderr' | 'ignore';\n\nexport interface SandboxExecOptions {\n\t/**\n\t * Where the command runs: the project root or a directory below it, as an\n\t * absolute path or relative to the root. Anywhere else is refused with\n\t * {@link SandboxCwdEscape}.\n\t */\n\tcwd: string;\n\t/**\n\t * The command's whole environment. Nothing of the host's is added to it:\n\t * start from {@link Sandbox.env} and add what the step needs.\n\t */\n\tenv: Readonly<Record<string, string>>;\n\t/**\n\t * How long the command may run before it is killed. Required: a step that\n\t * waits forever — a sniffed entry that opens a server, a build stuck on a\n\t * prompt — would otherwise hold the deploy, and its lock, forever.\n\t */\n\ttimeoutMs: number;\n\t/**\n\t * Files the command can read, by name. Mounted in a directory of their own\n\t * — named by `GKM_SECRETS_DIR` in the command's environment — and removed\n\t * when it exits. Never set as variables, which every child inherits, a\n\t * crash report prints and `/proc/<pid>/environ` shows.\n\t */\n\tsecrets?: Readonly<Record<string, string>>;\n\t/**\n\t * `capture` (the default) returns stdout and stderr in the result;\n\t * `inherit` gives the command the host's terminal; `stderr` sends both\n\t * streams to the host's stderr; `ignore` discards them.\n\t */\n\toutput?: SandboxOutput;\n\t/** Kills the command when aborted; `exec` rejects with the signal's reason. */\n\tsignal?: AbortSignal;\n}\n\n/** How a command ended. A non-zero exit is a result, not an error. */\nexport interface SandboxResult {\n\texitCode: number | null;\n\tsignal: string | null;\n\t/** What it wrote to stdout, when its output was captured. */\n\tstdout: string;\n\t/** What it wrote to stderr, when its output was captured. */\n\tstderr: string;\n}\n\n/**\n * Runs a command against the project, and nothing else of the host's.\n *\n * `exec` resolves with the result however the command exited. It rejects\n * with {@link CommandTimedOut} once the timeout passes — after the command is\n * gone — with {@link SandboxCwdEscape} for a directory outside the project,\n * with the signal's reason when aborted, and with the spawn error when the\n * program cannot be started.\n */\nexport interface Sandbox {\n\t/** The project: the directory every command runs at or below. */\n\treadonly root: string;\n\t/**\n\t * Whether the code it runs is kept from the host: its files, its\n\t * processes, its memory.\n\t *\n\t * An isolating sandbox shares nothing but what crosses `exec`, so a config\n\t * reaches the deploy as data — a live object in it (a custom state store,\n\t * an inline target) cannot cross, and is refused with\n\t * `ConfigObjectNotSerializable`. A non-isolating one, like\n\t * {@link LocalSandbox}, runs on the host as the host's user; a project\n\t * whose config holds live objects is then loaded in-process as before,\n\t * because a project trusted to run there is trusted to do that.\n\t */\n\treadonly isolating: boolean;\n\t/**\n\t * The environment a command starts from: what any program needs to run\n\t * here — `PATH`, `HOME`, the locale — and no credential.\n\t */\n\treadonly env: Readonly<Record<string, string>>;\n\texec(\n\t\tcommand: string,\n\t\targs: readonly string[],\n\t\toptions: SandboxExecOptions,\n\t): Promise<SandboxResult>;\n}\n\n/** The variable naming the directory a command's secrets are mounted in. */\nexport const SECRETS_DIR_ENV = 'GKM_SECRETS_DIR';\n\n/** A command was asked to run outside the project. */\nexport class SandboxCwdEscape extends GkmError {\n\tconstructor(\n\t\treadonly cwd: string,\n\t\treadonly root: string,\n\t) {\n\t\tsuper(\n\t\t\t`Refusing to run in '${cwd}': it is outside the project at '${root}'. ` +\n\t\t\t\t'A sandboxed step only runs inside the project it was given — check ' +\n\t\t\t\t'the app paths in gkm.config.ts for `..` or an absolute path.',\n\t\t);\n\t\tthis.name = 'SandboxCwdEscape';\n\t}\n}\n\n/** A path with its symlinks resolved where it exists — `/tmp` is `/private/tmp`. */\nfunction real(path: string): string {\n\treturn existsSync(path) ? realpathSync(path) : path;\n}\n\n/**\n * `cwd` as an absolute directory inside `root`, or {@link SandboxCwdEscape}.\n *\n * Symlinks are resolved on both sides first, so a link inside the project\n * that points out of it is an escape, and a project reached through a link\n * (`/tmp` on macOS) is still itself. For a sandbox of a host's own to call\n * before it runs anything.\n */\nexport function confineCwd(root: string, cwd: string): string {\n\tconst absolute = resolve(root, cwd);\n\tconst from = relative(real(resolve(root)), real(absolute));\n\tif (from === '..' || from.startsWith(`..${sep}`) || isAbsolute(from)) {\n\t\tthrow new SandboxCwdEscape(cwd, root);\n\t}\n\treturn absolute;\n}\n\n/** A secret's file name: one path segment, so it cannot be written elsewhere. */\nexport class SecretNameInvalid extends GkmError {\n\tconstructor(readonly secretName: string) {\n\t\tsuper(\n\t\t\t`'${secretName}' cannot be a secret's name: it becomes a file name in ` +\n\t\t\t\t'the secrets directory, so it must be one segment of letters, digits, ' +\n\t\t\t\t\"'.', '-' or '_' and not start with '.'.\",\n\t\t);\n\t\tthis.name = 'SecretNameInvalid';\n\t}\n}\n\nconst SECRET_NAME = /^[A-Za-z0-9_-][A-Za-z0-9._-]*$/;\n\n/** Every secret name, checked before anything is written. */\nexport function assertSecretNames(\n\tsecrets: Readonly<Record<string, string>> | undefined,\n): void {\n\tfor (const name of Object.keys(secrets ?? {})) {\n\t\tif (!SECRET_NAME.test(name)) throw new SecretNameInvalid(name);\n\t}\n}\n\n/** A run's sandbox, and what its workers already answered. */\ninterface SandboxRun {\n\tsandbox: Sandbox;\n\tanswers: Map<string, Promise<unknown>>;\n}\n\nconst active = new AsyncLocalStorage<SandboxRun>();\n\n/**\n * Run `fn` with `sandbox` as the one its steps use.\n *\n * Per run rather than global, as `withOutput` routes a run's lines: two\n * deploys in one host process each build in their own sandbox. A step deep in\n * the engine — discovering constructs, sniffing an app — asks\n * {@link activeSandbox} rather than every function between `deploy()` and it\n * taking one more parameter.\n */\nexport function withSandbox<T>(sandbox: Sandbox, fn: () => T): T {\n\treturn active.run({ sandbox, answers: new Map() }, fn);\n}\n\n/** The sandbox of the run this is part of, if it was started with one. */\nexport function activeSandbox(): Sandbox | undefined {\n\treturn active.getStore()?.sandbox;\n}\n\n/**\n * `ask()`'s answer, asked once per run.\n *\n * A deploy loads its config and discovers its constructs from several places\n * — the first load, the engine, the Dockerfile generator — and in a sandbox\n * each was a child process of its own, for the same answer: the checkout does\n * not change while it deploys. Within a run in `sandbox`, the first answer\n * for `key` is the one every later ask gets. Outside one, or for another\n * sandbox, `ask()` runs each time.\n */\nexport function oncePerRun<T>(\n\tsandbox: Sandbox,\n\tkey: string,\n\task: () => Promise<T>,\n): Promise<T> {\n\tconst run = active.getStore();\n\tif (!run || run.sandbox !== sandbox) return ask();\n\n\tlet answer = run.answers.get(key) as Promise<T> | undefined;\n\tif (!answer) {\n\t\tanswer = ask();\n\t\trun.answers.set(key, answer);\n\t\t// A failure is not remembered: the next ask tries again.\n\t\tanswer.catch(() => run.answers.delete(key));\n\t}\n\treturn answer;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,MAAa,kBAAkB;;AAG/B,IAAa,mBAAb,cAAsC,SAAS;CAEpC;CACA;CAFV,YACC,KACA,MACC;EACD,MACC,uBAAuB,IAAI,mCAAmC,KAAK,qIAGpE;EAPS,KAAA,MAAA;EACA,KAAA,OAAA;EAOT,KAAK,OAAO;CACb;AACD;;AAGA,SAAS,KAAK,MAAsB;CACnC,OAAO,WAAW,IAAI,IAAI,aAAa,IAAI,IAAI;AAChD;;;;;;;;;AAUA,SAAgB,WAAW,MAAc,KAAqB;CAC7D,MAAM,WAAW,QAAQ,MAAM,GAAG;CAClC,MAAM,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,GAAG,KAAK,QAAQ,CAAC;CACzD,IAAI,SAAS,QAAQ,KAAK,WAAW,KAAK,KAAK,KAAK,WAAW,IAAI,GAClE,MAAM,IAAI,iBAAiB,KAAK,IAAI;CAErC,OAAO;AACR;;AAGA,IAAa,oBAAb,cAAuC,SAAS;CAC1B;CAArB,YAAY,YAA6B;EACxC,MACC,IAAI,WAAW,oKAGhB;EALoB,KAAA,aAAA;EAMpB,KAAK,OAAO;CACb;AACD;AAEA,MAAM,cAAc;;AAGpB,SAAgB,kBACf,SACO;CACP,KAAK,MAAM,QAAQ,OAAO,KAAK,WAAW,CAAC,CAAC,GAC3C,IAAI,CAAC,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,kBAAkB,IAAI;AAE/D;AAQA,MAAM,SAAS,IAAI,kBAA8B;;;;;;;;;;AAWjD,SAAgB,YAAe,SAAkB,IAAgB;CAChE,OAAO,OAAO,IAAI;EAAE;EAAS,yBAAS,IAAI,IAAI;CAAE,GAAG,EAAE;AACtD;;AAGA,SAAgB,gBAAqC;CACpD,OAAO,OAAO,SAAS,CAAC,EAAE;AAC3B;;;;;;;;;;;AAYA,SAAgB,WACf,SACA,KACA,KACa;CACb,MAAM,MAAM,OAAO,SAAS;CAC5B,IAAI,CAAC,OAAO,IAAI,YAAY,SAAS,OAAO,IAAI;CAEhD,IAAI,SAAS,IAAI,QAAQ,IAAI,GAAG;CAChC,IAAI,CAAC,QAAQ;EACZ,SAAS,IAAI;EACb,IAAI,QAAQ,IAAI,KAAK,MAAM;EAE3B,OAAO,YAAY,IAAI,QAAQ,OAAO,GAAG,CAAC;CAC3C;CACA,OAAO;AACR"}
|