void 0.27.0 → 0.28.0
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 +3 -1
- package/dist/{account-cmd-l-FM7Ioq.mjs → account-cmd-Ci00cncT.mjs} +5 -5
- package/dist/{agents-B_pX_HmQ.mjs → agents-CuNtT0D_.mjs} +5 -2
- package/dist/{application-analysis-DKy02UY0.mjs → application-analysis-D72ZQfMZ.mjs} +118 -135
- package/dist/{application-routing-DQyUh_5S.mjs → application-routing-Dy589Vgn.mjs} +1 -2
- package/dist/atomic-write-Dq6R0BPN.mjs +18 -0
- package/dist/{auth-Dn2vw-SG.mjs → auth-B6iOCjKI.mjs} +23 -56
- package/dist/{auth-link-vz9Z2kmG.mjs → auth-link-DWr6Afao.mjs} +10 -10
- package/dist/{auth-migrations-BwHgeEsD.mjs → auth-migrations-Cgs0k6lS.mjs} +28 -5
- package/dist/{auth-router-DvsCUVw4.mjs → auth-router-DP14wVkZ.mjs} +4 -4
- package/dist/auth-wn6F8dB8.mjs +2 -0
- package/dist/base64-DVrOndmI.mjs +16 -0
- package/dist/{better-auth-shared-CPvWD3nG.d.mts → better-auth-shared-B74NJIus.d.mts} +8 -13
- package/dist/{better-auth-shared-DPpj8zxc.mjs → better-auth-shared-CMXlZG7W.mjs} +56 -68
- package/dist/{build-cmd-D6we0VjO.mjs → build-cmd-Cr3FJxv0.mjs} +5 -5
- package/dist/{cache-CZRdzKx1.mjs → cache-D0Tt28cn.mjs} +5 -5
- package/dist/{cancel-deploy-CQ3NnMvf.mjs → cancel-deploy-CJKvk7AN.mjs} +4 -4
- package/dist/{cf-access-TWNzXltp.mjs → cf-access-BM9G0lhO.mjs} +4 -3
- package/dist/{cf-access-BcIBSKqG.mjs → cf-access-CWP4avfP.mjs} +3 -7
- package/dist/cf-build-output-2u583yJK.mjs +2 -0
- package/dist/{cf-build-output-DjvB_872.mjs → cf-build-output-Bc8i3dzE.mjs} +2 -2
- package/dist/cf-user-agent-ChjQp2MU.mjs +33 -0
- package/dist/cli/cli.mjs +198 -311
- package/dist/cli/cloudflare-operation-process.mjs +41 -15
- package/dist/cli/env-schema-probe.d.mts +5 -43
- package/dist/cli/env-schema-probe.mjs +14 -80
- package/dist/client-C1BjRn3g.mjs +2 -0
- package/dist/{client-DlDJuY0s.mjs → client-DM9Kcf4e.mjs} +161 -415
- package/dist/{cloudflare-auth-CuxfF6OA.mjs → cloudflare-auth-CqFBDo52.mjs} +12 -39
- package/dist/{cloudflare-cmd-lHqNlJGW.mjs → cloudflare-cmd-CTrn-lXJ.mjs} +6 -5
- package/dist/{cloudflare-config-BmhBv3HV.mjs → cloudflare-config-DV60XFFK.mjs} +16 -28
- package/dist/{cloudflare-connect-2G3rL2rP.mjs → cloudflare-connect-BosmCNlq.mjs} +3 -3
- package/dist/{cloudflare-operations-CwI1bChl.mjs → cloudflare-operations-BKdSfNBN.mjs} +26 -34
- package/dist/{cloudflare-operations-BlYLlowZ.mjs → cloudflare-operations-Ds-lX3Ts.mjs} +1 -1
- package/dist/{cloudflare-process-2-TfIEzB.mjs → cloudflare-process-CeDWJRhj.mjs} +12 -7
- package/dist/collect-NUlJMpLY.mjs +2 -0
- package/dist/{collect-DiTn9yr6.mjs → collect-xjffdCdk.mjs} +1 -1
- package/dist/{config-CSa15FvD.d.mts → config-7qoq2p9v.d.mts} +2 -2
- package/dist/{config-CLYAosnQ.mjs → config-BEm9vRvS.mjs} +11 -5
- package/dist/{config-DiowPT80.mjs → config-Bx_1SpnO.mjs} +87 -177
- package/dist/config-CNnrSMYm.mjs +2 -0
- package/dist/{config-DPByhVck.mjs → config-D0GY5ItR.mjs} +1 -1
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-BfPBHHm-.mjs → connect-nukQSoEO.mjs} +8 -8
- package/dist/{create-project-BdXEFKal.mjs → create-project-D4APeBwX.mjs} +7 -7
- package/dist/{create-project-qFDC45zg.mjs → create-project-DL7YXpjj.mjs} +1 -1
- package/dist/{db-Xs80hcaA.mjs → db-27RztQLy.mjs} +173 -263
- package/dist/{delete-d2vuou3j.mjs → delete-BbsZFZIw.mjs} +5 -5
- package/dist/deploy-B06EQq4t.mjs +6009 -0
- package/dist/deploy-Db2ALnQP.mjs +3 -0
- package/dist/deploy-managed-static-CGswbcay.mjs +2277 -0
- package/dist/deploy-transport-BiicfoQW.mjs +180 -0
- package/dist/deploy.d.mts +10 -0
- package/dist/deploy.mjs +82 -0
- package/dist/dev-inbox-Rd6j_8vM.mjs +217 -0
- package/dist/discover-CTUiSsfG.mjs +2 -0
- package/dist/{discover-CkCYv9T_.mjs → discover-D2PGT63u.mjs} +2 -2
- package/dist/{dist-BVqXeR_h.mjs → dist-ipQi0Q8y.mjs} +2 -3
- package/dist/{domain-BsDUBAvt.mjs → domain-Bfq9n03H.mjs} +7 -22
- package/dist/{dotenv-BfU6eqFt.mjs → dotenv-CNazY3-w.mjs} +4 -16
- package/dist/{email-d_Aux1vM.mjs → email-BcjSyAL0.mjs} +4 -20
- package/dist/{email-_lGAHOhp.mjs → email-DIwaQU4P.mjs} +99 -191
- package/dist/email-cloudflare-CH053RxK.mjs +1096 -0
- package/dist/email-protocol-D9nTvhCp.mjs +82 -0
- package/dist/{entry-CMAkqBmU.mjs → entry-ehmBvs5w.mjs} +2 -2
- package/dist/{env-BxocywBB.mjs → env-BJjULvL0.mjs} +2 -2
- package/dist/{env-DMA3cXZt.mjs → env-BhdWMrNy.mjs} +2 -13
- package/dist/{env-C74QepDE.mjs → env-C6ipBLp3.mjs} +8 -8
- package/dist/{env-public-DR7ZM6d-.d.mts → env-public-CCdykygU.d.mts} +6 -23
- package/dist/{env-raw-jZpP5n47.mjs → env-raw-Cklzcde3.mjs} +3 -20
- package/dist/{env-types-CwXgeMgL.mjs → env-types-DS2_y4X8.mjs} +2 -2
- package/dist/{env-validation-CrVNjsPm.mjs → env-validation-CTn-HhG1.mjs} +1 -1
- package/dist/env-validation-cE0zcmzO.mjs +486 -0
- package/dist/{gen-DtkQhvQg.mjs → gen-CnN1Xidx.mjs} +131 -253
- package/dist/gen-F8pSZnhc.mjs +2 -0
- package/dist/{generate-GDbL7sUr.mjs → generate-Dat0UTry.mjs} +38 -4
- package/dist/generate-Rii9klHB.mjs +2 -0
- package/dist/generated-wrangler-config-DeWj5F9Y.mjs +18 -0
- package/dist/{github-cmd-DaDdBbSS.mjs → github-cmd-BdkU4Nhe.mjs} +27 -71
- package/dist/{handler-BHAn2fZJ.mjs → handler-BZ1t7-Rv.mjs} +2 -2
- package/dist/{handler-CNAwjRcW.d.mts → handler-_PqY82xe.d.mts} +1 -1
- package/dist/{headers-DlfR78Nu.mjs → headers-Di1FsD3e.mjs} +26 -81
- package/dist/{help-0bTe_lID.mjs → help-Bug7pyK_.mjs} +18 -10
- package/dist/help-s9q7LTcu.mjs +2 -0
- package/dist/{inbound-PfQDLXc5.mjs → inbound-DmkTQeWp.mjs} +71 -222
- package/dist/{inbound-CH5Mksyy.d.mts → inbound-brj2-TM5.d.mts} +19 -58
- package/dist/index.d.mts +2 -18
- package/dist/index.mjs +200 -496
- package/dist/{info-PYWwkWyt.mjs → info-CujPwtMe.mjs} +5 -5
- package/dist/{init-DaBGmaXC.mjs → init-ZWOJvc-Z.mjs} +179 -388
- package/dist/isr-config-DPjXM8J2.mjs +194 -0
- package/dist/{link-C6fjafep.mjs → link-UEc7bnF4.mjs} +8 -8
- package/dist/{list-BTFBlqKl.mjs → list-CuWeOnzk.mjs} +6 -17
- package/dist/{live-CgQuTpqD.mjs → live-BxLX-JqJ.mjs} +19 -17
- package/dist/{live-Du8jXwOW.d.mts → live-DJONVlQK.d.mts} +1 -1
- package/dist/load-user-env-DD5qveNU.mjs +49 -0
- package/dist/{local-d1-ga5O_idV.mjs → local-d1-BM3p74mm.mjs} +6 -6
- package/dist/{login-GKcNUmtI.mjs → login-CZ2Cqa-D.mjs} +11 -11
- package/dist/login-DhK7o1oJ.mjs +2 -0
- package/dist/{logs-BiMSULmc.mjs → logs-TihRcLTk.mjs} +5 -5
- package/dist/migrate-BgT-hmu8.mjs +2 -0
- package/dist/{migrate-NLsjBbuM.mjs → migrate-uFwojusJ.mjs} +69 -21
- package/dist/migration-handler-Cg0Y4EPu.mjs +470 -0
- package/dist/{migration-handler-DM4clYj5.d.mts → migration-handler-CwlEQUoo.d.mts} +17 -26
- package/dist/{mime-DxCznlJq.mjs → mime-srOklVVv.mjs} +92 -395
- package/dist/{node-DJicPvPj.mjs → node-DoKbo1SZ.mjs} +8 -24
- package/dist/{operator-args-DOBhIaIg.mjs → operator-args-UnE8Y2eK.mjs} +27 -26
- package/dist/{operator-auth-BEZ_u0Cz.mjs → operator-auth-Cr2zCc-J.mjs} +2 -2
- package/dist/{operator-client-DbDv4vtE.mjs → operator-client-C-ROjk1I.mjs} +4 -4
- package/dist/{operator-cmd-BT4hgavL.mjs → operator-cmd-C5lCctnc.mjs} +8 -8
- package/dist/operator-cmd-Cjk5DiRx.mjs +2 -0
- package/dist/{output-C50ag2r3.mjs → output-FNHKw5Ac.mjs} +36 -5
- package/dist/{package-json-DXfiT1jV.mjs → package-json-BjYqR-So.mjs} +1 -1
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/client.mjs +91 -5
- package/dist/pages/index.d.mts +1 -2
- package/dist/pages/index.mjs +6 -6
- package/dist/pages/islands-plugin.mjs +5 -83
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/pages/serialize.mjs +1 -1
- package/dist/{platform-args-DUeXY9Om.mjs → platform-args-C6Mb_I3a.mjs} +34 -58
- package/dist/platform-args-Cm7x-fot.mjs +2 -0
- package/dist/{platform-auth-config-CkSx3usH.mjs → platform-auth-config-CJmNkFT2.mjs} +10 -11
- package/dist/{platform-auth-protection-BJimB_p9.mjs → platform-auth-protection-D5wvsI-Y.mjs} +36 -26
- package/dist/{platform-auth-recovery-BU6izFAU.mjs → platform-auth-recovery-D_0I3n-1.mjs} +8 -9
- package/dist/{platform-cmd-BbmJiq5O.mjs → platform-cmd-Cuj4oUVo.mjs} +1 -1
- package/dist/{platform-cmd-BbY1dWiM.mjs → platform-cmd-DxxZO6e5.mjs} +15 -15
- package/dist/{platform-discovery-DIYz8V63.mjs → platform-discovery-CHhNs8Nn.mjs} +1 -1
- package/dist/{platform-domain-CHVS6cV0.mjs → platform-domain-zLXnW1G_.mjs} +5 -5
- package/dist/{platform-lifecycle-DzCwqhFq.mjs → platform-lifecycle-DOW-wLfx.mjs} +1398 -2043
- package/dist/{platform-lifecycle-ByAlpkhV.mjs → platform-lifecycle-_gfnjUBr.mjs} +1 -1
- package/dist/{platform-management-CBOT4BSM.mjs → platform-management-CYrLvTGH.mjs} +1 -1
- package/dist/{platform-management-CuuVDhyt.mjs → platform-management-t7HKy4-U.mjs} +632 -124
- package/dist/{platform-plans-config-CN-heS4q.mjs → platform-plans-config-CNH6zbPX.mjs} +15 -11
- package/dist/{platform-recovery-CskSJgLh.mjs → platform-recovery-DeucI7A9.mjs} +6 -9
- package/dist/{platform-registry-Cjv2Qf0r.mjs → platform-registry-B9mWX9LO.mjs} +13 -18
- package/dist/{platform-setup-BBxRxmFC.mjs → platform-setup-CTf6MMT9.mjs} +19 -26
- package/dist/{plugin-inference-BlQbOL0P.mjs → plugin-inference-DsARdQKE.mjs} +18 -33
- package/dist/{prepare-Dq9hTIbo.mjs → prepare-C4zfwks4.mjs} +3 -3
- package/dist/{prepare-Do96654b.mjs → prepare-CSH9dKTI.mjs} +11 -13
- package/dist/prepare-dr9uxQSV.mjs +2 -0
- package/dist/{prerender-render-Ct20jftc.mjs → prerender-render-Bfsumdkv.mjs} +8 -2
- package/dist/prerender-render.d.mts +2 -0
- package/dist/prerender-render.mjs +2 -2
- package/dist/project-DiiOBZPF.mjs +2 -0
- package/dist/{project-cmd-DaoRrn-8.mjs → project-cmd-Dq75AXzy.mjs} +19 -19
- package/dist/{project-paths-GgcMozYz.mjs → project-paths-DMvEeSau.mjs} +9 -14
- package/dist/{project-BAm2aB6Q.mjs → project-rqDnVsJN.mjs} +8 -4
- package/dist/{project-team-Q_lCA7Io.mjs → project-team-B3_QcStG.mjs} +6 -6
- package/dist/{project-token-BArgK9o1.mjs → project-token-CvsRvv2I.mjs} +5 -5
- package/dist/{project-tsconfig-CVJhNMxs.mjs → project-tsconfig-bveqhlYA.mjs} +3 -5
- package/dist/{project-zero-trust-KO9Hu2Pq.mjs → project-zero-trust-D1ICiwN_.mjs} +5 -5
- package/dist/{protocol-BPZaNqBo.d.mts → protocol-4H7V_3Os.d.mts} +1 -1
- package/dist/{protocol-CfaUwNs8.mjs → protocol-RNP0u7UY.mjs} +9 -3
- package/dist/{provision-BfaLiWbj.mjs → provision-DDh7ITVS.mjs} +118 -865
- package/dist/{requests-C7Oeoh5u.mjs → requests-3CL3BuZh.mjs} +4 -4
- package/dist/resolve-project-B9Hr0D3n.mjs +2 -0
- package/dist/resolve-project-C_Cu7E8a.mjs +48 -0
- package/dist/{rollback-DVAtrLAl.mjs → rollback-Ce1d_0J9.mjs} +7 -17
- package/dist/{route-types-CbtsIeFn.mjs → route-types-IrBuwJ7u.mjs} +35 -70
- package/dist/routing-assets-VkrKIbxE.mjs +139 -0
- package/dist/{runner-9wjsSZx-.mjs → runner-B5huK2eC.mjs} +1 -1
- package/dist/{runner-DMBKSrRk.mjs → runner-DcVDrzuR.mjs} +7 -28
- package/dist/{runner-mysql-CEzKtmFb.mjs → runner-mysql-CCtyI0p6.mjs} +4 -3
- package/dist/runner-mysql-CaJq-hd6.mjs +2 -0
- package/dist/runner-pg-BJhFZZG4.mjs +2 -0
- package/dist/{runner-pg-DV8p_zjA.mjs → runner-pg-CPd-CB_F.mjs} +1 -1
- package/dist/runtime/ai.mjs +9 -22
- package/dist/runtime/better-auth-mysql.d.mts +2 -5
- package/dist/runtime/better-auth-mysql.mjs +6 -31
- package/dist/runtime/better-auth-pg.d.mts +2 -5
- package/dist/runtime/better-auth-pg.mjs +6 -32
- package/dist/runtime/better-auth.d.mts +2 -4
- package/dist/runtime/better-auth.mjs +9 -19
- package/dist/runtime/db.mjs +1 -1
- package/dist/runtime/durable.d.mts +16 -0
- package/dist/runtime/durable.mjs +26 -2
- package/dist/runtime/email/testing.d.mts +1 -1
- package/dist/runtime/email/testing.mjs +9 -23
- package/dist/runtime/email-protocol.d.mts +12 -0
- package/dist/runtime/email-protocol.mjs +2 -70
- package/dist/runtime/email.d.mts +1 -1
- package/dist/runtime/email.mjs +79 -221
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/env-public.mjs +12 -38
- package/dist/runtime/env.d.mts +1 -12
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/kv.mjs +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +1 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/migration-handler-mysql.d.mts +2 -2
- package/dist/runtime/migration-handler-mysql.mjs +3 -2
- package/dist/runtime/migration-handler-pg.d.mts +2 -2
- package/dist/runtime/migration-handler-pg.mjs +1 -1
- package/dist/runtime/migration-handler.d.mts +2 -2
- package/dist/runtime/migration-handler.mjs +2 -470
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/remote/binding-handler.mjs +62 -62
- package/dist/runtime/remote/index.mjs +16 -77
- package/dist/runtime/routing.d.mts +1 -4
- package/dist/runtime/routing.mjs +82 -218
- package/dist/runtime/sandbox-container.d.mts +2 -2
- package/dist/runtime/sandbox-container.mjs +2 -2
- package/dist/runtime/sandbox.d.mts +2 -2
- package/dist/runtime/sandbox.mjs +13 -6
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -3
- package/dist/runtime/ws-server.mjs +6 -28
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{sandbox-container-Bo0eiFKz.d.mts → sandbox-container-ChQRum-j.d.mts} +3 -1
- package/dist/{sandbox-container-C6ItmVuN.mjs → sandbox-container-DBKIqDEK.mjs} +12 -1
- package/dist/{sandbox-C5LFoJMf.d.mts → sandbox-q3waMc2T.d.mts} +1 -1
- package/dist/{scan-C3uDzz6J.mjs → scan-C0BMdmEd.mjs} +84 -7
- package/dist/{secret-BvtB7IjY.mjs → secret-B5J8bBsI.mjs} +62 -80
- package/dist/{serialize-BPvnNQuA.mjs → serialize-BtQyaYoC.mjs} +10 -4
- package/dist/{skills-BgVMvQdy.mjs → skills-BJsan98C.mjs} +2 -2
- package/dist/{subcommand-prompt-BSlnD1fI.mjs → subcommand-prompt-gQ-NDA-u.mjs} +38 -43
- package/dist/sveltekit.mjs +1 -1
- package/dist/validate-C9xtFOYR.mjs +2 -0
- package/dist/{validate-C9qJArv7.mjs → validate-CheZGRE7.mjs} +4 -8
- package/dist/version-metadata-DIrqEHQo.mjs +73 -0
- package/dist/{wrangler-D9KTuqnv.mjs → wrangler-BYs07Rxy.mjs} +119 -378
- package/dist/{ws-CChrrAU-.d.mts → ws-aKVYB-fA.d.mts} +1 -1
- package/dist/yarn-pnp-DLbEFMT0.mjs +92 -0
- package/docs/guide/auth.md +2 -0
- package/docs/guide/database/postgresql.md +2 -0
- package/docs/guide/database.md +2 -0
- package/docs/guide/durable-state.md +24 -0
- package/docs/guide/platform/administration/access.md +4 -0
- package/docs/guide/platform/administration/connected-apps.md +55 -0
- package/docs/guide/platform/installation/credentials.md +3 -1
- package/docs/guide/quickstart.md +2 -0
- package/docs/guide/sandboxes.md +2 -0
- package/docs/reference/api/deploy.md +23 -0
- package/docs/reference/api/pages.md +2 -0
- package/docs/reference/api.md +2 -1
- package/docs/reference/cli/database.md +9 -3
- package/docs/reference/cli/platform-installation.md +1 -1
- package/docs/reference/cli/setup.md +2 -0
- package/package.json +13 -16
- package/skills/void/SKILL.md +1 -0
- package/dist/auth-LMJcNESe.mjs +0 -2
- package/dist/cf-build-output-H9a97vME.mjs +0 -2
- package/dist/cf-user-agent-lKblH3zU.mjs +0 -17
- package/dist/client-tso2OfcG.mjs +0 -2
- package/dist/collect-DLyFDiKW.mjs +0 -2
- package/dist/config-5r-YpMC-.mjs +0 -2
- package/dist/config-B_ggY-IO.mjs +0 -89
- package/dist/config-BtSFvXZx.mjs +0 -2
- package/dist/config-write-AHGesphx.mjs +0 -61
- package/dist/deploy-Bqe1PYBw.mjs +0 -10458
- package/dist/deploy-VsWsVQkw.mjs +0 -2
- package/dist/dev-inbox-CK-UuPob.mjs +0 -297
- package/dist/discover-EDUf6JJw.mjs +0 -2
- package/dist/dist-_UUlL6bg.mjs +0 -2
- package/dist/env-validation-Dxdx_5wo.mjs +0 -951
- package/dist/gen-dA9hW7AV.mjs +0 -2
- package/dist/head-client-DzmJGN4C.mjs +0 -90
- package/dist/help-DfQYVfGY.mjs +0 -2
- package/dist/login-mx_ydhmp.mjs +0 -2
- package/dist/migrate-BHp07yJE.mjs +0 -2
- package/dist/operator-cmd-CwBB-1yb.mjs +0 -2
- package/dist/pages/head-client.d.mts +0 -13
- package/dist/pages/head-client.mjs +0 -2
- package/dist/platform-args-D4E1PjVw.mjs +0 -2
- package/dist/prepare-DRUV-g3X.mjs +0 -2
- package/dist/project-DedqCp59.mjs +0 -2
- package/dist/provision-Wu9ZBk9L.mjs +0 -2
- package/dist/resolve-project-BIeYs9Cw.mjs +0 -2
- package/dist/resolve-project-CP8rZs_p.mjs +0 -28
- package/dist/runner-mysql-CkFqZ6CE.mjs +0 -2
- package/dist/runner-pg-BGYRFdRp.mjs +0 -2
- package/dist/runtime/env-helpers.d.mts +0 -2
- package/dist/runtime/env-helpers.mjs +0 -2
- package/dist/validate-BJr9LfXy.mjs +0 -2
- package/dist/yarn-pnp-CUX_iTPA.mjs +0 -188
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
//#region src/runtime/auth-migrations.ts
|
|
2
|
+
/** Wraps a `mysql2/promise` connection. */
|
|
3
|
+
function mysqlMigrationRunner(connection) {
|
|
4
|
+
return {
|
|
5
|
+
async all(sql, params) {
|
|
6
|
+
const [rows] = await connection.query(sql, params);
|
|
7
|
+
return rows;
|
|
8
|
+
},
|
|
9
|
+
async run(sql, params) {
|
|
10
|
+
await connection.query(sql, params);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** Wraps a `pg` client. */
|
|
15
|
+
function pgMigrationRunner(client) {
|
|
16
|
+
return {
|
|
17
|
+
async all(sql, params) {
|
|
18
|
+
return (await client.query(sql, params)).rows;
|
|
19
|
+
},
|
|
20
|
+
async run(sql, params) {
|
|
21
|
+
await client.query(sql, params);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
2
25
|
function quoteIdentifier(name, dialect) {
|
|
3
26
|
return dialect === "mysql" ? `\`${name.replaceAll("`", "``")}\`` : `"${name.replaceAll("\"", "\"\"")}"`;
|
|
4
27
|
}
|
|
@@ -57,7 +80,7 @@ function buildCreateTableSql(schema, table) {
|
|
|
57
80
|
return `CREATE TABLE IF NOT EXISTS ${quoteIdentifier(table.name, dialect)} (${columns.join(", ")})`;
|
|
58
81
|
}
|
|
59
82
|
function buildAddColumnSql(schema, tableName, fieldName, field) {
|
|
60
|
-
const ifNotExists = schema.dialect === "
|
|
83
|
+
const ifNotExists = schema.dialect === "postgresql" ? " IF NOT EXISTS" : "";
|
|
61
84
|
return `ALTER TABLE ${quoteIdentifier(tableName, schema.dialect)} ADD COLUMN${ifNotExists} ${buildColumnDefinition(schema.dialect, schema, fieldName, field)}`;
|
|
62
85
|
}
|
|
63
86
|
function buildModifyMySqlColumnSql(schema, tableName, fieldName, field) {
|
|
@@ -125,14 +148,14 @@ async function applyPgAuthMigrations(runner, schema) {
|
|
|
125
148
|
async function applyMySqlAuthMigrations(runner, schema) {
|
|
126
149
|
const databaseRows = await runner.all("SELECT DATABASE() AS database_name");
|
|
127
150
|
const databaseName = String(databaseRows[0]?.database_name ?? "");
|
|
128
|
-
const tableRows = await runner.all("SELECT table_name FROM information_schema.tables WHERE table_schema = ? AND table_type = 'BASE TABLE'", [databaseName]);
|
|
151
|
+
const tableRows = await runner.all("SELECT TABLE_NAME AS table_name FROM information_schema.tables WHERE table_schema = ? AND table_type = 'BASE TABLE'", [databaseName]);
|
|
129
152
|
const existingTables = new Set(tableRows.map((row) => String(row.table_name)));
|
|
130
153
|
for (const table of schema.tables) {
|
|
131
154
|
if (!existingTables.has(table.name)) {
|
|
132
155
|
await runner.run(buildCreateTableSql(schema, table));
|
|
133
156
|
existingTables.add(table.name);
|
|
134
157
|
} else {
|
|
135
|
-
const columnRows = await runner.all("SELECT column_name, data_type
|
|
158
|
+
const columnRows = await runner.all("SELECT COLUMN_NAME AS column_name, DATA_TYPE AS data_type FROM information_schema.columns WHERE table_schema = ? AND table_name = ?", [databaseName, table.name]);
|
|
136
159
|
const existingColumns = new Map(columnRows.map((row) => [String(row.column_name), row]));
|
|
137
160
|
for (const [fieldName, field] of Object.entries(table.fields)) {
|
|
138
161
|
const existingColumn = existingColumns.get(fieldName);
|
|
@@ -140,9 +163,9 @@ async function applyMySqlAuthMigrations(runner, schema) {
|
|
|
140
163
|
else if (field.unbounded && String(existingColumn.data_type ?? "").toLowerCase() === "varchar") await runner.run(buildModifyMySqlColumnSql(schema, table.name, fieldName, field));
|
|
141
164
|
}
|
|
142
165
|
}
|
|
143
|
-
const indexRows = await runner.all("SELECT index_name FROM information_schema.statistics WHERE table_schema = ? AND table_name = ?", [databaseName, table.name]);
|
|
166
|
+
const indexRows = await runner.all("SELECT INDEX_NAME AS index_name FROM information_schema.statistics WHERE table_schema = ? AND table_name = ?", [databaseName, table.name]);
|
|
144
167
|
await createMissingIndexes(runner, "mysql", table, new Set(indexRows.map((row) => String(row.index_name))));
|
|
145
168
|
}
|
|
146
169
|
}
|
|
147
170
|
//#endregion
|
|
148
|
-
export { applyPgAuthMigrations as n, applySqliteAuthMigrations as r, applyMySqlAuthMigrations as t };
|
|
171
|
+
export { pgMigrationRunner as a, mysqlMigrationRunner as i, applyPgAuthMigrations as n, applySqliteAuthMigrations as r, applyMySqlAuthMigrations as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as listPlatformConnections } from "./platform-registry-
|
|
2
|
-
import { n as readDeploymentPlatform } from "./project-
|
|
1
|
+
import { s as listPlatformConnections } from "./platform-registry-B9mWX9LO.mjs";
|
|
2
|
+
import { n as readDeploymentPlatform } from "./project-rqDnVsJN.mjs";
|
|
3
3
|
import { K as select, tt as isCancel } from "./dist-D3m88sjf.mjs";
|
|
4
4
|
//#region src/cli/auth-router.ts
|
|
5
5
|
async function chooseDestination(root, args, interactive) {
|
|
@@ -38,11 +38,11 @@ async function chooseDestination(root, args, interactive) {
|
|
|
38
38
|
async function runAuthRouter(root, args, interactive = Boolean(process.stdin.isTTY)) {
|
|
39
39
|
const destination = await chooseDestination(root, args, interactive);
|
|
40
40
|
if (destination.platform === "cloudflare") {
|
|
41
|
-
const { runCloudflareCommand } = await import("./cloudflare-cmd-
|
|
41
|
+
const { runCloudflareCommand } = await import("./cloudflare-cmd-CTrn-lXJ.mjs");
|
|
42
42
|
await runCloudflareCommand(root, { subcommand: args.subcommand });
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
const { runAccountCommand } = await import("./account-cmd-
|
|
45
|
+
const { runAccountCommand } = await import("./account-cmd-Ci00cncT.mjs");
|
|
46
46
|
const subcommand = args.subcommand === "status" ? "whoami" : args.subcommand;
|
|
47
47
|
if (!destination.apiUrl) {
|
|
48
48
|
await runAccountCommand(root, { subcommand });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/runtime/base64.ts
|
|
2
|
+
function bytesToBase64(bytes) {
|
|
3
|
+
let binary = "";
|
|
4
|
+
const chunkSize = 32768;
|
|
5
|
+
for (let i = 0; i < bytes.length; i += chunkSize) binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
|
|
6
|
+
return btoa(binary);
|
|
7
|
+
}
|
|
8
|
+
/** Throws on invalid input. */
|
|
9
|
+
function base64ToBytes(value) {
|
|
10
|
+
const binary = atob(value);
|
|
11
|
+
const out = new Uint8Array(binary.length);
|
|
12
|
+
for (let i = 0; i < binary.length; i++) out[i] = binary.charCodeAt(i);
|
|
13
|
+
return out;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { bytesToBase64 as n, base64ToBytes as t };
|
|
@@ -45,19 +45,14 @@ type VoidAuthEnv = Record<string, unknown> & {
|
|
|
45
45
|
};
|
|
46
46
|
BETTER_AUTH_SECRET?: string;
|
|
47
47
|
};
|
|
48
|
+
type AuthDatabase = NonNullable<BetterAuthOptions["database"]>;
|
|
48
49
|
type VoidAuthRuntimeApi = {
|
|
49
|
-
resolveVoidAuthOptions(request: Request, env: VoidAuthEnv, runtime: VoidAuthRuntimeOptions,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
dispose(): Promise<void>;
|
|
56
|
-
}>;
|
|
57
|
-
resolveVoidAuthState(request: Request, env: VoidAuthEnv, runtime: VoidAuthRuntimeOptions, databaseOverride?: NonNullable<BetterAuthOptions["database"]>, disposeOverride?: () => Promise<void>): Promise<AuthState | null>;
|
|
58
|
-
runVoidAuthMiddleware(c: Context, next: () => Promise<void>, runtime: VoidAuthRuntimeOptions, databaseOverride?: NonNullable<BetterAuthOptions["database"]>, disposeOverride?: () => Promise<void>): Promise<void>;
|
|
59
|
-
handleVoidAuthRequest(c: Context, runtime: VoidAuthRuntimeOptions, databaseOverride?: NonNullable<BetterAuthOptions["database"]>, disposeOverride?: () => Promise<void>): Promise<Response>;
|
|
60
|
-
runVoidAuthMigrations(request: Request, env: VoidAuthEnv, runtime: VoidAuthRuntimeOptions, migrationSchema: VoidAuthMigrationSchema): Promise<void>;
|
|
50
|
+
resolveVoidAuthOptions(request: Request, env: VoidAuthEnv, runtime: VoidAuthRuntimeOptions, database: AuthDatabase): Promise<BetterAuthOptions>;
|
|
51
|
+
createVoidAuth(request: Request, env: VoidAuthEnv, runtime: VoidAuthRuntimeOptions, database: AuthDatabase): Promise<ReturnType<typeof betterAuth>>;
|
|
52
|
+
resolveVoidAuthState(request: Request, env: VoidAuthEnv, runtime: VoidAuthRuntimeOptions, database: AuthDatabase): Promise<AuthState | null>;
|
|
53
|
+
runVoidAuthMiddleware(c: Context, next: () => Promise<void>, runtime: VoidAuthRuntimeOptions, database: AuthDatabase): Promise<void>;
|
|
54
|
+
handleVoidAuthRequest(c: Context, runtime: VoidAuthRuntimeOptions, database: AuthDatabase): Promise<Response>;
|
|
55
|
+
runVoidAuthMigrations(env: VoidAuthEnv, runtime: VoidAuthRuntimeOptions, migrationSchema: VoidAuthMigrationSchema): Promise<void>;
|
|
61
56
|
};
|
|
62
57
|
//#endregion
|
|
63
|
-
export {
|
|
58
|
+
export { VoidAuthRuntimeApi as n, VoidAuthRuntimeOptions as r, VoidAuthEnv as t };
|
|
@@ -80,15 +80,22 @@ function resolveSocialProviders(env, configuredProviders) {
|
|
|
80
80
|
}
|
|
81
81
|
function appendAuthHeaders(c, source, includeCachePolicy) {
|
|
82
82
|
if (!source) return;
|
|
83
|
+
const routeDirectives = bareCacheDirectives(c.res.headers.get("cache-control"));
|
|
84
|
+
const keepRoutePolicy = routeDirectives.has("no-store") || routeDirectives.has("private") && routeDirectives.has("no-cache");
|
|
83
85
|
source.forEach((value, key) => {
|
|
84
|
-
if (!includeCachePolicy && ["cache-control", "pragma"].includes(key.toLowerCase())) return;
|
|
86
|
+
if ((!includeCachePolicy || keepRoutePolicy) && ["cache-control", "pragma"].includes(key.toLowerCase())) return;
|
|
85
87
|
c.header(key, value, { append: key.toLowerCase() === "set-cookie" });
|
|
86
88
|
});
|
|
87
|
-
|
|
89
|
+
const sessionDirectives = bareCacheDirectives(source.get("cache-control"));
|
|
90
|
+
if (source.has("set-cookie") && !keepRoutePolicy && ![
|
|
88
91
|
"private",
|
|
89
92
|
"no-store",
|
|
90
93
|
"no-cache"
|
|
91
|
-
].
|
|
94
|
+
].some((directive) => sessionDirectives.has(directive))) c.header("Cache-Control", "private, no-store");
|
|
95
|
+
}
|
|
96
|
+
function bareCacheDirectives(policy) {
|
|
97
|
+
const directives = (policy ?? "").match(/(?:[^",]|"(?:[^"\\]|\\.)*"?)+/g) ?? [];
|
|
98
|
+
return new Set(directives.map((directive) => directive.trim().toLowerCase()).filter((directive) => !directive.includes("=")));
|
|
92
99
|
}
|
|
93
100
|
function resolveUserConfig(userConfig, defaults, request, env, dialect) {
|
|
94
101
|
const mergeEmailAndPasswordDefaults = (options) => {
|
|
@@ -189,16 +196,12 @@ function applyCloudflareRateLimitDefaults(options) {
|
|
|
189
196
|
}
|
|
190
197
|
};
|
|
191
198
|
}
|
|
192
|
-
function
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
async function resolveVoidAuthOptions(request, env, runtime,
|
|
197
|
-
|
|
198
|
-
const { database, dispose } = databaseOverride ? {
|
|
199
|
-
database: databaseOverride,
|
|
200
|
-
dispose: disposeOverride ?? (async () => {})
|
|
201
|
-
} : await resolveDatabase(env);
|
|
199
|
+
function createVoidAuthRuntime(dialect, applyMigrations) {
|
|
200
|
+
function assertDialect(received) {
|
|
201
|
+
if (received !== dialect) throw new Error(`auth: Runtime mismatch. Expected ${dialect}, received '${received}'.`);
|
|
202
|
+
}
|
|
203
|
+
async function resolveVoidAuthOptions(request, env, runtime, database) {
|
|
204
|
+
assertDialect(runtime.dialect);
|
|
202
205
|
const origin = new URL(request.url).origin;
|
|
203
206
|
const emailAndPassword = resolveEmailAndPassword(runtime.providers);
|
|
204
207
|
const socialProviders = resolveSocialProviders(env, runtime.providers);
|
|
@@ -212,72 +215,57 @@ function createVoidAuthRuntime(dialect, resolveDatabase, runVoidAuthMigrations)
|
|
|
212
215
|
trustedOrigins: [origin]
|
|
213
216
|
};
|
|
214
217
|
const resolved = resolveUserConfig(runtime.userConfig, defaults, request, env, dialect);
|
|
215
|
-
return
|
|
216
|
-
options: runtime.dev !== true && cloudflareClientIp(request) ? applyCloudflareRateLimitDefaults(resolved) : resolved,
|
|
217
|
-
dispose
|
|
218
|
-
};
|
|
218
|
+
return runtime.dev !== true && cloudflareClientIp(request) ? applyCloudflareRateLimitDefaults(resolved) : resolved;
|
|
219
219
|
}
|
|
220
|
-
async function createVoidAuth(request, env, runtime,
|
|
221
|
-
|
|
222
|
-
return {
|
|
223
|
-
auth: betterAuth(options),
|
|
224
|
-
dispose
|
|
225
|
-
};
|
|
220
|
+
async function createVoidAuth(request, env, runtime, database) {
|
|
221
|
+
return betterAuth(await resolveVoidAuthOptions(request, env, runtime, database));
|
|
226
222
|
}
|
|
227
|
-
async function resolveVoidAuthState(request, env, runtime,
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
})).response ?? null;
|
|
235
|
-
} finally {
|
|
236
|
-
await dispose();
|
|
237
|
-
}
|
|
223
|
+
async function resolveVoidAuthState(request, env, runtime, database) {
|
|
224
|
+
const auth = await createVoidAuth(request, env, runtime, database);
|
|
225
|
+
return (await auth.api.getSession({
|
|
226
|
+
headers: await sessionHeaders(request, auth),
|
|
227
|
+
asResponse: false,
|
|
228
|
+
returnHeaders: true
|
|
229
|
+
})).response ?? null;
|
|
238
230
|
}
|
|
239
|
-
async function runVoidAuthMiddleware(c, next, runtime,
|
|
231
|
+
async function runVoidAuthMiddleware(c, next, runtime, database) {
|
|
240
232
|
if (c.req.path.startsWith("/__")) {
|
|
241
233
|
c.set("user", null);
|
|
242
234
|
c.set("session", null);
|
|
243
235
|
return next();
|
|
244
236
|
}
|
|
245
|
-
const
|
|
237
|
+
const auth = await createVoidAuth(c.req.raw, c.env, runtime, database);
|
|
246
238
|
c.set("__voidAuth", auth);
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
appendAuthHeaders(c, result.headers, state !== null || credentialed || result.headers?.has("set-cookie") === true);
|
|
268
|
-
} finally {
|
|
269
|
-
await dispose();
|
|
270
|
-
}
|
|
239
|
+
const result = await auth.api.getSession({
|
|
240
|
+
headers: await sessionHeaders(c.req.raw, auth),
|
|
241
|
+
asResponse: false,
|
|
242
|
+
returnHeaders: true
|
|
243
|
+
});
|
|
244
|
+
const state = result.response ?? null;
|
|
245
|
+
c.set("user", state?.user ?? null);
|
|
246
|
+
c.set("session", state?.session ?? null);
|
|
247
|
+
await authContext.run({
|
|
248
|
+
user: state?.user ?? null,
|
|
249
|
+
state
|
|
250
|
+
}, async () => {
|
|
251
|
+
await next();
|
|
252
|
+
});
|
|
253
|
+
const credentialed = [
|
|
254
|
+
"cookie",
|
|
255
|
+
"authorization",
|
|
256
|
+
"cf-access-jwt-assertion"
|
|
257
|
+
].some((header) => c.req.raw.headers.has(header));
|
|
258
|
+
appendAuthHeaders(c, result.headers, state !== null || credentialed || result.headers?.has("set-cookie") === true);
|
|
271
259
|
}
|
|
272
|
-
async function handleVoidAuthRequest(c, runtime,
|
|
260
|
+
async function handleVoidAuthRequest(c, runtime, database) {
|
|
273
261
|
const existingAuth = c.get("__voidAuth");
|
|
274
262
|
if (existingAuth) return existingAuth.handler(c.req.raw);
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
263
|
+
return (await createVoidAuth(c.req.raw, c.env, runtime, database)).handler(c.req.raw);
|
|
264
|
+
}
|
|
265
|
+
async function runVoidAuthMigrations(env, runtime, migrationSchema) {
|
|
266
|
+
assertDialect(runtime.dialect);
|
|
267
|
+
assertDialect(migrationSchema.dialect);
|
|
268
|
+
await applyMigrations(env, migrationSchema);
|
|
281
269
|
}
|
|
282
270
|
return {
|
|
283
271
|
resolveVoidAuthOptions,
|
|
@@ -289,4 +277,4 @@ function createVoidAuthRuntime(dialect, resolveDatabase, runVoidAuthMigrations)
|
|
|
289
277
|
};
|
|
290
278
|
}
|
|
291
279
|
//#endregion
|
|
292
|
-
export {
|
|
280
|
+
export { resolveConnectionString as n, createVoidAuthRuntime as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as readProjectConfig } from "./project-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
1
|
+
import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { H as outro, L as log } from "./dist-D3m88sjf.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { n as PlatformApiError, r as PlatformClient } from "./client-
|
|
6
|
-
import {
|
|
4
|
+
import { f as import_picocolors, i as dim, m as printSuccess } from "./output-FNHKw5Ac.mjs";
|
|
5
|
+
import { n as PlatformApiError, r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
6
|
+
import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-C_Cu7E8a.mjs";
|
|
7
7
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
8
8
|
//#region src/cli/build-cmd.ts
|
|
9
9
|
const POLL_MS = 1e3;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as readProjectConfig } from "./project-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
1
|
+
import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { L as log } from "./dist-D3m88sjf.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as PlatformClient } from "./client-
|
|
6
|
-
import {
|
|
4
|
+
import { m as printSuccess, o as formatCount, r as createSpinner } from "./output-FNHKw5Ac.mjs";
|
|
5
|
+
import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
6
|
+
import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-C_Cu7E8a.mjs";
|
|
7
7
|
//#region src/cli/cache.ts
|
|
8
8
|
async function runPurgeCacheCommand(root, projectSlug) {
|
|
9
9
|
console.log();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as readProjectConfig } from "./project-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
1
|
+
import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { A as confirm, H as outro, L as log, tt as isCancel } from "./dist-D3m88sjf.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { m as printSuccess } from "./output-FNHKw5Ac.mjs";
|
|
5
|
+
import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
6
6
|
//#region src/cli/cancel-deploy.ts
|
|
7
7
|
const ACTIVE_STATUSES = /* @__PURE__ */ new Set([
|
|
8
8
|
"pending",
|
|
@@ -32,9 +32,10 @@ function cfAccessHeaders(env, targetUrl) {
|
|
|
32
32
|
if (typeof encoded === "string" && encoded) try {
|
|
33
33
|
const records = JSON.parse(encoded);
|
|
34
34
|
if (!records || typeof records !== "object" || Array.isArray(records)) return {};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
if (Object.hasOwn(records, origin)) {
|
|
36
|
+
const entry = records[origin];
|
|
37
|
+
return entry && typeof entry === "object" && !Array.isArray(entry) ? accessHeaders(entry) : {};
|
|
38
|
+
}
|
|
38
39
|
} catch {
|
|
39
40
|
return {};
|
|
40
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as writeKeyringPassword, c as normalizePlatformApiUrl, u as platformCredentialAccount, w as readKeyringPassword } from "./platform-registry-
|
|
2
|
-
import { t as cfAccessHeaders } from "./cf-access-
|
|
1
|
+
import { T as writeKeyringPassword, c as normalizePlatformApiUrl, u as platformCredentialAccount, w as readKeyringPassword } from "./platform-registry-B9mWX9LO.mjs";
|
|
2
|
+
import { t as cfAccessHeaders } from "./cf-access-BM9G0lhO.mjs";
|
|
3
3
|
import { spawnSync } from "node:child_process";
|
|
4
4
|
//#region src/cli/cf-access.ts
|
|
5
5
|
const ACCESS_KEYRING_SERVICE = "dev.void.cli.access";
|
|
@@ -105,10 +105,6 @@ function ensurePlatformAccessToken(apiUrl, challenged = false, required = false,
|
|
|
105
105
|
keyringTokens.set(origin, token);
|
|
106
106
|
writeKeyringPassword(ACCESS_KEYRING_SERVICE, account, token);
|
|
107
107
|
}
|
|
108
|
-
/** Restore only credentials scoped to this explicitly selected platform origin. */
|
|
109
|
-
function ensureCloudflaredToken(apiUrl) {
|
|
110
|
-
ensurePlatformAccessToken(apiUrl);
|
|
111
|
-
}
|
|
112
108
|
function runCloudflared(args, opts) {
|
|
113
109
|
try {
|
|
114
110
|
const result = spawnSync("cloudflared", args, {
|
|
@@ -133,4 +129,4 @@ function ensurePlatformProxyAccess(apiUrl, proxyUrl) {
|
|
|
133
129
|
ensurePlatformAccessToken(proxyUrl, false, Object.keys(cfAccessHeaders(process.env, apiUrl)).length > 0);
|
|
134
130
|
}
|
|
135
131
|
//#endregion
|
|
136
|
-
export {
|
|
132
|
+
export { ensurePlatformProxyAccess as n, isCloudflareAccessChallenge as r, ensurePlatformAccessToken as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as join,
|
|
1
|
+
import { a as join, c as resolve, i as isAbsolute, n as dirname, r as extname, s as relative, t as basename } from "./dist-ipQi0Q8y.mjs";
|
|
2
2
|
import { copyFileSync, cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { isRecord } from "@void/deploy-core";
|
|
@@ -6,9 +6,9 @@ import { randomUUID } from "node:crypto";
|
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
7
7
|
import { isDeepStrictEqual } from "node:util";
|
|
8
8
|
import { spawn, spawnSync } from "node:child_process";
|
|
9
|
+
import ignore from "ignore";
|
|
9
10
|
import { getWorkerBundleDir, normalizeDirectoryName, readBuildOutput, writeAssets, writeContainerConfig, writeRootConfig, writeWorkerConfig } from "@cloudflare/build-output-utils";
|
|
10
11
|
import { InputConfigSchema, OutputContainerSchema } from "@cloudflare/config";
|
|
11
|
-
import ignore from "ignore";
|
|
12
12
|
//#region src/cli/cf-config-migrate.ts
|
|
13
13
|
function record(value) {
|
|
14
14
|
return isRecord(value) ? value : null;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { n as getOwnVersion } from "./agents-CuNtT0D_.mjs";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
//#region src/cli/cf-command-values.ts
|
|
4
|
+
/** Accept a cf positional only when it cannot be read as a flag or carry control characters. */
|
|
5
|
+
function safePositional(value) {
|
|
6
|
+
return typeof value === "string" && value.length > 0 && !value.startsWith("-") && ![...value].some((character) => {
|
|
7
|
+
const code = character.charCodeAt(0);
|
|
8
|
+
return code < 32 || code === 127;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
/** Read the version ID and URLs that cf prints after a prebuilt upload. */
|
|
12
|
+
function readCfUploadOutput(stdout) {
|
|
13
|
+
return {
|
|
14
|
+
versionId: stdout.match(/(?:Worker|Current) Version ID:\s*([0-9a-f]{8}-[0-9a-f-]{27})/i)?.[1],
|
|
15
|
+
previewUrl: stdout.match(/Version Preview(?: Alias)? URL:\s*(https:\/\/\S+)/i)?.[1],
|
|
16
|
+
workersDevUrl: stdout.match(/(https:\/\/[a-z0-9.-]+\.workers\.dev(?:\/[^\s]*)?)/i)?.[1]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/cli/cf-user-agent.ts
|
|
21
|
+
let voidUserAgent;
|
|
22
|
+
let cfCliVersion;
|
|
23
|
+
function getVoidUserAgent() {
|
|
24
|
+
if (voidUserAgent === void 0) voidUserAgent = `void/${getOwnVersion()}`;
|
|
25
|
+
return voidUserAgent;
|
|
26
|
+
}
|
|
27
|
+
/** cf prepends `cf-cli/` to CLI_VERSION for both API requests and uploads. */
|
|
28
|
+
function getCfCliVersion(attribution) {
|
|
29
|
+
if (cfCliVersion === void 0) cfCliVersion = `${JSON.parse(readFileSync(new URL(import.meta.resolve("cf/package.json")), "utf8")).version} ${getVoidUserAgent()}`;
|
|
30
|
+
return attribution ? `${cfCliVersion} ${attribution}` : cfCliVersion;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { safePositional as i, getVoidUserAgent as n, readCfUploadOutput as r, getCfCliVersion as t };
|