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{r as e}from"./theme-BGHWSKCw.mjs";import"./api-
|
|
2
|
+
import{r as e}from"./theme-BGHWSKCw.mjs";import"./api-X3wKppsT.mjs";import{t}from"./path-DRw6Y-nd.mjs";import{n,t as r}from"./local-CSH3UMpD.mjs";import{a as i,i as a,n as o}from"./auth-BlWCu-YH.mjs";import{a as s,t as c}from"./context-CSjTAJ8s.mjs";import{t as l}from"./output-BJEgbI0G.mjs";import{t as u}from"./dry-run-gy0Hl9xo.mjs";import{t as d}from"./progress-BcjUdm_B.mjs";import{n as f,t as p}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{a as m,n as h,r as g,s as _,t as v}from"./body-parser-ChnyBsfm.mjs";import{n as y}from"./input-validation-D7z60HJH.mjs";import{a as ee,i as b,n as te,o as x,r as S}from"./prompt-BFRinxR0.mjs";import{_ as C,a as w,c as ne,d as T,g as E,h as D,i as O,m as k,o as re,p as ie,r as A,s as j,t as ae,u as oe}from"./schema-flags-blYVIAUK.mjs";import{domainToASCII as se}from"node:url";import{isDeepStrictEqual as ce}from"node:util";var M={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/extensions/${e.extension}`};function le(e){return e.usage("$0 registrar extensions get <extension>\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").positional(`extension`,{type:`string`,description:"The extension name (e.g., `com`, `co.uk`).",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get <extension>`,describe:`Get extension`,builder:le,handler:async e=>p({command:`registrar extensions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/extensions/${e.extension==null?`<extension>`:encodeURIComponent(String(e.extension))}`,pathParams:{extension:String(e.extension??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(M,{account_id:n,extension:e.extension}));l(i,{successLabel:`Loaded`})})};var de={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/extensions`,query:[`name`,`cursor`,`per_page`,`direction`,`sort_by`]};function fe(e){return e.usage("$0 registrar extensions list\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").option(`name`,{type:`string`,description:"Filter extensions by exact name match.\nFor example, `name=com` returns only the `com` extension."}).option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
|
|
3
3
|
Pass this value to fetch the next page of results. Omit (or
|
|
4
4
|
pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to `name` when omitted.",choices:[`name`,`created_at`,`updated_at`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`List extensions`,builder:fe,handler:async e=>p({command:`registrar extensions list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},e,async()=>{let t={name:e.name,cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){let e=await s();u({command:`cf registrar extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar/extensions`,pathParams:{},query:t,bodyKind:`none`});return}let n=await o(e),i=e.local?r:await c();e.accountId=i;let a=await d(`Loading`,async()=>n.send(de,{account_id:i,...t}));l(a,{successLabel:`Loaded`})})},me={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(ue).command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var N={method:`POST`,path:e=>t`/accounts/${e.account_id}/registrar/domain-check`,body:`json`,errors:{400:`BadRequestError`}};function he(e){return e.usage("$0 registrar registrations check <domains...>\n\nPerforms real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.").positional(`domains`,{type:`string`,array:!0,description:"List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension. - Minimum: 1 domain. - Maximum: 20 domains per request. - The response returns domains on unsupported extensions with `registrable: false` and a `reason` field. - The response may omit malformed domain names (e.g., names missing an extension). ",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const ge={command:`check <domains...>`,describe:`Check domain availability`,builder:he,handler:async e=>p({command:`registrar registrations check`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/domain-check`,pathParams:{},bodyKind:`json`,body:e.body===void 0?v({domains:e.domains}):h(e.body)});return}let t=await o(e),n=e.local?r:await c();if(e.accountId=n,e.body){let r=h(e.body),i=await d(`Creating`,async()=>t.send(N,{body:r,account_id:n}));l(i,{successLabel:`Created`});return}let i=v({domains:e.domains}),a=await d(`Creating`,async()=>t.send(N,{body:i,account_id:n}));l(a,{successLabel:`Created`})})};var _e={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}/registration-status`};function ve(e){return e.usage("$0 registrar registrations get-registration-status <domain-name>\n\nReturns the current status of a domain registration workflow. Use this endpoint to poll for completion when the POST response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `action_required` has `completed: false` and will not resolve on its own. The workflow is paused pending user intervention. - `blocked` has `completed: false` and indicates the workflow is waiting on a third party such as the extension registry or losing registrar. Continue polling while informing the user of the delay. Use increasing backoff between polls. When `state: blocked`, use a longer polling interval and do not poll indefinitely. A naive polling loop that only checks `completed` can run indefinitely when `state: action_required`. Break explicitly on `action_required`: ```js let status; do { await new Promise(r => setTimeout(r, 2000)); status = await cloudflare.request({ method: 'GET', path: reg.result.links.self, }); } while ( !status.result.completed && status.result.state !== 'action_required' ); if (status.result.state === 'action_required') { // Surface context.action and context.confirmation_sent_to to the user. // Do not re-submit the registration request. } ```").positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`get-registration-status <domain-name>`,describe:`Get Registration Status`,builder:ve,handler:async e=>p({command:`registrar registrations get-registration-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(_e,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var be={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}/transfer-in-status`};function xe(e){return e.usage("$0 registrar registrations get-transfer-status <domain-name>\n\nReturns the current status of a domain transfer workflow. Use this endpoint to poll transfer progress after initiating a transfer with `POST /accounts/{account_id}/registrar/registrations/{domain_name}/transfer-in`. The URL is provided in the `links.self` field of the transfer response. ### Transfer timelines Transfers typically take 1–10 days due to ICANN-mandated approval windows. ### Workflow states **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `in_progress`: Transfer has been submitted to the registry and is being processed. Continue polling. - `blocked`: The workflow is waiting on the losing registrar or registry to release the domain. This is the **most common state** for transfers and is entirely normal — it means the ICANN transfer approval window is in effect. The losing registrar has up to 5 days to approve or reject. Continue polling with longer intervals (e.g., every 30–60 minutes). - `action_required`: The user needs to take action (e.g., the FOA email needs to be accepted). See `context` for details on what is needed. - `pending`: Transfer workflow created but not yet started processing. ### Polling guidance Adjust your polling interval based on the current workflow state: - `pending` or `in_progress`: Poll every 30 seconds. - `blocked`: The transfer is waiting on a third party (e.g., losing registrar approval). Poll every 30–60 minutes. - `action_required`: Stop polling. The workflow will not advance until the user takes action. Check `context` for details on what is needed. - `succeeded` or `failed`: Terminal — stop polling.").positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get-transfer-status <domain-name>`,describe:`Get Transfer Status`,builder:xe,handler:async e=>p({command:`registrar registrations get-transfer-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get-transfer-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/transfer-in-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(be,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var Ce={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}/update-status`};function we(e){return e.usage("$0 registrar registrations get-update-status <domain-name>\n\nReturns the current status of a domain update workflow. Use this endpoint to poll for completion when the PATCH response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. Use increasing backoff between polls. When the workflow remains blocked on a third party, use a longer polling interval and do not poll indefinitely.").positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get-update-status <domain-name>`,describe:`Get Update Status`,builder:we,handler:async e=>p({command:`registrar registrations get-update-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(Ce,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var Ee={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}`};function De(e){return e.usage("$0 registrar registrations get <domain-name>\n\nReturns the current state of a domain registration. This is the canonical read endpoint for a domain you own. It returns the full registration resource including current settings and expiration. When the registration resource is ready, both `created_at` and `expires_at` are present in the response.").positional(`domain-name`,{type:`string`,description:`Domain name to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`get <domain-name>`,describe:`Get Registration`,builder:De,handler:async e=>p({command:`registrar registrations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(Ee,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var ke={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations`,query:[`cursor`,`per_page`,`direction`,`sort_by`]};function Ae(e){return e.usage("$0 registrar registrations list\n\nReturns a paginated list of domain registrations owned by the account. This endpoint uses cursor-based pagination. Results are ordered by registration date by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages.").option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
|
|
5
5
|
Pass this value to fetch the next page of results. Omit (or
|
|
@@ -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,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{n as u,r as d,s as f,t as p}from"./body-parser-ChnyBsfm.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h}from"./prompt-BFRinxR0.mjs";var g={method:`GET`,path:t=>e`/accounts/${t.account_id}/registrar-sandbox/extensions/${t.extension}`};function _(e){return e.usage("$0 registrar-sandbox extensions get <extension>\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").positional(`extension`,{type:`string`,description:"The extension name (e.g., `com`, `co.uk`).",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <extension>`,describe:`Get extension`,builder:_,handler:async e=>l({command:`registrar-sandbox extensions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf registrar-sandbox extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar-sandbox/extensions/${e.extension==null?`<extension>`:encodeURIComponent(String(e.extension))}`,pathParams:{extension:String(e.extension??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(g,{account_id:l,extension:e.extension}));o(u,{successLabel:`Loaded`})})};var y={method:`GET`,path:t=>e`/accounts/${t.account_id}/registrar-sandbox/extensions`,query:[`name`,`cursor`,`per_page`,`direction`,`sort_by`]};function b(e){return e.usage("$0 registrar-sandbox extensions list\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").option(`name`,{type:`string`,description:"Filter extensions by exact name match.\nFor example, `name=com` returns only the `com` extension."}).option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
|
|
3
3
|
Pass this value to fetch the next page of results. Omit (or
|
|
4
4
|
pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to `name` when omitted.",choices:[`name`,`created_at`,`updated_at`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List extensions`,builder:b,handler:async e=>l({command:`registrar-sandbox extensions list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},e,async()=>{let n={name:e.name,cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){let e=await i();s({command:`cf registrar-sandbox extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar-sandbox/extensions`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(y,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})},S={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(v).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var C={method:`POST`,path:t=>e`/accounts/${t.account_id}/registrar-sandbox/domain-check`,body:`json`,errors:{400:`BadRequestError`}};function w(e){return e.usage("$0 registrar-sandbox registrations check <domains...>\n\nPerforms real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.").positional(`domains`,{type:`string`,array:!0,description:"List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension. - Minimum: 1 domain. - Maximum: 20 domains per request. - The response returns domains on unsupported extensions with `registrable: false` and a `reason` field. - The response may omit malformed domain names (e.g., names missing an extension). ",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const T={command:`check <domains...>`,describe:`Check domain availability`,builder:w,handler:async e=>l({command:`registrar-sandbox registrations check`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf registrar-sandbox registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar-sandbox/domain-check`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({domains:e.domains}):u(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=u(e.body),r=await c(`Creating`,async()=>n.send(C,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}let d=p({domains:e.domains}),f=await c(`Creating`,async()=>n.send(C,{body:d,account_id:l}));o(f,{successLabel:`Created`})})};function E(e){return e.usage("$0 registrar-sandbox registrations create\n\nStarts a domain registration workflow. ### Prerequisites - The account must not already be at the maximum supported domain limit. A single account may own up to 500 domains in total across registrations created through either the dashboard or this API. - The domain must be on a supported extension for programmatic registration. - Use `POST /domain-check` immediately before calling this endpoint to confirm real-time availability and pricing. ### Defaults - `years`: defaults to the extension's minimum registration period (1 year for most extensions, but varies — for example, `.ai` (if supported) requires a minimum of 2 years). - `auto_renew`: defaults to `false`. Setting it to `true` is an explicit opt-in authorizing Cloudflare to charge the account's default payment method up to 30 days before domain expiry to renew the registration. Renewal pricing may change over time based on registry pricing. - `privacy_mode`: defaults to `redaction`. ### Premium domains Premium domain registration is not currently supported by this API. If `POST /domain-check` returns `tier: premium`, do not call this endpoint for that domain. ### Response behavior By default, the server holds the connection for a bounded, server-defined amount of time while the registration completes. Most registrations finish within this window and return `201 Created` with a completed workflow status. If the registration is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`.").option(`prefer`,{type:`string`,description:`Set to \`respond-async\` to receive an immediate \`202 Accepted\` without
|
|
5
5
|
waiting for the operation to complete (RFC 7240).
|
|
@@ -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{i as f}from"./prompt-BFRinxR0.mjs";var p={method:`GET`,path:t=>e`/accounts/${t.account_id}/reporting/industry`};function m(e){return e.usage(`$0 reporting industry get
|
|
3
3
|
|
|
4
4
|
Gets the industry classification for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get`,describe:`Get an account industry`,builder:m,handler:async e=>c({command:`reporting industry get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf reporting industry get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/reporting/industry`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(p,{account_id:l}));a(u,{successLabel:`Loaded`})})};var g={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/reporting/industry`,body:`json`,errors:{400:`BadRequestError`,423:`LockedError`,500:`InternalServerError`}};function _(e){return e.usage(`$0 reporting industry update
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./agent-context-
|
|
2
|
+
import{t as e}from"./agent-context-Dtyy4aKL.mjs";import{t}from"./version-Dp7G_dM6.mjs";import{t as n}from"./interactive-wQM7Blhm.mjs";import{n as r}from"./interactive-D4E8PdaW.mjs";function i(){return n?`ci`:r()?`interactive`:`non-interactive`}function a(){let n=e(),r=n.isAgentic&&n.harness!==null?{"X-CF-CLI-Agent":n.harness.id}:{};return{"User-Agent":t,"X-CF-CLI-Mode":i(),...r}}export{a as n,i as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
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}from"./prompt-BFRinxR0.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/request-tracer/trace`,body:`json`};function h(e){return e.usage(`$0 request-tracers traces create
|
|
3
3
|
|
|
4
4
|
Traces a simulated HTTP request through Cloudflare's edge to analyze how rules, settings, and configurations would process the request. Useful for debugging firewall rules, page rules, and other request transformations without sending actual traffic. Supports custom headers, cookies, body content, and geolocation context.`).option(`body-base64`,{type:`string`,description:`Base64 encoded request body`}).option(`body-json`,{type:`string`,description:`Arbitrary json as request body. Provide as a JSON object or @path/to/file.json.`}).option(`body-plain-text`,{type:`string`,description:`Request body as plain text`}).option(`context-bot-score`,{type:`number`,description:`Bot score used for evaluating tracing request processing`}).option(`context-geoloc-city`,{type:`string`,description:`The context.geoloc.city field`}).option(`context-geoloc-continent`,{type:`string`,description:`The context.geoloc.continent field`}).option(`context-geoloc-is-eu-country`,{type:`boolean`,description:`The context.geoloc.is_eu_country field`}).option(`context-geoloc-iso-code`,{type:`string`,description:`The context.geoloc.iso_code field`}).option(`context-geoloc-latitude`,{type:`number`,description:`The context.geoloc.latitude field`}).option(`context-geoloc-longitude`,{type:`number`,description:`The context.geoloc.longitude field`}).option(`context-geoloc-postal-code`,{type:`string`,description:`The context.geoloc.postal_code field`}).option(`context-geoloc-region-code`,{type:`string`,description:`The context.geoloc.region_code field`}).option(`context-geoloc-subdivision-2-iso-code`,{type:`string`,description:`The context.geoloc.subdivision_2_iso_code field`}).option(`context-geoloc-timezone`,{type:`string`,description:`The context.geoloc.timezone field`}).option(`context-skip-challenge`,{type:`boolean`,description:`Whether to skip any challenges for tracing request (e.g.: captcha)`}).option(`context-threat-score`,{type:`number`,description:`Threat score used for evaluating tracing request processing`}).option(`cookies`,{type:`string`,description:`Cookies added to tracing request. Provide as a JSON object or @path/to/file.json.`}).option(`headers`,{type:`string`,description:`Headers added to tracing request. Provide as a JSON object or @path/to/file.json.`}).option(`method`,{type:`string`,description:`HTTP Method of tracing request`}).option(`protocol`,{type:`string`,description:`HTTP Protocol of tracing request`}).option(`skip-response`,{type:`boolean`,description:`Skip sending the request to the Origin server after all rules evaluation`}).option(`url`,{type:`string`,description:`URL to which perform tracing request`}).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:`Request Trace`,builder:h,handler:async e=>c({command:`request-tracers traces create`,classification:{safeFlags:[`context-geoloc-is-eu-country`,`context-skip-challenge`,`skip-response`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf request-tracers traces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/request-tracer/trace`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({body:{base64:f(e[`body-base64`],`body-base64`,`text`),json:u(e[`body-json`],`body-json`),plain_text:f(e[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:e[`context-bot-score`],geoloc:{city:f(e[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:f(e[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:e[`context-geoloc-is-eu-country`],iso_code:f(e[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:e[`context-geoloc-latitude`],longitude:e[`context-geoloc-longitude`],postal_code:f(e[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:f(e[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:f(e[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:f(e[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:e[`context-skip-challenge`],threat_score:e[`context-threat-score`]},cookies:u(e.cookies,`cookies`),headers:u(e.headers,`headers`),method:f(e.method,`method`,`text`),protocol:f(e.protocol,`protocol`,`text`),skip_response:e[`skip-response`],url:f(e.url,`url`,`text`)},[[`body`,`json`],[`cookies`],[`headers`]]):l(e.body)});return}let c=await n(e),h=e.local?t:await i();if(e.accountId=h,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:h}));a(n,{successLabel:`Created`});return}e.method===void 0&&(e.method=await p(`method`,`HTTP Method of tracing request`)),e.url===void 0&&(e.url=await p(`url`,`URL to which perform tracing request`));let g=d({body:{base64:f(e[`body-base64`],`body-base64`,`text`),json:u(e[`body-json`],`body-json`),plain_text:f(e[`body-plain-text`],`body-plain-text`,`text`)},context:{bot_score:e[`context-bot-score`],geoloc:{city:f(e[`context-geoloc-city`],`context-geoloc-city`,`text`),continent:f(e[`context-geoloc-continent`],`context-geoloc-continent`,`text`),is_eu_country:e[`context-geoloc-is-eu-country`],iso_code:f(e[`context-geoloc-iso-code`],`context-geoloc-iso-code`,`text`),latitude:e[`context-geoloc-latitude`],longitude:e[`context-geoloc-longitude`],postal_code:f(e[`context-geoloc-postal-code`],`context-geoloc-postal-code`,`text`),region_code:f(e[`context-geoloc-region-code`],`context-geoloc-region-code`,`text`),subdivision_2_iso_code:f(e[`context-geoloc-subdivision-2-iso-code`],`context-geoloc-subdivision-2-iso-code`,`text`),timezone:f(e[`context-geoloc-timezone`],`context-geoloc-timezone`,`text`)},skip_challenge:e[`context-skip-challenge`],threat_score:e[`context-threat-score`]},cookies:u(e.cookies,`cookies`),headers:u(e.headers,`headers`),method:f(e.method,`method`,`text`),protocol:f(e.protocol,`protocol`,`text`),skip_response:e[`skip-response`],url:f(e.url,`url`,`text`)},[[`body`,`json`],[`cookies`],[`headers`]]),_=await s(`Creating`,async()=>c.send(m,{body:g,account_id:h}));a(_,{successLabel:`Created`})})},_={command:`traces`,describe:`Simulate request processing to debug rule matches, transforms, and routing decisions`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`request-tracers`,describe:`Trace how a request would be processed through Cloudflare's rules and configuration pipeline`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v 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{a as l,n as u,r 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}/shares`,body:`json`};function ee(e){return e.usage(`$0 resource-sharing create
|
|
3
3
|
|
|
4
4
|
Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`).option(`name`,{type:`string`,description:`The name of the share.`}).option(`recipients`,{type:`string`,description:`The recipients field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`resources`,{type:`string`,description:`The resources field. 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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Trigger a share creation`,builder:ee,handler:async e=>c({command:`resource-sharing create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),recipients:l(e.recipients,`recipients`),resources:l(e.resources,`resources`)}):u(e.body)});return}let c=await n(e),d=e.local?t:await i();if(e.accountId=d,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(_,{body:t,account_id:d}));a(n,{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await m(`name`,`The name of the share.`)),e.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);if(e.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let h=f({name:p(e.name,`name`,`text`),recipients:l(e.recipients,`recipients`),resources:l(e.resources,`resources`)}),g=await s(`Creating`,async()=>c.send(_,{body:h,account_id:d}));a(g,{successLabel:`Created`})})};var te={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}`};function ne(e){return e.usage(`$0 resource-sharing delete <share-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{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:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/bulk_operations/${t.operation_id}`};function _(e){return e.usage("$0 rules lists bulk-operations get <operation-id>\n\nGets the current status of an asynchronous operation on a list. The `status` property can have one of the following values: `pending`, `running`, `completed`, or `failed`. If the status is `failed`, the `error` property will contain a message describing the error.").positional(`operation-id`,{type:`string`,description:`The unique operation ID of the asynchronous action.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <operation-id>`,describe:`Get bulk operation status`,builder:_,handler:async e=>c({command:`rules lists bulk-operations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/bulk_operations/${e[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(e[`operation-id`]))}`,pathParams:{"operation-id":String(e[`operation-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(g,{account_id:l,operation_id:e[`operation-id`]}));a(u,{successLabel:`Loaded`})})},y={command:`bulk-operations`,describe:`Operations for lists.bulk-operations`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/rules/lists`,body:`json`};function x(e){return e.usage(`$0 rules lists create
|
|
3
3
|
|
|
4
4
|
Creates a new list of the specified kind.`).option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`kind`,{type:`string`,description:`The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).`,choices:[`ip`,`redirect`,`hostname`,`asn`]}).coerce(`kind`,e=>f(e,`kind`,`text`)).option(`name`,{type:`string`,description:`An informative name for the list. Use this name in filter and rule expressions.`}).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 S={command:`create`,describe:`Create a list`,builder:x,handler:async e=>c({command:`rules lists create`,classification:{safeFlags:[`kind`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(b,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}e.kind===void 0&&(e.kind=await m(`kind`,`The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).`,[`ip`,`redirect`,`hostname`,`asn`])),e.name===void 0&&(e.name=await p(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let h=d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}),g=await s(`Creating`,async()=>c.send(b,{body:h,account_id:l}));a(g,{successLabel:`Created`})})};var C={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`};function w(e){return e.usage(`$0 rules lists delete <list-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,s as p,t as m}from"./body-parser-ChnyBsfm.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{a as g,n as _}from"./prompt-BFRinxR0.mjs";var v={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets`,query:[`dry_run`],body:`json`};function y(e){return e.usage(`$0 rulesets create
|
|
3
3
|
|
|
4
4
|
Creates a ruleset.`).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).coerce(`kind`,e=>h(e,`kind`,`text`)).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_custom`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).coerce(`phase`,e=>h(e,`phase`,`text`)).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. 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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create`,describe:`Create an account or zone ruleset`,builder:y,handler:async e=>u({command:`rulesets create`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},e,async()=>{let n={dry_run:e[`validate-only`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,r=e.zone===void 0?`accounts`:`zones`,a=e.zone??t??`<account-id>`;c({command:`cf rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/rulesets`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a)},query:n,bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),id:h(e.id,`id`,`text`),name:h(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:d(e.rules,`rules`)}):f(e.body)});return}let u=await r(e),p=e.zone===void 0?`accounts`:`zones`,_=p===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();if(p===`zones`?e.zoneId=_:e.accountId=_,e.body){let t=f(e.body);new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let r=await l(`Creating`,async()=>u.send(v,{body:t,account_or_zone:p,account_or_zone_id:_,...n}));s(r,{successLabel:`Created`});return}e.id===void 0&&(e.id=await g(`id`,`The unique ID of the ruleset.`));let y=m({description:h(e.description,`description`,`text`),id:h(e.id,`id`,`text`),name:h(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:d(e.rules,`rules`)});new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let b=await l(`Creating`,async()=>u.send(v,{body:y,account_or_zone:p,account_or_zone_id:_,...n}));s(b,{successLabel:`Created`})})};function x(e){return e.usage(`$0 rulesets 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{a as l,n as u,t as d}from"./body-parser-ChnyBsfm.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-BFRinxR0.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`,body:`json`};function h(e){return e.usage(`$0 rum rules bulk-create
|
|
3
3
|
|
|
4
4
|
Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. 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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:h,handler:async e=>c({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({delete_rules:e[`delete-rules`],rules:l(e.rules,`rules`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:f,ruleset_id:e[`ruleset-id`]}));a(n,{successLabel:`Created`});return}let p=d({delete_rules:e[`delete-rules`],rules:l(e.rules,`rules`)}),h=await s(`Creating`,async()=>c.send(m,{body:p,account_id:f,ruleset_id:e[`ruleset-id`]}));a(h,{successLabel:`Created`})})};var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule`,body:`json`};function v(e){return e.usage(`$0 rum rules create <ruleset-id>
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./agent-context-
|
|
2
|
+
import{t as e}from"./agent-context-Dtyy4aKL.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{$ as n}from"./dist-BtzWfAjU.mjs";import{n as r}from"./version-Dp7G_dM6.mjs";import{n as i,t as a}from"./delegate-DzeuzE99.mjs";import{i as o,r as s}from"./lifecycle-oud60haK.mjs";import{t as c}from"./interactive-wQM7Blhm.mjs";import{n as l}from"./interactive-D4E8PdaW.mjs";import{t as u}from"./request-headers-DFPlTFRf.mjs";import{n as d,t as f}from"./state-DazGSbRx.mjs";import{t as p}from"./error-sanitization-ahuAGEjT.mjs";import{r as m}from"./sanitization-DkVWMHkc.mjs";import h from"node:os";import{createHash as g,randomUUID as _}from"node:crypto";const v=/* @__PURE__ */ new Date(`2026-01-01T00:00:00.000Z`),y=`CF_SEND_TELEMETRY`,b=`WRANGLER_SEND_METRICS`,x=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function S(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function C(){let e=S(process.env[y]);if(e!==void 0)return{enabled:e,source:`env`};let t=S(process.env[b]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function w(){return C()?.enabled}function T(){let e=f();if(typeof e.deviceId==`string`&&x.test(e.deviceId))return e.deviceId;let t=_();return d({deviceId:t}),t}function E(){return f().deviceId===void 0}function D(){if(n())return{enabled:!1,source:`do-not-track`};let e=C();if(e!==void 0)return e;let t=f().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=v?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function O(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return y;case`wrangler-env`:return b;default:return}}function k(e){d({telemetry:{preference:{enabled:e,date:(/* @__PURE__ */ new Date()).toISOString()}}})}function A(){return f().telemetry?.bannerLastShown}function j(e){d({telemetry:{bannerLastShown:e}})}const M=/^\d{1,5}\.\d{1,5}\.\d{1,5}(?:-[0-9A-Za-z.-]{1,40})?(?:\+[0-9A-Za-z.-]{1,40})?$/;function N(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function P(){return h.version()}function F(){return process.arch}function I(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function L(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function R(e=process.env,t=process.ppid){if(!e.CF_DELEGATION)return!1;let n=e[a];return n===void 0||n===String(t)}function z(e=process.env,t=process.ppid){if(!e.CF_DELEGATION_PID||!R(e,t))return;let n=e[i];if(!(typeof n!=`string`||n.length>64||!M.test(n)))return n}function B(e,t,n){return g(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function V(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let H;function U(){if(H)return H;let[t,n,i]=r.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),a=Date.now(),s=0,d=E(),{enabled:f}=D(),p=e(),m=p.harness?.id??null,h=p.matches.find(e=>e.sessionId),g=R(),_=z();function v(){let e=V(),o=T();return{product:`cf`,cliVersion:r,cliMajor:t??0,cliMinor:n??0,cliPatch:i??0,...e?{prereleaseLabel:e}:{},osPlatform:N(),osVersion:P(),arch:F(),nodeVersion:I(),packageManager:L(),deviceId:o,amplitude_session_id:a,amplitude_event_id:s++,...h?.sessionId?{agentSessionKey:B(o,h.harness.id,h.sessionId)}:{},isFirstUsage:d,isCI:c,isInteractive:l(),cliMode:u(),agent:m,delegated:g,..._?{globalCliVersion:_}:{}}}function y(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};if(process.env.DEBUG&&console.error(`Telemetry ${f?`sending`:`would send`}: ${JSON.stringify(n)}`),f)return fetch(`https://sparrow.cloudflare.com/api/v1/event`,{method:`POST`,signal:AbortSignal.timeout(1e3),headers:{Accept:`*/*`,"Content-Type":`application/json`,"Sparrow-Source-Key":`50598e014ed44c739ec8074fdc16057c`},mode:`cors`,keepalive:!0,body:JSON.stringify(n)}).then(()=>void 0).catch(e=>{process.env.DEBUG&&console.error(`Telemetry failed to send:`,e instanceof Error?e.message:String(e))})}return H={enabled:f,sendCommandEvent(e,t){if(f)try{o(y(e,{...v(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(f)try{o(y(e,{...v(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},H}const W=/* @__PURE__ */ new Set([`SIGINT`,`SIGTERM`]),G=1024;function K(e){if(e instanceof t)return e.cancelled||e.signal&&W.has(e.signal)?`cancelled`:e.code===0?`success`:`error`}async function q(e,t,n){let r;try{r=U()}catch{return n()}if(s(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:m(t,process.argv.slice(2),e.classification),command:e.command};r.sendCommandEvent(`cf command started`,i);let a=e.searchQuery===void 0?{}:{searchQuery:e.searchQuery.slice(0,G),...e.searchQuery.length>G?{searchQueryTruncated:!0}:{}},o=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-o}),e}catch(e){let t=K(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-o,...t===`error`?p(e):{}}),e}}function J(e,t){return{...e,handler:n=>q(t,n,()=>e.handler(n))}}export{v as a,w as c,D as d,j as f,y as i,O as l,J as n,A as o,k as p,U as r,T as s,q as t,E as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./theme-BGHWSKCw.mjs";import{n as t}from"./version-
|
|
2
|
+
import{r as e}from"./theme-BGHWSKCw.mjs";import{n as t}from"./version-Dp7G_dM6.mjs";import{i as n}from"./cf-fIBhEAxU.mjs";import{s as r}from"./body-parser-ChnyBsfm.mjs";import{n as i}from"./input-validation-D7z60HJH.mjs";import{o as a}from"./prompt-BFRinxR0.mjs";import{mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";import{dirname as l,join as u}from"node:path";import{isDeepStrictEqual as d}from"node:util";import{createHash as f}from"node:crypto";const p=5e3;function m(e,t=/* @__PURE__ */ new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=/* @__PURE__ */ new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>m(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>m(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>m(e,t)))||n.if!==void 0&&!m(n.if,t)||n.then!==void 0&&!m(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!m(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>m(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>m(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function h(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!m(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function g(e,r){let i=f(`sha256`).update([t,...r].join(` `)).digest(`hex`).slice(0,32);return u(n(),`cache`,e,`${i}.json`)}function _(e,t){try{let n=JSON.parse(s(g(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&m(n.schema)?n.schema:void 0}catch{return}}function v(e,t,n){try{let r=g(e,t);o(l(r),{recursive:!0}),c(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function ee(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
|
|
3
3
|
`)[0]??``).replace(/\.$/,``);return/^"?timeout"?$/i.test(r)?`the request timed out`:r}const y=/* @__PURE__ */ new Set(/* @__PURE__ */ `$comment.$defs.$id.$schema.additionalProperties.allOf.anyOf.const.default.definitions.deprecated.description.discriminator.enum.example.examples.exclusiveMaximum.exclusiveMinimum.externalDocs.if.items.maxItems.maxLength.maxProperties.maximum.minItems.minLength.minProperties.minimum.multipleOf.oneOf.pattern.properties.readOnly.required.then.title.type.uniqueItems.writeOnly.xml`.split(`.`));function te(e){let t=e.additionalProperties!==void 0&&typeof e.additionalProperties==`object`?[e.additionalProperties]:[],n=e.items===void 0?[]:Array.isArray(e.items)?e.items:[e.items];return[...Object.values(e.properties??{}),...t,...n,...e.oneOf??[],...e.anyOf??[],...e.allOf??[],...e.if?[e.if]:[],...e.then?[e.then]:[]]}function b(e,t){if(t.has(e))return!1;t.add(e);let n=e;return n.nullable===!0||n[`x-nullable`]===!0?!1:Object.keys(n).every(e=>y.has(e)||e.startsWith(`x-`))&&te(e).every(e=>b(e,t))}function ne(e){return b(e,/* @__PURE__ */ new WeakSet)}function re(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/).filter(Boolean).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}function ie(e){let t=e.path.at(-1)??e.name,n=a(e.schema.title?.trim()||re(t)),r=e.description?a(e.description.trim()):void 0;return!r||r.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${r}`}function x(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const ae=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);function S(e){return e.every(e=>!ae.has(e))}function C(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function w(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function oe(e){return e.type===void 0&&e.properties===void 0&&e.enum===void 0&&e.const===void 0&&e.oneOf===void 0&&e.anyOf===void 0}function se(e){if(e===null)return`json`;if(Array.isArray(e))return`array`;switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`object`:return`object`;default:return`string`}}function T(e){let t=ce(e);if(t.length>1){let e=new Set(t.map(T));return e.size===2&&e.has(`string`)&&e.has(`array`)?`string-or-array`:e.has(void 0)?void 0:e.size===1?[...e][0]??`json`:`json`}if(t[0]!==e)return T(t[0]??{});if(Array.isArray(e.type)&&e.type.includes(`object`)&&e.type.some(e=>e!==`object`))return`json`;let n=Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type;if(n===`null`||Array.isArray(e.type)&&e.type.length===1&&e.type[0]===`null`)return`json`;if(n===void 0){let t=e.const===void 0?e.enum:[e.const];if(t?.length){let e=new Set(t.map(se));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&oe(e))return`json`;switch(n){case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`string`}}function ce(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function E(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=new Set(Array.isArray(e)?e:[e]),r=new Set(Array.isArray(t)?t:[t]),i=(e,t)=>e.has(t)||t===`integer`&&e.has(`number`),a=[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`].filter(e=>i(n,e)&&i(r,e));return a.includes(`number`)&&a.splice(a.indexOf(`integer`),1),a.length===1?a[0]:a.length>1?a:void 0}function le(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>d(e,t)))}function D(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]),r=n[0];return n.length>0&&n.every(e=>d(e,r))?r:void 0}function ue(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]}function de(e,t){return{type:E(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:le(e.enum,t.enum),const:D(`const`,[e,t]),default:D(`default`,[e,t]),oneOf:e.oneOf===void 0?t.oneOf:t.oneOf===void 0?e.oneOf:void 0,anyOf:e.anyOf===void 0?t.anyOf:t.anyOf===void 0?e.anyOf:void 0,allOf:[e,t]}}function O(e){if(!e.allOf?.length)return e;let t=new Map(Object.entries(e.properties??{})),n=new Set(e.required??[]),r=e.type,i=e.title,a=e.description,o=e.enum;for(let s of e.allOf){let e=O(s);r=E(r,e.type),i??=e.title,a??=e.description,o=le(o,e.enum);for(let t of e.required??[])n.add(t);for(let[n,r]of Object.entries(e.properties??{})){let e=t.get(n);t.set(n,e===void 0?r:de(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:D(`const`,[e]),default:D(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function fe(e){return{...e,oneOf:void 0,anyOf:void 0}}function k(e){return(e.allOf??[]).flatMap(e=>[e,...k(e)])}function A(e){return[e,...k(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function j(e){return Object.keys(O(fe(e)).properties??{}).length>0||A(e).some(e=>e.some(j))}function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){let t=O(e),n=t.type===void 0?void 0:Array.isArray(t.type)?t.type:[t.type];return n?.length&&n.every(e=>e===`object`)?!0:n!==void 0&&!n.includes(`object`)?!1:t.const===void 0?t.enum?.length&&t.enum.every(e=>M(e))||A(e).some(e=>e.every(N))?!0:e.allOf?.some(N)??!1:M(t.const)}function P(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(!t?.length||!t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return;for(let r of t)n.push({value:r,label:t.length===1&&e.title?a(e.title):void 0})}return n}function pe(e){let t=e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0;return t?.length?t.map(e=>({value:e})):P(e)}function F(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(t?.length&&t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))for(let r of t){let t=K(r),i=e.title?a(e.title):void 0;n.push(i?`${t} (${i})`:t)}else if(e.pattern&&T(e)===`string`){let t=a(e.pattern),r=e.title?a(e.title):void 0;n.push(r?`${t} (${r})`:t)}else return}return n.length>0?n:void 0}function I(e,t,n,r,i){if(!S(e))return;let a=i??T(t);if(a===void 0)return;let o=a===`json`?void 0:pe(t),s=o?.map(({value:e})=>String(e)),c=Object.fromEntries((o??[]).filter(({value:e,label:t})=>t&&t!==String(e)).map(({value:e,label:t})=>[String(e),t])),l=e.map(x).join(`-`);if(![`mode`,`temporary-account`,`event-code`].includes(l))return{name:l,path:e,type:a,required:n,requiredWhen:r,description:t.description?.split(`
|
|
4
4
|
`)[0]??t.title,choices:s?.length?s:void 0,choiceLabels:Object.keys(c).length>0?c:void 0,schema:t}}function me(e,t){return e===t?e:[.../* @__PURE__ */ new Set([e,t])].every(e=>e===`string`||e===`array`||e===`string-or-array`)?`string-or-array`:`json`}function he(e,t){let n=me(e.type,t.type),r=e.schema.description??t.schema.description,i=n===`json`||n===`string-or-array`?{description:r}:{type:n===`number`?`number`:n,description:r};return{...e,type:n,required:e.required&&t.required,requiredWhen:L(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:d(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ge(e,t={}){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set,a=(e,t,n)=>{let a=r.get(e);n?i.has(e)||r.set(e,a===void 0?t:he(a,t)):(i.add(e),r.set(e,t))},o=(e,t,o)=>{for(let s of[e,...k(e)]){let c=s.if,l=s.then?O(s.then):void 0,u=l?.required;if(!c||!u?.length)continue;let f=Object.keys(c),p=c.type===void 0?void 0:Array.isArray(c.type)?c.type:[c.type];if(f.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||p!==void 0&&!p.includes(`object`))continue;let m=new Set(c.required??[]),h=c.properties??{};if(Object.keys(h).some(e=>!m.has(e)))continue;let g=[],_=!0;for(let e of m){if(!S([...t,e])){_=!1;break}let n=C(h,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){_=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>d(e,n.const))),n.type!==void 0){if(r===void 0){_=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>we(e,t)))}}g.push({path:[...t,e],values:r})}if(_&&g.length!==0)for(let s of u){let c=[...t,s].join(`.`);if(n.has(c))continue;let u={predicates:g},f=r.get(c),p=o&&C(e.properties,s)===void 0&&!i.has(c);if(!f||p){let e=C(l?.properties,s),n=e===void 0?void 0:I([...t,s],O(e),!1);n&&(a(c,n,o),f=r.get(c))}!o&&f&&!f.requiredIf?.some(e=>d(e,u))&&(f.requiredIf=[...f.requiredIf??[],u])}}},s=(e,t,i,c=!1)=>{let l=O(fe(e));if(l.properties){let e=new Set(l.required??[]);for(let[o,u]of Object.entries(l.properties)){let l=[...t,o],d=l.join(`.`);if(!S(l)||n.has(d))continue;let f=O(u),p=j(u),m=p&&N(u),h=!c&&e.has(o),g=h&&i===void 0,_=h&&i!==void 0?i:void 0;if(m){s(u,l,h?i:l,c);let e=[...r.values()].some(e=>e.required===g&&L(e.requiredWhen,_)&&e.path.length>l.length&&l.every((t,n)=>e.path[n]===t));if(h&&!e){let e=I(l,u,g,_);e&&a(d,{...e,requiredContainer:!0},c)}continue}let v=I(l,f,g,_,p?`json`:void 0);v&&a(d,v,c)}}for(let n of A(e))for(let e of n)s(e,t,i,!0);for(let n of[e,...k(e)])n.if&&n.then&&s(n.then,t,i,!0);o(l,t,c)};return s(e,[]),[...r.values()].sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function L(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function _e(t,n){if(t.length===0)return`${e.brand(a(n))}\n (no input fields)`;let r=process.stdout.columns??80,i=t.map(e=>`--${a(e.name)}`),o=Math.min(Math.max(...i.map(e=>e.length))+2,42),s=t.map((e,t)=>{let n=[`[${e.type}]`];e.required?n.push(`[required]`):e.requiredWhen&&n.push(`[required with --${a(e.requiredWhen.map(x).join(`-`))}-*]`),e.requiredIf&&n.push(`[conditionally required]`),e.choices&&n.push(`[choices: ${e.choices.map(t=>{let n=a(t),r=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return r?`${a(r)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&n.push(`[must be: ${a(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&n.push(`[default: ${a(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=n.join(` `),c=Math.max(r-o-4,20)-s.length-1,l=e.description===void 0?void 0:a(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,d=i[t]??``;return` ${d.length<o?d.padEnd(o):`${d} `}${[u,s].filter(Boolean).join(` `)}`});return[e.brand(a(n)),...s].join(`
|
|
5
5
|
`)}const ve=`_ $0 -- body dry-run dryRun event-code eventCode help h local m mode persist-to persistTo profile quiet q temporary-account temporaryAccount version v zone z`.split(` `);function R(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=w(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function ye(e,t,n){return e.filter(r=>{let i=n!==void 0&&B(n,r.path).found;return V(r,e,t,n)&&R(r,t)===void 0&&!i&&!H(r.path,e,t)&&!(r.requiredContainer&&U(r,e,t))})}function z(e,t){let n=e=>B(t,e);return e.filter(e=>be(e,n)&&!n(e.path).found)}function B(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return{found:!1};n=n[e]}return{found:!0,value:n}}function be(e,t){return e.required||e.requiredWhen!==void 0&&t(e.requiredWhen).found||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:n})=>{let r=t(e);return r.found&&(n===void 0||n.some(e=>d(r.value,e)))}))??!1)}function V(e,t,n,r){return e.required||e.requiredWhen!==void 0&&(H(e.requiredWhen,t,n)||r!==void 0&&B(r,e.requiredWhen).found)||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:i})=>{let a=xe(e,t,n),o=a.found||r===void 0?a:B(r,e),s=!a.found||a.descriptor===void 0||!L(a.descriptor.path,e)?o.value:q(a.descriptor,o.value,[]);return o.found&&(i===void 0||i.some(e=>d(s,e)))}))??!1)}function xe(e,t,n){for(let r of t){let t=R(r,n);if(t===void 0||r.path.length>e.length||!r.path.every((t,n)=>e[n]===t))continue;let i=t;if(typeof i==`string`&&r.path.length<e.length)try{i=JSON.parse(i)}catch{continue}for(let t of e.slice(r.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,t)){i=void 0;break}i=i[t]}if(i!==void 0)return{found:!0,value:i,descriptor:r}}return{found:!1}}function H(e,t,n){return t.some(t=>{let r=R(t,n);if(r===void 0)return!1;if(t.path.length>=e.length)return e.every((e,n)=>t.path[n]===e);if(!t.path.every((t,n)=>e[n]===t))return!1;let i=r;if(typeof i==`string`)try{i=JSON.parse(i)}catch{return!1}for(let n of e.slice(t.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,n))return!1;i=i[n]}return!0})}function U(e,t,n){return t.some(t=>t!==e&&t.path.length>e.path.length&&e.path.every((e,n)=>t.path[n]===e)&&R(t,n)!==void 0)}function W(e){return e.flatMap(e=>[e.name,w(e.name)])}function G(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function K(e){return a(G(e))}function q(e,t,n){let r=r=>{n.push(`--${a(e.name)} expects ${r} (got '${K(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(G(t)),i=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?i.includes(`integer`)&&!i.includes(`number`)&&!Number.isInteger(n)?r(`an integer`):n:r(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`||t!==`false`&&r(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return r(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:r(`a JSON ${e.type}`)}case`json`:{let n=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];if(n.length===1&&n[0]===`null`)return t===null||t===`null`?null:r(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return i(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:r(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return i(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`boolean`?r(`a string`):typeof n==`string`?i(n,e.name,`text`):G(n)}}}function J(e){return Array.from(e).length}function Se(e,t,n){let r=a(e.name),{const:i,pattern:o,minLength:s,maxLength:c,minimum:l,maximum:u,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(i!==void 0&&!d(t,i)){n.push(`--${r} must be ${a(JSON.stringify(i)??`undefined`)}`);return}let m=e.schema.enum??P(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>d(t,e)))n.push(`--${r} must be one of: ${m.map(K).join(`, `)}`);else{if(typeof t==`string`){let e=J(t);o!==void 0&&!new RegExp(o).test(t)&&n.push(`--${r} does not match the required format (${a(o)})`),s!==void 0&&e<s&&n.push(`--${r} must be at least ${s} characters`),c!==void 0&&e>c&&n.push(`--${r} must be at most ${c} characters`)}typeof t==`number`&&(l!==void 0&&(f===!0?t<=l:t<l)&&n.push(f===!0?`--${r} must be greater than ${l}`:`--${r} must be at least ${l}`),u!==void 0&&(p===!0?t>=u:t>u)&&n.push(p===!0?`--${r} must be less than ${u}`:`--${r} must be at most ${u}`),typeof f==`number`&&t<=f&&n.push(`--${r} must be greater than ${f}`),typeof p==`number`&&t>=p&&n.push(`--${r} must be less than ${p}`))}}function Ce(e,t){let n=[],r=q(e,t,n);if(r===void 0||(Se(e,r,n),n.length>0))return n[0];let i=Z(e.schema,r);return i.length>0?`--${a(e.name)} ${i[0]?.replace(/^the request body /,``)}`:void 0}function we(e,t){switch(e){case`null`:return t===null;case`array`:return Array.isArray(t);case`object`:return typeof t==`object`&&!!t&&!Array.isArray(t);case`integer`:return typeof t==`number`&&Number.isInteger(t);default:return typeof t===e}}function Te(e){return e.map(e=>e===`integer`?`an integer`:`a${/^[aeiou]/.test(e)?`n`:``} ${e}`).join(` or `)}function Y(e){return e.length===0?`the request body`:`\`/${e.map(e=>a(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n){let r=[],i=Y(n),o=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(o.length>0&&!o.some(e=>we(e,t)))return[`${i} must be ${Te(o)}`];if(e.const!==void 0&&!d(t,e.const))return[`${i} must be ${a(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>d(t,e)))return[`${i} must be one of: ${e.enum.map(K).join(`, `)}`];if(e.oneOf?.length&&e.oneOf.filter(e=>X(e,t,n).length===0).length!==1){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match exactly one allowed shape`]}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n).length===0)){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match an allowed shape`]}for(let i of e.allOf??[])r.push(...X(i,t,n));if(e.if&&X(e.if,t,n).length===0&&e.then&&r.push(...X(e.then,t,n)),typeof t==`string`){let n=J(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&r.push(`${i} does not match the required format (${a(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&r.push(`${i} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&r.push(`${i} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&r.push(e.exclusiveMinimum===!0?`${i} must be greater than ${e.minimum}`:`${i} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&r.push(e.exclusiveMaximum===!0?`${i} must be less than ${e.maximum}`:`${i} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&r.push(`${i} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&r.push(`${i} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&r.push(`${i} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)){if(e.minItems!==void 0&&t.length<e.minItems&&r.push(`${i} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&r.push(`${i} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>d(e,t)))&&r.push(`${i} must contain unique items`),e.items&&!Array.isArray(e.items))for(let[i,a]of t.entries())r.push(...X(e.items,a,[...n,String(i)]));else if(Array.isArray(e.items))for(let[i,a]of e.items.entries())i<t.length&&r.push(...X(a,t[i],[...n,String(i)]))}if(typeof t==`object`&&t&&!Array.isArray(t)){let a=t,o=e.properties??{};for(let t of e.required??[])Object.hasOwn(a,t)||r.push(`${Y([...n,t])} is required`);for(let[t,i]of Object.entries(a)){let a=Object.hasOwn(o,t)?o[t]:void 0;a?r.push(...X(a,i,[...n,t])):e.additionalProperties===!1?r.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&r.push(...X(e.additionalProperties,i,[...n,t]))}let s=Object.keys(a).length;e.minProperties!==void 0&&s<e.minProperties&&r.push(`${i} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&s>e.maxProperties&&r.push(`${i} must contain at most ${e.maxProperties} properties`)}return r}function Z(e,t){return[...new Set(X(e,t,[]))]}const Ee=[`const`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`maxItems`,`maxLength`,`maxProperties`,`maximum`,`minItems`,`minLength`,`minProperties`,`minimum`,`multipleOf`,`pattern`,`required`,`title`,`type`,`uniqueItems`];function Q(e){let t=e,n=Object.keys(t);if(t.nullable===!0||t[`x-nullable`]===!0||n.some(e=>[`$dynamicRef`,`$recursiveRef`,`$ref`].includes(e)))return{schema:{},exact:!1};let r={},i=n.every(e=>y.has(e)||e.startsWith(`x-`));for(let t of Ee){let n=e[t];n!==void 0&&Object.assign(r,{[t]:n})}if(e.properties!==void 0){let t=Object.entries(e.properties).map(([e,t])=>{let n=Q(t);return i&&=n.exact,[e,n.schema]});r.properties=Object.fromEntries(t)}if(e.additionalProperties!==void 0&&!Object.hasOwn(t,`patternProperties`)){if(typeof e.additionalProperties==`boolean`)r.additionalProperties=e.additionalProperties;else{let t=Q(e.additionalProperties);r.additionalProperties=t.schema,i&&=t.exact}}if(e.items!==void 0&&!Object.hasOwn(t,`prefixItems`)){if(Array.isArray(e.items))r.items=e.items.map(e=>{let t=Q(e);return i&&=t.exact,t.schema});else{let t=Q(e.items);r.items=t.schema,i&&=t.exact}}let a=(e.allOf??[]).map(e=>{let t=Q(e);return i&&=t.exact,t.schema});if(e.anyOf?.length&&(r.anyOf=e.anyOf.map(e=>{let t=Q(e);return i&&=t.exact,t.schema})),e.oneOf?.length){let t=e.oneOf.map(Q),n=t.every(e=>e.exact);i&&=n,n?r.oneOf=t.map(e=>e.schema):a.push({anyOf:t.map(e=>e.schema)})}if(e.if&&e.then){let t=Q(e.if),n=Q(e.then);i&&=t.exact&&n.exact,t.exact&&a.push({if:t.schema,then:n.schema})}return a.length>0&&(r.allOf=a),{schema:r,exact:i}}function De(e,t){return Z(Q(e).schema,t)}function Oe(e,t,n){let r=e;for(let e of t.slice(0,-1)){let t=r[e];(typeof t!=`object`||!t||Array.isArray(t))&&(r[e]={}),r=r[e]}let i=t.at(-1);i!==void 0&&(r[i]=n)}function $(e,t=[]){let n=/* @__PURE__ */ new Set([...ve,...t]),r=/* @__PURE__ */ new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(x(t))&&r.set(x(t),t);return[...r.values()].sort()}function ke(e,t,n={}){let i=[],o=n.baseBody!==void 0,s=n.baseBody===void 0?{}:structuredClone(n.baseBody),c=e.filter(({path:e})=>S(e)),l=[...n.reserved??[],...W(c)];for(let e of c){let n=R(e,t);if(n===void 0){!o&&V(e,c,t)&&!H(e.path,c,t)&&!(e.requiredContainer&&U(e,c,t))&&i.push(`--${a(e.name)} is required`);continue}let l=q(e,n,i);l!==void 0&&(Se(e,l,i),o?Oe(s,e.path,l):r(s,e.path,l))}if(o)for(let e of z(c,s))R(e,t)===void 0&&i.push(`--${a(e.name)} is required`);for(let e of $(t,l))i.push(`Unknown flag --${a(e)}`);return{body:s,errors:i}}export{v as _,z as a,ge as c,Z as d,De as f,_ as g,h,ye as i,$ as l,ee as m,W as n,_e as o,p,ne as r,ie as s,ke as t,Ce as u};
|
|
@@ -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,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{n as u,t as d}from"./input-validation-D7z60HJH.mjs";import{n as f}from"./prompt-BFRinxR0.mjs";function ee(e){return e.usage("$0 scim groups create\n\nCreates a new SCIM Group (user group) for the account. The `displayName` must not be empty and must not begin with `CF` (reserved for system groups).").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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const p={command:`create`,describe:`Create SCIM Group`,builder:ee,handler:async e=>l({command:`scim groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:e.body});return}let l=await r(e),f=e.local?t:await a();if(e.accountId=f,e.file){let t=d(e.file),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Created`})}else if(e.body){let t=u(e.body,`body`,`binary`),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Created`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var m={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/scim/v2/Groups/${t.group_id}`,response:!1};function h(e){return e.usage(`$0 scim groups delete <group-id>
|
|
3
3
|
|
|
4
4
|
Deletes a SCIM Group (custom user groups only). System groups backed by Cloudflare permission groups cannot be deleted via SCIM. Returns 204 No Content on success.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",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 g={command:`delete <group-id>`,describe:`Delete SCIM Group`,builder:h,handler:async e=>l({command:`scim groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await f({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await c(`Deleting`,async()=>n.send(m,{account_id:l,group_id:e[`group-id`]}));o(u,{successLabel:`Deleted`})})};function _(e){return e.usage("$0 scim groups edit <group-id>\n\nPartially updates a SCIM Group via PATCH operations (RFC 7644 Section 3.5.2). Supports add, remove, and replace operations on `members`, `displayName`, and `externalId`. For system groups (prefixed `cloudflare-v1-`), only member management operations are supported.").positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const v={command:`edit <group-id>`,describe:`Patch SCIM Group`,builder:_,handler:async e=>l({command:`scim groups edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf scim groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`octet-stream`,body:e.body});return}let l=await r(e),f=e.local?t:await a();if(e.accountId=f,e.file){let t=d(e.file),r=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(e[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Updated`})}else if(e.body){let t=u(e.body,`body`,`binary`),r=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(e[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var y={method:`GET`,path:t=>e`/accounts/${t.account_id}/scim/v2/Groups/${t.group_id}`};function b(e){return e.usage(`$0 scim groups get <group-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:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/quota`};function h(e){return e.usage(`$0 secrets-store quota get
|
|
3
3
|
|
|
4
4
|
Lists the number of secrets used in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`View secret usage`,builder:h,handler:async e=>c({command:`secrets-store quota get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(m,{account_id:l}));a(u,{successLabel:`Loaded`})})},_={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var v={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets`,body:`json`};function y(e){return e.usage(`$0 secrets-store secrets bulk-delete
|
|
5
5
|
|
|
@@ -9,9 +9,9 @@ Creates a secret in the account.`).positional(`store-id`,{type:`string`,descript
|
|
|
9
9
|
|
|
10
10
|
Deletes a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store 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 E={command:`delete <secret-id>`,describe:`Delete a secret`,builder:T,handler:async e=>c({command:`secrets-store secrets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf secrets-store secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await p({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(w,{account_id:l,store_id:e[`store-id`],secret_id:e[`secret-id`]}));a(u,{successLabel:`Deleted`})})};var D={method:`POST`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets/${t.secret_id}/duplicate`,body:`json`};function O(e){return e.usage(`$0 secrets-store secrets duplicate <secret-id>
|
|
11
11
|
|
|
12
|
-
Creates a duplicate of the secret, keeping the value.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`name`,{type:`string`,description:`The name of the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).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:`duplicate <secret-id>`,describe:`Duplicate Secret`,builder:O,handler:async e=>c({command:`secrets-store secrets duplicate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf secrets-store secrets duplicate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}/duplicate`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({comment:d(e.comment,`comment`,`text`),name:d(e.name,`name`,`text`),scopes:e.scopes}):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(D,{body:t,account_id:p,store_id:e[`store-id`],secret_id:e[`secret-id`]}));a(n,{successLabel:`Created`});return}
|
|
12
|
+
Creates a duplicate of the secret, keeping the value.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`name`,{type:`string`,description:`The name of the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret. Omit it on create or duplicate to inherit the store's scopes. An empty list lets no service use the secret.`}).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:`duplicate <secret-id>`,describe:`Duplicate Secret`,builder:O,handler:async e=>c({command:`secrets-store secrets duplicate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf secrets-store secrets duplicate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}/duplicate`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({comment:d(e.comment,`comment`,`text`),name:d(e.name,`name`,`text`),scopes:e.scopes}):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(D,{body:t,account_id:p,store_id:e[`store-id`],secret_id:e[`secret-id`]}));a(n,{successLabel:`Created`});return}e.name===void 0&&(e.name=await f(`name`,`The name of the secret.`));let m=u({comment:d(e.comment,`comment`,`text`),name:d(e.name,`name`,`text`),scopes:e.scopes}),h=await s(`Creating`,async()=>c.send(D,{body:m,account_id:p,store_id:e[`store-id`],secret_id:e[`secret-id`]}));a(h,{successLabel:`Created`})})};var A={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets/${t.secret_id}`,body:`json`};function j(e){return e.usage(`$0 secrets-store secrets edit <secret-id>
|
|
13
13
|
|
|
14
|
-
Updates a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).option(`value`,{type:`string`,description:`The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - the API never returns this value; it exists only to create or modify secrets.`}).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 M={command:`edit <secret-id>`,describe:`Patch a secret`,builder:j,handler:async e=>c({command:`secrets-store secrets edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf secrets-store secrets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({comment:d(e.comment,`comment`,`text`),scopes:e.scopes,value:d(e.value,`value`,`text`)}):l(e.body),sensitiveBodyPaths:[[`value`]]});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send(A,{body:t,account_id:f,store_id:e[`store-id`],secret_id:e[`secret-id`]}));a(n,{successLabel:`Updated`});return}let p=u({comment:d(e.comment,`comment`,`text`),scopes:e.scopes,value:d(e.value,`value`,`text`)}),m=await s(`Updating`,async()=>c.send(A,{body:p,account_id:f,store_id:e[`store-id`],secret_id:e[`secret-id`]}));a(m,{successLabel:`Updated`})})};var N={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets/${t.secret_id}`};function P(e){return e.usage(`$0 secrets-store secrets get <secret-id>
|
|
14
|
+
Updates a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret, or null when the secret inherits its store's scopes. Set it to null in a patch to inherit again. An empty list lets no service use the secret.`}).option(`value`,{type:`string`,description:`The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - the API never returns this value; it exists only to create or modify secrets.`}).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 M={command:`edit <secret-id>`,describe:`Patch a secret`,builder:j,handler:async e=>c({command:`secrets-store secrets edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf secrets-store secrets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({comment:d(e.comment,`comment`,`text`),scopes:e.scopes,value:d(e.value,`value`,`text`)}):l(e.body),sensitiveBodyPaths:[[`value`]]});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send(A,{body:t,account_id:f,store_id:e[`store-id`],secret_id:e[`secret-id`]}));a(n,{successLabel:`Updated`});return}let p=u({comment:d(e.comment,`comment`,`text`),scopes:e.scopes,value:d(e.value,`value`,`text`)}),m=await s(`Updating`,async()=>c.send(A,{body:p,account_id:f,store_id:e[`store-id`],secret_id:e[`secret-id`]}));a(m,{successLabel:`Updated`})})};var N={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets/${t.secret_id}`};function P(e){return e.usage(`$0 secrets-store secrets get <secret-id>
|
|
15
15
|
|
|
16
16
|
Returns details of a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <secret-id>`,describe:`Get a secret by ID`,builder:P,handler:async e=>c({command:`secrets-store secrets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf secrets-store secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/secrets_store/stores/${e[`store-id`]==null?`<store-id>`:encodeURIComponent(String(e[`store-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"store-id":String(e[`store-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(N,{account_id:l,store_id:e[`store-id`],secret_id:e[`secret-id`]}));a(u,{successLabel:`Loaded`})})};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets`,query:[`direction`,`page`,`per_page`,`search`,`order`,`scopes`],joined:[`scopes`]};function L(e){return e.usage(`$0 secrets-store secrets list
|
|
17
17
|
|
|
@@ -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{n as u,t as d}from"./body-parser-ChnyBsfm.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p,t as m}from"./raw-fetch-BO0VqOVx.mjs";var h={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/${t.issue_id}/audit-log`,query:[`per_page`,`cursor`,`field_changed`,`changed_by`,`since`,`before`,`order`]};function g(e){return e.usage(`$0 security-insights audit-logs get <issue-id>
|
|
3
3
|
|
|
4
4
|
Lists audit log entries for a specific Security Center insight, showing changes to its status and classification over time.`).positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`cursor`,{type:`string`,description:`Opaque cursor for pagination. Use the cursor value from result_info of the previous response.`}).option(`field-changed`,{type:`string`,description:`Filter by the field that was changed.`,choices:[`status`,`user_classification`]}).option(`changed-by`,{type:`string`,description:`Filter by the actor that made the change.`}).option(`since`,{type:`string`,description:`Filter entries changed at or after this timestamp (RFC 3339).`}).option(`before`,{type:`string`,description:`Filter entries changed before this timestamp (RFC 3339).`}).option(`order`,{type:`string`,description:`Sort order for results. Use 'asc' for oldest first or 'desc' for newest first.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <issue-id>`,describe:`Retrieves Issue Audit Log`,builder:g,handler:async e=>l({command:`security-insights audit-logs get`,classification:{safeFlags:[`field-changed`,`order`,`dry-run`]}},e,async()=>{let l={per_page:e[`per-page`],cursor:e.cursor,field_changed:e[`field-changed`],changed_by:e[`changed-by`],since:e.since,before:e.before,order:e.order};if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf security-insights audit-logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/audit-log`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),"issue-id":String(e[`issue-id`]??``)},query:l,bodyKind:`none`});return}let u=await n(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await i({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await a();d===`zones`?e.zoneId=f:e.accountId=f;let p=await c(`Loading`,async()=>u.send(h,{account_or_zone:d,account_or_zone_id:f,issue_id:e[`issue-id`],...l}));o(p,{successLabel:`Loaded`})})};var _={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/audit-log`,query:[`per_page`,`cursor`,`field_changed`,`changed_by`,`since`,`before`,`order`]};function te(e){return e.usage(`$0 security-insights audit-logs 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";import{n as l}from"./input-validation-D7z60HJH.mjs";import{n as u}from"./prompt-BFRinxR0.mjs";var d={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/security-center/securitytxt`};function f(e){return e.usage(`$0 security-txt delete
|
|
3
3
|
|
|
4
4
|
Removes the security.txt file configuration for a zone. The /.well-known/security.txt endpoint will no longer be served.`).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 p={command:`delete`,describe:`Deletes security.txt`,builder:f,handler:async e=>o({command:`security-txt delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf security-txt delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/securitytxt`,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});if(e.zoneId=s,!await u({force:!!e.force}))return;let c=await a(`Deleting`,async()=>o.send(d,{zone_id:s}));r(c,{successLabel:`Deleted`})})};var m={method:`GET`,path:t=>e`/zones/${t.zone_id}/security-center/securitytxt`};function h(e){return e.usage(`$0 security-txt get
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./theme-BGHWSKCw.mjs";import{c as t}from"./chunk-XVBBSNW2-DfMyGS-l.mjs";import{r as n}from"./blocks-
|
|
2
|
+
import{r as e}from"./theme-BGHWSKCw.mjs";import{c as t}from"./chunk-XVBBSNW2-DfMyGS-l.mjs";import{r as n}from"./blocks-DDNRRYxu.mjs";let r=!1,i=!1,a=!1;function o(e,t={}){r||i||(t.quiet||!process.stderr.isTTY?i=!0:(process.stderr.write(`${n(e,t.update)}\n`),r=!0))}function s(n){!r||i||a||n==="default"||t({allowGlobalAuthKey:!1})!==void 0||(process.stderr.write(`${e.muted(`Active profile:`)} ${e.info(n)}\n`),a=!0)}export{s as n,o as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,r as t}from"./dotenv-CmPRiXmU.mjs";import{J as n,K as r,rt as i}from"./dist-BtzWfAjU.mjs";import{t as a}from"./log-BWdaOGOW.mjs";import{_ as o,d as s,f as c,t as l}from"./deploy-context-
|
|
2
|
+
import{i as e,r as t}from"./dotenv-CmPRiXmU.mjs";import{J as n,K as r,rt as i}from"./dist-BtzWfAjU.mjs";import{t as a}from"./log-BWdaOGOW.mjs";import{_ as o,d as s,f as c,t as l}from"./deploy-context-C_YUdUN-.mjs";import{a as u,l as d,r as f,t as p,u as m}from"./containers-f3DbMCIO.mjs";import{a as h,i as g,n as _,o as v,r as y,s as b}from"./build-DKFvtSB_.mjs";import{i as x,n as S,t as C}from"./deploy-input-CKQOolPd.mjs";import{readBuildOutput as w}from"@cloudflare/build-output-utils";function T(e){return e.option(`prebuilt`,{type:`boolean`,description:`Deploy existing Build Output Specification files without building`,default:!1}).option(`tag`,{type:`string`,description:`A tag to associate with this Worker Version`,requiresArg:!0}).option(`message`,{type:`string`,description:`A message to associate with this Worker Version`,requiresArg:!0}).option(`secrets-file`,{type:`string`,description:`Path to a file containing secrets to upload with the version (JSON or .env format)`,requiresArg:!0}).option(`dry-run`,{describe:`Build a project and run checks without actually uploading the Worker`,type:`boolean`,default:!1}).option(`worker`,y)}async function E(e,n){if(!e.prebuilt){if(await _(e.mode,{worker:e.worker,dryRun:e[`dry-run`]})===`setup-needed`){a.success(`--dry-run: exiting now.`);return}a.message(``)}return t(e,()=>D(e,n))}async function D(t,_){let{workers:y,rootConfig:T,containers:E}=await w(process.cwd());if(T.buildContext.isPreview){let e=[`cf previews deploy`,...t.prebuilt?[`--prebuilt`]:[],...T.buildContext.mode===void 0?[]:[`--mode`,T.buildContext.mode]].join(` `);throw Error(`This build output is for a Preview. Run ${e} instead.`)}b(t.mode,T.buildContext.mode),v(T.accountId,t[`temporary-account`]===!0);let D=h(y,t.worker),O=g(D,T),k=e(O.wranglerConfig),A=C(D,O.builtConfig),j=n(k),{authToken:M,accountId:N}=await f({accountId:T.accountId,complianceRegion:j,dryRun:t[`dry-run`]}),P=l(M);m(P),o({logger:P.logger,fetchResult:P.fetchResult,fetchPagedListResult:P.fetchPagedListResult}),N!==void 0&&E.length>0&&c(N,M,r(k));let F=p(E,k,{accountId:N,containersRollout:t[`containers-rollout`]}),I;if(_.command===`Deploy`){let e=S(D,k,N,t,F);a.section(`Deploy`),{versionId:I}=await u(e,k,A,{deployCommand:`cf deploy`,versionsDeployCommand:`cf workers deployments create --worker <worker-name> --strategy percentage --versions <versions-json>`,d1ListCommand:`cf d1 list`,d1DeleteCommand:`cf d1 delete <database-id>`,queueCreateCommand:e=>`cf queues create --queue-name ${e}`,secretPutCommand:`cf workers secrets update --worker <worker-name> --type secret_text`,workersDevConfigFieldName:`workersDev`,workersDevConfigAssignment:e=>`workersDev: ${e}`,previewUrlsConfigFieldName:`previewUrls`,previewUrlsConfigAssignment:e=>`previewUrls: ${e}`,configFileName:`cloudflare.config.ts`,observabilityTargetPercentageField:`targetInstancePercentage`,observabilityTargetCountField:`targetInstanceCount`,syncWorkersSite:void 0,analyseBundle:void 0})}else{let e=x(D,k,N,t,F);a.section(`Upload`),{versionId:I}=await d(e,k,A,{deployCommand:`cf deploy`,versionsUploadCommand:`cf workers versions create`,versionsDeployCommand:`cf workers deployments create --worker <worker-name> --strategy percentage --versions <versions-json>`,triggersDeployCommand:`cf workers triggers deploy`,d1ListCommand:`cf d1 list`,d1DeleteCommand:`cf d1 delete <database-id>`,queueCreateCommand:e=>`cf queues create --queue-name ${e}`,versionsSecretPutCommand:`wrangler versions secret put`,analyseBundle:void 0})}I!==null&&!t[`dry-run`]&&(_.command!==`Deploy`||t[`containers-rollout`]!==`none`)&&await s([..._.command===`Deploy`?F.standard.builtImages:[],...F.durableObjects.builtImages],i()),t[`dry-run`]||a.success(`${_.command} complete`)}export{T as n,E as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./auth-
|
|
2
|
+
import{n as e}from"./auth-BlWCu-YH.mjs";import{t}from"./output-BJEgbI0G.mjs";import{t as n}from"./dry-run-gy0Hl9xo.mjs";import{t as r}from"./progress-BcjUdm_B.mjs";import{t as i}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";var a={method:`GET`,path:()=>`/signed-url`,response:!1,errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function o(e){return e.usage(`$0 signed-url get
|
|
3
3
|
|
|
4
4
|
Internal route for testing signed URLs.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const s={command:`get`,describe:`Internal route for testing signed URLs`,builder:o,handler:async o=>i({command:`signed-url get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf signed-url get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/signed-url`,pathParams:{},bodyKind:`none`});return}let i=await e(o),s=await r(`Loading`,async()=>i.send(a));t(s,{successLabel:`Loaded`})})},c={command:`signed-url`,describe:`signed-url`,builder:e=>e.command(s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{c 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{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{a as s,n as c,r 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`/zones/${t.zone_id}/smart_shield/cache_reserve_clear`};function h(e){return e.usage(`$0 smart-shield cache-reserve-clear clear
|
|
3
3
|
|
|
4
4
|
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`).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 g={command:`clear`,describe:`Start Cache Reserve Clear`,builder:h,handler:async e=>o({command:`smart-shield cache-reserve-clear clear`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf smart-shield cache-reserve-clear clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,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});if(e.zoneId=s,!await p({force:!!e.force,message:`This operation permanently clears Cache Reserve for this zone and cannot be undone.`}))return;let c=await a(`Deleting`,async()=>o.send(m,{zone_id:s}));r(c,{successLabel:`Deleted`})})};var _={method:`GET`,path:t=>e`/zones/${t.zone_id}/smart_shield/cache_reserve_clear`};function v(e){return e.usage(`$0 smart-shield cache-reserve-clear status
|
|
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{i as t,n}from"./auth-BlWCu-YH.mjs";import{i as r}from"./context-CSjTAJ8s.mjs";import{t as i}from"./output-BJEgbI0G.mjs";import{t as a}from"./dry-run-gy0Hl9xo.mjs";import{t as o}from"./progress-BcjUdm_B.mjs";import{t as s}from"./run--9dxcon4.mjs";import"./telemetry-THz8wtoW.mjs";import{a as c,n as l,t as u}from"./body-parser-ChnyBsfm.mjs";import{n as d,t as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-BFRinxR0.mjs";import{n as m,t as h}from"./raw-fetch-BO0VqOVx.mjs";function g(e){return e.usage(`$0 snippets content get <snippet-name>
|
|
3
3
|
|
|
4
4
|
Fetches the content of a snippet belonging to the zone.`).positional(`snippet-name`,{type:`string`,description:`Identify the snippet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const _={command:`get <snippet-name>`,describe:`Get a zone snippet content`,builder:g,handler:async e=>s({command:`snippets content get`,classification:{safeFlags:[`dry-run`,`text`]}},e,async()=>{if(e.dryRun){a({command:`cf snippets content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/snippets/${e[`snippet-name`]==null?`<snippet-name>`:encodeURIComponent(String(e[`snippet-name`]))}/content`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"snippet-name":String(e[`snippet-name`]??``)},bodyKind:`none`});return}let t=await n(e);e.zoneId=await r({zone:e.zone},t,{quiet:e.quiet});let i=await o(`Loading`,async()=>h(`/zones/${e.zoneId}/snippets/${encodeURIComponent(String(e[`snippet-name`]))}/content`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));m(e.text===!0?i.toString(`utf-8`):i)})},v={command:`content`,describe:`Operations for content`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var y={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/snippets/${t.snippet_name}`};function b(e){return e.usage(`$0 snippets delete <snippet-name>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e,t}from"./rolldown-runtime-BNtqjh-B.mjs";import{r as n}from"./theme-BGHWSKCw.mjs";import{t as r}from"./cli-exit-CstFZ1eJ.mjs";import{a as i}from"./autoconfig-
|
|
2
|
+
import{r as e,t}from"./rolldown-runtime-BNtqjh-B.mjs";import{r as n}from"./theme-BGHWSKCw.mjs";import{t as r}from"./cli-exit-CstFZ1eJ.mjs";import{a as i}from"./autoconfig-Bjb97Onj.mjs";import{t as a}from"./blocks-DDNRRYxu.mjs";import"./ui-DvC7Qa0H.mjs";import{a as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./gt-BQkaDQDq.mjs";import"./log-BWdaOGOW.mjs";import{n as p,t as m}from"./discover-C06Syc2B.mjs";import{t as h}from"./registry-Bm-GgDC3.mjs";import{constants as g}from"node:os";var _=/* @__PURE__ */ t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),v=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>n(e,t,r)===0})),y=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>n(e,t,r)!==0})),b=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>n(e,t,r)>=0})),x=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>n(e,t,r)<0})),S=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>n(e,t,r)<=0})),C=/* @__PURE__ */ t(((e,t)=>{let n=v(),r=y(),i=f(),a=b(),o=x(),s=S();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),w=/* @__PURE__ */ t(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),l(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.value=this.semver===n?``:this.operator+this.semver.version,l(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new f(r[2],this.options.loose):n}toString(){return this.value}test(e){if(l(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}return c(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new p(t.value,n).test(this.value):t.operator===``?t.value===``||new p(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||c(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||c(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=s(),{safeRe:i,t:a}=o(),c=C(),l=d(),f=u(),p=T()})),T=/* @__PURE__ */ t(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!C(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&T(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(S,``);let t=((this.options.includePrerelease&&b)|(this.options.loose&&x))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,o=i?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];e=e.replace(o,R(this.options.includePrerelease)),c(`hyphen replace`,e),e=e.replace(p[h.COMPARATORTRIM],g),c(`comparator trim`,e),e=e.replace(p[h.TILDETRIM],v),c(`tilde trim`,e),e=e.replace(p[h.CARETTRIM],y),c(`caret trim`,e);let s=e.split(` `).map(e=>D(e,this.options)).join(` `).split(/\s+/).map(e=>L(e,this.options));i&&(s=s.filter(e=>(c(`loose invalid filter`,e,this.options),!!e.match(p[h.COMPARATORLOOSE])))),c(`range list`,s);let l=/* @__PURE__ */ new Map,u=s.map(e=>new a(e,this.options));for(let e of u){if(C(e))return[e];l.set(e.value,e)}l.size>1&&l.has(``)&&l.delete(``);let d=[...l.values()];return r.set(t,d),d}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>E(e,n)&&t.set.some(t=>E(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(z(this.set[t],e,this.options))return!0;return!1}};let r=new(_()),i=s(),a=w(),c=d(),f=u(),{safeRe:p,src:m,t:h,comparatorTrimReplace:g,tildeTrimReplace:v,caretTrimReplace:y}=o(),{FLAG_INCLUDE_PRERELEASE:b,FLAG_LOOSE:x}=l(),S=new RegExp(m[h.BUILD],`g`),C=e=>e.value===`<0.0.0-0`,T=e=>e.value===``,E=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},D=(e,t)=>(e=e.replace(p[h.BUILD],``),c(`comp`,e,t),e=M(e,t),c(`caret`,e),e=A(e,t),c(`tildes`,e),e=P(e,t),c(`xrange`,e),e=I(e,t),c(`stars`,e),e),O=e=>!e||e.toLowerCase()===`x`||e===`*`,k=(e,t,n)=>O(e)&&!O(t)||O(t)&&n&&!O(n),A=(e,t)=>e.trim().split(/\s+/).map(e=>j(e,t)).join(` `),j=(e,t)=>{let n=t.loose?p[h.TILDELOOSE]:p[h.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{c(`tilde`,e,t,n,i,a,o);let s;return O(n)?s=``:O(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:O(a)?s=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:o?(c(`replaceTilde pr`,o),s=`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`):s=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,c(`tilde return`,s),s})},M=(e,t)=>e.trim().split(/\s+/).map(e=>N(e,t)).join(` `),N=(e,t)=>{c(`caret`,e,t);let n=t.loose?p[h.CARETLOOSE]:p[h.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{c(`caret`,e,t,n,i,a,o);let s;return O(n)?s=``:O(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:O(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(c(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(c(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),c(`caret return`,s),s})},P=(e,t)=>(c(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>F(e,t)).join(` `)),F=(e,t)=>{e=e.trim();let n=t.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{if(c(`xRange`,e,n,r,i,a,o,s),k(i,a,o))return e;let l=O(i),u=l||O(a),d=u||O(o),f=d;return r===`=`&&f&&(r=``),s=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),o=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):u?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),c(`xRange return`,n),n})},I=(e,t)=>(c(`replaceStars`,e,t),e.trim().replace(p[h.STAR],``)),L=(e,t)=>(c(`replaceGTE0`,e,t),e.trim().replace(p[t.includePrerelease?h.GTE0PRE:h.GTE0],``)),R=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=O(r)?``:O(i)?`>=${r}.0.0${e?`-0`:``}`:O(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=O(l)?``:O(u)?`<${+l+1}.0.0-0`:O(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),z=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(c(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),E=/* @__PURE__ */ e((/* @__PURE__ */ t(((e,t)=>{let n=T();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})))(),1);function D(e){let t=m(e);if(t.length===0)throw j(e),new r(1);if(t.length>1)throw M(t),new r(1);let[n]=t;if(!n)throw new r(1);if(!n.binary)throw N(n),new r(1);if(n.impl.versionConstraint!==void 0&&!O(n.installedVersion,n.impl.versionConstraint.range))throw k(n),new r(1);return n}function O(e,t){return e!==void 0&&(0,E.default)(e,t,{includePrerelease:!0})}function k(e){P(`${e.impl.pkg}@${e.installedVersion??`unknown`} is installed, but it is not compatible with cf's local runtime.`,A(e),e.impl)}function A(e){return`cf requires ${e.impl.versionConstraint?.display??`a compatible version`} for cf dev, cf build, cf deploy, and cf previews deploy.`}function j(e){console.error(a(`No Cloudflare dev server is installed in ${e}.`,`Checked package.json, pyproject.toml and Cargo.toml.`)),console.error(`
|
|
3
3
|
Install one of these:`);for(let e of p)console.error(`\n${n.bold(e.pkg)} ${n.muted(e.description)}`),F(e)}function M(e){console.error(a(`Multiple Cloudflare dev-server implementations are configured.`,[...e.map(e=>`${e.impl.pkg} (${e.manifestPath})`),``,`A project can only use one dev-server. Remove all but one from your project's manifest and try again.`].join(`
|
|
4
4
|
`)))}function N(e){e.installed&&e.impl.versionConstraint?P(`${e.impl.pkg} is declared in ${e.manifestPath}, but this installation does not include the cf delegate.`,A(e),e.impl):P(`${e.impl.pkg} is declared in ${e.manifestPath} but is not installed.`,void 0,e.impl)}function P(e,t,n){console.error(a(e,t)),console.error(`
|
|
5
5
|
Try:`),F(n)}function F(e){for(let t of e.installCommands)console.error(`${` `.repeat(3)}${n.code(t)}`)}function I(e,t=process.platform){return t!==`win32`||e!==`SIGINT`}function L(e,t,n){let r=t??n??void 0;return{exitCode:e??(r?128+(g.signals[r]??1):1),...r?{signal:r}:{}}}async function R(e,t,n,r={}){let a=r.output??`stderr`,o=e.binary;if(!o){let t=e.impl.installCommands.map(e=>`\`${e}\``);throw Error(`Cannot spawn ${e.impl.pkg}: binary not found.\nTry: ${new Intl.ListFormat(`en`,{type:`disjunction`}).format(t)}`)}let{command:s,prefixArgs:c}=B(o),l=i(s,[...c,t,...n],{nodePath:!1,nodeOptions:{stdio:[`inherit`,a===`inherit`?`inherit`:a===`silent`?`ignore`:process.stderr,`inherit`],env:z(t,r.env)}}),u,d=e=>{u??=e,I(e)&&l.kill(e)},f=()=>d(`SIGINT`),p=()=>d(`SIGTERM`);process.on(`SIGINT`,f),process.on(`SIGTERM`,p);try{return L((await l).exitCode??null,l.process?.signalCode??null,u)}finally{process.off(`SIGINT`,f),process.off(`SIGTERM`,p)}}function z(e,t={}){let n={...V(process.env,`--no-deprecation`),...t,CLOUDFLARE_CF_AUTH:`true`};return e===`dev`?{...n,...h(n)}:n}function B(e){return e.startsWith(`uv:`)?{command:`uv`,prefixArgs:[`run`,`--no-sync`,e.slice(3)]}:{command:e,prefixArgs:[]}}function V(e,t){let n=e.NODE_OPTIONS??``;return n.split(/\s+/).includes(t)?e:{...e,NODE_OPTIONS:n?`${n} ${t}`:t}}export{D as n,R as t};
|