cf 1.0.0-beta.21 → 1.0.0-beta.22
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/_meta/commands.json +5080 -4931
- package/dist/_meta/schemas.json +3051 -3055
- package/dist/{abuse-reports-CbUAnJxd.mjs → abuse-reports-GF9V-_qH.mjs} +1 -1
- package/dist/{access-C-78DlxL.mjs → access-dWdATy_5.mjs} +1 -1
- package/dist/{accounts-DEqQPxCz.mjs → accounts-CNpiDgQ-.mjs} +50 -52
- package/dist/{acm-jmhCq3Yh.mjs → acm-BXOuZNqO.mjs} +1 -1
- package/dist/{addressing-BeYFpQvC.mjs → addressing-BE4KpVHp.mjs} +1 -1
- package/dist/agent-context-Dtyy4aKL.mjs +2 -0
- package/dist/{agent-memory-Chlovb7j.mjs → agent-memory-WOFBlqfc.mjs} +1 -1
- package/dist/{ai-BndH3HYN.mjs → ai-2syYes5a.mjs} +1 -1
- package/dist/{ai-audit-BUJ-70O_.mjs → ai-audit-DBZnZtSH.mjs} +1 -1
- package/dist/{ai-gateway-CCk7VKhL.mjs → ai-gateway-BL8uRjav.mjs} +1 -1
- package/dist/{ai-search-BexET_wp.mjs → ai-search-xKyrECHJ.mjs} +1 -1
- package/dist/{ai-security-D4MxRlxX.mjs → ai-security-D-o76TBI.mjs} +1 -1
- package/dist/{alerting-rw8Oi3x7.mjs → alerting-D0Hh3IxQ.mjs} +1 -1
- package/dist/{analytics-q-guNEOK.mjs → analytics-BS_HDYYE.mjs} +1 -1
- package/dist/{analytics-engine-Bk7dQLcm.mjs → analytics-engine-B8J0AASh.mjs} +1 -1
- package/dist/api-X3wKppsT.mjs +3 -0
- package/dist/{api-security-BDc6gkf1.mjs → api-security-Dm-_J64v.mjs} +1 -1
- package/dist/{argo-CnLIqm0i.mjs → argo-DLLQUUEp.mjs} +1 -1
- package/dist/{artifacts-Cil33dzV.mjs → artifacts-B-ILiKwb.mjs} +1 -1
- package/dist/{audit-logs--E2Eclb7.mjs → audit-logs-B6f7Yyqb.mjs} +1 -1
- package/dist/{auth-BcNLQji1.mjs → auth-BlWCu-YH.mjs} +1 -1
- package/dist/auth-C0-WtqBw.mjs +2 -0
- package/dist/{auth-BtZmY6sE.mjs → auth-CENmPoCB.mjs} +1 -1
- package/dist/{auth-token-aF5AVLlH.mjs → auth-token-7Gn0n5N_.mjs} +1 -1
- package/dist/{autoconfig-Dbp6J25P.mjs → autoconfig-Bjb97Onj.mjs} +1 -1
- package/dist/{basin-catalog-dnVyzopm.mjs → basin-catalog-C61jbxPf.mjs} +1 -1
- package/dist/{billing-Fqp3jB2V.mjs → billing-CpbtioM3.mjs} +1 -1
- package/dist/blocks-DDNRRYxu.mjs +5 -0
- package/dist/{bot-management-SEDgo1Xg.mjs → bot-management-iYrqBG7K.mjs} +1 -1
- package/dist/{botnet-feed-DPqR4M0Y.mjs → botnet-feed-CiCwJ6Oe.mjs} +1 -1
- package/dist/{brand-protection-B8vwKfM9.mjs → brand-protection-D25yQ6cQ.mjs} +1 -1
- package/dist/{browser-run-BybYDq3I.mjs → browser-run-CC3fAKEB.mjs} +1 -1
- package/dist/build-CovoviZW.mjs +2 -0
- package/dist/{build-CWlpWVBf.mjs → build-DKFvtSB_.mjs} +1 -1
- package/dist/{builds-CvtOG-Gk.mjs → builds-AFdd5qia.mjs} +1 -1
- package/dist/{cache-Bme_d2Wx.mjs → cache-BI3Oyz-Z.mjs} +1 -1
- package/dist/{cli-CIKDqm-u.mjs → cli-Dji5-s1V.mjs} +1 -1
- package/dist/{client-side-security-ZQeRoo1t.mjs → client-side-security-rknn53xw.mjs} +1 -1
- package/dist/{cloud-connector-BeunZlNV.mjs → cloud-connector-BTc3qgHz.mjs} +1 -1
- package/dist/cloudforce-one-BoFYTYsT.mjs +316 -0
- package/dist/{command-CkZkTjIj.mjs → command-6vX_Ie2o.mjs} +1 -1
- package/dist/{command-DWWuXQV8.mjs → command-BDFf54JB.mjs} +1 -1
- package/dist/{command-C9CNvZi_.mjs → command-B_C1I0aq.mjs} +1 -1
- package/dist/{command-CzWWQv8j.mjs → command-BpmbvQqK.mjs} +1 -1
- package/dist/{command-BGRucANI.mjs → command-CKEmPXtc.mjs} +1 -1
- package/dist/{command-CQ5qHE7n.mjs → command-CiBygnsK.mjs} +1 -1
- package/dist/{command-B3uWlw57.mjs → command-KuJJ2WEe.mjs} +1 -1
- package/dist/{command-prWMAJbg.mjs → command-WlIhTGN6.mjs} +1 -1
- package/dist/{command-DkwmylF2.mjs → command-leDr72L4.mjs} +1 -1
- package/dist/{command-CtlD6MEi.mjs → command-ukMoR-tT.mjs} +1 -1
- package/dist/{completions-2Otv0HMd.mjs → completions-DGe2alry.mjs} +1 -1
- package/dist/{connector-interrupts-Dfhxupmg.mjs → connector-interrupts-DZyCZta-.mjs} +1 -1
- package/dist/{connector-telemetry-events-CLVpDTIa.mjs → connector-telemetry-events-BP5GTJuQ.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-E_1tmNmQ.mjs → connector-telemetry-snapshots-Q9y68rU7.mjs} +1 -1
- package/dist/{connectors-ChJpQFSl.mjs → connectors-C6wEHhyM.mjs} +1 -1
- package/dist/{containers-Cj5-9nUg.mjs → containers-DcR44W-a.mjs} +2 -2
- package/dist/{containers-CzAZfmnj.mjs → containers-f3DbMCIO.mjs} +1 -1
- package/dist/{content-scan-CIA_9PV8.mjs → content-scan-cQbQH1Ko.mjs} +1 -1
- package/dist/{context-DVh8Wyfs.mjs → context-CSjTAJ8s.mjs} +1 -1
- package/dist/{cps-hJkqdsHx.mjs → cps-aDZte41c.mjs} +1 -1
- package/dist/create-BtmuVqVL.mjs +2 -0
- package/dist/{csam-scanner-cCVO3lNF.mjs → csam-scanner-cRaGDmR_.mjs} +1 -1
- package/dist/{custom-csrs-BrTWUZ0c.mjs → custom-csrs-DoAFlLRn.mjs} +1 -1
- package/dist/{custom-hostnames-C4ft77oC.mjs → custom-hostnames-5vHNAJo7.mjs} +1 -1
- package/dist/{custom-nameservers-BWfrZhD1.mjs → custom-nameservers-B7dTZfCW.mjs} +1 -1
- package/dist/{custom-pages-DqTMKtRc.mjs → custom-pages-DsXlaGqQ.mjs} +1 -1
- package/dist/{d1-B58AA9PA.mjs → d1-DZ2JyfdZ.mjs} +3 -3
- package/dist/{delegate-D7yYckA4.mjs → delegate-DzeuzE99.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-CEROLAdh.mjs → deploy-CPFnQQOk.mjs} +1 -1
- package/dist/{deploy-context-Do89WayB.mjs → deploy-context-C_YUdUN-.mjs} +1 -1
- package/dist/{deploy-input-DyMuMsi5.mjs → deploy-input-CKQOolPd.mjs} +1 -1
- package/dist/{dev-BaFS7kOM.mjs → dev-rRWAGDV_.mjs} +1 -1
- package/dist/{diagnostics-4gfYj7Pf.mjs → diagnostics-BIuJQRjU.mjs} +1 -1
- package/dist/{dls-ClWVxTBg.mjs → dls-BurMhzEE.mjs} +1 -1
- package/dist/{dns-CML-wxIt.mjs → dns-Dl1VSmFf.mjs} +1 -1
- package/dist/{dns-firewall-CL0b3dJ1.mjs → dns-firewall-BykvgGT1.mjs} +1 -1
- package/dist/{docs-BeYBHwUN.mjs → docs-FllOac9a.mjs} +1 -1
- package/dist/{durable-objects-uZECeq_f.mjs → durable-objects-BNCJA3NE.mjs} +1 -1
- package/dist/{email-auth-CCNW798I.mjs → email-auth-BYvR29qP.mjs} +1 -1
- package/dist/{email-domains-1rD1d84O.mjs → email-domains-C3jG7o39.mjs} +1 -1
- package/dist/{email-routing-CYv-LrbV.mjs → email-routing-BQ7b2KAy.mjs} +1 -1
- package/dist/{email-security-CWEUYPYo.mjs → email-security-CsoNcUfp.mjs} +1 -1
- package/dist/{email-sending-DHSzCfJx.mjs → email-sending-d_b9vyge.mjs} +3 -3
- package/dist/{error-sanitization-DWJ5ka7h.mjs → error-sanitization-ahuAGEjT.mjs} +1 -1
- package/dist/error-sanitization-rodO1WCL.mjs +2 -0
- package/dist/{errors-ol9sMqSe.mjs → errors-DFSWbpd6.mjs} +5 -5
- package/dist/{field-extractors-CuBM_uO4.mjs → field-extractors-Be4UTSz-.mjs} +1 -1
- package/dist/{firewall-SMIUSypF.mjs → firewall-DYGPUErP.mjs} +1 -1
- package/dist/{flagship-D3v6iDdw.mjs → flagship-HIikhoYo.mjs} +1 -1
- package/dist/{fraud-B2f7O15X.mjs → fraud-DNAOkNU5.mjs} +1 -1
- package/dist/get-Be821dio.mjs +2 -0
- package/dist/{google-tag-gateway-BwOc62Gy.mjs → google-tag-gateway-DHvhuTYu.mjs} +1 -1
- package/dist/{healthchecks-BQXHnihB.mjs → healthchecks-BKtoWgF2.mjs} +1 -1
- package/dist/{hyperdrive-Bd6Yfje3.mjs → hyperdrive-DQrmkuSh.mjs} +1 -1
- package/dist/{iam-qJPI1_aZ.mjs → iam-BEs1Geob.mjs} +1 -1
- package/dist/{images-goHZJOxy.mjs → images-D55kUS0m.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-CVx0Ya1E.mjs → init-BTXSeUaj.mjs} +1 -1
- package/dist/{intel-CwiqwJI9.mjs → intel-BDbanlya.mjs} +1 -1
- package/dist/{internal-5cnlw9mH.mjs → internal-Cj_Wo6sr.mjs} +1 -1
- package/dist/{ips-KBxmXhvO.mjs → ips-CHrG3mwW.mjs} +1 -1
- package/dist/{k2-KhIP5NFT.mjs → k2-CJzI3dVt.mjs} +1 -1
- package/dist/{kv-CCem2sEY.mjs → kv-BjfDMxOg.mjs} +1 -1
- package/dist/{lazy-command-BMhD5ffF.mjs → lazy-command-DkI_21Dt.mjs} +1 -1
- package/dist/{leaked-credential-checks-BkPZiwE2.mjs → leaked-credential-checks-BHe-erAg.mjs} +1 -1
- package/dist/{live-BhHzxFna.mjs → live-DSwOLngp.mjs} +1 -1
- package/dist/{load-balancers-17GBXdju.mjs → load-balancers-CWNEVfum.mjs} +1 -1
- package/dist/{login-Buhvx6Fi.mjs → login-CJYJE6Ae.mjs} +1 -1
- package/dist/login-D2Bf_HMY.mjs +2 -0
- package/dist/{logpush-BCCUxa4J.mjs → logpush-BQhzhkBY.mjs} +1 -1
- package/dist/{logs-4CwupKRG.mjs → logs-DndNcbrR.mjs} +1 -1
- package/dist/{magic-cloud-networking-Xy6SC-V-.mjs → magic-cloud-networking-XmIKU6F1.mjs} +1 -1
- package/dist/{magic-network-monitoring-B8pRZp2g.mjs → magic-network-monitoring-BgPLcQzT.mjs} +1 -1
- package/dist/{magic-transit-CwfO3OOX.mjs → magic-transit-C2kLj1Hd.mjs} +1 -1
- package/dist/{managed-defense-CtFLuvuB.mjs → managed-defense-Bq63Exyv.mjs} +1 -1
- package/dist/{managed-transforms-Hto8OCBS.mjs → managed-transforms-Bz3Q6vSk.mjs} +1 -1
- package/dist/{mcp-SQ0MAVUJ.mjs → mcp-IiegTI5c.mjs} +1 -1
- package/dist/{mesh-C8A6tVqA.mjs → mesh-C7sj3FL4.mjs} +1 -1
- package/dist/{migrate-Dufxsb_F.mjs → migrate-D7pH9_Y8.mjs} +1 -1
- package/dist/{monetization-CYVaCAe9.mjs → monetization-DvfqZhGk.mjs} +1 -1
- package/dist/{network-CJBTdEM3.mjs → network-CnqNYoOf.mjs} +1 -1
- package/dist/{network-interconnects-CKlNFj3i.mjs → network-interconnects-BXftLikd.mjs} +1 -1
- package/dist/{o11y-5x2Q8CWm.mjs → o11y-1Qku543b.mjs} +1 -1
- package/dist/{oauth-BN6_FpYp.mjs → oauth-B-SYl8nR.mjs} +1 -1
- package/dist/{oauth-D_A8AcIS.mjs → oauth-C6uYSFM5.mjs} +1 -1
- package/dist/{oauth-clients-qKXg8ZH3.mjs → oauth-clients-DXNO-K_e.mjs} +1 -1
- package/dist/{oauth-scopes-Ct1jDyC5.mjs → oauth-scopes-WxoyDblU.mjs} +1 -1
- package/dist/{organization-lBQSeqS1.mjs → organization-HBQnzh8z.mjs} +1 -1
- package/dist/{organizations-DEX8Er3g.mjs → organizations-DvS-ENN2.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-DUsxVGCs.mjs → origin-post-quantum-encryption-BnjX0dCp.mjs} +1 -1
- package/dist/package-DAB8HAGn.mjs +2 -0
- package/dist/{page-rules-BMt6nt03.mjs → page-rules-CypVq1Wb.mjs} +1 -1
- package/dist/{pages-Jxa92ECz.mjs → pages-BxLbPYIf.mjs} +1 -1
- package/dist/{pay-per-crawl-Cv0044CZ.mjs → pay-per-crawl-KidGhWnn.mjs} +1 -1
- package/dist/{pay-per-use-DGEeG-dC.mjs → pay-per-use-DcsdwXr7.mjs} +1 -1
- package/dist/{pipelines-CEC78A3w.mjs → pipelines-CX7esgh3.mjs} +1 -1
- package/dist/{precursor-Ba0Ejhzt.mjs → precursor-BzDcAmUT.mjs} +1 -1
- package/dist/{previews-DnZbUTym.mjs → previews-B7MZKZK6.mjs} +1 -1
- package/dist/{progress-CtGsPOpV.mjs → progress-BcjUdm_B.mjs} +1 -1
- package/dist/{prompt-YrI7ltMa.mjs → prompt-BFRinxR0.mjs} +1 -1
- package/dist/{queues-Chq997uj.mjs → queues-mSjNdJNl.mjs} +1 -1
- package/dist/{r2-BFgZDs-F.mjs → r2-ClBc0jT0.mjs} +1 -1
- package/dist/{radar-DJdDzLJw.mjs → radar-C9GwykGn.mjs} +1 -1
- package/dist/{raw-fetch-BE3QgdTE.mjs → raw-fetch-BO0VqOVx.mjs} +1 -1
- package/dist/{ready-Cok0aqke.mjs → ready-DhdeN4ga.mjs} +1 -1
- package/dist/{realtime-BHWWCiKp.mjs → realtime-9V5zWcij.mjs} +73 -71
- package/dist/{registrar-9Y-1IQ0n.mjs → registrar-DsI2A62h.mjs} +1 -1
- package/dist/{registrar-sandbox-DTS1kRnb.mjs → registrar-sandbox-DcjFW26g.mjs} +1 -1
- package/dist/{reporting-D5RbKQJf.mjs → reporting-pAQ3jvEO.mjs} +1 -1
- package/dist/{request-headers-KhW_hy36.mjs → request-headers-DFPlTFRf.mjs} +1 -1
- package/dist/{request-tracers-wxWCjmHo.mjs → request-tracers-CQqdbHj8.mjs} +1 -1
- package/dist/{resource-sharing-BGoaVvJa.mjs → resource-sharing-BJraifhD.mjs} +1 -1
- package/dist/{rules-Cd3EjhdF.mjs → rules-B_Mopjel.mjs} +1 -1
- package/dist/{rulesets-Bnz3rSBT.mjs → rulesets-DRV0HtYz.mjs} +1 -1
- package/dist/{rum-CK9HEe3O.mjs → rum-D5dYq2Uy.mjs} +1 -1
- package/dist/{run-DnZGQbq_.mjs → run--9dxcon4.mjs} +1 -1
- package/dist/run-BUebYPOn.mjs +2 -0
- package/dist/{schema-flags-BrDlFwLv.mjs → schema-flags-blYVIAUK.mjs} +1 -1
- package/dist/{scim-UdqaWnOu.mjs → scim-C91WGj_g.mjs} +1 -1
- package/dist/{secrets-store-Bf5v96LC.mjs → secrets-store-D4Zr-fuz.mjs} +3 -3
- package/dist/{security-insights-BAGySlGu.mjs → security-insights-DJWdVax5.mjs} +1 -1
- package/dist/{security-txt-D0fMmjHs.mjs → security-txt-B0NLFJNk.mjs} +1 -1
- package/dist/{session-6xqrJWXy.mjs → session-Bafy81hj.mjs} +1 -1
- package/dist/{shared-DYRRG9A-.mjs → shared-rCcn7D66.mjs} +1 -1
- package/dist/{signed-url-Ce0muRem.mjs → signed-url-DBf_p7Wf.mjs} +1 -1
- package/dist/{smart-shield-CCy7_M3j.mjs → smart-shield-BufLvdU3.mjs} +1 -1
- package/dist/{snippets-Bc8m3HSV.mjs → snippets-DA2Gk50m.mjs} +1 -1
- package/dist/{spawn-BAEdy9kS.mjs → spawn-hrdbxnm1.mjs} +1 -1
- package/dist/{spectrum-DtNX8WBX.mjs → spectrum-DlI8qtVo.mjs} +1 -1
- package/dist/{speed-TbkeWV_x.mjs → speed-DNwm5gYl.mjs} +1 -1
- package/dist/{sql-DI319y25.mjs → sql-aBDdRWdd.mjs} +1 -1
- package/dist/{src-Dc6ojwUW.mjs → src-4-uZcDN_.mjs} +5 -5
- package/dist/{ssl-D0MIzFl2.mjs → ssl-DEDucWlo.mjs} +1 -1
- package/dist/{stream-4Mrb8HEo.mjs → stream-DGv9Bssl.mjs} +1 -1
- package/dist/{tags-BP25qydR.mjs → tags-CNBA4Pf1.mjs} +1 -1
- package/dist/telemetry-THz8wtoW.mjs +2 -0
- package/dist/{telemetry-DKSJSLtq.mjs → telemetry-klBrZrC7.mjs} +1 -1
- package/dist/{tenant-jmfZqEZ4.mjs → tenant-DVtqafWB.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-BzVP85Tq.mjs → tenant-custom-nameservers-CtrqQc_i.mjs} +1 -1
- package/dist/{tunnels-BNswR1Dj.mjs → tunnels-Bc_r--ln.mjs} +2 -2
- package/dist/{turnstile-BgsTP2fz.mjs → turnstile-Cr2cTE0C.mjs} +1 -1
- package/dist/ui-DvC7Qa0H.mjs +2 -0
- package/dist/{update-check-BOF1hn_I.mjs → update-check-B5V9BBM7.mjs} +1 -1
- package/dist/{update-check-C7mfEeQ7.mjs → update-check-C5bJ4-Ef.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization-Bqrs4-2F.mjs → url-normalization-D6r0sLRj.mjs} +1 -1
- package/dist/{url-scanner-Dm4Fps5T.mjs → url-scanner-D4u7jbzf.mjs} +1 -1
- package/dist/{user-u_LxzLM4.mjs → user-DhWPKWo0.mjs} +1 -1
- package/dist/{vectorize-DLGiOyd4.mjs → vectorize-CB9IjpC3.mjs} +1 -1
- package/dist/version-Dp7G_dM6.mjs +2 -0
- package/dist/{waiting-rooms-DmgJgJXb.mjs → waiting-rooms-BYlwhzgD.mjs} +1 -1
- package/dist/{web-assets-rNhZWP-6.mjs → web-assets-Nn2HArqh.mjs} +1 -1
- package/dist/{web3-BVBdFt8E.mjs → web3-DpJNkFNQ.mjs} +1 -1
- package/dist/{workers-CjUKJvH8.mjs → workers-BkNt1wSN.mjs} +2 -2
- package/dist/{workers-builds-D3Q97l7X.mjs → workers-builds-BL3dK2R3.mjs} +1 -1
- package/dist/{workers-for-platforms-C_fcw30y.mjs → workers-for-platforms-CAQLG6dE.mjs} +1 -1
- package/dist/{workers-vpc-CnRO3Stc.mjs → workers-vpc-WnRec8oo.mjs} +1 -1
- package/dist/{workflows-cpHFe5v6.mjs → workflows-DpXBMizW.mjs} +1 -1
- package/dist/{wrangler-migration-DQehjmoh.mjs → wrangler-migration-__jrVjrp.mjs} +1 -1
- package/dist/{zaraz-BRj0J7vK.mjs → zaraz-hWisKRaN.mjs} +1 -1
- package/dist/{zero-trust-CVZKDLCB.mjs → zero-trust-DiZhiSa4.mjs} +37 -37
- package/dist/{zone-N6ccK70C.mjs → zone-D7b949er.mjs} +1 -1
- package/dist/{zones-C4S_kpGz.mjs → zones-giCZ0LO8.mjs} +1 -1
- package/package.json +1 -1
- package/dist/agent-context-DFEgYjEQ.mjs +0 -2
- package/dist/api-eMuS5GI1.mjs +0 -3
- package/dist/auth-B0lEsD_1.mjs +0 -2
- package/dist/blocks-BOQH-Won.mjs +0 -5
- package/dist/build-BqGmiORA.mjs +0 -2
- package/dist/cloudforce-one-D20t9ojD.mjs +0 -370
- package/dist/create-OXylMu6m.mjs +0 -2
- package/dist/error-sanitization-Byb-_IS9.mjs +0 -2
- package/dist/get-iPUHxD1r.mjs +0 -2
- package/dist/login-BTiflOun.mjs +0 -2
- package/dist/package-BqSbnt6u.mjs +0 -2
- package/dist/run-Be6Js7D6.mjs +0 -2
- package/dist/telemetry-CvZean4s.mjs +0 -2
- package/dist/ui-Bo6DCvbS.mjs +0 -2
- package/dist/version-DmTuWNZ5.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./hand-written-dry-run-B82fRl2N.mjs";import{t as n}from"./local-CSH3UMpD.mjs";import{n as r}from"./auth-BlWCu-YH.mjs";import{n as i}from"./resolve-C3FmNlSO.mjs";import{a,t as o}from"./context-CSjTAJ8s.mjs";import{t as s}from"./output-BJEgbI0G.mjs";import{t as c}from"./dry-run-gy0Hl9xo.mjs";import{t as l}from"./progress-BcjUdm_B.mjs";import{n as u,t as d}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{a as f,n as p,t as m}from"./body-parser-ChnyBsfm.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v,t as y}from"./prompt-BFRinxR0.mjs";import b from"node:fs";import x from"node:path";var ee={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database`,body:`json`};function te(e){return e.usage(`$0 d1 create
|
|
3
3
|
|
|
4
4
|
Create a new D1 database in your account.`).option(`jurisdiction`,{type:`string`,description:`Specify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored.`,choices:[`eu`,`fedramp`,`us`]}).coerce(`jurisdiction`,e=>h(e,`jurisdiction`,`text`)).option(`name`,{type:`string`,description:`D1 database name.`}).option(`primary-location-hint`,{type:`string`,description:`Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.`,choices:[`wnam`,`enam`,`weur`,`eeur`,`apac`,`oc`]}).coerce(`primary-location-hint`,e=>h(e,`primary-location-hint`,`text`)).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).coerce(`read-replication-mode`,e=>h(e,`read-replication-mode`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`read-replication-mode`].some(t=>e[t]!==void 0)){let t=[`read-replication-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --read_replication-* flag is set`)}return!0})}const ne={command:`create`,describe:`Create D1 Database`,builder:te,handler:async e=>d({command:`d1 create`,classification:{safeFlags:[`jurisdiction`,`primary-location-hint`,`read-replication-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({jurisdiction:e.jurisdiction,name:h(e.name,`name`,`text`),primary_location_hint:e[`primary-location-hint`],read_replication:{mode:e[`read-replication-mode`]}}):p(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=p(e.body),r=await l(`Creating`,async()=>t.send(ee,{body:n,account_id:i}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await g(`name`,`D1 database name.`));let u=m({jurisdiction:e.jurisdiction,name:h(e.name,`name`,`text`),primary_location_hint:e[`primary-location-hint`],read_replication:{mode:e[`read-replication-mode`]}}),d=await l(`Creating`,async()=>t.send(ee,{body:u,account_id:i}));s(d,{successLabel:`Created`})})};var re={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`};function ie(e){return e.usage(`$0 d1 delete <database-id>
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@ Execute a SQL query against a D1 database and return result rows as arrays rathe
|
|
|
18
18
|
|
|
19
19
|
Retrieve the current bookmark, or the nearest bookmark at or before a provided timestamp. Bookmarks can be used with the restore endpoint to revert the database to a previous point in time.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`timestamp`,{type:`string`,description:`An optional ISO 8601 timestamp. If provided, returns the nearest available bookmark at or before this timestamp. If omitted, returns the current bookmark.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get-bookmark <database-id>`,describe:`Get D1 database bookmark`,builder:be,handler:async e=>d({command:`d1 time-travel get-bookmark`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={timestamp:e.timestamp};if(e.dryRun){let n=await a();c({command:`cf d1 time-travel get-bookmark`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/time_travel/bookmark`,pathParams:{"database-id":String(e[`database-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();e.accountId=u;let d=await l(`Loading`,async()=>i.send(ye,{account_id:u,database_id:e[`database-id`],...t}));s(d,{successLabel:`Loaded`})})};var Se={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/time_travel/restore`,query:[`bookmark`,`timestamp`]};function Ce(e){return e.usage(`$0 d1 time-travel restore <database-id>
|
|
20
20
|
|
|
21
|
-
Restore a D1 database to a previous point in time either via a bookmark or a timestamp.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`bookmark`,{type:`string`,description:"A bookmark to restore the database to. Required if `timestamp` is not provided."}).option(`timestamp`,{type:`string`,description:"An ISO 8601 timestamp to restore the database to. Required if `bookmark` is not provided."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const we={command:`restore <database-id>`,describe:`Restore D1 Database to a bookmark or point in time`,builder:Ce,handler:async e=>d({command:`d1 time-travel restore`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={bookmark:e.bookmark,timestamp:e.timestamp};if(e.dryRun){let n=await a();c({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(e[`database-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();if(e.accountId=u,!await v({force:!!e.force,message:`This reverts the D1 database to a previous point in time. Data written after the bookmark will be lost.`}))return;let d=await l(`Deleting`,async()=>i.send(Se,{account_id:u,database_id:e[`database-id`],...t}));s(d,{successLabel:`Deleted`})})},Te={command:`time-travel`,describe:`use specific point-in-time backups of your D1 database`,builder:e=>e.command(xe).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ee={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/undelete`,body:`json`};function De(e){return e.usage("$0 d1 undelete <database-id>\n\nRestore a deleted D1 database. The database is restored with the name it had when it was deleted, unless `new_name` is provided. The restored database counts against the account's limits. Undeleting a database that is not deleted succeeds without changes, unless `new_name` differs from its current name which errors. Once a database is undeleted, Time Travel (point-in-time recovery) cannot restore it to a bookmark or timestamp at or before the undeletion. Only states after the undeletion can be restored.").positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`new-name`,{type:`string`,description:`Restore the database with this name instead of the name it had when it was deleted. Required if another database in the account already uses that name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Oe={command:`undelete <database-id>`,describe:`Undelete D1 Database`,builder:De,handler:async e=>d({command:`d1 undelete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 undelete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/undelete`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({new_name:h(e[`new-name`],`new-name`,`text`)}):p(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,!await v({force:!!e.force,message:`After undeleting, Time Travel cannot restore the D1 database to a point in time at or before the undeletion.`}))return;if(e.body){let n=p(e.body),r=await l(`Deleting`,async()=>t.send(Ee,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Deleted`});return}let u=m({new_name:h(e[`new-name`],`new-name`,`text`)}),d=await l(`Deleting`,async()=>t.send(Ee,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Deleted`})})};var ke={method:`PUT`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`,body:`json`};function Ae(e){return e.usage(`$0 d1 update <database-id>
|
|
21
|
+
Restore a D1 database to a previous point in time either via a bookmark or a timestamp.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`bookmark`,{type:`string`,description:"A bookmark to restore the database to. Required if `timestamp` is not provided."}).option(`timestamp`,{type:`string`,description:"An ISO 8601 timestamp to restore the database to. Required if `bookmark` is not provided."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const we={command:`restore <database-id>`,describe:`Restore D1 Database to a bookmark or point in time`,builder:Ce,handler:async e=>d({command:`d1 time-travel restore`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={bookmark:e.bookmark,timestamp:e.timestamp};if(e.dryRun){let n=await a();c({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(e[`database-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();if(e.accountId=u,!await v({force:!!e.force,message:`This reverts the D1 database to a previous point in time. Data written after the bookmark will be lost.`}))return;let d=await l(`Deleting`,async()=>i.send(Se,{account_id:u,database_id:e[`database-id`],...t}));s(d,{successLabel:`Deleted`})})},Te={command:`time-travel`,describe:`use specific point-in-time backups of your D1 database`,builder:e=>e.command(xe).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ee={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/undelete`,body:`json`};function De(e){return e.usage("$0 d1 undelete <database-id>\n\nRestore a deleted D1 database. The database is restored with the name it had when it was deleted, unless `new_name` is provided. The restored database counts against the account's limits. Undeleting a database that is not deleted succeeds without changes, unless `new_name` differs from its current name which errors. A database can only be undeleted within 7 days (7 * 24 hours) of its deletion. Once a database is undeleted, Time Travel (point-in-time recovery) cannot restore it to a bookmark or timestamp at or before the undeletion. Only states after the undeletion can be restored.").positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`new-name`,{type:`string`,description:`Restore the database with this name instead of the name it had when it was deleted. Required if another database in the account already uses that name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Oe={command:`undelete <database-id>`,describe:`Undelete D1 Database`,builder:De,handler:async e=>d({command:`d1 undelete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 undelete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/undelete`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({new_name:h(e[`new-name`],`new-name`,`text`)}):p(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,!await v({force:!!e.force,message:`After undeleting, Time Travel cannot restore the D1 database to a point in time at or before the undeletion.`}))return;if(e.body){let n=p(e.body),r=await l(`Deleting`,async()=>t.send(Ee,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Deleted`});return}let u=m({new_name:h(e[`new-name`],`new-name`,`text`)}),d=await l(`Deleting`,async()=>t.send(Ee,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Deleted`})})};var ke={method:`PUT`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`,body:`json`};function Ae(e){return e.usage(`$0 d1 update <database-id>
|
|
22
22
|
|
|
23
23
|
Update a D1 database's configuration.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).coerce(`read-replication-mode`,e=>h(e,`read-replication-mode`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const je={command:`update <database-id>`,describe:`Update D1 Database`,builder:Ae,handler:async e=>d({command:`d1 update`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({read_replication:{mode:e[`read-replication-mode`]}}):p(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=p(e.body),r=await l(`Updating`,async()=>t.send(ke,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Updated`});return}e[`read-replication-mode`]===void 0&&(e[`read-replication-mode`]=await _(`read-replication-mode`,`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,[`auto`,`disabled`]));let u=m({read_replication:{mode:e[`read-replication-mode`]}}),d=await l(`Updating`,async()=>t.send(ke,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Updated`})})},Me=(e,t,n)=>{let r=e instanceof RegExp?Ne(e,n):e,i=t instanceof RegExp?Ne(t,n):t,a=r!==null&&i!=null&&Pe(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},Ne=(e,t)=>{let n=t.match(e);return n?n[0]:null},Pe=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},Fe=`\0SLASH`+Math.random()+`\0`,w=`\0OPEN`+Math.random()+`\0`,T=`\0CLOSE`+Math.random()+`\0`,Ie=`\0COMMA`+Math.random()+`\0`,E=`\0PERIOD`+Math.random()+`\0`,Le=new RegExp(Fe,`g`),Re=new RegExp(w,`g`),ze=new RegExp(T,`g`),Be=new RegExp(Ie,`g`),Ve=new RegExp(E,`g`),He=/\\\\/g,Ue=/\\{/g,We=/\\}/g,Ge=/\\,/g,Ke=/\\\./g;function D(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function qe(e){return e.replace(He,Fe).replace(Ue,w).replace(We,T).replace(Ge,Ie).replace(Ke,E)}function Je(e){return e.replace(Le,`\\`).replace(Re,`{`).replace(ze,`}`).replace(Be,`,`).replace(Ve,`.`)}function O(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Ye(e){let t=[],n=``;for(;;){let r=Me(`{`,`}`,e);if(!r){let r=e.split(`,`);return r[0]=n+r[0],O(t,r),t}let{pre:i,body:a,post:o}=r,s=i.split(`,`);if(s[0]=n+s[0],s[s.length-1]+=`{`+a+`}`,!o.length)return O(t,s),t;n=s.pop(),O(t,s),e=o}}function Xe(e,t={}){if(!e)return[];let{max:n=1e5,maxLength:r=4e6,maxDepth:i=1e3,maxRewrites:a=1e3}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),A(qe(e),n,r,i,0,a,!0).map(Je)}function Ze(e){return`{`+e+`}`}function Qe(e){return/^-?0\d/.test(e)}function $e(e,t){return e<=t}function et(e,t){return e>=t}function k(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!a||u){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function tt(e,t,n,r){let i=e.split(/\.\./),a=[];
|
|
24
24
|
/* c8 ignore start */
|
|
@@ -86,4 +86,4 @@ return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`
|
|
|
86
86
|
`,a++):t+=o:(t+=o,o===n&&(s===n?(t+=s,a++):n=void 0))}return t}function Jt({migrationsPath:e,migrationName:t,migrationsTableName:n}){return`${b.readFileSync(x.join(e,t),`utf8`)}
|
|
87
87
|
INSERT INTO ${Z(n)} (name)
|
|
88
88
|
values ('${t.replace(/'/g,`''`)}');`}function Yt(e){return e.option(`dir`,{type:`string`,description:`Directory containing migration files (default: ./migrations)`}).option(`pattern`,{type:`string`,description:`Glob for discovering migration files under --dir. Defaults to "<dir>/*.sql"; Drizzle's nested layout uses "<dir>/*/migration.sql"`})}function Xt(e){return Yt(e).option(`table`,{type:`string`,description:`Table recording applied migrations`,default:`d1_migrations`})}async function $(e,t,n,r,i,a=!1){return l(i,async()=>{let i={account_id:t,database_id:n,body:{sql:qt(r)}};return a?((await e.send(C,i))?.result??[]).map(e=>{let t=e.results?.columns??[],n=e.results?.rows??[];return{...e,results:n.map(e=>Object.fromEntries(t.map((t,n)=>[t,e[n]])))}}):(await e.send(S,i))?.result??[]})}async function Zt(e){if(!i(e.database))throw Error(`Expected a D1 database ID, but received <database>=${JSON.stringify(e.database)}. Database names and binding names are not accepted.`);let t=zt({dir:e.dir,pattern:e.pattern,table:e.table});if(!b.existsSync(t.migrationsPath))throw Error(`No migrations directory at ${t.migrationsPath}.`+(e.dir===void 0?` Pass --dir to point at one.`:``));return{client:await r(e),accountId:e.local?n:await o(),databaseId:e.database,config:t,local:e.local===!0}}async function Qt(e){let{client:t,accountId:n,databaseId:r,config:i}=e;await $(t,n,r,Lt(i.migrationsTableName),`Preparing`,e.local);let a=(await $(t,n,r,Rt(i.migrationsTableName),`Loading`,e.local))[0].results.map(e=>e.name),o=Ut(i);if(o.length===0){let e=Kt(i);e!==void 0&&process.stderr.write(`No files matched --pattern "${i.migrationsPattern}", but "${e}" does match. If an ORM such as drizzle manages your migrations, pass --pattern "${e}".\n`)}return{applied:a,all:o,unapplied:Wt(o,a)}}function $t(e){return Xt(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const en={command:`apply <database>`,describe:`Apply any unapplied D1 migrations`,builder:$t,handler:async e=>{let t=await Zt(e),n=(await Qt(t)).unapplied.map(e=>({name:e,status:`🕒️`}));if(n.length===0)s([],{successLabel:`No migrations to apply`,quiet:e.quiet});else if(await y(`About to apply ${n.length} migration(s)\nYour database may not be available to serve requests during the migration, continue?`)){for(let e of n){let n=Jt({migrationsPath:t.config.migrationsPath,migrationName:e.name,migrationsTableName:t.config.migrationsTableName}),r=!0,i=[];try{let i=await $(t.client,t.accountId,t.databaseId,n,`Applying ${e.name}`,t.local);for(let e of i)e.success||(r=!1)}catch(e){r=!1,i=[e instanceof Error?e.message:String(e)]}if(e.status=r?`✅`:`❌`,i.length>0)throw Error(i.join(`
|
|
89
|
-
`))}s(n,{quiet:e.quiet})}}};function tn(e){return Yt(e.positional(`message`,{type:`string`,description:`Describes what the migration does`,demandOption:!0}))}const nn={command:`create <message>`,describe:`Create a new empty D1 migration file`,builder:tn,handler:async e=>{if(e.local)throw Error("--local is not supported with `cf d1 migrations create`. This command only creates a migration file on your local filesystem, so you do not need --local.");let t=zt({dir:e.dir,pattern:e.pattern}),n=rn(Gt(t),4),r=e.message.replaceAll(` `,`_`);if(/[\\/]/.test(r))throw Error(`The migration name ${JSON.stringify(e.message)} contains a path separator ("/" or "\\"). Remove it and try again.`);let i=`${n}_${r}.sql`,a=X(`${t.migrationsDir}/${i}`);if(!new Y(t.migrationsPattern,{dot:!1}).match(a))throw Error(`Would create "${a}", but --pattern "${t.migrationsPattern}" would not match it, so \`cf d1 migrations apply\` would skip it.\n\`cf d1 migrations create\` only writes top-level files inside --dir. If you are using an ORM like Drizzle, use \`drizzle-kit generate\` instead — it writes the nested layout your pattern expects.`);if(!b.existsSync(t.migrationsPath)){if(!await y(`No migrations folder found.\nOk to create ${t.migrationsPath}?`))throw Error(`No migrations folder present at ${t.migrationsPath}.`);b.mkdirSync(t.migrationsPath,{recursive:!0})}let o=x.join(t.migrationsPath,i);b.writeFileSync(o,`-- Migration number: ${n} \t ${(/* @__PURE__ */ new Date()).toISOString()}\n`),s({name:i,path:o},{successLabel:`Created ${i}`,quiet:e.quiet})}};function rn(e,t){let n=e.toString();for(;n.length<t;)n=`0`+n;return n}function an(e){return Xt(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const on={command:`list <database>`,describe:`View a list of unapplied migration files`,builder:an,handler:async e=>{let{unapplied:t}=await Qt(await Zt(e));s(t.map(e=>({Name:e})),{quiet:e.quiet})}},sn={command:`migrations`,describe:`Create, list, and apply D1 database migrations`,builder:e=>e.command(u(en,{command:`d1 migrations apply`,classification:{safeFlags:[]}})).command(u(nn,{command:`d1 migrations create`,classification:{safeFlags:[]}})).command(u(on,{command:`d1 migrations list`,classification:{safeFlags:[]}})).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},cn={command:`d1`,describe:`D1 is Cloudflare's managed, serverless database with SQLite's SQL semantics, built-in disaster recovery, and Worker and HTTP API access.`,builder:e=>e.command(ne).command(ae).command(ce).command(de).command(me).command(ge).command(ve).command(Oe).command(je).command(t(sn,`preview`)).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{cn as default};
|
|
89
|
+
`))}s(n,{quiet:e.quiet})}}};function tn(e){return Yt(e.positional(`message`,{type:`string`,description:`Describes what the migration does`,demandOption:!0}))}const nn={command:`create <message>`,describe:`Create a new empty D1 migration file`,builder:tn,handler:async e=>{if(e.local)throw Error("--local is not supported with `cf d1 migrations create`. This command only creates a migration file on your local filesystem, so you do not need --local.");let t=zt({dir:e.dir,pattern:e.pattern}),n=rn(Gt(t),4),r=e.message.replaceAll(` `,`_`);if(/[\\/]/.test(r))throw Error(`The migration name ${JSON.stringify(e.message)} contains a path separator ("/" or "\\"). Remove it and try again.`);if(/[:*?"<>|]/.test(r))throw Error(`The migration name ${JSON.stringify(e.message)} contains a character that cannot be used in a file name (: * ? " < > |). Remove it and try again.`);let i=`${n}_${r}.sql`,a=X(`${t.migrationsDir}/${i}`);if(!new Y(t.migrationsPattern,{dot:!1}).match(a))throw Error(`Would create "${a}", but --pattern "${t.migrationsPattern}" would not match it, so \`cf d1 migrations apply\` would skip it.\n\`cf d1 migrations create\` only writes top-level files inside --dir. If you are using an ORM like Drizzle, use \`drizzle-kit generate\` instead — it writes the nested layout your pattern expects.`);if(!b.existsSync(t.migrationsPath)){if(!await y(`No migrations folder found.\nOk to create ${t.migrationsPath}?`))throw Error(`No migrations folder present at ${t.migrationsPath}.`);b.mkdirSync(t.migrationsPath,{recursive:!0})}let o=x.join(t.migrationsPath,i);b.writeFileSync(o,`-- Migration number: ${n} \t ${(/* @__PURE__ */ new Date()).toISOString()}\n`),s({name:i,path:o},{successLabel:`Created ${i}`,quiet:e.quiet})}};function rn(e,t){let n=e.toString();for(;n.length<t;)n=`0`+n;return n}function an(e){return Xt(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const on={command:`list <database>`,describe:`View a list of unapplied migration files`,builder:an,handler:async e=>{let{unapplied:t}=await Qt(await Zt(e));s(t.map(e=>({Name:e})),{quiet:e.quiet})}},sn={command:`migrations`,describe:`Create, list, and apply D1 database migrations`,builder:e=>e.command(u(en,{command:`d1 migrations apply`,classification:{safeFlags:[]}})).command(u(nn,{command:`d1 migrations create`,classification:{safeFlags:[]}})).command(u(on,{command:`d1 migrations list`,classification:{safeFlags:[]}})).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},cn={command:`d1`,describe:`D1 is Cloudflare's managed, serverless database with SQLite's SQL semantics, built-in disaster recovery, and Worker and HTTP API access.`,builder:e=>e.command(ne).command(ae).command(ce).command(de).command(me).command(ge).command(ve).command(Oe).command(je).command(t(sn,`preview`)).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{cn as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./package-
|
|
2
|
+
import{t as e}from"./package-DAB8HAGn.mjs";import{createRequire as t}from"node:module";import{existsSync as n,readFileSync as r,realpathSync as i}from"node:fs";import{dirname as a,resolve as o}from"node:path";import{fileURLToPath as s}from"node:url";import{constants as c}from"node:os";import{spawn as l}from"node:child_process";const u=`CF_DELEGATION`,d=`CF_DELEGATING_CLI_VERSION`,f=`CF_DELEGATION_PID`;function p(e){if(e.env.CF_DELEGATION||b(e.ownPackageJsonPath))return null;let i;try{i=t(o(e.cwd,`package.json`)).resolve(`cf/package.json`)}catch{return null}if(e.ownPackageJsonPath&&y(i,e.ownPackageJsonPath))return null;let s;try{s=JSON.parse(r(i,`utf-8`))}catch{return null}let c=v(s.bin);if(!c)return null;let l=o(a(i),c);return n(l)?{packageJsonPath:i,binPath:l,version:typeof s.version==`string`?s.version:`unknown`}:null}async function m(e={}){let t=e.cwd??process.cwd(),n=e.argv??process.argv.slice(2),r=e.env??process.env,i=p({cwd:t,ownPackageJsonPath:e.ownPackageJsonPath===void 0?S():e.ownPackageJsonPath,env:r});return i?{delegated:!0,exitCode:await _(i.binPath,n,r)}:{delegated:!1}}async function h(){let e=process.argv.slice(2);return g(e)?{delegated:!1}:m({argv:e})}function g(e){return e.find(e=>!e.startsWith(`-`))===`complete`}function _(t,n,r){return new Promise((i,a)=>{let o=l(process.execPath,[t,...n],{stdio:[`inherit`,`inherit`,`inherit`,`ipc`],env:{...r,[u]:`1`,[d]:e,[f]:String(process.pid)}});o.on(`message`,e=>{process.send&&process.send(e)});let s=e=>()=>{o.kill(e)},p=s(`SIGINT`),m=s(`SIGTERM`);process.on(`SIGINT`,p),process.on(`SIGTERM`,m);let h=()=>{process.off(`SIGINT`,p),process.off(`SIGTERM`,m)};o.once(`exit`,(e,t)=>{h(),i(e===null?t?128+(c.signals[t]??1):0:e)}),o.once(`error`,e=>{h(),a(e)})})}function v(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e,n=t.cf;if(typeof n==`string`)return n;for(let e of Object.values(t))if(typeof e==`string`)return e}return null}function y(e,t){try{return i(e)===i(t)}catch{return o(e)===o(t)}}function b(e){return e?e.split(/[\\/]/).some(e=>e===`_npx`||e===`dlx`||e.startsWith(`dlx-`)):!1}function x(){return b(S())}function S(){let e=a(s(import.meta.url));for(;;){let t=o(e,`package.json`);if(n(t))return t;let r=a(e);if(r===e)return null;e=r}}export{h as a,x as i,d as n,m as o,u as r,p as s,f as t};
|
package/dist/delegate.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{t as DELEGATING_PID_ENV,n as DELEGATING_VERSION_ENV,r as DELEGATION_SENTINEL,i as isEphemeralExecRun,a as maybeDelegateFromProcess,o as maybeDelegateToLocalInstall,s as resolveDelegateTarget}from"./delegate-
|
|
2
|
+
export{t as DELEGATING_PID_ENV,n as DELEGATING_VERSION_ENV,r as DELEGATION_SENTINEL,i as isEphemeralExecRun,a as maybeDelegateFromProcess,o as maybeDelegateToLocalInstall,s as resolveDelegateTarget}from"./delegate-DzeuzE99.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,t}from"./shared-
|
|
2
|
+
import{n as e,t}from"./shared-rCcn7D66.mjs";function n(t){return e(t).option(`provision`,{type:`boolean`,description:`Automatically provision resources for bindings that need them`,default:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)`,requiresArg:!0}).option(`containers-rollout`,{description:`Rollout strategy for Container changes. Immediate rolls out to all instances in one step; none leaves deployed Containers unchanged.`,choices:[`immediate`,`gradual`,`none`]})}const r={command:`deploy`,describe:`Deploy a worker to Cloudflare`,builder:n,handler:async e=>{await t(e,{command:`Deploy`})}};export{r as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{O as e,U as t,X as n,Y as r,_ as i,g as a,rt as o,tt as s,v as c}from"./dist-BtzWfAjU.mjs";import{M as l,N as u,d,g as f,k as p,v as m}from"./chunk-2HLTAS5V-B92NbX1j.mjs";import{t as h}from"./version-DmTuWNZ5.mjs";import{t as g}from"./log-BWdaOGOW.mjs";import{n as _,r as v,t as y}from"./dialog-D5lus4M4.mjs";import{S as b,T as x,b as S,c as C,f as ee,g as te,h as ne,i as re,o as ie,p as ae,u as w,w as oe,x as T}from"./interactive-D4E8PdaW.mjs";import{createRequire as se}from"node:module";import{setTimeout as E}from"node:timers/promises";import{existsSync as ce,readFileSync as D}from"node:fs";import O,{join as le}from"node:path";import k from"node:process";import{release as A}from"node:os";import ue from"node:assert";import{createServer as de}from"node:net";import{once as fe}from"node:events";import j,{createHash as pe,randomUUID as me}from"node:crypto";import{execFile as he,execFileSync as ge,spawn as M}from"node:child_process";import{cleanBuildOutputDir as _e,normalizeDirectoryName as ve,writeContainerConfig as N}from"@cloudflare/build-output-utils";function ye(e,t=k.stderr){t.isTTY&&(e?t.write(`\x1B[?25h`):t.write(`\x1B[?25l`))}const P=se(import.meta.url||(typeof __filename==`string`?__filename:`/`));var be=Object.create,xe=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,Ce=Object.getOwnPropertyNames,we=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty,F=(e,t)=>xe(e,`name`,{value:t,configurable:!0}),I=/* @__PURE__ */ (e=>P===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(P===void 0?e:P)[t]}):e:P)(function(e){if(P!==void 0)return P.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),L=(e,t)=>function(){return t||(0,e[Ce(e)[0]])((t={exports:{}}).exports,t),t.exports},Ee=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Ce(t))!Te.call(e,i)&&i!==n&&xe(e,i,{get:()=>t[i],enumerable:!(r=Se(t,i))||r.enumerable});return e},R=(e,t,n)=>(n=e==null?{}:be(we(e)),Ee(xe(n,`default`,{value:e,enumerable:!0}),e)),z=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/constants.js"(e,t){var n=[`nodebuffer`,`arraybuffer`,`fragments`],r=typeof Blob<`u`;r&&n.push(`blob`),t.exports={BINARY_TYPES:n,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,hasBlob:r,kForOnEventAttribute:Symbol(`kIsForOnEventAttribute`),kListener:Symbol(`kListener`),kStatusCode:Symbol(`status-code`),kWebSocket:Symbol(`websocket`),NOOP:/* @__PURE__ */ F(()=>{},`NOOP`)}}}),De=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/buffer-util.js"(e,t){var{EMPTY_BUFFER:n}=z(),r=Buffer[Symbol.species];function i(e,t){if(e.length===0)return n;if(e.length===1)return e[0];let i=Buffer.allocUnsafe(t),a=0;for(let t=0;t<e.length;t++){let n=e[t];i.set(n,a),a+=n.length}return a<t?new r(i.buffer,i.byteOffset,a):i}F(i,`concat`);function a(e,t,n,r,i){for(let a=0;a<i;a++)n[r+a]=e[a]^t[a&3]}F(a,`_mask`);function o(e,t){for(let n=0;n<e.length;n++)e[n]^=t[n&3]}F(o,`_unmask`);function s(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}F(s,`toArrayBuffer`);function c(e){if(c.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new r(e):ArrayBuffer.isView(e)?t=new r(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),c.readOnly=!1),t}if(F(c,`toBuffer`),t.exports={concat:i,mask:a,toArrayBuffer:s,toBuffer:c,unmask:o},!process.env.WS_NO_BUFFER_UTIL)try{let e=I(`bufferutil`);t.exports.mask=function(t,n,r,i,o){o<48?a(t,n,r,i,o):e.mask(t,n,r,i,o)},t.exports.unmask=function(t,n){t.length<32?o(t,n):e.unmask(t,n)}}catch{}}}),Oe=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/limiter.js"(e,t){var n=Symbol(`kDone`),r=Symbol(`kRun`);t.exports=class{static{F(this,`Limiter`)}constructor(e){this[n]=()=>{this.pending--,this[r]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[r]()}[r](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[n])}}}}}),B=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/permessage-deflate.js"(e,t){var n=I(`zlib`),r=De(),i=Oe(),{kStatusCode:a}=z(),o=Buffer[Symbol.species],s=Buffer.from([0,0,255,255]),c=Symbol(`permessage-deflate`),l=Symbol(`total-length`),u=Symbol(`callback`),d=Symbol(`buffers`),f=Symbol(`error`),p;t.exports=class{static{F(this,`PerMessageDeflate`)}constructor(e){this._options=e||{},this._threshold=this._options.threshold===void 0?1024:this._options.threshold,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,p||=new i(this._options.concurrencyLimit===void 0?10:this._options.concurrencyLimit)}static get extensionName(){return`permessage-deflate`}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits??(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&=(this._inflate.close(),null),this._deflate){let e=this._deflate[u];this._deflate.close(),this._deflate=null,e&&e(/* @__PURE__ */ Error(`The deflate stream was closed while data was being processed`))}}acceptAsServer(e){let t=this._options,n=e.find(e=>!(t.serverNoContextTakeover===!1&&e.server_no_context_takeover||e.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits==`number`&&t.serverMaxWindowBits>e.server_max_window_bits)||typeof t.clientMaxWindowBits==`number`&&!e.client_max_window_bits));if(!n)throw Error(`None of the extension offers can be accepted`);return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits==`number`&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits==`number`?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw Error(`Unexpected parameter "client_no_context_takeover"`);if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits==`number`&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==`number`&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw Error(`Unexpected or invalid parameter "client_max_window_bits"`);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{let n=e[t];if(n.length>1)throw Error(`Parameter "${t}" must have only a single value`);if(n=n[0],t===`client_max_window_bits`){if(n!==!0){let e=+n;if(!Number.isInteger(e)||e<8||e>15)throw TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${t}": ${n}`)}else if(t===`server_max_window_bits`){let e=+n;if(!Number.isInteger(e)||e<8||e>15)throw TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(t===`client_no_context_takeover`||t===`server_no_context_takeover`){if(n!==!0)throw TypeError(`Invalid value for parameter "${t}": ${n}`)}else throw Error(`Unknown parameter "${t}"`);e[t]=n})}),e}decompress(e,t,n){p.add(r=>{this._decompress(e,t,(e,t)=>{r(),n(e,t)})})}compress(e,t,n){p.add(r=>{this._compress(e,t,(e,t)=>{r(),n(e,t)})})}_decompress(e,t,i){let a=this._isServer?`client`:`server`;if(!this._inflate){let e=`${a}_max_window_bits`,t=typeof this.params[e]==`number`?this.params[e]:n.Z_DEFAULT_WINDOWBITS;this._inflate=n.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[c]=this,this._inflate[l]=0,this._inflate[d]=[],this._inflate.on(`error`,g),this._inflate.on(`data`,h)}this._inflate[u]=i,this._inflate.write(e),t&&this._inflate.write(s),this._inflate.flush(()=>{let e=this._inflate[f];if(e){this._inflate.close(),this._inflate=null,i(e);return}let n=r.concat(this._inflate[d],this._inflate[l]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[l]=0,this._inflate[d]=[],t&&this.params[`${a}_no_context_takeover`]&&this._inflate.reset()),i(null,n)})}_compress(e,t,i){let a=this._isServer?`server`:`client`;if(!this._deflate){let e=`${a}_max_window_bits`,t=typeof this.params[e]==`number`?this.params[e]:n.Z_DEFAULT_WINDOWBITS;this._deflate=n.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[l]=0,this._deflate[d]=[],this._deflate.on(`data`,m)}this._deflate[u]=i,this._deflate.write(e),this._deflate.flush(n.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let e=r.concat(this._deflate[d],this._deflate[l]);t&&(e=new o(e.buffer,e.byteOffset,e.length-4)),this._deflate[u]=null,this._deflate[l]=0,this._deflate[d]=[],t&&this.params[`${a}_no_context_takeover`]&&this._deflate.reset(),i(null,e)})}};function m(e){this[d].push(e),this[l]+=e.length}F(m,`deflateOnData`);function h(e){this[l]+=e.length,this[c]._maxPayload<1||this[l]<=this[c]._maxPayload?this[d].push(e):(this[f]=/* @__PURE__ */ RangeError(`Max payload size exceeded`),this[f].code=`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`,this[f][a]=1009,this.removeListener(`data`,h),this.reset())}F(h,`inflateOnData`);function g(e){this[c]._inflate=null,this[f]?this[u](this[f]):(e[a]=1007,this[u](e))}F(g,`inflateOnError`)}}),ke=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/validation.js"(e,t){var{isUtf8:n}=I(`buffer`),{hasBlob:r}=z(),i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function a(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}F(a,`isValidStatusCode`);function o(e){let t=e.length,n=0;for(;n<t;)if(!(e[n]&128))n++;else if((e[n]&224)==192){if(n+1===t||(e[n+1]&192)!=128||(e[n]&254)==192)return!1;n+=2}else if((e[n]&240)==224){if(n+2>=t||(e[n+1]&192)!=128||(e[n+2]&192)!=128||e[n]===224&&(e[n+1]&224)==128||e[n]===237&&(e[n+1]&224)==160)return!1;n+=3}else if((e[n]&248)==240){if(n+3>=t||(e[n+1]&192)!=128||(e[n+2]&192)!=128||(e[n+3]&192)!=128||e[n]===240&&(e[n+1]&240)==128||e[n]===244&&e[n+1]>143||e[n]>244)return!1;n+=4}else return!1;return!0}F(o,`_isValidUTF8`);function s(e){return r&&typeof e==`object`&&typeof e.arrayBuffer==`function`&&typeof e.type==`string`&&typeof e.stream==`function`&&(e[Symbol.toStringTag]===`Blob`||e[Symbol.toStringTag]===`File`)}if(F(s,`isBlob`),t.exports={isBlob:s,isValidStatusCode:a,isValidUTF8:o,tokenChars:i},n)t.exports.isValidUTF8=function(e){return e.length<24?o(e):n(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=I(`utf-8-validate`);t.exports.isValidUTF8=function(t){return t.length<32?o(t):e(t)}}catch{}}}),Ae=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/receiver.js"(e,t){var{Writable:n}=I(`stream`),r=B(),{BINARY_TYPES:i,EMPTY_BUFFER:a,kStatusCode:o,kWebSocket:s}=z(),{concat:c,toArrayBuffer:l,unmask:u}=De(),{isValidStatusCode:d,isValidUTF8:f}=ke(),p=Buffer[Symbol.species],m=0,h=1,g=2,_=3,v=4,y=5,b=6;t.exports=class extends n{static{F(this,`Receiver`)}constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents===void 0||e.allowSynchronousEvents,this._binaryType=e.binaryType||i[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[s]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=m}_write(e,t,n){if(this._opcode===8&&this._state==m)return n();this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks?n(this.createError(RangeError,`Too many buffered chunks`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`)):(this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n))}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let t=this._buffers[0];return this._buffers[0]=new p(t.buffer,t.byteOffset+e,t.length-e),new p(t.buffer,t.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new p(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case m:this.getInfo(e);break;case h:this.getPayloadLength16(e);break;case g:this.getPayloadLength64(e);break;case _:this.getMask();break;case v:this.getData(e);break;case y:case b:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if(t[0]&48){e(this.createError(RangeError,`RSV2 and RSV3 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_2_3`));return}let n=(t[0]&64)==64;if(n&&!this._extensions[r.extensionName])e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));else{if(this._fin=(t[0]&128)==128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(!this._fragmented){e(this.createError(RangeError,`invalid opcode 0`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){e(this.createError(RangeError,`FIN must be set`,!0,1002,`WS_ERR_EXPECTED_FIN`));return}if(n){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){e(this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,`WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH`));return}}else{e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)==128,this._isServer){if(!this._masked){e(this.createError(RangeError,`MASK must be set`,!0,1002,`WS_ERR_EXPECTED_MASK`));return}}else if(this._masked){e(this.createError(RangeError,`MASK must be clear`,!0,1002,`WS_ERR_UNEXPECTED_MASK`));return}this._payloadLength===126?this._state=h:this._payloadLength===127?this._state=g:this.haveLength(e)}}getPayloadLength16(e){this._bufferedBytes<2?this._loop=!1:(this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e))}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);n>2**21-1?e(this.createError(RangeError,`Unsupported WebSocket frame: payload length > 2^53 - 1`,!1,1009,`WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH`)):(this._payloadLength=n*2**32+t.readUInt32BE(4),this.haveLength(e))}haveLength(e){this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)?e(this.createError(RangeError,`Max payload size exceeded`,!1,1009,`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`)):this._state=this._masked?_:v}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=v)}getData(e){let t=a;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&u(t,this._mask)}if(this._opcode>7)this.controlMessage(t,e);else if(this._compressed)this._state=y,this.decompress(t,e);else{if(t.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){e(this.createError(RangeError,`Too many message fragments`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`));return}this._messageLength=this._totalPayloadLength,this._fragments.push(t)}this.dataMessage(e)}}decompress(e,t){this._extensions[r.extensionName].decompress(e,this._fin,(e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){t(this.createError(RangeError,`Max payload size exceeded`,!1,1009,`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`));return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){t(this.createError(RangeError,`Too many message fragments`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`));return}this._fragments.push(n)}this.dataMessage(t),this._state===m&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=m;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let r;r=this._binaryType===`nodebuffer`?c(n,t):this._binaryType===`arraybuffer`?l(c(n,t)):this._binaryType===`blob`?new Blob(n):n,this._allowSynchronousEvents?(this.emit(`message`,r,!0),this._state=m):(this._state=b,setImmediate(()=>{this.emit(`message`,r,!0),this._state=m,this.startLoop(e)}))}else{let r=c(n,t);if(!this._skipUTF8Validation&&!f(r)){e(this.createError(Error,`invalid UTF-8 sequence`,!0,1007,`WS_ERR_INVALID_UTF8`));return}this._state===y||this._allowSynchronousEvents?(this.emit(`message`,r,!1),this._state=m):(this._state=b,setImmediate(()=>{this.emit(`message`,r,!1),this._state=m,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit(`conclude`,1005,a),this.end();else{let n=e.readUInt16BE(0);if(!d(n)){t(this.createError(RangeError,`invalid status code ${n}`,!0,1002,`WS_ERR_INVALID_CLOSE_CODE`));return}let r=new p(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!f(r)){t(this.createError(Error,`invalid UTF-8 sequence`,!0,1007,`WS_ERR_INVALID_UTF8`));return}this._loop=!1,this.emit(`conclude`,n,r),this.end()}this._state=m}else this._allowSynchronousEvents?(this.emit(this._opcode===9?`ping`:`pong`,e),this._state=m):(this._state=b,setImmediate(()=>{this.emit(this._opcode===9?`ping`:`pong`,e),this._state=m,this.startLoop(t)}))}createError(e,t,n,r,i){this._loop=!1,this._errored=!0;let a=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(a,this.createError),a.code=i,a[o]=r,a}}}}),je=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/sender.js"(e,t){var{Duplex:n}=I(`stream`),{randomFillSync:r}=I(`crypto`),{types:{isUint8Array:i}}=I(`util`),a=B(),{EMPTY_BUFFER:o,kWebSocket:s,NOOP:c}=z(),{isBlob:l,isValidStatusCode:u}=ke(),{mask:d,toBuffer:f}=De(),p=Symbol(`kByteLength`),m=Buffer.alloc(4),h=8192,g,_=h,v=0,y=1,b=2;t.exports=class e{static{F(this,`Sender`)}constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=v,this.onerror=c,this[s]=void 0}static frame(e,t){let n,i=!1,a=2,o=!1;t.mask&&(n=t.maskBuffer||m,t.generateMask?t.generateMask(n):(_===h&&(g===void 0&&(g=Buffer.alloc(h)),r(g,0,h),_=0),n[0]=g[_++],n[1]=g[_++],n[2]=g[_++],n[3]=g[_++]),o=(n[0]|n[1]|n[2]|n[3])===0,a=6);let s;typeof e==`string`?(!t.mask||o)&&t[p]!==void 0?s=t[p]:(e=Buffer.from(e),s=e.length):(s=e.length,i=t.mask&&t.readOnly&&!o);let c=s;s>=65536?(a+=8,c=127):s>125&&(a+=2,c=126);let l=Buffer.allocUnsafe(i?s+a:a);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(s,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(s,4,6)),!t.mask||(l[1]|=128,l[a-4]=n[0],l[a-3]=n[1],l[a-2]=n[2],l[a-1]=n[3],o)?[l,e]:i?(d(e,n,l,a,s),[l]):(d(e,n,e,0,s),[l,e])}close(t,n,r,a){let s;if(t===void 0)s=o;else if(typeof t!=`number`||!u(t))throw TypeError(`First argument must be a valid error code number`);else if(n===void 0||!n.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let e=Buffer.byteLength(n);if(e>123)throw RangeError(`The message must not be greater than 123 bytes`);if(s=Buffer.allocUnsafe(2+e),s.writeUInt16BE(t,0),typeof n==`string`)s.write(n,2);else if(i(n))s.set(n,2);else throw TypeError(`Second argument must be a string or a Uint8Array`)}let c={[p]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state===v?this.sendFrame(e.frame(s,c),a):this.enqueue([this.dispatch,s,!1,c,a])}ping(t,n,r){let i,a;if(typeof t==`string`?(i=Buffer.byteLength(t),a=!1):l(t)?(i=t.size,a=!1):(t=f(t),i=t.length,a=f.readOnly),i>125)throw RangeError(`The data size must not be greater than 125 bytes`);let o={[p]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};l(t)?this._state===v?this.getBlobData(t,!1,o,r):this.enqueue([this.getBlobData,t,!1,o,r]):this._state===v?this.sendFrame(e.frame(t,o),r):this.enqueue([this.dispatch,t,!1,o,r])}pong(t,n,r){let i,a;if(typeof t==`string`?(i=Buffer.byteLength(t),a=!1):l(t)?(i=t.size,a=!1):(t=f(t),i=t.length,a=f.readOnly),i>125)throw RangeError(`The data size must not be greater than 125 bytes`);let o={[p]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};l(t)?this._state===v?this.getBlobData(t,!1,o,r):this.enqueue([this.getBlobData,t,!1,o,r]):this._state===v?this.sendFrame(e.frame(t,o),r):this.enqueue([this.dispatch,t,!1,o,r])}send(e,t,n){let r=this._extensions[a.extensionName],i=t.binary?2:1,o=t.compress,s,c;typeof e==`string`?(s=Buffer.byteLength(e),c=!1):l(e)?(s=e.size,c=!1):(e=f(e),s=e.length,c=f.readOnly),this._firstFragment?(this._firstFragment=!1,o&&r&&r.params[r._isServer?`server_no_context_takeover`:`client_no_context_takeover`]&&(o=s>=r._threshold),this._compress=o):(o=!1,i=0),t.fin&&(this._firstFragment=!0);let u={[p]:s,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:o};l(e)?this._state===v?this.getBlobData(e,this._compress,u,n):this.enqueue([this.getBlobData,e,this._compress,u,n]):this._state===v?this.dispatch(e,this._compress,u,n):this.enqueue([this.dispatch,e,this._compress,u,n])}getBlobData(t,n,r,i){this._bufferedBytes+=r[p],this._state=b,t.arrayBuffer().then(t=>{if(this._socket.destroyed){let e=/* @__PURE__ */ Error(`The socket was closed while the blob was being read`);process.nextTick(x,this,e,i);return}this._bufferedBytes-=r[p];let a=f(t);n?this.dispatch(a,n,r,i):(this._state=v,this.sendFrame(e.frame(a,r),i),this.dequeue())}).catch(e=>{process.nextTick(S,this,e,i)})}dispatch(t,n,r,i){if(!n){this.sendFrame(e.frame(t,r),i);return}let o=this._extensions[a.extensionName];this._bufferedBytes+=r[p],this._state=y,o.compress(t,r.fin,(t,n)=>{if(this._socket.destroyed){let e=/* @__PURE__ */ Error(`The socket was closed while data was being compressed`);x(this,e,i)}else this._bufferedBytes-=r[p],this._state=v,r.readOnly=!1,this.sendFrame(e.frame(n,r),i),this.dequeue()})}dequeue(){for(;this._state===v&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][p],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][p],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};function x(e,t,n){typeof n==`function`&&n(t);for(let n=0;n<e._queue.length;n++){let r=e._queue[n],i=r[r.length-1];typeof i==`function`&&i(t)}}F(x,`callCallbacks`);function S(e,t,n){x(e,t,n),e.onerror(t)}F(S,`onError`)}}),Me=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/event-target.js"(e,t){var{kForOnEventAttribute:n,kListener:r}=z(),i=Symbol(`kCode`),a=Symbol(`kData`),o=Symbol(`kError`),s=Symbol(`kMessage`),c=Symbol(`kReason`),l=Symbol(`kTarget`),u=Symbol(`kType`),d=Symbol(`kWasClean`),f=class{static{F(this,`Event`)}constructor(e){this[l]=null,this[u]=e}get target(){return this[l]}get type(){return this[u]}};Object.defineProperty(f.prototype,"target",{enumerable:!0}),Object.defineProperty(f.prototype,"type",{enumerable:!0});var p=class extends f{static{F(this,`CloseEvent`)}constructor(e,t={}){super(e),this[i]=t.code===void 0?0:t.code,this[c]=t.reason===void 0?``:t.reason,this[d]=t.wasClean!==void 0&&t.wasClean}get code(){return this[i]}get reason(){return this[c]}get wasClean(){return this[d]}};Object.defineProperty(p.prototype,"code",{enumerable:!0}),Object.defineProperty(p.prototype,"reason",{enumerable:!0}),Object.defineProperty(p.prototype,"wasClean",{enumerable:!0});var m=class extends f{static{F(this,`ErrorEvent`)}constructor(e,t={}){super(e),this[o]=t.error===void 0?null:t.error,this[s]=t.message===void 0?``:t.message}get error(){return this[o]}get message(){return this[s]}};Object.defineProperty(m.prototype,"error",{enumerable:!0}),Object.defineProperty(m.prototype,"message",{enumerable:!0});var h=class extends f{static{F(this,`MessageEvent`)}constructor(e,t={}){super(e),this[a]=t.data===void 0?null:t.data}get data(){return this[a]}};Object.defineProperty(h.prototype,"data",{enumerable:!0}),t.exports={CloseEvent:p,ErrorEvent:m,Event:f,EventTarget:{addEventListener(e,t,i={}){for(let a of this.listeners(e))if(!i[n]&&a[r]===t&&!a[n])return;let a;if(e===`message`)a=/* @__PURE__ */ F(function(e,n){let r=new h(`message`,{data:n?e:e.toString()});r[l]=this,g(t,this,r)},`onMessage`);else if(e===`close`)a=/* @__PURE__ */ F(function(e,n){let r=new p(`close`,{code:e,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[l]=this,g(t,this,r)},`onClose`);else if(e===`error`)a=/* @__PURE__ */ F(function(e){let n=new m(`error`,{error:e,message:e.message});n[l]=this,g(t,this,n)},`onError`);else if(e===`open`)a=/* @__PURE__ */ F(function(){let e=new f(`open`);e[l]=this,g(t,this,e)},`onOpen`);else return;a[n]=!!i[n],a[r]=t,i.once?this.once(e,a):this.on(e,a)},removeEventListener(e,t){for(let i of this.listeners(e))if(i[r]===t&&!i[n]){this.removeListener(e,i);break}}},MessageEvent:h};function g(e,t,n){typeof e==`object`&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}F(g,`callListener`)}}),Ne=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/extension.js"(e,t){var{tokenChars:n}=ke();function r(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}F(r,`push`);function i(e){let t=/* @__PURE__ */ Object.create(null),i=/* @__PURE__ */ Object.create(null),a=!1,o=!1,s=!1,c,l,u=-1,d=-1,f=-1,p=0;for(;p<e.length;p++)if(d=e.charCodeAt(p),c===void 0){if(f===-1&&n[d]===1)u===-1&&(u=p);else if(p!==0&&(d===32||d===9))f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let n=e.slice(u,f);d===44?(r(t,n,i),i=/* @__PURE__ */ Object.create(null)):c=n,u=f=-1}else throw SyntaxError(`Unexpected character at index ${p}`)}else if(l===void 0){if(f===-1&&n[d]===1)u===-1&&(u=p);else if(d===32||d===9)f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p),r(i,e.slice(u,f),!0),d===44&&(r(t,c,i),i=/* @__PURE__ */ Object.create(null),c=void 0),u=f=-1}else if(d===61&&u!==-1&&f===-1)l=e.slice(u,p),u=f=-1;else throw SyntaxError(`Unexpected character at index ${p}`)}else if(o){if(n[d]!==1)throw SyntaxError(`Unexpected character at index ${p}`);u===-1?u=p:a||=!0,o=!1}else if(s){if(n[d]===1)u===-1&&(u=p);else if(d===34&&u!==-1)s=!1,f=p;else if(d===92)o=!0;else throw SyntaxError(`Unexpected character at index ${p}`)}else if(d===34&&e.charCodeAt(p-1)===61)s=!0;else if(f===-1&&n[d]===1)u===-1&&(u=p);else if(u!==-1&&(d===32||d===9))f===-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let n=e.slice(u,f);a&&=(n=n.replace(/\\/g,``),!1),r(i,l,n),d===44&&(r(t,c,i),i=/* @__PURE__ */ Object.create(null),c=void 0),l=void 0,u=f=-1}else throw SyntaxError(`Unexpected character at index ${p}`);if(u===-1||s||d===32||d===9)throw SyntaxError(`Unexpected end of input`);f===-1&&(f=p);let m=e.slice(u,f);return c===void 0?r(t,m,i):(l===void 0?r(i,m,!0):a?r(i,l,m.replace(/\\/g,``)):r(i,l,m),r(t,c,i)),t}F(i,`parse`);function a(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>[t].concat(Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>e===!0?t:`${t}=${e}`).join(`; `)})).join(`; `)).join(`, `)}).join(`, `)}F(a,`format`),t.exports={format:a,parse:i}}}),Pe=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket.js"(e,t){var n=I(`events`),r=I(`https`),i=I(`http`),a=I(`net`),o=I(`tls`),{randomBytes:s,createHash:c}=I(`crypto`),{Duplex:l,Readable:u}=I(`stream`),{URL:d}=I(`url`),f=B(),p=Ae(),m=je(),{isBlob:h}=ke(),{BINARY_TYPES:g,CLOSE_TIMEOUT:_,EMPTY_BUFFER:v,GUID:y,kForOnEventAttribute:b,kListener:x,kStatusCode:S,kWebSocket:C,NOOP:ee}=z(),{EventTarget:{addEventListener:te,removeEventListener:ne}}=Me(),{format:re,parse:ie}=Ne(),{toBuffer:ae}=De(),w=Symbol(`kAborted`),oe=[8,13],T=[`CONNECTING`,`OPEN`,`CLOSING`,`CLOSED`],se=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,E=class e extends n{static{F(this,`WebSocket`)}constructor(t,n,r){super(),this._binaryType=g[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=v,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol=``,this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t===null?(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0):(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n==`object`&&n?(r=n,n=[]):n=[n]),ce(this,t,n,r))}get binaryType(){return this._binaryType}set binaryType(e){g.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}
|
|
2
|
+
import{O as e,U as t,X as n,Y as r,_ as i,g as a,rt as o,tt as s,v as c}from"./dist-BtzWfAjU.mjs";import{M as l,N as u,d,g as f,k as p,v as m}from"./chunk-2HLTAS5V-B92NbX1j.mjs";import{t as h}from"./version-Dp7G_dM6.mjs";import{t as g}from"./log-BWdaOGOW.mjs";import{n as _,r as v,t as y}from"./dialog-D5lus4M4.mjs";import{S as b,T as x,b as S,c as C,f as ee,g as te,h as ne,i as re,o as ie,p as ae,u as w,w as oe,x as T}from"./interactive-D4E8PdaW.mjs";import{createRequire as se}from"node:module";import{setTimeout as E}from"node:timers/promises";import{existsSync as ce,readFileSync as D}from"node:fs";import O,{join as le}from"node:path";import k from"node:process";import{release as A}from"node:os";import ue from"node:assert";import{createServer as de}from"node:net";import{once as fe}from"node:events";import j,{createHash as pe,randomUUID as me}from"node:crypto";import{execFile as he,execFileSync as ge,spawn as M}from"node:child_process";import{cleanBuildOutputDir as _e,normalizeDirectoryName as ve,writeContainerConfig as N}from"@cloudflare/build-output-utils";function ye(e,t=k.stderr){t.isTTY&&(e?t.write(`\x1B[?25h`):t.write(`\x1B[?25l`))}const P=se(import.meta.url||(typeof __filename==`string`?__filename:`/`));var be=Object.create,xe=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,Ce=Object.getOwnPropertyNames,we=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty,F=(e,t)=>xe(e,`name`,{value:t,configurable:!0}),I=/* @__PURE__ */ (e=>P===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(P===void 0?e:P)[t]}):e:P)(function(e){if(P!==void 0)return P.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),L=(e,t)=>function(){return t||(0,e[Ce(e)[0]])((t={exports:{}}).exports,t),t.exports},Ee=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Ce(t))!Te.call(e,i)&&i!==n&&xe(e,i,{get:()=>t[i],enumerable:!(r=Se(t,i))||r.enumerable});return e},R=(e,t,n)=>(n=e==null?{}:be(we(e)),Ee(xe(n,`default`,{value:e,enumerable:!0}),e)),z=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/constants.js"(e,t){var n=[`nodebuffer`,`arraybuffer`,`fragments`],r=typeof Blob<`u`;r&&n.push(`blob`),t.exports={BINARY_TYPES:n,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,hasBlob:r,kForOnEventAttribute:Symbol(`kIsForOnEventAttribute`),kListener:Symbol(`kListener`),kStatusCode:Symbol(`status-code`),kWebSocket:Symbol(`websocket`),NOOP:/* @__PURE__ */ F(()=>{},`NOOP`)}}}),De=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/buffer-util.js"(e,t){var{EMPTY_BUFFER:n}=z(),r=Buffer[Symbol.species];function i(e,t){if(e.length===0)return n;if(e.length===1)return e[0];let i=Buffer.allocUnsafe(t),a=0;for(let t=0;t<e.length;t++){let n=e[t];i.set(n,a),a+=n.length}return a<t?new r(i.buffer,i.byteOffset,a):i}F(i,`concat`);function a(e,t,n,r,i){for(let a=0;a<i;a++)n[r+a]=e[a]^t[a&3]}F(a,`_mask`);function o(e,t){for(let n=0;n<e.length;n++)e[n]^=t[n&3]}F(o,`_unmask`);function s(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}F(s,`toArrayBuffer`);function c(e){if(c.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new r(e):ArrayBuffer.isView(e)?t=new r(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),c.readOnly=!1),t}if(F(c,`toBuffer`),t.exports={concat:i,mask:a,toArrayBuffer:s,toBuffer:c,unmask:o},!process.env.WS_NO_BUFFER_UTIL)try{let e=I(`bufferutil`);t.exports.mask=function(t,n,r,i,o){o<48?a(t,n,r,i,o):e.mask(t,n,r,i,o)},t.exports.unmask=function(t,n){t.length<32?o(t,n):e.unmask(t,n)}}catch{}}}),Oe=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/limiter.js"(e,t){var n=Symbol(`kDone`),r=Symbol(`kRun`);t.exports=class{static{F(this,`Limiter`)}constructor(e){this[n]=()=>{this.pending--,this[r]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[r]()}[r](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[n])}}}}}),B=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/permessage-deflate.js"(e,t){var n=I(`zlib`),r=De(),i=Oe(),{kStatusCode:a}=z(),o=Buffer[Symbol.species],s=Buffer.from([0,0,255,255]),c=Symbol(`permessage-deflate`),l=Symbol(`total-length`),u=Symbol(`callback`),d=Symbol(`buffers`),f=Symbol(`error`),p;t.exports=class{static{F(this,`PerMessageDeflate`)}constructor(e){this._options=e||{},this._threshold=this._options.threshold===void 0?1024:this._options.threshold,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,p||=new i(this._options.concurrencyLimit===void 0?10:this._options.concurrencyLimit)}static get extensionName(){return`permessage-deflate`}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits??(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&=(this._inflate.close(),null),this._deflate){let e=this._deflate[u];this._deflate.close(),this._deflate=null,e&&e(/* @__PURE__ */ Error(`The deflate stream was closed while data was being processed`))}}acceptAsServer(e){let t=this._options,n=e.find(e=>!(t.serverNoContextTakeover===!1&&e.server_no_context_takeover||e.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits==`number`&&t.serverMaxWindowBits>e.server_max_window_bits)||typeof t.clientMaxWindowBits==`number`&&!e.client_max_window_bits));if(!n)throw Error(`None of the extension offers can be accepted`);return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits==`number`&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits==`number`?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw Error(`Unexpected parameter "client_no_context_takeover"`);if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits==`number`&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==`number`&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw Error(`Unexpected or invalid parameter "client_max_window_bits"`);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{let n=e[t];if(n.length>1)throw Error(`Parameter "${t}" must have only a single value`);if(n=n[0],t===`client_max_window_bits`){if(n!==!0){let e=+n;if(!Number.isInteger(e)||e<8||e>15)throw TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${t}": ${n}`)}else if(t===`server_max_window_bits`){let e=+n;if(!Number.isInteger(e)||e<8||e>15)throw TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(t===`client_no_context_takeover`||t===`server_no_context_takeover`){if(n!==!0)throw TypeError(`Invalid value for parameter "${t}": ${n}`)}else throw Error(`Unknown parameter "${t}"`);e[t]=n})}),e}decompress(e,t,n){p.add(r=>{this._decompress(e,t,(e,t)=>{r(),n(e,t)})})}compress(e,t,n){p.add(r=>{this._compress(e,t,(e,t)=>{r(),n(e,t)})})}_decompress(e,t,i){let a=this._isServer?`client`:`server`;if(!this._inflate){let e=`${a}_max_window_bits`,t=typeof this.params[e]==`number`?this.params[e]:n.Z_DEFAULT_WINDOWBITS;this._inflate=n.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[c]=this,this._inflate[l]=0,this._inflate[d]=[],this._inflate.on(`error`,g),this._inflate.on(`data`,h)}this._inflate[u]=i,this._inflate.write(e),t&&this._inflate.write(s),this._inflate.flush(()=>{let e=this._inflate[f];if(e){this._inflate.close(),this._inflate=null,i(e);return}let n=r.concat(this._inflate[d],this._inflate[l]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[l]=0,this._inflate[d]=[],t&&this.params[`${a}_no_context_takeover`]&&this._inflate.reset()),i(null,n)})}_compress(e,t,i){let a=this._isServer?`server`:`client`;if(!this._deflate){let e=`${a}_max_window_bits`,t=typeof this.params[e]==`number`?this.params[e]:n.Z_DEFAULT_WINDOWBITS;this._deflate=n.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[l]=0,this._deflate[d]=[],this._deflate.on(`data`,m)}this._deflate[u]=i,this._deflate.write(e),this._deflate.flush(n.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let e=r.concat(this._deflate[d],this._deflate[l]);t&&(e=new o(e.buffer,e.byteOffset,e.length-4)),this._deflate[u]=null,this._deflate[l]=0,this._deflate[d]=[],t&&this.params[`${a}_no_context_takeover`]&&this._deflate.reset(),i(null,e)})}};function m(e){this[d].push(e),this[l]+=e.length}F(m,`deflateOnData`);function h(e){this[l]+=e.length,this[c]._maxPayload<1||this[l]<=this[c]._maxPayload?this[d].push(e):(this[f]=/* @__PURE__ */ RangeError(`Max payload size exceeded`),this[f].code=`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`,this[f][a]=1009,this.removeListener(`data`,h),this.reset())}F(h,`inflateOnData`);function g(e){this[c]._inflate=null,this[f]?this[u](this[f]):(e[a]=1007,this[u](e))}F(g,`inflateOnError`)}}),ke=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/validation.js"(e,t){var{isUtf8:n}=I(`buffer`),{hasBlob:r}=z(),i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function a(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}F(a,`isValidStatusCode`);function o(e){let t=e.length,n=0;for(;n<t;)if(!(e[n]&128))n++;else if((e[n]&224)==192){if(n+1===t||(e[n+1]&192)!=128||(e[n]&254)==192)return!1;n+=2}else if((e[n]&240)==224){if(n+2>=t||(e[n+1]&192)!=128||(e[n+2]&192)!=128||e[n]===224&&(e[n+1]&224)==128||e[n]===237&&(e[n+1]&224)==160)return!1;n+=3}else if((e[n]&248)==240){if(n+3>=t||(e[n+1]&192)!=128||(e[n+2]&192)!=128||(e[n+3]&192)!=128||e[n]===240&&(e[n+1]&240)==128||e[n]===244&&e[n+1]>143||e[n]>244)return!1;n+=4}else return!1;return!0}F(o,`_isValidUTF8`);function s(e){return r&&typeof e==`object`&&typeof e.arrayBuffer==`function`&&typeof e.type==`string`&&typeof e.stream==`function`&&(e[Symbol.toStringTag]===`Blob`||e[Symbol.toStringTag]===`File`)}if(F(s,`isBlob`),t.exports={isBlob:s,isValidStatusCode:a,isValidUTF8:o,tokenChars:i},n)t.exports.isValidUTF8=function(e){return e.length<24?o(e):n(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=I(`utf-8-validate`);t.exports.isValidUTF8=function(t){return t.length<32?o(t):e(t)}}catch{}}}),Ae=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/receiver.js"(e,t){var{Writable:n}=I(`stream`),r=B(),{BINARY_TYPES:i,EMPTY_BUFFER:a,kStatusCode:o,kWebSocket:s}=z(),{concat:c,toArrayBuffer:l,unmask:u}=De(),{isValidStatusCode:d,isValidUTF8:f}=ke(),p=Buffer[Symbol.species],m=0,h=1,g=2,_=3,v=4,y=5,b=6;t.exports=class extends n{static{F(this,`Receiver`)}constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents===void 0||e.allowSynchronousEvents,this._binaryType=e.binaryType||i[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[s]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=m}_write(e,t,n){if(this._opcode===8&&this._state==m)return n();this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks?n(this.createError(RangeError,`Too many buffered chunks`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`)):(this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n))}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let t=this._buffers[0];return this._buffers[0]=new p(t.buffer,t.byteOffset+e,t.length-e),new p(t.buffer,t.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new p(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case m:this.getInfo(e);break;case h:this.getPayloadLength16(e);break;case g:this.getPayloadLength64(e);break;case _:this.getMask();break;case v:this.getData(e);break;case y:case b:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if(t[0]&48){e(this.createError(RangeError,`RSV2 and RSV3 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_2_3`));return}let n=(t[0]&64)==64;if(n&&!this._extensions[r.extensionName])e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));else{if(this._fin=(t[0]&128)==128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(!this._fragmented){e(this.createError(RangeError,`invalid opcode 0`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){e(this.createError(RangeError,`FIN must be set`,!0,1002,`WS_ERR_EXPECTED_FIN`));return}if(n){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){e(this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,`WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH`));return}}else{e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)==128,this._isServer){if(!this._masked){e(this.createError(RangeError,`MASK must be set`,!0,1002,`WS_ERR_EXPECTED_MASK`));return}}else if(this._masked){e(this.createError(RangeError,`MASK must be clear`,!0,1002,`WS_ERR_UNEXPECTED_MASK`));return}this._payloadLength===126?this._state=h:this._payloadLength===127?this._state=g:this.haveLength(e)}}getPayloadLength16(e){this._bufferedBytes<2?this._loop=!1:(this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e))}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);n>2**21-1?e(this.createError(RangeError,`Unsupported WebSocket frame: payload length > 2^53 - 1`,!1,1009,`WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH`)):(this._payloadLength=n*2**32+t.readUInt32BE(4),this.haveLength(e))}haveLength(e){this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)?e(this.createError(RangeError,`Max payload size exceeded`,!1,1009,`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`)):this._state=this._masked?_:v}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=v)}getData(e){let t=a;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&u(t,this._mask)}if(this._opcode>7)this.controlMessage(t,e);else if(this._compressed)this._state=y,this.decompress(t,e);else{if(t.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){e(this.createError(RangeError,`Too many message fragments`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`));return}this._messageLength=this._totalPayloadLength,this._fragments.push(t)}this.dataMessage(e)}}decompress(e,t){this._extensions[r.extensionName].decompress(e,this._fin,(e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){t(this.createError(RangeError,`Max payload size exceeded`,!1,1009,`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`));return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){t(this.createError(RangeError,`Too many message fragments`,!1,1008,`WS_ERR_TOO_MANY_BUFFERED_PARTS`));return}this._fragments.push(n)}this.dataMessage(t),this._state===m&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=m;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let r;r=this._binaryType===`nodebuffer`?c(n,t):this._binaryType===`arraybuffer`?l(c(n,t)):this._binaryType===`blob`?new Blob(n):n,this._allowSynchronousEvents?(this.emit(`message`,r,!0),this._state=m):(this._state=b,setImmediate(()=>{this.emit(`message`,r,!0),this._state=m,this.startLoop(e)}))}else{let r=c(n,t);if(!this._skipUTF8Validation&&!f(r)){e(this.createError(Error,`invalid UTF-8 sequence`,!0,1007,`WS_ERR_INVALID_UTF8`));return}this._state===y||this._allowSynchronousEvents?(this.emit(`message`,r,!1),this._state=m):(this._state=b,setImmediate(()=>{this.emit(`message`,r,!1),this._state=m,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit(`conclude`,1005,a),this.end();else{let n=e.readUInt16BE(0);if(!d(n)){t(this.createError(RangeError,`invalid status code ${n}`,!0,1002,`WS_ERR_INVALID_CLOSE_CODE`));return}let r=new p(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!f(r)){t(this.createError(Error,`invalid UTF-8 sequence`,!0,1007,`WS_ERR_INVALID_UTF8`));return}this._loop=!1,this.emit(`conclude`,n,r),this.end()}this._state=m}else this._allowSynchronousEvents?(this.emit(this._opcode===9?`ping`:`pong`,e),this._state=m):(this._state=b,setImmediate(()=>{this.emit(this._opcode===9?`ping`:`pong`,e),this._state=m,this.startLoop(t)}))}createError(e,t,n,r,i){this._loop=!1,this._errored=!0;let a=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(a,this.createError),a.code=i,a[o]=r,a}}}}),je=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/sender.js"(e,t){var{Duplex:n}=I(`stream`),{randomFillSync:r}=I(`crypto`),{types:{isUint8Array:i}}=I(`util`),a=B(),{EMPTY_BUFFER:o,kWebSocket:s,NOOP:c}=z(),{isBlob:l,isValidStatusCode:u}=ke(),{mask:d,toBuffer:f}=De(),p=Symbol(`kByteLength`),m=Buffer.alloc(4),h=8192,g,_=h,v=0,y=1,b=2;t.exports=class e{static{F(this,`Sender`)}constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=v,this.onerror=c,this[s]=void 0}static frame(e,t){let n,i=!1,a=2,o=!1;t.mask&&(n=t.maskBuffer||m,t.generateMask?t.generateMask(n):(_===h&&(g===void 0&&(g=Buffer.alloc(h)),r(g,0,h),_=0),n[0]=g[_++],n[1]=g[_++],n[2]=g[_++],n[3]=g[_++]),o=(n[0]|n[1]|n[2]|n[3])===0,a=6);let s;typeof e==`string`?(!t.mask||o)&&t[p]!==void 0?s=t[p]:(e=Buffer.from(e),s=e.length):(s=e.length,i=t.mask&&t.readOnly&&!o);let c=s;s>=65536?(a+=8,c=127):s>125&&(a+=2,c=126);let l=Buffer.allocUnsafe(i?s+a:a);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(s,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(s,4,6)),!t.mask||(l[1]|=128,l[a-4]=n[0],l[a-3]=n[1],l[a-2]=n[2],l[a-1]=n[3],o)?[l,e]:i?(d(e,n,l,a,s),[l]):(d(e,n,e,0,s),[l,e])}close(t,n,r,a){let s;if(t===void 0)s=o;else if(typeof t!=`number`||!u(t))throw TypeError(`First argument must be a valid error code number`);else if(n===void 0||!n.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let e=Buffer.byteLength(n);if(e>123)throw RangeError(`The message must not be greater than 123 bytes`);if(s=Buffer.allocUnsafe(2+e),s.writeUInt16BE(t,0),typeof n==`string`)s.write(n,2);else if(i(n))s.set(n,2);else throw TypeError(`Second argument must be a string or a Uint8Array`)}let c={[p]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state===v?this.sendFrame(e.frame(s,c),a):this.enqueue([this.dispatch,s,!1,c,a])}ping(t,n,r){let i,a;if(typeof t==`string`?(i=Buffer.byteLength(t),a=!1):l(t)?(i=t.size,a=!1):(t=f(t),i=t.length,a=f.readOnly),i>125)throw RangeError(`The data size must not be greater than 125 bytes`);let o={[p]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};l(t)?this._state===v?this.getBlobData(t,!1,o,r):this.enqueue([this.getBlobData,t,!1,o,r]):this._state===v?this.sendFrame(e.frame(t,o),r):this.enqueue([this.dispatch,t,!1,o,r])}pong(t,n,r){let i,a;if(typeof t==`string`?(i=Buffer.byteLength(t),a=!1):l(t)?(i=t.size,a=!1):(t=f(t),i=t.length,a=f.readOnly),i>125)throw RangeError(`The data size must not be greater than 125 bytes`);let o={[p]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};l(t)?this._state===v?this.getBlobData(t,!1,o,r):this.enqueue([this.getBlobData,t,!1,o,r]):this._state===v?this.sendFrame(e.frame(t,o),r):this.enqueue([this.dispatch,t,!1,o,r])}send(e,t,n){let r=this._extensions[a.extensionName],i=t.binary?2:1,o=t.compress,s,c;typeof e==`string`?(s=Buffer.byteLength(e),c=!1):l(e)?(s=e.size,c=!1):(e=f(e),s=e.length,c=f.readOnly),this._firstFragment?(this._firstFragment=!1,o&&r&&r.params[r._isServer?`server_no_context_takeover`:`client_no_context_takeover`]&&(o=s>=r._threshold),this._compress=o):(o=!1,i=0),t.fin&&(this._firstFragment=!0);let u={[p]:s,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:o};l(e)?this._state===v?this.getBlobData(e,this._compress,u,n):this.enqueue([this.getBlobData,e,this._compress,u,n]):this._state===v?this.dispatch(e,this._compress,u,n):this.enqueue([this.dispatch,e,this._compress,u,n])}getBlobData(t,n,r,i){this._bufferedBytes+=r[p],this._state=b,t.arrayBuffer().then(t=>{if(this._socket.destroyed){let e=/* @__PURE__ */ Error(`The socket was closed while the blob was being read`);process.nextTick(x,this,e,i);return}this._bufferedBytes-=r[p];let a=f(t);n?this.dispatch(a,n,r,i):(this._state=v,this.sendFrame(e.frame(a,r),i),this.dequeue())}).catch(e=>{process.nextTick(S,this,e,i)})}dispatch(t,n,r,i){if(!n){this.sendFrame(e.frame(t,r),i);return}let o=this._extensions[a.extensionName];this._bufferedBytes+=r[p],this._state=y,o.compress(t,r.fin,(t,n)=>{if(this._socket.destroyed){let e=/* @__PURE__ */ Error(`The socket was closed while data was being compressed`);x(this,e,i)}else this._bufferedBytes-=r[p],this._state=v,r.readOnly=!1,this.sendFrame(e.frame(n,r),i),this.dequeue()})}dequeue(){for(;this._state===v&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][p],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][p],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};function x(e,t,n){typeof n==`function`&&n(t);for(let n=0;n<e._queue.length;n++){let r=e._queue[n],i=r[r.length-1];typeof i==`function`&&i(t)}}F(x,`callCallbacks`);function S(e,t,n){x(e,t,n),e.onerror(t)}F(S,`onError`)}}),Me=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/event-target.js"(e,t){var{kForOnEventAttribute:n,kListener:r}=z(),i=Symbol(`kCode`),a=Symbol(`kData`),o=Symbol(`kError`),s=Symbol(`kMessage`),c=Symbol(`kReason`),l=Symbol(`kTarget`),u=Symbol(`kType`),d=Symbol(`kWasClean`),f=class{static{F(this,`Event`)}constructor(e){this[l]=null,this[u]=e}get target(){return this[l]}get type(){return this[u]}};Object.defineProperty(f.prototype,"target",{enumerable:!0}),Object.defineProperty(f.prototype,"type",{enumerable:!0});var p=class extends f{static{F(this,`CloseEvent`)}constructor(e,t={}){super(e),this[i]=t.code===void 0?0:t.code,this[c]=t.reason===void 0?``:t.reason,this[d]=t.wasClean!==void 0&&t.wasClean}get code(){return this[i]}get reason(){return this[c]}get wasClean(){return this[d]}};Object.defineProperty(p.prototype,"code",{enumerable:!0}),Object.defineProperty(p.prototype,"reason",{enumerable:!0}),Object.defineProperty(p.prototype,"wasClean",{enumerable:!0});var m=class extends f{static{F(this,`ErrorEvent`)}constructor(e,t={}){super(e),this[o]=t.error===void 0?null:t.error,this[s]=t.message===void 0?``:t.message}get error(){return this[o]}get message(){return this[s]}};Object.defineProperty(m.prototype,"error",{enumerable:!0}),Object.defineProperty(m.prototype,"message",{enumerable:!0});var h=class extends f{static{F(this,`MessageEvent`)}constructor(e,t={}){super(e),this[a]=t.data===void 0?null:t.data}get data(){return this[a]}};Object.defineProperty(h.prototype,"data",{enumerable:!0}),t.exports={CloseEvent:p,ErrorEvent:m,Event:f,EventTarget:{addEventListener(e,t,i={}){for(let a of this.listeners(e))if(!i[n]&&a[r]===t&&!a[n])return;let a;if(e===`message`)a=/* @__PURE__ */ F(function(e,n){let r=new h(`message`,{data:n?e:e.toString()});r[l]=this,g(t,this,r)},`onMessage`);else if(e===`close`)a=/* @__PURE__ */ F(function(e,n){let r=new p(`close`,{code:e,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[l]=this,g(t,this,r)},`onClose`);else if(e===`error`)a=/* @__PURE__ */ F(function(e){let n=new m(`error`,{error:e,message:e.message});n[l]=this,g(t,this,n)},`onError`);else if(e===`open`)a=/* @__PURE__ */ F(function(){let e=new f(`open`);e[l]=this,g(t,this,e)},`onOpen`);else return;a[n]=!!i[n],a[r]=t,i.once?this.once(e,a):this.on(e,a)},removeEventListener(e,t){for(let i of this.listeners(e))if(i[r]===t&&!i[n]){this.removeListener(e,i);break}}},MessageEvent:h};function g(e,t,n){typeof e==`object`&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}F(g,`callListener`)}}),Ne=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/extension.js"(e,t){var{tokenChars:n}=ke();function r(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}F(r,`push`);function i(e){let t=/* @__PURE__ */ Object.create(null),i=/* @__PURE__ */ Object.create(null),a=!1,o=!1,s=!1,c,l,u=-1,d=-1,f=-1,p=0;for(;p<e.length;p++)if(d=e.charCodeAt(p),c===void 0){if(f===-1&&n[d]===1)u===-1&&(u=p);else if(p!==0&&(d===32||d===9))f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let n=e.slice(u,f);d===44?(r(t,n,i),i=/* @__PURE__ */ Object.create(null)):c=n,u=f=-1}else throw SyntaxError(`Unexpected character at index ${p}`)}else if(l===void 0){if(f===-1&&n[d]===1)u===-1&&(u=p);else if(d===32||d===9)f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p),r(i,e.slice(u,f),!0),d===44&&(r(t,c,i),i=/* @__PURE__ */ Object.create(null),c=void 0),u=f=-1}else if(d===61&&u!==-1&&f===-1)l=e.slice(u,p),u=f=-1;else throw SyntaxError(`Unexpected character at index ${p}`)}else if(o){if(n[d]!==1)throw SyntaxError(`Unexpected character at index ${p}`);u===-1?u=p:a||=!0,o=!1}else if(s){if(n[d]===1)u===-1&&(u=p);else if(d===34&&u!==-1)s=!1,f=p;else if(d===92)o=!0;else throw SyntaxError(`Unexpected character at index ${p}`)}else if(d===34&&e.charCodeAt(p-1)===61)s=!0;else if(f===-1&&n[d]===1)u===-1&&(u=p);else if(u!==-1&&(d===32||d===9))f===-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let n=e.slice(u,f);a&&=(n=n.replace(/\\/g,``),!1),r(i,l,n),d===44&&(r(t,c,i),i=/* @__PURE__ */ Object.create(null),c=void 0),l=void 0,u=f=-1}else throw SyntaxError(`Unexpected character at index ${p}`);if(u===-1||s||d===32||d===9)throw SyntaxError(`Unexpected end of input`);f===-1&&(f=p);let m=e.slice(u,f);return c===void 0?r(t,m,i):(l===void 0?r(i,m,!0):a?r(i,l,m.replace(/\\/g,``)):r(i,l,m),r(t,c,i)),t}F(i,`parse`);function a(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>[t].concat(Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>e===!0?t:`${t}=${e}`).join(`; `)})).join(`; `)).join(`, `)}).join(`, `)}F(a,`format`),t.exports={format:a,parse:i}}}),Pe=L({"../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/websocket.js"(e,t){var n=I(`events`),r=I(`https`),i=I(`http`),a=I(`net`),o=I(`tls`),{randomBytes:s,createHash:c}=I(`crypto`),{Duplex:l,Readable:u}=I(`stream`),{URL:d}=I(`url`),f=B(),p=Ae(),m=je(),{isBlob:h}=ke(),{BINARY_TYPES:g,CLOSE_TIMEOUT:_,EMPTY_BUFFER:v,GUID:y,kForOnEventAttribute:b,kListener:x,kStatusCode:S,kWebSocket:C,NOOP:ee}=z(),{EventTarget:{addEventListener:te,removeEventListener:ne}}=Me(),{format:re,parse:ie}=Ne(),{toBuffer:ae}=De(),w=Symbol(`kAborted`),oe=[8,13],T=[`CONNECTING`,`OPEN`,`CLOSING`,`CLOSED`],se=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,E=class e extends n{static{F(this,`WebSocket`)}constructor(t,n,r){super(),this._binaryType=g[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=v,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol=``,this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t===null?(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0):(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n==`object`&&n?(r=n,n=[]):n=[n]),ce(this,t,n,r))}get binaryType(){return this._binaryType}set binaryType(e){g.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}
|
|
3
3
|
/* istanbul ignore next */
|
|
4
4
|
get onclose(){return null}
|
|
5
5
|
/* istanbul ignore next */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{c as e}from"./build-
|
|
2
|
+
import{c as e}from"./build-DKFvtSB_.mjs";import{existsSync as t,readFileSync as n,statSync as r}from"node:fs";import{dirname as i,join as a,sep as o}from"node:path";const s={esm:`esm`,cjs:`commonjs`,python:`python`,"python-requirement":`python-requirement`,wasm:`compiled-wasm`,text:`text`,data:`buffer`,json:`text`};function c(e,t,n,r,a){let o=process.cwd(),s=t.main??``;return{entry:{file:s,projectRoot:o,configPath:e.configPath,format:`modules`,moduleRoot:s?i(s):e.bundleDir??``,exports:[]},name:e.config.name,compatibilityDate:t.compatibility_date,compatibilityFlags:t.compatibility_flags??[],assetsDir:p(e,t),main:t.main??void 0,keepVars:t.keep_vars??!1,dryRun:r[`dry-run`],env:void 0,outfile:void 0,tag:r.tag,message:r.message,secretsFile:r[`secrets-file`],experimentalAutoCreate:!0,accountId:n,sendMetrics:!1,resourcesProvision:!0,skipProvisioningConfigWriteback:!0,skipLastDeployedFromApiCheck:!1,containers:a,cliVars:{},isWorkersSite:!1,useServiceEnvApiPath:!1}}function l(e,t,n,r,i){return{...c(e,t,n,r,i),command:`deploy`,resourcesProvision:r.provision??!0,containersRollout:r[`containers-rollout`],triggers:t.triggers?.crons,routes:f(t),logpush:t.logpush,dispatchNamespace:r[`dispatch-namespace`],strict:!0,legacyAssetPaths:void 0,oldAssetTtl:void 0}}function u(e,t,n,r,i){return{...c(e,t,n,r,i),command:`versions upload`,strict:!0,previewAlias:r[`preview-alias`]}}function d(e,t,n,r){return{config:t,accountId:n,scriptName:t.name??e.config.name,crons:t.triggers?.crons,routes:f(t),firstDeploy:!1,dryRun:r[`dry-run`],validated:!1}}function f(e){return e.routes?e.routes:e.route?[e.route]:[]}function p(t,n){let r=t.assetsDir;if(!r)return;let i=!!n.main,a=n.assets?.run_worker_first;if(!i&&a)throw new e(`assets.run_worker_first requires a Worker entrypoint, but no main module is configured.`);return{directory:r,binding:n.assets?.binding,directoryExists:!0}}function m(i,o){if(!o.manifest||!i.bundleDir)return{modules:[],sourceMaps:void 0,dependencies:{},resolvedEntryPointPath:``,bundleType:`esm`,content:``};let{mainModule:c,modules:l}=o.manifest;h(c,i.bundleDir);let u=a(i.bundleDir,c);if(!t(u))throw new e(`Main module not found: ${u}`);let d=l?.[c]?.type??`esm`;if(d===`sourcemap`)throw new e(`Main module "${c}" cannot be a sourcemap.`);let f=n(u,`utf8`),p=s[d],m=[],g=[],_={};if(_[u]={bytesInOutput:r(u).size},l)for(let[o,u]of Object.entries(l)){if(o===c)continue;h(o,i.bundleDir);let l=a(i.bundleDir,o);if(u.type===`sourcemap`){if(!t(l))throw new e(`Module not found: ${l}`);g.push({name:o,content:n(l,`utf8`)});continue}if(!t(l))throw new e(`Module not found: ${l}`);let d=u.type===`wasm`||u.type===`data`?n(l):n(l,`utf8`);m.push({name:o,filePath:l,content:d,type:s[u.type]}),_[l]={bytesInOutput:r(l).size}}return{modules:m,sourceMaps:g.length>0?g:void 0,dependencies:_,resolvedEntryPointPath:u,bundleType:p,content:f}}function h(t,n){let r=a(n,t);if(r!==n&&!r.startsWith(n+o))throw new e(`Module path "${t}" escapes the bundle directory.`)}export{u as i,l as n,d as r,m as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{i as n,r}from"./autoconfig-
|
|
2
|
+
import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{i as n,r}from"./autoconfig-Bjb97Onj.mjs";import"./ui-DvC7Qa0H.mjs";import{n as i,t as a}from"./spawn-hrdbxnm1.mjs";import{t as o}from"./registry-Bm-GgDC3.mjs";const s={command:`dev [implArgs..]`,describe:`Run the project's Cloudflare dev server`,builder:t=>t.positional(`implArgs`,{type:`string`,array:!0,describe:`Arguments forwarded to the dev-server implementation`}).parserConfiguration({"unknown-options-as-args":!0,"camel-case-expansion":!1}).epilogue(`cf dev starts the appropriate development server for your project. It runs your framework's dev command when available, falling back to an installed Cloudflare dev server.
|
|
3
3
|
|
|
4
4
|
Only ${e.brand(`--mode`)} is forwarded to supported framework development servers. Other arguments are forwarded only to Cloudflare dev-server implementations.`),handler:async e=>{let s=process.cwd(),{details:c}=await r(s),l=(e.implArgs??[]).map(String),u=e.mode?[`--mode`,e.mode]:[];if(c?.devCommand){if(l.length>0)throw Error(`Arguments cannot currently be forwarded to the detected dev command \`${c.devCommand}\`. Run that command directly with the required arguments.`);if(e.mode&&!c.framework?.supportsMode)throw Error(`The detected command \`${c.devCommand}\` does not currently support \`--mode\`.`);let r=await n(c.devCommand,s,{env:{...c.env,...o()},args:u,output:`inherit`});throw new t(r.exitCode,{signal:r.signal})}let d=i(s),f=await a(d,`dev`,[...u,...l],{output:`inherit`});throw new t(f.exitCode,{signal:f.signal})}};export{s as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CSH3UMpD.mjs";import{n}from"./auth-BlWCu-YH.mjs";import{a as r,t as i}from"./context-CSjTAJ8s.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-BcjUdm_B.mjs";import{t as c}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{n as l,t as u}from"./body-parser-ChnyBsfm.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,i as p,n as m}from"./prompt-BFRinxR0.mjs";var h={method:`POST`,path:t=>e`/accounts/${t.account_id}/diagnostics/endpoint-healthchecks`,body:`json`,constants:{check_type:`icmp`}};function g(e){return e.usage(`$0 diagnostics endpoint-healthchecks create
|
|
3
3
|
|
|
4
4
|
Create Endpoint Health Check.`).option(`check-type`,{type:`string`,description:`type of check to perform`,choices:[`icmp`],default:`icmp`}).coerce(`check-type`,e=>d(e,`check-type`,`text`)).option(`endpoint`,{type:`string`,description:`the IP address of the host to perform checks against`}).option(`name`,{type:`string`,description:`Optional name associated with this check`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Endpoint Health Check`,builder:g,handler:async e=>c({command:`diagnostics endpoint-healthchecks create`,classification:{safeFlags:[`check-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf diagnostics endpoint-healthchecks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/diagnostics/endpoint-healthchecks`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({check_type:e[`check-type`],endpoint:d(e.endpoint,`endpoint`,`text`),name:d(e.name,`name`,`text`)}):l(e.body)});return}let c=await n(e),m=e.local?t:await i();if(e.accountId=m,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(h,{body:t,account_id:m}));a(n,{successLabel:`Created`});return}e[`check-type`]===void 0&&(e[`check-type`]=await p(`check-type`,`type of check to perform`,[`icmp`])),e.endpoint===void 0&&(e.endpoint=await f(`endpoint`,`the IP address of the host to perform checks against`));let g=u({check_type:e[`check-type`],endpoint:d(e.endpoint,`endpoint`,`text`),name:d(e.name,`name`,`text`)}),_=await s(`Creating`,async()=>c.send(h,{body:g,account_id:m}));a(_,{successLabel:`Created`})})};var v={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/diagnostics/endpoint-healthchecks/${t.id}`};function y(e){return e.usage(`$0 diagnostics endpoint-healthchecks delete <id>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CSH3UMpD.mjs";import{n}from"./auth-BlWCu-YH.mjs";import{a as r,t as i}from"./context-CSjTAJ8s.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-BcjUdm_B.mjs";import{t as c}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{n as l,t as u}from"./body-parser-ChnyBsfm.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-BFRinxR0.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/dls/regional_services/prefix_bindings`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,409:`ConflictError`,500:`InternalServerError`}};function h(e){return e.usage(`$0 dls regional-services prefix-bindings create
|
|
3
3
|
|
|
4
4
|
Bind a CIDR from a BYOIP prefix to a region. This requires the **IP Prefixes Write** permission in addition to **DLS Write**, because the binding is created against a BYOIP prefix in Addressing.`).option(`cidr`,{type:`string`,description:`IP prefix in CIDR notation to bind.`}).option(`prefix-id`,{type:`string`,description:`The ID of the parent IP prefix that contains the CIDR.`}).option(`region-key`,{type:`string`,description:`Region key from managed regions (e.g., "us", "eu").`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create a DLS prefix binding`,builder:h,handler:async e=>c({command:`dls regional-services prefix-bindings create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf dls regional-services prefix-bindings create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dls/regional_services/prefix_bindings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({cidr:d(e.cidr,`cidr`,`text`),prefix_id:d(e[`prefix-id`],`prefix-id`,`text`),region_key:d(e[`region-key`],`region-key`,`text`)}):l(e.body)});return}let c=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:p}));a(n,{successLabel:`Created`});return}e.cidr===void 0&&(e.cidr=await f(`cidr`,`IP prefix in CIDR notation to bind.`)),e[`prefix-id`]===void 0&&(e[`prefix-id`]=await f(`prefix-id`,`The ID of the parent IP prefix that contains the CIDR.`)),e[`region-key`]===void 0&&(e[`region-key`]=await f(`region-key`,`Region key from managed regions (e.g., "us", "eu").`));let h=u({cidr:d(e.cidr,`cidr`,`text`),prefix_id:d(e[`prefix-id`],`prefix-id`,`text`),region_key:d(e[`region-key`],`region-key`,`text`)}),g=await s(`Creating`,async()=>c.send(m,{body:h,account_id:p}));a(g,{successLabel:`Created`})})};var _={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dls/regional_services/prefix_bindings/${t.binding_id}`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function v(e){return e.usage(`$0 dls regional-services prefix-bindings delete <binding-id>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CSH3UMpD.mjs";import{i as n,n as r}from"./auth-BlWCu-YH.mjs";import{a as i,i as a,t as o}from"./context-CSjTAJ8s.mjs";import{t as s}from"./output-BJEgbI0G.mjs";import{t as c}from"./dry-run-gy0Hl9xo.mjs";import{t as l}from"./progress-BcjUdm_B.mjs";import{t as u}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{a as d,n as f,t as p}from"./body-parser-ChnyBsfm.mjs";import{n as m,t as h}from"./input-validation-D7z60HJH.mjs";import{a as g,n as _}from"./prompt-BFRinxR0.mjs";import{n as v,t as y}from"./raw-fetch-BO0VqOVx.mjs";var ee={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/dnssec`};function b(e){return e.usage(`$0 dns dnssec delete
|
|
3
3
|
|
|
4
4
|
Delete DNSSEC.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete`,describe:`Delete DNSSEC records`,builder:b,handler:async e=>u({command:`dns dnssec delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){c({command:`cf dns dnssec delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await _({force:!!e.force}))return;let i=await l(`Deleting`,async()=>t.send(ee,{zone_id:n}));s(i,{successLabel:`Deleted`})})};var S={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/dnssec`,body:`json`};function te(e){return e.usage(`$0 dns dnssec edit
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CSH3UMpD.mjs";import{n}from"./auth-BlWCu-YH.mjs";import{a as r,t as i}from"./context-CSjTAJ8s.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-BcjUdm_B.mjs";import{t as c}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{n as l,r as u,t as d}from"./body-parser-ChnyBsfm.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,n as m}from"./prompt-BFRinxR0.mjs";var h={method:`POST`,path:t=>e`/accounts/${t.account_id}/dns_firewall`,body:`json`};function g(e){return e.usage(`$0 dns-firewall create
|
|
3
3
|
|
|
4
4
|
Create a DNS Firewall cluster`).option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
|
|
5
5
|
indicated by the TTL received from upstream nameservers. This setting
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./request-headers-
|
|
2
|
+
import{n as e}from"./request-headers-DFPlTFRf.mjs";import{t}from"./output-BJEgbI0G.mjs";import{t as n}from"./run--9dxcon4.mjs";const r=`https://developers.cloudflare.com`;function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function a(e){return i(e)?e.success===!1?e.error===void 0||typeof e.error==`string`:e.success===!0&&i(e.result)&&Array.isArray(e.result.chunks)&&e.result.chunks.every(e=>{if(!i(e)||!i(e.item)||typeof e.item.key!=`string`||e.item.key.length===0)return!1;let t=e.item.metadata;return t===void 0||i(t)&&(t.title===void 0||typeof t.title==`string`)&&(t.description===void 0||typeof t.description==`string`)}):!1}function o(e){let t;try{t=new URL(e,`${r}/`)}catch{throw Error(`Cloudflare docs search returned an invalid URL.`)}if(t.origin!==r||t.username||t.password)throw Error(`Cloudflare docs search returned an invalid URL.`);return t.href}async function s(t){let n=AbortSignal.timeout(3e4),r;try{r=await fetch(`https://ai-search.developers.cloudflare.com/api/ai-search/search`,{method:`POST`,headers:{...e(),"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify({messages:[{role:`user`,content:t}],stream:!1,ai_search_options:{retrieval:{metadata_only:!0,max_num_results:5}}}),signal:n})}catch(e){throw Error(n.aborted?`Cloudflare docs search timed out. Try again.`:`Unable to reach Cloudflare docs search. Check your connection and try again.`,{cause:e})}if(!r.ok)throw Error(`Cloudflare docs search failed (HTTP ${r.status}).`);let i;try{i=await r.json()}catch(e){throw Error(n.aborted?`Cloudflare docs search timed out. Try again.`:`Cloudflare docs search returned an invalid JSON response.`,{cause:e})}if(!a(i))throw Error(`Cloudflare docs search returned an invalid response.`);if(!i.success)throw Error(`Cloudflare docs search failed: ${i.error??`Unknown error`}`);return i.result.chunks.slice(0,5).map(({item:e})=>({title:e.metadata?.title??`Untitled`,description:e.metadata?.description??``,url:o(e.key)}))}const c={command:`search <query>`,describe:`Search live Cloudflare documentation, guides, tutorials, and examples`,builder:e=>e.positional(`query`,{describe:`Search terms or a question about Cloudflare`,type:`string`,demandOption:!0,coerce:e=>{let t=e.trim();if(!t)throw Error(`query must not be empty.`);return t}}).example(`cf docs search "schedule a worker"`,`Find guides and examples`).epilogue(`Returns up to five ranked JSON results with title, description, and url. No Cloudflare login is required.
|
|
3
3
|
Fetch a result's URL with Accept: text/markdown to read the full page as Markdown.`),handler:e=>n({command:`docs search`,recordArgs:!1,searchQuery:e.query},e,async()=>{t(await s(e.query))})},l={command:`docs`,describe:`Search live Cloudflare documentation`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{l as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CSH3UMpD.mjs";import{n}from"./auth-BlWCu-YH.mjs";import{a as r,t as i}from"./context-CSjTAJ8s.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-BcjUdm_B.mjs";import{t as c}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";var l={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/durable_objects/namespaces`,query:[`page`,`per_page`]};function u(e){return e.usage(`$0 durable-objects namespaces list
|
|
3
3
|
|
|
4
4
|
Returns the Durable Object namespaces owned by an account.`).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`List Durable Object Namespaces`,builder:u,handler:async e=>c({command:`durable-objects namespaces list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();o({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let u=await n(e),d=e.local?t:await i();e.accountId=d;let f=await s(`Loading`,async()=>u.send(l,{account_id:d,...c}));a(f,{successLabel:`Loaded`})})};var f={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/durable_objects/namespaces/${t.id}/objects`,query:[`limit`,`cursor`]};function p(e){return e.usage(`$0 durable-objects namespaces objects list
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-BlWCu-YH.mjs";import{i as n}from"./context-CSjTAJ8s.mjs";import{t as r}from"./output-BJEgbI0G.mjs";import{t as i}from"./dry-run-gy0Hl9xo.mjs";import{t as a}from"./progress-BcjUdm_B.mjs";import{t as o}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{n as s,t as c}from"./body-parser-ChnyBsfm.mjs";var l={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/email/auth/dmarc-reports`,body:`json`};function u(e){return e.usage("$0 email-auth dmarc-reports edit\n\nUpdates the DMARC report configuration for a zone. At least one of `enabled` or `skip_wizard` must be provided. When enabling, the handler will ensure the DMARC RUA record exists in DNS.").option(`enabled`,{type:`boolean`,description:`Enable or disable DMARC reports for this zone`}).option(`skip-wizard`,{type:`boolean`,description:`Skip the DMARC setup wizard`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for PATCH /dmarc-reports`})}const d={command:`edit`,describe:`Configure DMARC Reports`,builder:u,handler:async e=>o({command:`email-auth dmarc-reports edit`,classification:{safeFlags:[`enabled`,`skip-wizard`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf email-auth dmarc-reports edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/auth/dmarc-reports`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled,skip_wizard:e[`skip-wizard`]}):s(e.body)});return}let o=await t(e),u=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=u,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(l,{body:t,zone_id:u}));r(n,{successLabel:`Updated`});return}let d=c({enabled:e.enabled,skip_wizard:e[`skip-wizard`]}),f=await a(`Updating`,async()=>o.send(l,{body:d,zone_id:u}));r(f,{successLabel:`Updated`})})};var f={method:`GET`,path:t=>e`/zones/${t.zone_id}/email/auth/dmarc-reports`};function p(e){return e.usage(`$0 email-auth dmarc-reports get
|
|
3
3
|
|
|
4
4
|
Retrieves the current DMARC report configuration and status for a zone. Returns the RUA prefix, enabled status, approved sources, and DNS records.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Get DMARC Report Status`,builder:p,handler:async e=>o({command:`email-auth dmarc-reports get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf email-auth dmarc-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/auth/dmarc-reports`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(f,{zone_id:s}));r(c,{successLabel:`Loaded`})})},h={command:`dmarc-reports`,describe:`Operations for dmarc-reports`,builder:e=>e.command(d).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var g={method:`GET`,path:t=>e`/zones/${t.zone_id}/email/auth/spf/inspect`,query:[`id`]};function _(e){return e.usage(`$0 email-auth spf inspect
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CSH3UMpD.mjs";import{n}from"./auth-BlWCu-YH.mjs";import{a as r,t as i}from"./context-CSjTAJ8s.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-BcjUdm_B.mjs";import{t as c}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{n as l,t as u}from"./body-parser-ChnyBsfm.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-BFRinxR0.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/email/domains`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`,429:`TooManyRequestsError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function h(e){return e.usage(`$0 email-domains create
|
|
3
3
|
|
|
4
4
|
Creates a candidate and four DNS instructions. Rejects hostnames whose assigned Return-Path exceeds 201 ASCII characters. Creation follows read-only checks of the saved provider bundle and published exclusion. Hostnames inside an active full Cloudflare DNS zone return the generic hostname conflict error 2083. No per-domain provider DNS writes occur. Customer DNS observations remain pending and mail remains inactive. Unverified candidates may share a hostname. Supply an account-unique client_reference to retry the same enrollment safely; reuse with a different hostname returns error 2083. Final public-DNS, namespace protection and runtime readiness are separate gates. Available only to the configured OpenAI pilot account behind a default-off gate. Authentication failures may use the gateway error envelope.`).option(`client-reference`,{type:`string`,description:`Opaque reference for one customer enrollment. Reuse it with the same hostname to retry Create safely. Distinct references can enroll the same unverified hostname; a hostname alone never identifies a customer.`}).option(`hostname`,{type:`string`,description:`Exact external hostname to enroll. After ASCII conversion, the assigned Return-Path hostname must be at most 201 characters (191 for the current cf-bounce. prefix). Wildcards, provider-zone names, and hostnames inside an existing Cloudflare-managed DNS zone are rejected.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create an Email Domain`,builder:h,handler:async e=>c({command:`email-domains create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email/domains`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({client_reference:d(e[`client-reference`],`client-reference`,`text`),hostname:d(e.hostname,`hostname`,`text`)}):l(e.body)});return}let c=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:p}));a(n,{successLabel:`Created`});return}e.hostname===void 0&&(e.hostname=await f(`hostname`,`Exact external hostname to enroll. After ASCII conversion, the assigned Return-Path hostname must be at most 201 characters (191 for the current cf-bounce. prefix). Wildcards, provider-zone names, and hostnames inside an existing Cloudflare-managed DNS zone are rejected.`));let h=u({client_reference:d(e[`client-reference`],`client-reference`,`text`),hostname:d(e.hostname,`hostname`,`text`)}),g=await s(`Creating`,async()=>c.send(m,{body:h,account_id:p}));a(g,{successLabel:`Created`})})};var _={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email/domains/${t.email_domain_id}`,errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function v(e){return e.usage(`$0 email-domains delete <email-domain-id>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CSH3UMpD.mjs";import{n}from"./auth-BlWCu-YH.mjs";import{a as r,i,t as a}from"./context-CSjTAJ8s.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-BcjUdm_B.mjs";import{t as l}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{a as u,n as d,t as f}from"./body-parser-ChnyBsfm.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";import{a as m,i as h,n as g}from"./prompt-BFRinxR0.mjs";var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/email/routing/addresses`,body:`json`,errors:{422:`UnprocessableEntityError`}};function v(e){return e.usage(`$0 email-routing addresses create
|
|
3
3
|
|
|
4
4
|
Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.`).option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create a destination address`,builder:v,handler:async e=>l({command:`email-routing addresses create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({email:p(e.email,`email`,`text`)}):d(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),n=await c(`Creating`,async()=>i.send(_,{body:t,account_id:l}));o(n,{successLabel:`Created`});return}e.email===void 0&&(e.email=await m(`email`,`The contact email address of the user.`));let u=f({email:p(e.email,`email`,`text`)}),h=await c(`Creating`,async()=>i.send(_,{body:u,account_id:l}));o(h,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/email/routing/addresses/${t.destination_address_identifier}`,errors:{404:`NotFoundError`}};function x(e){return e.usage(`$0 email-routing addresses delete <destination-address-identifier>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CSH3UMpD.mjs";import{n}from"./auth-BlWCu-YH.mjs";import{a as r,t as i}from"./context-CSjTAJ8s.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-BcjUdm_B.mjs";import{t as c}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{a as l,n as u,t as d}from"./body-parser-ChnyBsfm.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-BFRinxR0.mjs";var g={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/allow_policies/batch`,body:`json`};function ee(e){return e.usage(`$0 email-security allow-policies batch
|
|
3
3
|
|
|
4
4
|
Executes multiple allow policy operations atomically: delete, partially update, replace, and create allow policies in a single request. All four operation arrays (deletes, patches, puts, posts) are required and executed in order. Send empty arrays for unused operations.`).option(`deletes`,{type:`string`,description:`IDs of the allow policies to delete. Provide as a JSON array of objects or @path/to/file.json.`}).option(`patches`,{type:`string`,description:`Partial updates to apply — each entry carries the policy's ID and only the fields to change. Provide as a JSON array of objects or @path/to/file.json.`}).option(`posts`,{type:`string`,description:`Allow policies to create. Provide as a JSON array of objects or @path/to/file.json.`}).option(`puts`,{type:`string`,description:`Full replacements to apply — each entry carries the policy's ID and every field of its new value. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`batch`,describe:`Batch allow policy operations`,builder:ee,handler:async e=>c({command:`email-security allow-policies batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf email-security allow-policies batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email-security/settings/allow_policies/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,!await h({force:!!e.force,message:`This operation may delete the selected allow policies and restore normal security scanning and disposition actions for matching emails.`}))return;if(e.body){let t=u(e.body),n=await s(`Deleting`,async()=>c.send(g,{body:t,account_id:f}));a(n,{successLabel:`Deleted`});return}if(e.deletes===void 0)throw Error(`--deletes is required (or pass --body with this field set).`);if(e.patches===void 0)throw Error(`--patches is required (or pass --body with this field set).`);if(e.posts===void 0)throw Error(`--posts is required (or pass --body with this field set).`);if(e.puts===void 0)throw Error(`--puts is required (or pass --body with this field set).`);let p=d({deletes:l(e.deletes,`deletes`),patches:l(e.patches,`patches`),posts:l(e.posts,`posts`),puts:l(e.puts,`puts`)}),m=await s(`Deleting`,async()=>c.send(g,{body:p,account_id:f}));a(m,{successLabel:`Deleted`})})};var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/email-security/settings/allow_policies`,body:`json`};function ne(e){return e.usage(`$0 email-security allow-policies create
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CSH3UMpD.mjs";import{n}from"./auth-BlWCu-YH.mjs";import{a as r,i,t as a}from"./context-CSjTAJ8s.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-BcjUdm_B.mjs";import{t as l}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{a as u,n as d,r as f,t as p}from"./body-parser-ChnyBsfm.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,n as g}from"./prompt-BFRinxR0.mjs";var _={method:`GET`,path:t=>e`/accounts/${t.account_id}/email/sending/messages/${t.message_id}`,response:`binary-response`,errors:{404:`NotFoundError`,500:`InternalServerError`}};function v(e){return e.usage(`$0 email-sending get <message-id>
|
|
3
3
|
|
|
4
4
|
Returns the raw RFC 5322 MIME message for the given account and message id.`).positional(`message-id`,{type:`string`,description:`Message ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <message-id>`,describe:`Fetch an email message`,builder:v,handler:async e=>l({command:`email-sending get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf email-sending get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email/sending/messages/${e[`message-id`]==null?`<message-id>`:encodeURIComponent(String(e[`message-id`]))}`,pathParams:{"message-id":String(e[`message-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(_,{account_id:l,message_id:e[`message-id`]}));o(u,{successLabel:`Loaded`})})};var b={method:`GET`,path:t=>e`/accounts/${t.account_id}/email/sending/limits`,errors:{403:`ForbiddenError`}};function ee(e){return e.usage(`$0 email-sending limits get
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ Returns the authoritative Email Sending reputation state and active evaluation p
|
|
|
9
9
|
|
|
10
10
|
Send a raw RFC 5322 (MIME) email for the specified account. Provide the full MIME message plus the SMTP envelope (from and recipients).`).option(`from`,{type:`string`,description:`Sender email address.`}).option(`mime-message`,{type:`string`,description:`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`}).option(`recipients`,{type:`string`,array:!0,description:`List of recipient email addresses.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`send-raw`,describe:`Send a raw MIME email`,builder:S,handler:async e=>l({command:`email-sending send-raw`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf email-sending send-raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email/sending/send_raw`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({from:m(e.from,`from`,`text`),mime_message:m(e[`mime-message`],`mime-message`,`text`),recipients:e.recipients}):d(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),n=await c(`Creating`,async()=>i.send(x,{body:t,account_id:l}));o(n,{successLabel:`Created`});return}if(e.from===void 0&&(e.from=await h(`from`,`Sender email address.`)),e[`mime-message`]===void 0&&(e[`mime-message`]=await h(`mime-message`,`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`)),e.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);let u=p({from:m(e.from,`from`,`text`),mime_message:m(e[`mime-message`],`mime-message`,`text`),recipients:e.recipients}),f=await c(`Creating`,async()=>i.send(x,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var w={method:`POST`,path:t=>e`/accounts/${t.account_id}/email/sending/send`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,409:`ConflictError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function T(e){return e.usage(`$0 email-sending send
|
|
11
11
|
|
|
12
|
-
Send an email for the specified account using the structured builder. Provide the sender, recipients, subject, and at least one of text or html; attachments are optional.`).option(`attachments`,{type:`string`,description:`File attachments and inline images. Provide as a JSON array of objects or @path/to/file.json.`}).option(`bcc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`bcc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`cc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`cc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`from-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`from-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`headers`,{type:`string`,description:`Custom email headers as key-value pairs. Provide as a JSON object or @path/to/file.json.`}).option(`html`,{type:`string`,description:`HTML body of the email. Provide at least one of text or html (non-empty).`}).option(`reply-to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`reply-to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`subject`,{type:`string`,description:`Email subject line.`}).option(`text`,{type:`string`,description:`Plain text body of the email. Provide at least one of text or html (non-empty).`}).option(`to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`send`,describe:`Send an email`,builder:T,handler:async e=>l({command:`email-sending send`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf email-sending send`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email/sending/send`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({attachments:u(e.attachments,`attachments`),bcc:{address:m(e[`bcc-address`],`bcc-address`,`text`),name:m(e[`bcc-name`],`bcc-name`,`text`)},cc:{address:m(e[`cc-address`],`cc-address`,`text`),name:m(e[`cc-name`],`cc-name`,`text`)},from:{address:m(e[`from-address`],`from-address`,`text`),name:m(e[`from-name`],`from-name`,`text`)},headers:f(e.headers,`headers`),html:m(e.html,`html`,`text`),reply_to:{address:m(e[`reply-to-address`],`reply-to-address`,`text`),name:m(e[`reply-to-name`],`reply-to-name`,`text`)},subject:m(e.subject,`subject`,`text`),text:m(e.text,`text`,`text`),to:{address:m(e[`to-address`],`to-address`,`text`),name:m(e[`to-name`],`to-name`,`text`)}},[[`headers`]]):d(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),n=await c(`Creating`,async()=>i.send(w,{body:t,account_id:l}));o(n,{successLabel:`Created`});return}e.subject===void 0&&(e.subject=await h(`subject`,`Email subject line.`));let g=p({attachments:u(e.attachments,`attachments`),bcc:{address:m(e[`bcc-address`],`bcc-address`,`text`),name:m(e[`bcc-name`],`bcc-name`,`text`)},cc:{address:m(e[`cc-address`],`cc-address`,`text`),name:m(e[`cc-name`],`cc-name`,`text`)},from:{address:m(e[`from-address`],`from-address`,`text`),name:m(e[`from-name`],`from-name`,`text`)},headers:f(e.headers,`headers`),html:m(e.html,`html`,`text`),reply_to:{address:m(e[`reply-to-address`],`reply-to-address`,`text`),name:m(e[`reply-to-name`],`reply-to-name`,`text`)},subject:m(e.subject,`subject`,`text`),text:m(e.text,`text`,`text`),to:{address:m(e[`to-address`],`to-address`,`text`),name:m(e[`to-name`],`to-name`,`text`)}},[[`headers`]]),_=await c(`Creating`,async()=>i.send(w,{body:g,account_id:l}));o(_,{successLabel:`Created`})})};var D={method:`POST`,path:t=>e`/zones/${t.zone_id}/email/sending/subdomains`,body:`json`,errors:{403:`ForbiddenError`}};function O(e){return e.usage("$0 email-sending subdomains create\n\nCreates a new sending subdomain or re-enables sending on an existing subdomain that had it disabled. If zone-level Email Sending has not been enabled yet, the zone flag is automatically set when the entitlement is present. A leftmost wildcard such as `*.example.com` is accepted only for accounts with wildcard Email Sending enabled. Wildcard senders share the base domain's DKIM signing identity and `cf-bounce.<base>` return path.").option(`name`,{type:`string`,description:"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`create`,describe:`Create a sending subdomain`,builder:O,handler:async e=>l({command:`email-sending subdomains create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf email-sending subdomains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`)}):d(e.body)});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=d(e.body),i=await c(`Creating`,async()=>t.send(D,{body:n,zone_id:r}));o(i,{successLabel:`Created`});return}e.name===void 0&&(e.name=await h(`name`,"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement."));let a=p({name:m(e.name,`name`,`text`)}),l=await c(`Creating`,async()=>t.send(D,{body:a,zone_id:r}));o(l,{successLabel:`Created`})})};var A={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/email/sending/subdomains/${t.subdomain_id}`,errors:{404:`NotFoundError`}};function j(e){return e.usage(`$0 email-sending subdomains delete <subdomain-id>
|
|
12
|
+
Send an email for the specified account using the structured builder. Provide the sender, recipients, subject, and at least one of text or html; attachments are optional.`).option(`attachments`,{type:`string`,description:`File attachments and inline images. Provide as a JSON array of objects or @path/to/file.json.`}).option(`bcc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`bcc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`cc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`cc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`from-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`from-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`headers`,{type:`string`,description:`Custom email headers as key-value pairs. Provide as a JSON object or @path/to/file.json.`}).option(`html`,{type:`string`,description:`HTML body of the email. Provide at least one of text or html (non-empty).`}).option(`reply-to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`reply-to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`subject`,{type:`string`,description:`Email subject line.`}).option(`text`,{type:`string`,description:`Plain text body of the email. Provide at least one of text or html (non-empty).`}).option(`to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`send`,describe:`Send an email`,builder:T,handler:async e=>l({command:`email-sending send`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf email-sending send`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/email/sending/send`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({attachments:u(e.attachments,`attachments`),bcc:{address:m(e[`bcc-address`],`bcc-address`,`text`),name:m(e[`bcc-name`],`bcc-name`,`text`)},cc:{address:m(e[`cc-address`],`cc-address`,`text`),name:m(e[`cc-name`],`cc-name`,`text`)},from:{address:m(e[`from-address`],`from-address`,`text`),name:m(e[`from-name`],`from-name`,`text`)},headers:f(e.headers,`headers`),html:m(e.html,`html`,`text`),reply_to:{address:m(e[`reply-to-address`],`reply-to-address`,`text`),name:m(e[`reply-to-name`],`reply-to-name`,`text`)},subject:m(e.subject,`subject`,`text`),text:m(e.text,`text`,`text`),to:{address:m(e[`to-address`],`to-address`,`text`),name:m(e[`to-name`],`to-name`,`text`)}},[[`headers`]]):d(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),n=await c(`Creating`,async()=>i.send(w,{body:t,account_id:l}));o(n,{successLabel:`Created`});return}e.subject===void 0&&(e.subject=await h(`subject`,`Email subject line.`));let g=p({attachments:u(e.attachments,`attachments`),bcc:{address:m(e[`bcc-address`],`bcc-address`,`text`),name:m(e[`bcc-name`],`bcc-name`,`text`)},cc:{address:m(e[`cc-address`],`cc-address`,`text`),name:m(e[`cc-name`],`cc-name`,`text`)},from:{address:m(e[`from-address`],`from-address`,`text`),name:m(e[`from-name`],`from-name`,`text`)},headers:f(e.headers,`headers`),html:m(e.html,`html`,`text`),reply_to:{address:m(e[`reply-to-address`],`reply-to-address`,`text`),name:m(e[`reply-to-name`],`reply-to-name`,`text`)},subject:m(e.subject,`subject`,`text`),text:m(e.text,`text`,`text`),to:{address:m(e[`to-address`],`to-address`,`text`),name:m(e[`to-name`],`to-name`,`text`)}},[[`headers`]]),_=await c(`Creating`,async()=>i.send(w,{body:g,account_id:l}));o(_,{successLabel:`Created`})})};var D={method:`POST`,path:t=>e`/zones/${t.zone_id}/email/sending/subdomains`,body:`json`,errors:{403:`ForbiddenError`}};function O(e){return e.usage("$0 email-sending subdomains create\n\nCreates a new sending subdomain or re-enables sending on an existing subdomain that had it disabled. If zone-level Email Sending has not been enabled yet, the zone flag is automatically set when the entitlement is present. A leftmost wildcard such as `*.example.com` is accepted only for accounts with wildcard Email Sending enabled. Wildcard senders share the base domain's DKIM signing identity and `cf-bounce.<base>` return path.").option(`name`,{type:`string`,description:"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement. The derived Return-Path hostname, including its bounce prefix, must be at most 201 characters after ASCII conversion; wildcards use the base hostname."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`create`,describe:`Create a sending subdomain`,builder:O,handler:async e=>l({command:`email-sending subdomains create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf email-sending subdomains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`)}):d(e.body)});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=d(e.body),i=await c(`Creating`,async()=>t.send(D,{body:n,zone_id:r}));o(i,{successLabel:`Created`});return}e.name===void 0&&(e.name=await h(`name`,"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement. The derived Return-Path hostname, including its bounce prefix, must be at most 201 characters after ASCII conversion; wildcards use the base hostname."));let a=p({name:m(e.name,`name`,`text`)}),l=await c(`Creating`,async()=>t.send(D,{body:a,zone_id:r}));o(l,{successLabel:`Created`})})};var A={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/email/sending/subdomains/${t.subdomain_id}`,errors:{404:`NotFoundError`}};function j(e){return e.usage(`$0 email-sending subdomains delete <subdomain-id>
|
|
13
13
|
|
|
14
14
|
Disables sending on a subdomain and removes its DNS records. If routing is still active on the subdomain, only sending is disabled.`).positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const M={command:`delete <subdomain-id>`,describe:`Delete a sending subdomain`,builder:j,handler:async e=>l({command:`email-sending subdomains delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){s({command:`cf email-sending subdomains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"subdomain-id":String(e[`subdomain-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,!await g({force:!!e.force,message:`This operation disables sending and removes the subdomain's Email Sending DNS records.`}))return;let a=await c(`Deleting`,async()=>t.send(A,{zone_id:r,subdomain_id:e[`subdomain-id`]}));o(a,{successLabel:`Deleted`})})};var N={method:`POST`,path:t=>e`/zones/${t.zone_id}/email/sending/subdomains/${t.subdomain_id}/dns`,errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`}};function P(e){return e.usage(`$0 email-sending subdomains dns fix <subdomain-id>
|
|
15
15
|
|
|
@@ -23,7 +23,7 @@ Gets information for a specific sending subdomain.`).positional(`subdomain-id`,{
|
|
|
23
23
|
|
|
24
24
|
Lists all sending-enabled subdomains for the zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`list`,describe:`List sending subdomains`,builder:q,handler:async e=>l({command:`email-sending subdomains list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf email-sending subdomains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r;let a=await c(`Loading`,async()=>t.send(K,{zone_id:r}));o(a,{successLabel:`Loaded`})})};var J={method:`POST`,path:t=>e`/zones/${t.zone_id}/email/sending/subdomains/preview`,body:`json`,errors:{403:`ForbiddenError`}};function ce(e){return e.usage(`$0 email-sending subdomains preview
|
|
25
25
|
|
|
26
|
-
Returns the DNS records that would be created for a sending subdomain, flags which records are missing, and reports any conflicts with existing DNS records. This is a read-only dry-run — no records are created or modified. Use before or after creating a subdomain to check DNS status. A leftmost wildcard requires wildcard Email Sending to be enabled for the account and previews base-scoped DKIM and return-path records.`).option(`name`,{type:`string`,description:"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const le={command:`preview`,describe:`Preview sending subdomain DNS`,builder:ce,handler:async e=>l({command:`email-sending subdomains preview`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf email-sending subdomains preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/preview`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`)}):d(e.body)});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=d(e.body),i=await c(`Loading`,async()=>t.send(J,{body:n,zone_id:r}));o(i,{successLabel:`Loaded`});return}e.name===void 0&&(e.name=await h(`name`,"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement."));let a=p({name:m(e.name,`name`,`text`)}),l=await c(`Loading`,async()=>t.send(J,{body:a,zone_id:r}));o(l,{successLabel:`Loaded`})})};var ue={method:`GET`,path:t=>e`/zones/${t.zone_id}/email/sending/subdomains/${t.subdomain_id}/reputation/complaints`,query:[`start_at`,`end_at`],errors:{400:`BadRequestError`,404:`NotFoundError`,422:`UnprocessableEntityError`,502:`BadGatewayError`}};function de(e){return e.usage(`$0 email-sending subdomains reputation get-complaints <subdomain-id>
|
|
26
|
+
Returns the DNS records that would be created for a sending subdomain, flags which records are missing, and reports any conflicts with existing DNS records. This is a read-only dry-run — no records are created or modified. Use before or after creating a subdomain to check DNS status. A leftmost wildcard requires wildcard Email Sending to be enabled for the account and previews base-scoped DKIM and return-path records.`).option(`name`,{type:`string`,description:"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement. The derived Return-Path hostname, including its bounce prefix, must be at most 201 characters after ASCII conversion; wildcards use the base hostname."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const le={command:`preview`,describe:`Preview sending subdomain DNS`,builder:ce,handler:async e=>l({command:`email-sending subdomains preview`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf email-sending subdomains preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/preview`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`)}):d(e.body)});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=d(e.body),i=await c(`Loading`,async()=>t.send(J,{body:n,zone_id:r}));o(i,{successLabel:`Loaded`});return}e.name===void 0&&(e.name=await h(`name`,"The domain name within the zone. A wildcard is allowed only as the complete leftmost label (`*.example.com`) and requires the account wildcard Email Sending entitlement. The derived Return-Path hostname, including its bounce prefix, must be at most 201 characters after ASCII conversion; wildcards use the base hostname."));let a=p({name:m(e.name,`name`,`text`)}),l=await c(`Loading`,async()=>t.send(J,{body:a,zone_id:r}));o(l,{successLabel:`Loaded`})})};var ue={method:`GET`,path:t=>e`/zones/${t.zone_id}/email/sending/subdomains/${t.subdomain_id}/reputation/complaints`,query:[`start_at`,`end_at`],errors:{400:`BadRequestError`,404:`NotFoundError`,422:`UnprocessableEntityError`,502:`BadGatewayError`}};function de(e){return e.usage(`$0 email-sending subdomains reputation get-complaints <subdomain-id>
|
|
27
27
|
|
|
28
28
|
Returns the matched complaint count for a sending subdomain in a half-open time window of up to seven days.`).positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`start-at`,{type:`string`,description:`Start at`,demandOption:!0}).option(`end-at`,{type:`string`,description:`End at`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`get-complaints <subdomain-id>`,describe:`Get sending subdomain complaint count`,builder:de,handler:async e=>l({command:`email-sending subdomains reputation get-complaints`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={start_at:e[`start-at`],end_at:e[`end-at`]};if(e.dryRun){s({command:`cf email-sending subdomains reputation get-complaints`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/reputation/complaints`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"subdomain-id":String(e[`subdomain-id`]??``)},query:t,bodyKind:`none`});return}let r=await n(e),a=await i({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a;let l=await c(`Loading`,async()=>r.send(ue,{zone_id:a,subdomain_id:e[`subdomain-id`],...t}));o(l,{successLabel:`Loaded`})})},pe={command:`reputation`,describe:`Operations for subdomains.reputation`,builder:e=>e.command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Y={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/email/sending/subdomains/${t.subdomain_id}`,body:`json`,errors:{404:`NotFoundError`}};function me(e){return e.usage(`$0 email-sending subdomains update <subdomain-id>
|
|
29
29
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./chunk-2HLTAS5V-B92NbX1j.mjs";import{n as t}from"./api-
|
|
2
|
+
import{t as e}from"./chunk-2HLTAS5V-B92NbX1j.mjs";import{n as t}from"./api-X3wKppsT.mjs";function n(e){if(typeof e!=`object`||!e)return[];let t=e.errors;return Array.isArray(t)?t.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.code;return typeof t==`number`&&Number.isFinite(t)?[t]:[]}):[]}function r(e){return typeof e==`number`&&Number.isInteger(e)&&e>=100&&e<=599}function i(e){try{return a(e)}catch{return{errorType:`Error`}}}function a(i){if(i instanceof t){let e=n(i.body);return{errorType:`APIError`,...r(i.statusCode)?{httpStatus:i.statusCode}:{},...e.length===0?{}:{errorCodes:e}}}return i instanceof e?{errorType:`APIError`,...r(i.status)?{httpStatus:i.status}:{},...typeof i.code==`number`&&Number.isFinite(i.code)?{errorCodes:[i.code]}:{}}:i instanceof Error?{errorType:`Error`}:{errorType:typeof i}}export{i as t};
|