cf 1.0.0-beta.26 → 1.0.0-beta.27
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 +1996 -3422
- package/dist/_meta/schemas.json +9249 -2339
- package/dist/abuse-reports-RxXqfDEW.mjs +24 -0
- package/dist/{access-DCOOmDC5.mjs → access-BxEprr2f.mjs} +1 -1
- package/dist/{accounts-HC6XuIwP.mjs → accounts-DU2ZNYqP.mjs} +17 -11
- package/dist/{acm-DYgr6SAR.mjs → acm-CBCIKBJ4.mjs} +1 -1
- package/dist/{addressing-BS66pJ_a.mjs → addressing-BKxiLRHk.mjs} +1 -1
- package/dist/{agent-memory-BbXdueL0.mjs → agent-memory-DkBpQYUL.mjs} +1 -1
- package/dist/{ai-BiIKznNv.mjs → ai-DqEN_hhg.mjs} +2 -2
- package/dist/{ai-audit-DI4Rw2wl.mjs → ai-audit-BmzOgt6x.mjs} +1 -1
- package/dist/{ai-gateway-rlYCbts5.mjs → ai-gateway-B0uiYVHq.mjs} +3 -3
- package/dist/ai-search-DbZIxdio.mjs +74 -0
- package/dist/{ai-security-BUwS6kVh.mjs → ai-security-CvZfP2JC.mjs} +1 -1
- package/dist/{alerting-BSzuvFk1.mjs → alerting-BjGwBxZT.mjs} +1 -1
- package/dist/{analytics-CQ-Yt1mm.mjs → analytics-C7kT_H-W.mjs} +4 -4
- package/dist/{analytics-engine-CdrY5-95.mjs → analytics-engine-BHpcNSdD.mjs} +1 -1
- package/dist/{api-security-BBxEJjGv.mjs → api-security-BbcvDtff.mjs} +2 -2
- package/dist/{argo-BiefH8wc.mjs → argo-D1VONzu-.mjs} +1 -1
- package/dist/{artifacts-B9g9aPrk.mjs → artifacts-2R2sxIKO.mjs} +1 -1
- package/dist/{audit-logs-BhJs-OS2.mjs → audit-logs-LoBB1OO_.mjs} +1 -1
- package/dist/auth-CspwoBlp.mjs +2 -0
- package/dist/{auth-C50SqX9F.mjs → auth-D499YE2n.mjs} +3 -3
- package/dist/{auth-D5Yj9eYU.mjs → auth-FK2eLQ02.mjs} +1 -1
- package/dist/{auth-token-DvNoIhRL.mjs → auth-token-BwpERbnG.mjs} +1 -1
- package/dist/{autoconfig-ldsgXxa6.mjs → autoconfig-B2w-woU0.mjs} +36 -36
- package/dist/{basin-catalog-CtKFiH-n.mjs → basin-catalog-AgOHGiPI.mjs} +2 -2
- package/dist/billing-DRNww0iC.mjs +24 -0
- package/dist/{blocks-DnNrvi8s.mjs → blocks-C8vyXIAT.mjs} +1 -1
- package/dist/body-unions-CjpNjwSW.mjs +2 -0
- package/dist/bot-management-fwxKIbaB.mjs +9 -0
- package/dist/{botnet-feed-lD9s2oLA.mjs → botnet-feed-DCYB5kYZ.mjs} +1 -1
- package/dist/{brand-protection-Byoa1hvj.mjs → brand-protection-BVICLzBc.mjs} +1 -1
- package/dist/browser-run-CEk-NIgP.mjs +40 -0
- package/dist/build-CRm2TQq8.mjs +2 -0
- package/dist/{build-Dwd1_7o0.mjs → build-DO_GNhRl.mjs} +1 -1
- package/dist/{builds-D3mAH87h.mjs → builds-CoazxuN-.mjs} +26 -26
- package/dist/{cache-0xCdyNg9.mjs → cache-jlLJLSu7.mjs} +1 -1
- package/dist/{cf-CpC4giTf.mjs → cf-hP0SOgC6.mjs} +2 -2
- package/dist/{chunk-DSGVRFIS-vdfri8fR.mjs → chunk-DSGVRFIS-DQwKND2c.mjs} +1 -1
- package/dist/chunk-SOBRPAPT-BKzUiNx_.mjs +363 -0
- package/dist/{cli-Cm4Twas4.mjs → cli-Nqf58-1c.mjs} +1 -1
- package/dist/{client-side-security-BRn7KBpu.mjs → client-side-security-VmZzMy-m.mjs} +1 -1
- package/dist/{cloud-connector-DqkOIRDr.mjs → cloud-connector-bMlFnqP0.mjs} +1 -1
- package/dist/{cloudflared-DDp_8PTK.mjs → cloudflared-Ba4KWdTO.mjs} +1 -1
- package/dist/{cloudforce-one-B9k8vhso.mjs → cloudforce-one-CCaIBOAo.mjs} +121 -119
- package/dist/{command-BV8-laJK.mjs → command-BASaTmJc.mjs} +1 -1
- package/dist/{command-CfOqnqlN.mjs → command-BiIVclNA.mjs} +1 -1
- package/dist/{command-BKNQsGqu.mjs → command-Bih1HLr3.mjs} +1 -1
- package/dist/{command-BVz2aES3.mjs → command-BxZBNPxG.mjs} +1 -1
- package/dist/{command-B-_ba4rQ.mjs → command-ByYf12-8.mjs} +1 -1
- package/dist/{command-Dn39o5xQ.mjs → command-C0qCuw03.mjs} +1 -1
- package/dist/{command-BsCFkho-.mjs → command-C2FVMd1b.mjs} +1 -1
- package/dist/{command--Y_QAiU2.mjs → command-C4OgtX_x.mjs} +1 -1
- package/dist/{command-DlI7Z_7j.mjs → command-C5Kqc5Km.mjs} +1 -1
- package/dist/{command-CQMRxiDz.mjs → command-CFxyp8Uo.mjs} +1 -1
- package/dist/{command-CN8NFLs2.mjs → command-CZAR85ba.mjs} +1 -1
- package/dist/{command-QHmV62Fv.mjs → command-CelQVrZL.mjs} +1 -1
- package/dist/{command-yOG9VUtq.mjs → command-CrAlzysj.mjs} +1 -1
- package/dist/{command-DsOv6z9q.mjs → command-pMoNdd22.mjs} +1 -1
- package/dist/{completions-BA52jTea.mjs → completions-DRzBiqpv.mjs} +1 -1
- package/dist/{connector-interrupts-zL7pxPn6.mjs → connector-interrupts-CrTeSyaM.mjs} +1 -1
- package/dist/{connector-telemetry-events-PL4Fqqvu.mjs → connector-telemetry-events-BbAOUt9h.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-DyBSuEFB.mjs → connector-telemetry-snapshots-DcpBx7Qx.mjs} +1 -1
- package/dist/{connectors-D8H6rQz9.mjs → connectors-D1WFLJoE.mjs} +1 -1
- package/dist/{containers-Db-eWudu.mjs → containers-BOBEs1Gk.mjs} +4 -4
- package/dist/containers-DINLx5_i.mjs +380 -0
- package/dist/{content-scan-DUVq09i8.mjs → content-scan-D1GfPSL0.mjs} +1 -1
- package/dist/{context-BvLXzoMs.mjs → context-Dp4CXG22.mjs} +1 -1
- package/dist/{cps-CqaRliZZ.mjs → cps-D4uhzg3k.mjs} +1 -1
- package/dist/{csam-scanner-DsXvOOsZ.mjs → csam-scanner-DOOUBeBM.mjs} +1 -3
- package/dist/custom-csrs-DtdFo5YZ.mjs +18 -0
- package/dist/{custom-hostnames-Cj_csfo_.mjs → custom-hostnames-ccdlELaD.mjs} +1 -1
- package/dist/custom-nameservers-p3gDjfva.mjs +12 -0
- package/dist/custom-pages-DAkKVzgR.mjs +38 -0
- package/dist/d1-CDIyRdh4.mjs +52 -0
- package/dist/{delegate-CMfEjvHn.mjs → delegate-B4bKqF7i.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-DDbmxkiX.mjs → deploy-BaC5Ty7F.mjs} +1 -1
- package/dist/{deploy-context-DsEVu7bf.mjs → deploy-context-DTTgNGro.mjs} +1 -1
- package/dist/{deploy-input-BA_3Q2Xu.mjs → deploy-input-mAy06fAI.mjs} +1 -1
- package/dist/{dev-BS156bim.mjs → dev-De-HszNT.mjs} +1 -1
- package/dist/{diagnostics-BmkQnSEb.mjs → diagnostics-D1CUs2o9.mjs} +1 -1
- package/dist/{dist-DehXZozc.mjs → dist-D5qkmHhC.mjs} +1 -1
- package/dist/{dls-DciZC_gQ.mjs → dls-DWBiYzY1.mjs} +1 -1
- package/dist/{dns-firewall-CRfde07f.mjs → dns-firewall-DH9xIT5H.mjs} +8 -8
- package/dist/{dns-C2YPspGN.mjs → dns-wMjf1t6-.mjs} +14 -8
- package/dist/{docs-CYjyBA8q.mjs → docs-BA7qslb2.mjs} +1 -1
- package/dist/{durable-objects-DcI97y4p.mjs → durable-objects-DF0MYpnV.mjs} +1 -1
- package/dist/{email-auth-CMCQAu99.mjs → email-auth-BShMFXn4.mjs} +1 -1
- package/dist/email-domains-CDSbVclP.mjs +14 -0
- package/dist/{email-routing-7p9dr5Ue.mjs → email-routing-CBCkbg_F.mjs} +4 -2
- package/dist/{email-security-Bu0fAYh-.mjs → email-security-CnNa1YON.mjs} +4 -4
- package/dist/{email-sending-OpMZNaHZ.mjs → email-sending-CpDSw-Eb.mjs} +16 -16
- package/dist/{errors-C5RGao2J.mjs → errors-DatLr-iR.mjs} +1 -1
- package/dist/{field-extractors-BfsNjd0e.mjs → field-extractors-BwGdMnTr.mjs} +1 -1
- package/dist/{firewall-CJ-VIOk1.mjs → firewall-CY_oem-d.mjs} +25 -9
- package/dist/{flagship-C5PTR1ND.mjs → flagship-Bat5EZCk.mjs} +1 -1
- package/dist/{fraud-B7hwBheX.mjs → fraud-CSUKLh8X.mjs} +2 -2
- package/dist/global-options-DiKj2cQy.mjs +2 -0
- package/dist/{google-tag-gateway-D7iFDVEa.mjs → google-tag-gateway-C2skt6t-.mjs} +1 -1
- package/dist/{healthchecks-B4jTcKV7.mjs → healthchecks-uC43QKQd.mjs} +1 -1
- package/dist/{hyperdrive-1432DM-p.mjs → hyperdrive-FcBbpew4.mjs} +3 -3
- package/dist/iam-8T74DNhH.mjs +62 -0
- package/dist/{images-Ttea4khD.mjs → images-C3JUaf6b.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-BeYrAg7Q.mjs → init-BEVVz4_P.mjs} +1 -1
- package/dist/{intel-CJznBf5n.mjs → intel-DRy4rHrt.mjs} +6 -7
- package/dist/{interactive-DsU8VDvK.mjs → interactive-CKHdGvkh.mjs} +1 -1
- package/dist/{internal-DOho_iA0.mjs → internal-CamuESs0.mjs} +1 -1
- package/dist/{ips-BgNoRwFN.mjs → ips-DinCNnWj.mjs} +1 -1
- package/dist/k2-wsanPL3y.mjs +10 -0
- package/dist/{kv-CTyuvcAz.mjs → kv-BLSPcEnH.mjs} +1 -1
- package/dist/{lazy-command-DeTzOWvU.mjs → lazy-command-WB1FOuew.mjs} +1 -1
- package/dist/{leaked-credential-checks-21Wc7OqL.mjs → leaked-credential-checks-CSZd9hBQ.mjs} +1 -1
- package/dist/{live-BfrWKfq8.mjs → live-B6AsI_E5.mjs} +1 -1
- package/dist/{load-balancers-DMTsh-9q.mjs → load-balancers-gap5u4b1.mjs} +19 -7
- package/dist/local-CFsO9Tkg.mjs +2 -0
- package/dist/{local-CvzO-cQH.mjs → local-CgBhtmON.mjs} +1 -1
- package/dist/{local-runtime-DOpR_Tnc.mjs → local-runtime-CmlJ20uJ.mjs} +1 -1
- package/dist/{login-CVWkMh1L.mjs → login-BJHaTERg.mjs} +1 -1
- package/dist/login-BfuOf-Yi.mjs +2 -0
- package/dist/logpush-qhlxsioM.mjs +68 -0
- package/dist/{logs-BSyyNwso.mjs → logs-bI54CJ0w.mjs} +23 -7
- package/dist/{magic-network-monitoring-DRRvSrDP.mjs → magic-network-monitoring-CX3TaMTu.mjs} +1 -1
- package/dist/{magic-transit-BhP424T-.mjs → magic-transit-BwDyySHJ.mjs} +20 -20
- package/dist/{managed-defense-6l_B3hn_.mjs → managed-defense-CsBBkfeQ.mjs} +2 -2
- package/dist/{managed-transforms-D7FMBsnq.mjs → managed-transforms-CUC-uAbW.mjs} +1 -1
- package/dist/{mcp-BUOfMkBP.mjs → mcp-CyI0sDmL.mjs} +3 -3
- package/dist/{mesh-B1RrhAT1.mjs → mesh-Czr0UCP4.mjs} +2 -2
- package/dist/{migrate-BTU8AvlP.mjs → migrate-DKDWYrz2.mjs} +1 -1
- package/dist/{monetization-Da3ooFLC.mjs → monetization-NUgfDtSy.mjs} +7 -3
- package/dist/{network-CjhSzhMm.mjs → network-B42zrBic.mjs} +1 -1
- package/dist/{network-interconnects-DEQD6GM8.mjs → network-interconnects-DuIBe8fK.mjs} +4 -4
- package/dist/{o11y-DeNxXxcp.mjs → o11y-oEUpMC3O.mjs} +6 -6
- package/dist/{oauth-DdXkpU44.mjs → oauth-BLQ1-y3R.mjs} +1 -1
- package/dist/{oauth-Dnog5v-Q.mjs → oauth-BmSFLp_s.mjs} +1 -1
- package/dist/observability-BxhJQCgZ.mjs +4 -0
- package/dist/organization-CEnlXwrl.mjs +70 -0
- package/dist/{organizations-p8Mgo8A7.mjs → organizations-Dt86ToxE.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-Bwysyttf.mjs → origin-post-quantum-encryption-lX-uaJSL.mjs} +1 -1
- package/dist/package-CiRJBRHO.mjs +2 -0
- package/dist/{page-rules-D2eFbKWb.mjs → page-rules-J6LhwR-s.mjs} +1 -1
- package/dist/{pages-DYZDvWK6.mjs → pages-BksdnChs.mjs} +4 -4
- package/dist/{pay-per-crawl-CgPFv5HT.mjs → pay-per-crawl-BLcbHRoR.mjs} +1 -1
- package/dist/{pay-per-use-BIQrsrTy.mjs → pay-per-use-VatiU-Nt.mjs} +4 -2
- package/dist/{pipelines-D6pkhlpm.mjs → pipelines-B5AoB3f3.mjs} +5 -5
- package/dist/precursor-D3VH2MXT.mjs +4 -0
- package/dist/{previews-B1mqjXaJ.mjs → previews-DzJ85fsr.mjs} +1 -1
- package/dist/{progress-B-CVX0kn.mjs → progress-DLri-rA7.mjs} +1 -1
- package/dist/{prompt-DJF_Rs5S.mjs → prompt-D0dXwuME.mjs} +1 -1
- package/dist/{queues-DaqLO-UO.mjs → queues-BsAck4To.mjs} +5 -5
- package/dist/{r2-DDIU9JN3.mjs → r2-BYjdHDEZ.mjs} +38 -38
- package/dist/{radar-D59qCgld.mjs → radar-CvLtu-Vr.mjs} +1 -1
- package/dist/{raw-fetch-BrOxDN9k.mjs → raw-fetch-DQeDx1wT.mjs} +1 -1
- package/dist/{ready-DgE08svD.mjs → ready-gsGEaWLL.mjs} +1 -1
- package/dist/{realtime-DWjdrDzv.mjs → realtime-DiCEgFTC.mjs} +81 -79
- package/dist/{registrar-uYOU1U27.mjs → registrar-D4wdgWpo.mjs} +8 -8
- package/dist/{registrar-sandbox-uzs3eOKk.mjs → registrar-sandbox-B6yopzdG.mjs} +2 -2
- package/dist/{reporting-Dx2YTick.mjs → reporting-BiHgnT8L.mjs} +1 -1
- package/dist/{request-headers-DHzBX7dQ.mjs → request-headers-CoxHUNcB.mjs} +1 -1
- package/dist/{request-tracers-B49cBKkj.mjs → request-tracers-817HTytF.mjs} +1 -1
- package/dist/{resource-sharing-CIsLVAcK.mjs → resource-sharing-CW9xxtq5.mjs} +12 -12
- package/dist/{rules-CjgLSlUC.mjs → rules-CRhe_ca9.mjs} +1 -1
- package/dist/rulesets-CKyc-Xlx.mjs +42 -0
- package/dist/{rum-vPEpMS_h.mjs → rum-BfnWHW_d.mjs} +1 -1
- package/dist/{run-BZ6Fj3jQ.mjs → run-Ciw_GIrC.mjs} +1 -1
- package/dist/run-DD45EQTm.mjs +2 -0
- package/dist/{schema-cache-C_rvto6Y.mjs → schema-cache-BIo0Gi2H.mjs} +1 -1
- package/dist/schema-flags-DrqvwQNw.mjs +4 -0
- package/dist/{scim-BA7XbsSu.mjs → scim-C4iRWNYB.mjs} +1 -1
- package/dist/{secrets-store-MEUNt1Ph.mjs → secrets-store-DgtzZRze.mjs} +1 -1
- package/dist/security-insights-SlUGW3F_.mjs +62 -0
- package/dist/{security-txt-DikhnR2L.mjs → security-txt-C3YS0REz.mjs} +1 -1
- package/dist/{session-BOnam-Wv.mjs → session-D2yuwO4i.mjs} +1 -1
- package/dist/{shared-DmmWSObC.mjs → shared--uVkAAd7.mjs} +1 -1
- package/dist/{signed-url-C-24KbWB.mjs → signed-url-ClLk45_J.mjs} +1 -1
- package/dist/{smart-shield-DPqLMz7M.mjs → smart-shield-Dn95hqUH.mjs} +1 -1
- package/dist/{snippets-Bi3Uq1DF.mjs → snippets-BNUKOajz.mjs} +1 -1
- package/dist/{spawn-C3hzWVrJ.mjs → spawn-DuT4snxu.mjs} +1 -1
- package/dist/{spectrum-BaWKMoAl.mjs → spectrum-Cj0BMtg2.mjs} +3 -3
- package/dist/{speed-DShjlpAs.mjs → speed-BrVeZRyX.mjs} +1 -1
- package/dist/{sql-DCoFf15T.mjs → sql-BX1pBqj3.mjs} +2 -2
- package/dist/src-DPnUfK4c.mjs +131 -0
- package/dist/{ssl-C4nt4pJK.mjs → ssl-Bx4LCutF.mjs} +3 -3
- package/dist/{startup-profile-CFJ_Lu1c.mjs → startup-profile-DqaYNT0b.mjs} +1 -1
- package/dist/startup-profile-tZNb2HGz.mjs +2 -0
- package/dist/{state-DmjHXZat.mjs → state-BmzOLELo.mjs} +1 -1
- package/dist/state-Uwfrmw5I.mjs +2 -0
- package/dist/{stream-CpZbnSpH.mjs → stream-BRzr6yh0.mjs} +1 -1
- package/dist/{tags-BIjQ3Kjh.mjs → tags-xVzjZxdt.mjs} +11 -5
- package/dist/{telemetry-BDhqOpUw.mjs → telemetry-CJ9URio3.mjs} +1 -1
- package/dist/telemetry-Pt5GpCKD.mjs +2 -0
- package/dist/tenant-custom-nameservers-M7Fxqh2W.mjs +8 -0
- package/dist/{tunnels-CXAO2CeL.mjs → tunnels-DQVXKUKA.mjs} +3 -3
- package/dist/{turnstile-Ctm0rs0q.mjs → turnstile-B_Ugzgom.mjs} +1 -1
- package/dist/ui-FYultowZ.mjs +2 -0
- package/dist/{update-check-D_Wtw0_D.mjs → update-check-DHUo4FOJ.mjs} +1 -1
- package/dist/{update-check-Dc7cRFlx.mjs → update-check-DRr0eRhB.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization-DOfc2Q7a.mjs → url-normalization-CZRQH_pJ.mjs} +1 -1
- package/dist/{url-scanner-J8M3X2tR.mjs → url-scanner-BH4PLy16.mjs} +1 -1
- package/dist/{user-BaF0qvvO.mjs → user-Bn82Qw0Y.mjs} +10 -12
- package/dist/{vectorize-D5qiggZU.mjs → vectorize-DoVVz_sh.mjs} +1 -1
- package/dist/version-Zr2oF8mY.mjs +2 -0
- package/dist/{waiting-rooms-BdmAq7ul.mjs → waiting-rooms-QUW131o3.mjs} +5 -3
- package/dist/{web-assets-BySw_Tme.mjs → web-assets-CgQXsp8m.mjs} +2 -2
- package/dist/{web3-BKkKf1RF.mjs → web3-TY9s6Swn.mjs} +3 -3
- package/dist/workers-B3uJqJKc.mjs +39 -0
- package/dist/{workers-builds-CVJ4FqzB.mjs → workers-builds-BgGY0IGk.mjs} +2 -2
- package/dist/{workers-for-platforms-mzdtmr6r.mjs → workers-for-platforms-5RkV9MVp.mjs} +2 -2
- package/dist/workers-vpc-Bt4OQbwM.mjs +12 -0
- package/dist/{workflows-Cr957c4U.mjs → workflows-6m85DdqF.mjs} +7 -7
- package/dist/{wrangler-migration-DZV7-4Fp.mjs → wrangler-migration-BbmGOu8l.mjs} +3 -3
- package/dist/{zaraz-C8__FhOh.mjs → zaraz-8WSJ7l0L.mjs} +2 -2
- package/dist/{zero-trust-BVCvQJ4e.mjs → zero-trust-DK0cqDZv.mjs} +483 -405
- package/dist/{zones-BzyjOT10.mjs → zones-DTAcguf6.mjs} +3 -3
- package/package.json +14 -14
- package/dist/abuse-reports-zPrsxbRz.mjs +0 -24
- package/dist/ai-search-QOenIzDL.mjs +0 -74
- package/dist/auth-Czzy5Rs_.mjs +0 -2
- package/dist/billing-BrLJqlOf.mjs +0 -22
- package/dist/bot-management-BSBVuKc0.mjs +0 -9
- package/dist/browser-run-BSVANGzU.mjs +0 -40
- package/dist/build-CPKxZ3kL.mjs +0 -2
- package/dist/chunk-3PJ54H4K-CY8EY_n2.mjs +0 -363
- package/dist/containers-D4sa-Eoy.mjs +0 -380
- package/dist/custom-csrs-Dl_daAbX.mjs +0 -10
- package/dist/custom-nameservers-Bw2P7F_W.mjs +0 -8
- package/dist/custom-pages-CJ7ecSX6.mjs +0 -20
- package/dist/d1-BsWI546w.mjs +0 -89
- package/dist/email-domains-1Nx60ETD.mjs +0 -12
- package/dist/iam-DuZenYtc.mjs +0 -48
- package/dist/k2-Cj1ORHul.mjs +0 -10
- package/dist/local-CWTti4ot.mjs +0 -2
- package/dist/login-Djz5mvHJ.mjs +0 -2
- package/dist/logpush-OMhp7VgE.mjs +0 -44
- package/dist/magic-cloud-networking-DD29yMnE.mjs +0 -68
- package/dist/oauth-clients-UnbMcHkx.mjs +0 -14
- package/dist/oauth-scopes-DbtnZVO4.mjs +0 -4
- package/dist/organization-IsxVyWol.mjs +0 -73
- package/dist/package-BOE_De2L.mjs +0 -2
- package/dist/precursor-B35P8h6h.mjs +0 -4
- package/dist/rulesets-C7_aZA7m.mjs +0 -34
- package/dist/run-D4-K_cbQ.mjs +0 -2
- package/dist/schema-flags-Cr6kleor.mjs +0 -4
- package/dist/security-insights-ZKtey62s.mjs +0 -40
- package/dist/src-jyCTFHcS.mjs +0 -131
- package/dist/startup-profile-D_Qjgca1.mjs +0 -2
- package/dist/state-C7lNNN31.mjs +0 -2
- package/dist/telemetry-BZdRnr26.mjs +0 -2
- package/dist/tenant-CqYoylyU.mjs +0 -10
- package/dist/tenant-custom-nameservers-DDzzdyY3.mjs +0 -8
- package/dist/ui-BUCBQ3Sq.mjs +0 -2
- package/dist/version-DNcdABcr.mjs +0 -2
- package/dist/workers-TS0oQ-XH.mjs +0 -39
- package/dist/workers-vpc-xB1hHFPd.mjs +0 -12
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-D5Yj9eYU.mjs";import{t as n}from"./output-BJEgbI0G.mjs";import{t as r}from"./dry-run-gy0Hl9xo.mjs";import{t as i}from"./progress-B-CVX0kn.mjs";import{t as a}from"./run-BZ6Fj3jQ.mjs";import"./telemetry-BZdRnr26.mjs";import{a as o,n as s,t as c}from"./body-parser-BKcZS9iJ.mjs";import{n as l}from"./input-validation-D7z60HJH.mjs";import{a as u,i as d,n as f}from"./prompt-DJF_Rs5S.mjs";var p={method:`GET`,path:t=>e`/organizations/${t.organization_id}/accounts`,query:[`account_pubname`,`account_pubname.startsWith`,`account_pubname.endsWith`,`account_pubname.contains`,`name`,`name.startsWith`,`name.endsWith`,`name.contains`,`order_by`,`direction`,`include_tags`,`include_total`,`page_token`,`page_size`],joined:[`account_pubname`,`account_pubname.startsWith`,`account_pubname.endsWith`,`account_pubname.contains`,`name`,`name.startsWith`,`name.endsWith`,`name.contains`,`order_by`,`direction`,`include_tags`,`include_total`,`page_token`,`page_size`]};function m(e){return e.usage(`$0 organization account list
|
|
3
|
-
|
|
4
|
-
Retrieve the accounts immediately attached to a specific organization. Accounts attached to sub-organizations are not included.`).option(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a list of accounts for.`,demandOption:!0}).option(`account-pubname`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname is equal to
|
|
5
|
-
a particular string.`}).option(`account-pubname-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname starts with
|
|
6
|
-
a particular string.`}).option(`account-pubname-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname ends with
|
|
7
|
-
a particular string.`}).option(`account-pubname-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname contains
|
|
8
|
-
a particular string.`}).option(`name`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name is equal to a
|
|
9
|
-
particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name starts with a
|
|
10
|
-
particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name ends with a particular
|
|
11
|
-
string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name contains a particular
|
|
12
|
-
string.`}).option(`order-by`,{type:`string`,description:"Field to order results by. Currently supported values: `account_name`.\nWhen not specified, results are ordered by internal account ID.",choices:[`account_name`]}).option(`direction`,{type:`string`,description:"Sort direction for the order_by field. Valid values: `asc`, `desc`.\nDefaults to `asc` when order_by is specified.",choices:[`asc`,`desc`]}).option(`include-tags`,{type:`boolean`,description:`Include Account tags from the resource tag mirror. Omit this parameter to preserve the existing Account response shape.`}).option(`include-total`,{type:`boolean`,description:`Whether to calculate and return the exact result_info.total_size for cursor
|
|
13
|
-
pagination. Defaults to true. When false, total_size is omitted. page_size and
|
|
14
|
-
include_total may change between pages; next_page_token remains the authoritative
|
|
15
|
-
continuation signal.
|
|
16
|
-
Legacy page/per_page requests always calculate total_count.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
17
|
-
provided will retrieve the next page.
|
|
18
|
-
|
|
19
|
-
Parameters used to filter the retrieved list must remain in subsequent
|
|
20
|
-
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`List organization accounts`,builder:m,handler:async e=>a({command:`organization account list`,classification:{safeFlags:[`order-by`,`direction`,`include-tags`,`include-total`,`dry-run`]}},e,async()=>{let a={account_pubname:e[`account-pubname`],"account_pubname.startsWith":e[`account-pubname-starts-with`],"account_pubname.endsWith":e[`account-pubname-ends-with`],"account_pubname.contains":e[`account-pubname-contains`],name:e.name,"name.startsWith":e[`name-starts-with`],"name.endsWith":e[`name-ends-with`],"name.contains":e[`name-contains`],order_by:e[`order-by`],direction:e.direction,include_tags:e[`include-tags`],include_total:e[`include-total`],page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){r({command:`cf organization account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/accounts`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await t(e),s=await i(`Loading`,async()=>o.send(p,{organization_id:e[`organization-id`],...a}));n(s,{successLabel:`Loaded`})})},g={command:`account`,describe:`Operations for account`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var _={method:`POST`,path:()=>`/organizations`,body:`json`};function ee(e){return e.usage(`$0 organization create
|
|
21
|
-
|
|
22
|
-
Create a new organization for a user. Sub-organization creation availability depends on the organization's capabilities.`).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`Organization ID`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`References an Organization in the Cloudflare data model.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --profile-* flag is set`)}return!0})}const te={command:`create`,describe:`Create organization`,builder:ee,handler:async e=>a({command:`organization create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organization create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({name:l(e.name,`name`,`text`),parent:{id:l(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:l(e[`profile-business-address`],`profile-business-address`,`text`),business_email:l(e[`profile-business-email`],`profile-business-email`,`text`),business_name:l(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:l(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:l(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):s(e.body)});return}let a=await t(e);if(e.body){let t=s(e.body),r=await i(`Creating`,async()=>a.send(_,{body:t}));n(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await u(`name`,`The name field`));let o=c({name:l(e.name,`name`,`text`),parent:{id:l(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:l(e[`profile-business-address`],`profile-business-address`,`text`),business_email:l(e[`profile-business-email`],`profile-business-email`,`text`),business_name:l(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:l(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:l(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}),d=await i(`Creating`,async()=>a.send(_,{body:o}));n(d,{successLabel:`Created`})})};var v={method:`DELETE`,path:t=>e`/organizations/${t.organization_id}`};function y(e){return e.usage(`$0 organization delete <organization-id>
|
|
23
|
-
|
|
24
|
-
Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. Sub-organization deletion availability depends on the organization's capabilities. **Access Control:** Restricted to enterprise organizations.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to delete.`,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 b={command:`delete <organization-id>`,describe:`Delete organization`,builder:y,handler:async e=>a({command:`organization delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){r({command:`cf organization delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let a=await t(e);if(!await f({force:!!e.force,message:`Delete this empty organization? This action cannot be undone.`}))return;let o=await i(`Deleting`,async()=>a.send(v,{organization_id:e[`organization-id`]}));n(o,{successLabel:`Deleted`})})};var x={method:`GET`,path:t=>e`/organizations/${t.organization_id}`};function S(e){return e.usage(`$0 organization get <organization-id>
|
|
25
|
-
|
|
26
|
-
Retrieve the details of a certain organization.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <organization-id>`,describe:`Get organization`,builder:S,handler:async e=>a({command:`organization get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organization get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let a=await t(e),o=await i(`Loading`,async()=>a.send(x,{organization_id:e[`organization-id`]}));n(o,{successLabel:`Loaded`})})};var w={method:`PUT`,path:t=>e`/organizations/${t.organization_id}/invites/${t.member_code}`,body:`json`};function T(e){return e.usage(`$0 organization invite update <member-code>
|
|
27
|
-
|
|
28
|
-
Accept or reject an invitation to a specific organization. The credential must belong to the invited user. No additional API token permission is required.`).positional(`member-code`,{type:`string`,description:`The invitation code to accept or reject.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`The ID of the organization associated with the invitation.`,demandOption:!0}).option(`status`,{type:`string`,description:`The status field`,choices:[`accept`,`reject`]}).coerce(`status`,e=>l(e,`status`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"The invitation action. Use `accept` to join the organization or `reject` to decline the invitation."})}const E={command:`update <member-code>`,describe:`Handle organization invite`,builder:T,handler:async e=>a({command:`organization invite update`,classification:{safeFlags:[`status`,`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organization invite update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/invites/${e[`member-code`]==null?`<member-code>`:encodeURIComponent(String(e[`member-code`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``),"member-code":String(e[`member-code`]??``)},bodyKind:`json`,body:e.body===void 0?c({status:e.status}):s(e.body)});return}let a=await t(e);if(e.body){let t=s(e.body),r=await i(`Updating`,async()=>a.send(w,{body:t,organization_id:e[`organization-id`],member_code:e[`member-code`]}));n(r,{successLabel:`Updated`});return}e.status===void 0&&(e.status=await d(`status`,`The status field`,[`accept`,`reject`]));let o=c({status:e.status}),l=await i(`Updating`,async()=>a.send(w,{body:o,organization_id:e[`organization-id`],member_code:e[`member-code`]}));n(l,{successLabel:`Updated`})})},D={command:`invite`,describe:`Operations for invite`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var O={method:`GET`,path:()=>`/organizations`,query:[`id`,`name`,`name.startsWith`,`name.endsWith`,`name.contains`,`containing.account`,`containing.user`,`containing.organization`,`parent.id`,`page_token`,`page_size`],joined:[`id`,`name`,`name.startsWith`,`name.endsWith`,`name.contains`,`containing.account`,`containing.user`,`containing.organization`,`parent.id`,`page_token`,`page_size`]};function k(e){return e.usage(`$0 organization list
|
|
29
|
-
|
|
30
|
-
Retrieve a list of organizations a particular user has access to.`).option(`id`,{type:`string`,array:!0,description:`Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements
|
|
31
|
-
by repeating the query value.`}).option(`name`,{type:`string`,description:`(case-sensitive) Filter the list of organizations to where the name is equal to a
|
|
32
|
-
particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name starts with a
|
|
33
|
-
particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name ends with a particular
|
|
34
|
-
string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name contains a particular
|
|
35
|
-
string.`}).option(`containing-account`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
36
|
-
account.`}).option(`containing-user`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
37
|
-
user.
|
|
38
|
-
|
|
39
|
-
IMPORTANT: Just because an organization "contains" a user is not a
|
|
40
|
-
representation of any authorization or privilege to manage any resources
|
|
41
|
-
therein. An organization "containing" a user simply means the user is managed by
|
|
42
|
-
that organization.`}).option(`containing-organization`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
43
|
-
organization.`}).option(`parent-id`,{type:`string`,description:`Filter the list of organizations to the ones that are a sub-organization
|
|
44
|
-
of the specified organization.
|
|
45
|
-
|
|
46
|
-
"null" is a valid value to provide for this parameter. It means "where
|
|
47
|
-
an organization has no parent (i.e. it is a 'root' organization)."`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
48
|
-
provided will retrieve the next page.
|
|
49
|
-
|
|
50
|
-
Parameters used to filter the retrieved list must remain in subsequent
|
|
51
|
-
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List organizations the user has access to`,builder:k,handler:async e=>a({command:`organization list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let a={id:e.id,name:e.name,"name.startsWith":e[`name-starts-with`],"name.endsWith":e[`name-ends-with`],"name.contains":e[`name-contains`],"containing.account":e[`containing-account`],"containing.user":e[`containing-user`],"containing.organization":e[`containing-organization`],"parent.id":e[`parent-id`],page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){r({command:`cf organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},query:a,bodyKind:`none`});return}let o=await t(e),s=await i(`Loading`,async()=>o.send(O,a));n(s,{successLabel:`Loaded`})})};var j={method:`POST`,path:t=>e`/organizations/${t.organization_id}/members:batchCreate`,body:`json`};function M(e){return e.usage(`$0 organization member batch create <organization-id>
|
|
52
|
-
|
|
53
|
-
Batch create multiple memberships that grant access to a specific Organization.`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`members`,{type:`string`,description:`The members 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 N={command:`create <organization-id>`,describe:`Batch create organization members`,builder:M,handler:async e=>a({command:`organization member batch create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organization member batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members:batchCreate`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({members:o(e.members,`members`)}):s(e.body)});return}let a=await t(e);if(e.body){let t=s(e.body),r=await i(`Creating`,async()=>a.send(j,{body:t,organization_id:e[`organization-id`]}));n(r,{successLabel:`Created`});return}if(e.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let l=c({members:o(e.members,`members`)}),u=await i(`Creating`,async()=>a.send(j,{body:l,organization_id:e[`organization-id`]}));n(u,{successLabel:`Created`})})},P={command:`batch`,describe:`Operations for member.batch`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var F={method:`POST`,path:t=>e`/organizations/${t.organization_id}/members`,body:`json`};function I(e){return e.usage(`$0 organization member create <organization-id>
|
|
54
|
-
|
|
55
|
-
Create a membership that grants access to a specific Organization.`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`member-status`,{type:`string`,description:`The member.status field`,choices:[`active`,`canceled`]}).coerce(`member-status`,e=>l(e,`member-status`,`text`)).option(`member-user-email`,{type:`string`,description:`The member.user.email field`}).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 L={command:`create <organization-id>`,describe:`Create organization member`,builder:I,handler:async e=>a({command:`organization member create`,classification:{safeFlags:[`member-status`,`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organization member create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({member:{status:e[`member-status`],user:{email:l(e[`member-user-email`],`member-user-email`,`text`)}}}):s(e.body)});return}let a=await t(e);if(e.body){let t=s(e.body),r=await i(`Creating`,async()=>a.send(F,{body:t,organization_id:e[`organization-id`]}));n(r,{successLabel:`Created`});return}e[`member-user-email`]===void 0&&(e[`member-user-email`]=await u(`member-user-email`,`The member.user.email field`));let o=c({member:{status:e[`member-status`],user:{email:l(e[`member-user-email`],`member-user-email`,`text`)}}}),d=await i(`Creating`,async()=>a.send(F,{body:o,organization_id:e[`organization-id`]}));n(d,{successLabel:`Created`})})};var ne={method:`DELETE`,path:t=>e`/organizations/${t.organization_id}/members/${t.member_id}`,response:!1};function R(e){return e.usage(`$0 organization member delete <member-id>
|
|
56
|
-
|
|
57
|
-
Delete a membership to a particular Organization.`).positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,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 z={command:`delete <member-id>`,describe:`Delete organization member`,builder:R,handler:async e=>a({command:`organization member delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){r({command:`cf organization member delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``),"member-id":String(e[`member-id`]??``)},bodyKind:`none`});return}let a=await t(e);if(!await f({force:!!e.force,message:`Delete this organization membership? The member will lose access to this organization and its sub-organizations.`}))return;let o=await i(`Deleting`,async()=>a.send(ne,{organization_id:e[`organization-id`],member_id:e[`member-id`]}));n(o,{successLabel:`Deleted`})})};var B={method:`GET`,path:t=>e`/organizations/${t.organization_id}/members/${t.member_id}`};function V(e){return e.usage(`$0 organization member get <member-id>
|
|
58
|
-
|
|
59
|
-
Retrieve a single membership from an Organization.`).positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <member-id>`,describe:`Get organization member`,builder:V,handler:async e=>a({command:`organization member get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organization member get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``),"member-id":String(e[`member-id`]??``)},bodyKind:`none`});return}let a=await t(e),o=await i(`Loading`,async()=>a.send(B,{organization_id:e[`organization-id`],member_id:e[`member-id`]}));n(o,{successLabel:`Loaded`})})};var U={method:`GET`,path:t=>e`/organizations/${t.organization_id}/members`,query:[`status`,`user.email`,`user.email.contains`,`user.email.startsWith`,`user.email.endsWith`,`page_token`,`page_size`],joined:[`user.email`,`user.email.contains`,`user.email.startsWith`,`user.email.endsWith`,`page_token`,`page_size`]};function W(e){return e.usage(`$0 organization member list
|
|
60
|
-
|
|
61
|
-
List memberships for an Organization.`).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`status`,{type:`string`,array:!0,description:`Filter the list of memberships by membership status.`}).option(`user-email`,{type:`string`,description:`Filter the list of memberships for a specific email.`}).option(`user-email-contains`,{type:`string`,description:`Filter the list of memberships for a specific email that contains a substring.`}).option(`user-email-starts-with`,{type:`string`,description:`Filter the list of memberships for a specific email that starts with a substring.`}).option(`user-email-ends-with`,{type:`string`,description:`Filter the list of memberships for a specific email that ends with a substring.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
62
|
-
provided will retrieve the next page.
|
|
63
|
-
|
|
64
|
-
Parameters used to filter the retrieved list must remain in subsequent
|
|
65
|
-
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List organization members`,builder:W,handler:async e=>a({command:`organization member list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let a={status:e.status,"user.email":e[`user-email`],"user.email.contains":e[`user-email-contains`],"user.email.startsWith":e[`user-email-starts-with`],"user.email.endsWith":e[`user-email-ends-with`],page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){r({command:`cf organization member list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await t(e),s=await i(`Loading`,async()=>o.send(U,{organization_id:e[`organization-id`],...a}));n(s,{successLabel:`Loaded`})})},K={command:`member`,describe:`Operations for member`,builder:e=>e.command(L).command(z).command(H).command(G).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var q={method:`GET`,path:t=>e`/organizations/${t.organization_id}/profile`};function J(e){return e.usage(`$0 organization profile get <organization-id>
|
|
66
|
-
|
|
67
|
-
Get an organizations profile if it exists.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a profile for.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get <organization-id>`,describe:`Get organization profile`,builder:J,handler:async e=>a({command:`organization profile get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organization profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let a=await t(e),o=await i(`Loading`,async()=>a.send(q,{organization_id:e[`organization-id`]}));n(o,{successLabel:`Loaded`})})};var X={method:`PUT`,path:t=>e`/organizations/${t.organization_id}/profile`,body:`json`,response:!1};function Z(e){return e.usage(`$0 organization profile update <organization-id>
|
|
68
|
-
|
|
69
|
-
Modify organization profile.`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata field`}).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 re={command:`update <organization-id>`,describe:`Modify organization profile.`,builder:Z,handler:async e=>a({command:`organization profile update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organization profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({business_address:l(e[`business-address`],`business-address`,`text`),business_email:l(e[`business-email`],`business-email`,`text`),business_name:l(e[`business-name`],`business-name`,`text`),business_phone:l(e[`business-phone`],`business-phone`,`text`),external_metadata:l(e[`external-metadata`],`external-metadata`,`text`)}):s(e.body)});return}let a=await t(e);if(e.body){let t=s(e.body),r=await i(`Updating`,async()=>a.send(X,{body:t,organization_id:e[`organization-id`]}));n(r,{successLabel:`Updated`});return}e[`business-address`]===void 0&&(e[`business-address`]=await u(`business-address`,`The business_address field`)),e[`business-email`]===void 0&&(e[`business-email`]=await u(`business-email`,`The business_email field`)),e[`business-name`]===void 0&&(e[`business-name`]=await u(`business-name`,`The business_name field`)),e[`business-phone`]===void 0&&(e[`business-phone`]=await u(`business-phone`,`The business_phone field`)),e[`external-metadata`]===void 0&&(e[`external-metadata`]=await u(`external-metadata`,`The external_metadata field`));let o=c({business_address:l(e[`business-address`],`business-address`,`text`),business_email:l(e[`business-email`],`business-email`,`text`),business_name:l(e[`business-name`],`business-name`,`text`),business_phone:l(e[`business-phone`],`business-phone`,`text`),external_metadata:l(e[`external-metadata`],`external-metadata`,`text`)}),d=await i(`Updating`,async()=>a.send(X,{body:o,organization_id:e[`organization-id`]}));n(d,{successLabel:`Updated`})})},ie={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(Y).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ae={method:`GET`,path:t=>e`/organizations/${t.organization_id}/shares`,query:[`status`,`kind`,`target_type`,`resource_types`,`order`,`direction`,`page`,`per_page`]};function oe(e){return e.usage(`$0 organization share list
|
|
70
|
-
|
|
71
|
-
Lists all organization shares.`).option(`organization-id`,{type:`string`,description:`Organization identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,array:!0,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page` is supplied without `per_page`. May be omitted entirely along with `page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`list`,describe:`List organization shares`,builder:oe,handler:async e=>a({command:`organization share list`,classification:{safeFlags:[`status`,`kind`,`target-type`,`order`,`direction`,`dry-run`]}},e,async()=>{let a={status:e.status,kind:e.kind,target_type:e[`target-type`],resource_types:e[`resource-types`],order:e.order,direction:e.direction,page:e.page,per_page:e[`per-page`]};if(e.dryRun){r({command:`cf organization share list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/shares`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await t(e),s=await i(`Loading`,async()=>o.send(ae,{organization_id:e[`organization-id`],...a}));n(s,{successLabel:`Loaded`})})},Q={command:`share`,describe:`Operations for share`,builder:e=>e.command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $={method:`PUT`,path:t=>e`/organizations/${t.organization_id}`,body:`json`};function ce(e){return e.usage(`$0 organization update <organization-id>
|
|
72
|
-
|
|
73
|
-
Update an organization's name.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to modify.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`Organization ID`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new details of the organization. Only accepts updates to "name" currently.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --profile-* flag is set`)}return!0})}const le={command:`update <organization-id>`,describe:`Update organization`,builder:ce,handler:async e=>a({command:`organization update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organization update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:l(e.name,`name`,`text`),parent:{id:l(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:l(e[`profile-business-address`],`profile-business-address`,`text`),business_email:l(e[`profile-business-email`],`profile-business-email`,`text`),business_name:l(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:l(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:l(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):s(e.body)});return}let a=await t(e);if(e.body){let t=s(e.body),r=await i(`Updating`,async()=>a.send($,{body:t,organization_id:e[`organization-id`]}));n(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await u(`name`,`The name field`));let o=c({name:l(e.name,`name`,`text`),parent:{id:l(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:l(e[`profile-business-address`],`profile-business-address`,`text`),business_email:l(e[`profile-business-email`],`profile-business-email`,`text`),business_name:l(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:l(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:l(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}),d=await i(`Updating`,async()=>a.send($,{body:o,organization_id:e[`organization-id`]}));n(d,{successLabel:`Updated`})})},ue={command:`organization`,describe:`organization`,builder:e=>e.command(te).command(b).command(C).command(A).command(le).command(g).command(D).command(K).command(ie).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ue as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{i as e,n as t}from"./auth-D5Yj9eYU.mjs";import{i as n}from"./context-BvLXzoMs.mjs";import{t as r}from"./output-BJEgbI0G.mjs";import{t as i}from"./dry-run-gy0Hl9xo.mjs";import{t as a}from"./progress-B-CVX0kn.mjs";import{t as o}from"./run-BZ6Fj3jQ.mjs";import"./telemetry-BZdRnr26.mjs";import{a as s,n as c,s as l,t as u}from"./body-parser-BKcZS9iJ.mjs";function d(e){return e.usage("$0 precursor get\n\nRetrieve a zone's Precursor configuration: the detection `mode`, whether to `show_interstitial`, and the ordered list of `rules`.").option(`cloudflare-version`,{type:`string`,description:`Selects the split Precursor API schema.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Get Zone Precursor Config`,builder:d,handler:async s=>o({command:`precursor get`,classification:{safeFlags:[`dry-run`]}},s,async()=>{let o={};if(s[`cloudflare-version`]!==void 0&&(o[`Cloudflare-Version`]=String(s[`cloudflare-version`])),s.dryRun){i({command:`cf precursor get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`none`});return}let c=await t(s);s.zoneId=await n({zone:s.zone},c,{quiet:s.quiet});let l=await a(`Loading`,async()=>e(c,`GET`,`/zones/${s.zoneId}/precursor`,{headers:Object.keys(o).length>0?o:void 0}));r(l,{successLabel:`Loaded`})})};function p(e){return e.usage("$0 precursor update\n\nUpdates the Precursor configuration for a zone. `mode` controls whether Precursor detection is off, monitoring, or armed. `show_interstitial` controls the zone-level response when armed. `rules` is the ordered list of overrides for matching requests. This is a partial update: only the fields present in the request body are changed. - Sending an empty array (`[]`) clears all rules. - At least one of `mode`, `show_interstitial`, or `rules` must be present; an empty body (`{}`) is rejected with `400`. - Rule `id` is read-only (assigned by Cloudflare) and ignored on input. - Rule `show_interstitial` is required and controls the response for requests that match that rule. - Rule `expression` is limited to 4000 characters. The limit applies to each rule individually, not to the combined size of all rules.").option(`cloudflare-version`,{type:`string`,description:`Selects the split Precursor API schema.`,demandOption:!0}).option(`rules`,{type:`string`,description:`The ordered list of Precursor rules for the zone. Provide as a JSON array of objects or @path/to/file.json.`}).option(`show-interstitial`,{type:`boolean`,description:`Whether Precursor shows an interstitial when it takes action on a
|
|
3
|
-
request.
|
|
4
|
-
`}).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:`update`,describe:`Update Zone Precursor Config`,builder:p,handler:async d=>o({command:`precursor update`,classification:{safeFlags:[`show-interstitial`,`dry-run`]}},d,async()=>{let o={};if(d[`cloudflare-version`]!==void 0&&(o[`Cloudflare-Version`]=String(d[`cloudflare-version`])),d.dryRun){i({command:`cf precursor update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${d.zone??d.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(d.zone??d[`zone-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({rules:s(d.rules,`rules`),show_interstitial:d[`show-interstitial`],cloudflare_version:d[`cloudflare-version`]}):c(d.body)});return}let f=await t(d);if(d.zoneId=await n({zone:d.zone},f,{quiet:d.quiet}),d.body){let t=c(d.body),n=await a(`Updating`,async()=>e(f,`PUT`,`/zones/${d.zoneId}/precursor`,{body:t,headers:Object.keys(o).length>0?o:void 0}));r(n,{successLabel:`Updated`});return}let p={};d.rules!==void 0&&l(p,[`rules`],s(d.rules,`rules`)),d[`show-interstitial`]!==void 0&&l(p,[`show_interstitial`],d[`show-interstitial`]),d[`cloudflare-version`]!==void 0&&(p.cloudflare_version=d[`cloudflare-version`]);let m=await a(`Updating`,async()=>e(f,`PUT`,`/zones/${d.zoneId}/precursor`,{body:p,headers:Object.keys(o).length>0?o:void 0}));r(m,{successLabel:`Updated`})})},h={command:`precursor`,describe:`Precursor settings for a zone`,builder:e=>e.command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CvzO-cQH.mjs";import{i as n,n as r}from"./auth-D5Yj9eYU.mjs";import{a as i,i as a,t as o}from"./context-BvLXzoMs.mjs";import{t as s}from"./output-BJEgbI0G.mjs";import{t as c}from"./dry-run-gy0Hl9xo.mjs";import{t as l}from"./progress-B-CVX0kn.mjs";import{t as u}from"./run-BZ6Fj3jQ.mjs";import"./telemetry-BZdRnr26.mjs";import{a as d,n as f,s as p,t as m}from"./body-parser-BKcZS9iJ.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{a as g,n as _}from"./prompt-DJF_Rs5S.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
|
-
|
|
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
|
-
|
|
6
|
-
Deletes all versions of an existing account or zone ruleset.`).positional(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).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(`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 S={command:`delete <id>`,describe:`Delete an account or zone ruleset`,builder:x,handler:async e=>u({command:`rulesets delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let u={dry_run:e[`validate-only`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),id:String(e.id??``)},query:u,bodyKind:`none`});return}let d=await r(e),f=e.zone===void 0?`accounts`:`zones`,p=f===`zones`?await a({zone:e.zone},d,{quiet:e.quiet}):e.local?t:await o();if(f===`zones`?e.zoneId=p:e.accountId=p,!await _({force:!!e.force}))return;let m=await l(`Deleting`,async()=>n(d,`DELETE`,`/${f}/${p}/rulesets/${encodeURIComponent(String(e.id))}`,{query:u}));s(m,{successLabel:`Deleted`})})};function C(e){return e.usage(`$0 rulesets entrypoint get <phase>
|
|
7
|
-
|
|
8
|
-
Fetches the latest version of the account or zone entry point ruleset for a given phase.`).positional(`phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <phase>`,describe:`Get an account or zone entry point ruleset`,builder:C,handler:async e=>u({command:`rulesets entrypoint get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets entrypoint get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${e.phase==null?`<phase>`:encodeURIComponent(String(e.phase))}/entrypoint`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),phase:String(e.phase??``)},bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>n(u,`GET`,`/${d}/${f}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint`));s(p,{successLabel:`Loaded`})})};function T(e){return e.usage(`$0 rulesets entrypoint update <phase>
|
|
9
|
-
|
|
10
|
-
Updates an account or zone entry point ruleset, creating a new version.`).positional(`phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).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.`}).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).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 E={command:`update <phase>`,describe:`Update an account or zone entry point ruleset`,builder:T,handler:async e=>u({command:`rulesets entrypoint update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},e,async()=>{let u={dry_run:e[`validate-only`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets entrypoint update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${e.phase==null?`<phase>`:encodeURIComponent(String(e.phase))}/entrypoint`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),phase:String(e.phase??``)},query:u,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`),rules:d(e.rules,`rules`)}):f(e.body)});return}let _=await r(e),v=e.zone===void 0?`accounts`:`zones`,y=v===`zones`?await a({zone:e.zone},_,{quiet:e.quiet}):e.local?t:await o();if(v===`zones`?e.zoneId=y:e.accountId=y,e.body){let t=f(e.body),r=new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i=await l(`Updating`,async()=>n(_,`PUT`,`/${v}/${y}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint${r?`?`+r:``}`,{body:t}));s(i,{successLabel:`Updated`});return}e.id===void 0&&(e.id=await g(`id`,`The unique ID of the ruleset.`));let b={};e.description!==void 0&&p(b,[`description`],h(e.description,`description`,`text`)),e.id!==void 0&&p(b,[`id`],h(e.id,`id`,`text`)),e.name!==void 0&&p(b,[`name`],h(e.name,`name`,`text`)),e.rules!==void 0&&p(b,[`rules`],d(e.rules,`rules`));let x=new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),S=await l(`Updating`,async()=>n(_,`PUT`,`/${v}/${y}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint${x?`?`+x:``}`,{body:b}));s(S,{successLabel:`Updated`})})};function D(e){return e.usage(`$0 rulesets entrypoint versions get <ruleset-version>
|
|
11
|
-
|
|
12
|
-
Fetches a specific version of an account or zone entry point ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <ruleset-version>`,describe:`Get an account or zone entry point ruleset version`,builder:D,handler:async e=>u({command:`rulesets entrypoint versions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets entrypoint versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${e.phase==null?`<phase>`:encodeURIComponent(String(e.phase))}/entrypoint/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),phase:String(e.phase??``),"ruleset-version":String(e[`ruleset-version`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>n(u,`GET`,`/${d}/${f}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint/versions/${encodeURIComponent(String(e[`ruleset-version`]))}`));s(p,{successLabel:`Loaded`})})};function k(e){return e.usage(`$0 rulesets entrypoint versions list
|
|
13
|
-
|
|
14
|
-
Fetches the versions of an account or zone entry point ruleset.`).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List an account or zone entry point ruleset's versions`,builder:k,handler:async e=>u({command:`rulesets entrypoint versions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets entrypoint versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${e.phase==null?`<phase>`:encodeURIComponent(String(e.phase))}/entrypoint/versions`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),phase:String(e.phase??``)},bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>n(u,`GET`,`/${d}/${f}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint/versions`));s(p,{successLabel:`Loaded`})})},j={command:`versions`,describe:`Operations for entrypoint.versions`,builder:e=>e.command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`entrypoint`,describe:`Operations for entrypoint`,builder:e=>e.command(w).command(E).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.usage(`$0 rulesets get <id>
|
|
15
|
-
|
|
16
|
-
Fetches the latest version of an account or zone ruleset.`).positional(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <id>`,describe:`Get an account or zone ruleset`,builder:N,handler:async e=>u({command:`rulesets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),id:String(e.id??``)},bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>n(u,`GET`,`/${d}/${f}/rulesets/${encodeURIComponent(String(e.id))}`));s(p,{successLabel:`Loaded`})})};var F={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets`,query:[`cursor`,`per_page`]};function I(e){return e.usage(`$0 rulesets list
|
|
17
|
-
|
|
18
|
-
Fetches all rulesets.`).option(`cursor`,{type:`string`,description:`The cursor to use for the next page.`}).option(`per-page`,{type:`number`,description:`The number of rulesets to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`List account or zone rulesets`,builder:I,handler:async e=>u({command:`rulesets list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`]};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 list`,method:`GET`,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:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>u.send(F,{account_or_zone:d,account_or_zone_id:f,...n}));s(p,{successLabel:`Loaded`})})};var R={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}/rules`,query:[`dry_run`],body:`json`};function z(e){return e.usage(`$0 rulesets rules create <ruleset-id>
|
|
19
|
-
|
|
20
|
-
Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).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(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const B={command:`create <ruleset-id>`,describe:`Create an account or zone ruleset rule`,builder:z,handler:async e=>u({command:`rulesets rules create`,classification:{safeFlags:[`validate-only`,`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 rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a),"ruleset-id":String(e[`ruleset-id`]??``)},query:n,bodyKind:`json`,body:e.body===void 0?m({position:{before:h(e[`position-before`],`position-before`,`text`),after:h(e[`position-after`],`position-after`,`text`),index:e[`position-index`]}}):f(e.body)});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,p=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();if(d===`zones`?e.zoneId=p:e.accountId=p,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(R,{body:t,account_or_zone:d,account_or_zone_id:p,ruleset_id:e[`ruleset-id`],...n}));s(r,{successLabel:`Created`});return}let g=m({position:{before:h(e[`position-before`],`position-before`,`text`),after:h(e[`position-after`],`position-after`,`text`),index:e[`position-index`]}});new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let _=await l(`Creating`,async()=>u.send(R,{body:g,account_or_zone:d,account_or_zone_id:p,ruleset_id:e[`ruleset-id`],...n}));s(_,{successLabel:`Created`})})};var V={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}/rules/${t.rule_id}`,query:[`dry_run`]};function H(e){return e.usage(`$0 rulesets rules delete <rule-id>
|
|
21
|
-
|
|
22
|
-
Deletes an existing rule from an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).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(`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 ee={command:`delete <rule-id>`,describe:`Delete an account or zone ruleset rule`,builder:H,handler:async e=>u({command:`rulesets rules delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},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 rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a),"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},query:n,bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();if(d===`zones`?e.zoneId=f:e.accountId=f,!await _({force:!!e.force}))return;let p=await l(`Deleting`,async()=>u.send(V,{account_or_zone:d,account_or_zone_id:f,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...n}));s(p,{successLabel:`Deleted`})})};var U={method:`PATCH`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}/rules/${t.rule_id}`,query:[`dry_run`],body:`json`};function W(e){return e.usage(`$0 rulesets rules update <rule-id>
|
|
23
|
-
|
|
24
|
-
Updates an existing rule in an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).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(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const G={command:`update <rule-id>`,describe:`Update an account or zone ruleset rule`,builder:W,handler:async e=>u({command:`rulesets rules update`,classification:{safeFlags:[`validate-only`,`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 rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a),"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},query:n,bodyKind:`json`,body:e.body===void 0?m({position:{before:h(e[`position-before`],`position-before`,`text`),after:h(e[`position-after`],`position-after`,`text`),index:e[`position-index`]}}):f(e.body)});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,p=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();if(d===`zones`?e.zoneId=p:e.accountId=p,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(`Updating`,async()=>u.send(U,{body:t,account_or_zone:d,account_or_zone_id:p,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...n}));s(r,{successLabel:`Updated`});return}let g=m({position:{before:h(e[`position-before`],`position-before`,`text`),after:h(e[`position-after`],`position-after`,`text`),index:e[`position-index`]}});new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let _=await l(`Updating`,async()=>u.send(U,{body:g,account_or_zone:d,account_or_zone_id:p,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...n}));s(_,{successLabel:`Updated`})})},K={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(B).command(ee).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var q={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}`,query:[`dry_run`],body:`json`};function J(e){return e.usage(`$0 rulesets update <ruleset-id>
|
|
25
|
-
|
|
26
|
-
Updates an account or zone ruleset, creating a new version.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).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.`}).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 Y={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:J,handler:async e=>u({command:`rulesets update`,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 update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a),"ruleset-id":String(e[`ruleset-id`]??``)},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(`Updating`,async()=>u.send(q,{body:t,account_or_zone:p,account_or_zone_id:_,ruleset_id:e[`ruleset-id`],...n}));s(r,{successLabel:`Updated`});return}e.id===void 0&&(e.id=await g(`id`,`The unique ID of the ruleset.`));let v=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 y=await l(`Updating`,async()=>u.send(q,{body:v,account_or_zone:p,account_or_zone_id:_,ruleset_id:e[`ruleset-id`],...n}));s(y,{successLabel:`Updated`})})};function X(e){return e.usage(`$0 rulesets versions by-tag get <tag>
|
|
27
|
-
|
|
28
|
-
Fetches the rules of a managed account or zone ruleset version for a given tag.`).positional(`tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <tag>`,describe:`List an account or zone ruleset version's rules by tag`,builder:X,handler:async e=>u({command:`rulesets versions by-tag get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets versions by-tag get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}/by_tag/${e.tag==null?`<tag>`:encodeURIComponent(String(e.tag))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),id:String(e.id??``),"ruleset-version":String(e[`ruleset-version`]??``),tag:String(e.tag??``)},bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>n(u,`GET`,`/${d}/${f}/rulesets/${encodeURIComponent(String(e.id))}/versions/${encodeURIComponent(String(e[`ruleset-version`]))}/by_tag/${encodeURIComponent(String(e.tag))}`));s(p,{successLabel:`Loaded`})})},Q={command:`by-tag`,describe:`Operations for versions.by-tag`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.usage(`$0 rulesets versions delete <ruleset-version>
|
|
29
|
-
|
|
30
|
-
Deletes an existing version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).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(`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 te={command:`delete <ruleset-version>`,describe:`Delete an account or zone ruleset version`,builder:$,handler:async e=>u({command:`rulesets versions delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let u={dry_run:e[`validate-only`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),id:String(e.id??``),"ruleset-version":String(e[`ruleset-version`]??``)},query:u,bodyKind:`none`});return}let d=await r(e),f=e.zone===void 0?`accounts`:`zones`,p=f===`zones`?await a({zone:e.zone},d,{quiet:e.quiet}):e.local?t:await o();if(f===`zones`?e.zoneId=p:e.accountId=p,!await _({force:!!e.force}))return;let m=await l(`Deleting`,async()=>n(d,`DELETE`,`/${f}/${p}/rulesets/${encodeURIComponent(String(e.id))}/versions/${encodeURIComponent(String(e[`ruleset-version`]))}`,{query:u}));s(m,{successLabel:`Deleted`})})};function ne(e){return e.usage(`$0 rulesets versions get <ruleset-version>
|
|
31
|
-
|
|
32
|
-
Fetches a specific version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <ruleset-version>`,describe:`Get an account or zone ruleset version`,builder:ne,handler:async e=>u({command:`rulesets versions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),id:String(e.id??``),"ruleset-version":String(e[`ruleset-version`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>n(u,`GET`,`/${d}/${f}/rulesets/${encodeURIComponent(String(e.id))}/versions/${encodeURIComponent(String(e[`ruleset-version`]))}`));s(p,{successLabel:`Loaded`})})};function ie(e){return e.usage(`$0 rulesets versions list
|
|
33
|
-
|
|
34
|
-
Fetches the versions of an account or zone ruleset.`).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`List an account or zone ruleset's versions`,builder:ie,handler:async e=>u({command:`rulesets versions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),id:String(e.id??``)},bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>n(u,`GET`,`/${d}/${f}/rulesets/${encodeURIComponent(String(e.id))}/versions`));s(p,{successLabel:`Loaded`})})},oe={command:`versions`,describe:`Operations for versions`,builder:e=>e.command(te).command(re).command(ae).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},se={command:`rulesets`,describe:`rulesets`,builder:e=>e.command(b).command(S).command(P).command(L).command(Y).command(M).command(K).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{se as default};
|
package/dist/run-D4-K_cbQ.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./theme-BGHWSKCw.mjs";import{s as t}from"./body-parser-BKcZS9iJ.mjs";import{n}from"./input-validation-D7z60HJH.mjs";import{o as r}from"./prompt-DJF_Rs5S.mjs";import{isDeepStrictEqual as i}from"node:util";const a=/* @__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 o(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 s(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=>a.has(e)||e.startsWith(`x-`))&&o(e).every(e=>s(e,t))}function c(e){return s(e,/* @__PURE__ */ new WeakSet)}function l(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 u(e){let t=e.path.at(-1)??e.name,n=r(e.schema.title?.trim()||l(t)),i=e.description?r(e.description.trim()):void 0;return!i||i.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${i}`}function d(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const f=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);function p(e){return e.every(e=>!f.has(e))}function m(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function h(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function g(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 _(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 v(e){let t=y(e);if(t.length>1){let e=new Set(t.map(v));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 v(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(_));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&g(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 y(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function b(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 x(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>i(e,t)))}function S(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>C(e,t))]),r=n[0];return n.length>0&&n.every(e=>i(e,r))?r:void 0}function C(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>C(e,t))]}function ee(e,t){return{type:b(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:x(e.enum,t.enum),const:S(`const`,[e,t]),default:S(`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 w(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=w(s);r=b(r,e.type),i??=e.title,a??=e.description,o=x(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:ee(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:S(`const`,[e]),default:S(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function T(e){return{...e,oneOf:void 0,anyOf:void 0}}function E(e){return(e.allOf??[]).flatMap(e=>[e,...E(e)])}function D(e){return[e,...E(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function O(e){return Object.keys(w(T(e)).properties??{}).length>0||D(e).some(e=>e.some(O))}function k(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A(e){let t=w(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=>k(e))||D(e).some(e=>e.every(A))?!0:e.allOf?.some(A)??!1:k(t.const)}function j(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 i of t)n.push({value:i,label:t.length===1&&e.title?r(e.title):void 0})}return n}function te(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})):j(e)}function M(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 i of t){let t=W(i),a=e.title?r(e.title):void 0;n.push(a?`${t} (${a})`:t)}else if(e.pattern&&v(e)===`string`){let t=r(e.pattern),i=e.title?r(e.title):void 0;n.push(i?`${t} (${i})`:t)}else return}return n.length>0?n:void 0}function N(e,t,n,r,i){if(!p(e))return;let a=i??v(t);if(a===void 0)return;let o=a===`json`?void 0:te(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(d).join(`-`);if(![`mode`,`temporary-account`,`event-code`].includes(l))return{name:l,path:e,type:a,required:n,requiredWhen:r,description:t.description?.split(`
|
|
3
|
-
`)[0]??t.title,choices:s?.length?s:void 0,choiceLabels:Object.keys(c).length>0?c:void 0,schema:t}}function ne(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 re(e,t){let n=ne(e.type,t.type),r=e.schema.description??t.schema.description,a=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:F(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:a,requiredIf:i(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function P(e,t={}){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=/* @__PURE__ */ new Map,a=/* @__PURE__ */ new Set,o=(e,t,n)=>{let i=r.get(e);n?a.has(e)||r.set(e,i===void 0?t:re(i,t)):(a.add(e),r.set(e,t))},s=(e,t,s)=>{for(let c of[e,...E(e)]){let l=c.if,u=c.then?w(c.then):void 0,d=u?.required;if(!l||!d?.length)continue;let f=Object.keys(l),h=l.type===void 0?void 0:Array.isArray(l.type)?l.type:[l.type];if(f.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||h!==void 0&&!h.includes(`object`))continue;let g=new Set(l.required??[]),_=l.properties??{};if(Object.keys(_).some(e=>!g.has(e)))continue;let v=[],y=!0;for(let e of g){if(!p([...t,e])){y=!1;break}let n=m(_,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){y=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>i(e,n.const))),n.type!==void 0){if(r===void 0){y=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>J(e,t)))}}v.push({path:[...t,e],values:r})}if(y&&v.length!==0)for(let c of d){let l=[...t,c].join(`.`);if(n.has(l))continue;let d={predicates:v},f=r.get(l),p=s&&m(e.properties,c)===void 0&&!a.has(l);if(!f||p){let e=m(u?.properties,c),n=e===void 0?void 0:N([...t,c],w(e),!1);n&&(o(l,n,s),f=r.get(l))}!s&&f&&!f.requiredIf?.some(e=>i(e,d))&&(f.requiredIf=[...f.requiredIf??[],d])}}},c=(e,t,i,a=!1)=>{let l=w(T(e));if(l.properties){let e=new Set(l.required??[]);for(let[s,u]of Object.entries(l.properties)){let l=[...t,s],d=l.join(`.`);if(!p(l)||n.has(d))continue;let f=w(u),m=O(u),h=m&&A(u),g=!a&&e.has(s),_=g&&i===void 0,v=g&&i!==void 0?i:void 0;if(h){c(u,l,g?i:l,a);let e=[...r.values()].some(e=>e.required===_&&F(e.requiredWhen,v)&&e.path.length>l.length&&l.every((t,n)=>e.path[n]===t));if(g&&!e){let e=N(l,u,_,v);e&&o(d,{...e,requiredContainer:!0},a)}continue}let y=N(l,f,_,v,m?`json`:void 0);y&&o(d,y,a)}}for(let n of D(e))for(let e of n)c(e,t,i,!0);for(let n of[e,...E(e)])n.if&&n.then&&c(n.then,t,i,!0);s(l,t,a)};return c(e,[]),[...r.values()].sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function F(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function ie(t,n){if(t.length===0)return`${e.brand(r(n))}\n (no input fields)`;let i=process.stdout.columns??80,a=t.map(e=>`--${r(e.name)}`),o=Math.min(Math.max(...a.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 --${r(e.requiredWhen.map(d).join(`-`))}-*]`),e.requiredIf&&n.push(`[conditionally required]`),e.choices&&n.push(`[choices: ${e.choices.map(t=>{let n=r(t),i=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return i?`${r(i)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&n.push(`[must be: ${r(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&n.push(`[default: ${r(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=n.join(` `),c=Math.max(i-o-4,20)-s.length-1,l=e.description===void 0?void 0:r(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,f=a[t]??``;return` ${f.length<o?f.padEnd(o):`${f} `}${[u,s].filter(Boolean).join(` `)}`});return[e.brand(r(n)),...s].join(`
|
|
4
|
-
`)}const ae=`_ $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 I(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=h(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function oe(e,t,n){return e.filter(r=>{let i=n!==void 0&&R(n,r.path).found;return z(r,e,t,n)&&I(r,t)===void 0&&!i&&!B(r.path,e,t)&&!(r.requiredContainer&&V(r,e,t))})}function L(e,t){let n=e=>R(t,e);return e.filter(e=>se(e,n)&&!n(e.path).found)}function R(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 se(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=>i(r.value,e)))}))??!1)}function z(e,t,n,r){return e.required||e.requiredWhen!==void 0&&(B(e.requiredWhen,t,n)||r!==void 0&&R(r,e.requiredWhen).found)||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:a})=>{let o=ce(e,t,n),s=o.found||r===void 0?o:R(r,e),c=!o.found||o.descriptor===void 0||!F(o.descriptor.path,e)?s.value:G(o.descriptor,s.value,[]);return s.found&&(a===void 0||a.some(e=>i(c,e)))}))??!1)}function ce(e,t,n){for(let r of t){let t=I(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 B(e,t,n){return t.some(t=>{let r=I(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 V(e,t,n){return t.some(t=>t!==e&&t.path.length>e.path.length&&e.path.every((e,n)=>t.path[n]===e)&&I(t,n)!==void 0)}function H(e){return e.flatMap(e=>[e.name,h(e.name)])}function U(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function W(e){return r(U(e))}function G(e,t,i){let a=n=>{i.push(`--${r(e.name)} expects ${n} (got '${W(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(U(t)),r=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?r.includes(`integer`)&&!r.includes(`number`)&&!Number.isInteger(n)?a(`an integer`):n:a(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`||t!==`false`&&a(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return a(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:a(`a JSON ${e.type}`)}case`json`:{let r=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];if(r.length===1&&r[0]===`null`)return t===null||t===`null`?null:a(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return n(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:a(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return n(t,e.name,`text`);default:{let r=Array.isArray(t)?t[t.length-1]:t;return typeof r==`boolean`?a(`a string`):typeof r==`string`?n(r,e.name,`text`):U(r)}}}function K(e){return Array.from(e).length}function q(e,t,n){let a=r(e.name),{const:o,pattern:s,minLength:c,maxLength:l,minimum:u,maximum:d,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(o!==void 0&&!i(t,o)){n.push(`--${a} must be ${r(JSON.stringify(o)??`undefined`)}`);return}let m=e.schema.enum??j(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>i(t,e)))n.push(`--${a} must be one of: ${m.map(W).join(`, `)}`);else{if(typeof t==`string`){let e=K(t);s!==void 0&&!new RegExp(s).test(t)&&n.push(`--${a} does not match the required format (${r(s)})`),c!==void 0&&e<c&&n.push(`--${a} must be at least ${c} characters`),l!==void 0&&e>l&&n.push(`--${a} must be at most ${l} characters`)}typeof t==`number`&&(u!==void 0&&(f===!0?t<=u:t<u)&&n.push(f===!0?`--${a} must be greater than ${u}`:`--${a} must be at least ${u}`),d!==void 0&&(p===!0?t>=d:t>d)&&n.push(p===!0?`--${a} must be less than ${d}`:`--${a} must be at most ${d}`),typeof f==`number`&&t<=f&&n.push(`--${a} must be greater than ${f}`),typeof p==`number`&&t>=p&&n.push(`--${a} must be less than ${p}`))}}function le(e,t){let n=[],i=G(e,t,n);if(i===void 0||(q(e,i,n),n.length>0))return n[0];let a=Z(e.schema,i);return a.length>0?`--${r(e.name)} ${a[0]?.replace(/^the request body /,``)}`:void 0}function J(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 ue(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=>r(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n){let a=[],o=Y(n),s=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(s.length>0&&!s.some(e=>J(e,t)))return[`${o} must be ${ue(s)}`];if(e.const!==void 0&&!i(t,e.const))return[`${o} must be ${r(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>i(t,e)))return[`${o} must be one of: ${e.enum.map(W).join(`, `)}`];if(e.oneOf?.length&&e.oneOf.filter(e=>X(e,t,n).length===0).length!==1){let t=M(e);return[t?`${o} must be one of: ${t.join(`, `)}`:`${o} must match exactly one allowed shape`]}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n).length===0)){let t=M(e);return[t?`${o} must be one of: ${t.join(`, `)}`:`${o} must match an allowed shape`]}for(let r of e.allOf??[])a.push(...X(r,t,n));if(e.if&&X(e.if,t,n).length===0&&e.then&&a.push(...X(e.then,t,n)),typeof t==`string`){let n=K(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&a.push(`${o} does not match the required format (${r(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&a.push(`${o} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&a.push(`${o} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&a.push(e.exclusiveMinimum===!0?`${o} must be greater than ${e.minimum}`:`${o} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&a.push(e.exclusiveMaximum===!0?`${o} must be less than ${e.maximum}`:`${o} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&a.push(`${o} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&a.push(`${o} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&a.push(`${o} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)){if(e.minItems!==void 0&&t.length<e.minItems&&a.push(`${o} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&a.push(`${o} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>i(e,t)))&&a.push(`${o} must contain unique items`),e.items&&!Array.isArray(e.items))for(let[r,i]of t.entries())a.push(...X(e.items,i,[...n,String(r)]));else if(Array.isArray(e.items))for(let[r,i]of e.items.entries())r<t.length&&a.push(...X(i,t[r],[...n,String(r)]))}if(typeof t==`object`&&t&&!Array.isArray(t)){let r=t,i=e.properties??{};for(let t of e.required??[])Object.hasOwn(r,t)||a.push(`${Y([...n,t])} is required`);for(let[t,o]of Object.entries(r)){let r=Object.hasOwn(i,t)?i[t]:void 0;r?a.push(...X(r,o,[...n,t])):e.additionalProperties===!1?a.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&a.push(...X(e.additionalProperties,o,[...n,t]))}let s=Object.keys(r).length;e.minProperties!==void 0&&s<e.minProperties&&a.push(`${o} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&s>e.maxProperties&&a.push(`${o} must contain at most ${e.maxProperties} properties`)}return a}function Z(e,t){return[...new Set(X(e,t,[]))]}const de=[`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=>a.has(e)||e.startsWith(`x-`));for(let t of de){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 o=(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):o.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&&o.push({if:t.schema,then:n.schema})}return o.length>0&&(r.allOf=o),{schema:r,exact:i}}function fe(e,t){return Z(Q(e).schema,t)}function pe(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([...ae,...t]),r=/* @__PURE__ */ new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(d(t))&&r.set(d(t),t);return[...r.values()].sort()}function me(e,n,i={}){let a=[],o=i.baseBody!==void 0,s=i.baseBody===void 0?{}:structuredClone(i.baseBody),c=e.filter(({path:e})=>p(e)),l=[...i.reserved??[],...H(c)];for(let e of c){let i=I(e,n);if(i===void 0){!o&&z(e,c,n)&&!B(e.path,c,n)&&!(e.requiredContainer&&V(e,c,n))&&a.push(`--${r(e.name)} is required`);continue}let l=G(e,i,a);l!==void 0&&(q(e,l,a),o?pe(s,e.path,l):t(s,e.path,l))}if(o)for(let e of L(c,s))I(e,n)===void 0&&a.push(`--${r(e.name)} is required`);for(let e of $(n,l))a.push(`Unknown flag --${r(e)}`);return{body:s,errors:a}}export{L as a,P as c,Z as d,fe as f,oe as i,$ as l,H as n,ie as o,c as r,u as s,me as t,le as u};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CvzO-cQH.mjs";import{n}from"./auth-D5Yj9eYU.mjs";import{a as r,i,t as a}from"./context-BvLXzoMs.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-B-CVX0kn.mjs";import{t as l}from"./run-BZ6Fj3jQ.mjs";import"./telemetry-BZdRnr26.mjs";import{n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p,t as m}from"./raw-fetch-BrOxDN9k.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
|
-
|
|
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
|
-
|
|
6
|
-
Lists audit log entries for all Security Center insights in the account or zone, showing changes to insight status and classification.`).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 ne={command:`list`,describe:`Retrieves account or zone Audit Log`,builder:te,handler:async e=>l({command:`security-insights audit-logs list`,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 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/audit-log`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},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(_,{account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})},re={command:`audit-logs`,describe:`Operations for audit-logs`,builder:e=>e.command(ee).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var v={method:`PATCH`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/${t.issue_id}/classification`,body:`json`};function y(e){return e.usage(`$0 security-insights classify <issue-id>
|
|
7
|
-
|
|
8
|
-
Updates the user classification for a Security Center insight. Valid values are 'false_positive' or 'accept_risk'. To reset, set classification to null. Cannot change directly between classification values - must reset to null first.`).positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`classification`,{type:`string`,description:`User-defined classification for the insight. Can be 'false_positive', 'accept_risk', 'other', or null.`,choices:[`false_positive`,`accept_risk`,`other`]}).coerce(`classification`,e=>f(e,`classification`,`text`)).option(`rationale`,{type:`string`,description:`Rationale for the classification change. Required when classification is 'accept_risk' or 'other'.`}).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:`classify <issue-id>`,describe:`Updates Security Center Insight Classification`,builder:y,handler:async e=>l({command:`security-insights classify`,classification:{safeFlags:[`classification`,`dry-run`]}},e,async()=>{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 classify`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/classification`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),"issue-id":String(e[`issue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({classification:e.classification,rationale:f(e.rationale,`rationale`,`text`)}):u(e.body)});return}let l=await n(e),p=e.zone===void 0?`accounts`:`zones`,m=p===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();if(p===`zones`?e.zoneId=m:e.accountId=m,e.body){let t=u(e.body),n=await c(`Updating`,async()=>l.send(v,{body:t,account_or_zone:p,account_or_zone_id:m,issue_id:e[`issue-id`]}));o(n,{successLabel:`Updated`});return}let h=d({classification:e.classification,rationale:f(e.rationale,`rationale`,`text`)}),g=await c(`Updating`,async()=>l.send(v,{body:h,account_or_zone:p,account_or_zone_id:m,issue_id:e[`issue-id`]}));o(g,{successLabel:`Updated`})})};var x={method:`GET`,path:t=>e`/accounts/${t.account_id}/security-center/insights/${t.issue_id}/context`};function S(e){return e.usage(`$0 security-insights context get <issue-id>
|
|
9
|
-
|
|
10
|
-
Returns the full context payload for an insight. This endpoint is used for insights with large payloads that are not included inline in the list response.`).positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <issue-id>`,describe:`Retrieves Security Center Insight Context`,builder:S,handler:async e=>l({command:`security-insights context get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf security-insights context get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/security-center/insights/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/context`,pathParams:{"issue-id":String(e[`issue-id`]??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(x,{account_id:l,issue_id:e[`issue-id`]}));o(u,{successLabel:`Loaded`})})},w={command:`context`,describe:`Operations for context`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var T={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/class`,query:[`dismissed`,`issue_class`,`issue_type`,`product`,`source`,`severity`,`subject`,`issue_class~neq`,`issue_type~neq`,`product~neq`,`severity~neq`,`subject~neq`]};function E(e){return e.usage(`$0 security-insights count by-class
|
|
11
|
-
|
|
12
|
-
Retrieves Security Center insight counts aggregated by classification class.`).option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,array:!0,description:`Issue class`}).option(`issue-type`,{type:`string`,array:!0,description:`Issue type`}).option(`product`,{type:`string`,array:!0,description:`Product`}).option(`source`,{type:`string`,array:!0,description:`Source`}).option(`severity`,{type:`string`,array:!0,description:`Severity`}).option(`subject`,{type:`string`,array:!0,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`by-class`,describe:`Retrieves Security Center Insight Counts by Class`,builder:E,handler:async e=>l({command:`security-insights count by-class`,classification:{safeFlags:[`dismissed`,`dry-run`]}},e,async()=>{let l={dismissed:e.dismissed,issue_class:e[`issue-class`],issue_type:e[`issue-type`],product:e.product,source:e.source,severity:e.severity,subject:e.subject};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 count by-class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/class`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},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(T,{account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})};var O={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/partner-count`,query:[`source`]};function k(e){return e.usage(`$0 security-insights count by-partner
|
|
13
|
-
|
|
14
|
-
Retrieves the uncapped count of active, non-dismissed, unclassified RiskRecon insights for the account or zone.`).option(`source`,{type:`string`,description:`Source`,choices:[`riskrecon`],demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`by-partner`,describe:`Retrieves a Partner Security Center Insight Count`,builder:k,handler:async e=>l({command:`security-insights count by-partner`,classification:{safeFlags:[`source`,`dry-run`]}},e,async()=>{let l={source:e.source};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 count by-partner`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/partner-count`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},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(O,{account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})};var j={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/severity`,query:[`dismissed`,`issue_class`,`issue_type`,`product`,`source`,`severity`,`subject`,`issue_class~neq`,`issue_type~neq`,`product~neq`,`severity~neq`,`subject~neq`]};function M(e){return e.usage(`$0 security-insights count by-severity
|
|
15
|
-
|
|
16
|
-
Retrieves Security Center insight counts aggregated by severity level (critical, high, medium, low).`).option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,array:!0,description:`Issue class`}).option(`issue-type`,{type:`string`,array:!0,description:`Issue type`}).option(`product`,{type:`string`,array:!0,description:`Product`}).option(`source`,{type:`string`,array:!0,description:`Source`}).option(`severity`,{type:`string`,array:!0,description:`Severity`}).option(`subject`,{type:`string`,array:!0,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`by-severity`,describe:`Retrieves Security Center Insight Counts by Severity`,builder:M,handler:async e=>l({command:`security-insights count by-severity`,classification:{safeFlags:[`dismissed`,`dry-run`]}},e,async()=>{let l={dismissed:e.dismissed,issue_class:e[`issue-class`],issue_type:e[`issue-type`],product:e.product,source:e.source,severity:e.severity,subject:e.subject};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 count by-severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/severity`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},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(j,{account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})};var P={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/type`,query:[`dismissed`,`issue_class`,`issue_type`,`product`,`source`,`severity`,`subject`,`issue_class~neq`,`issue_type~neq`,`product~neq`,`severity~neq`,`subject~neq`]};function F(e){return e.usage(`$0 security-insights count by-type
|
|
17
|
-
|
|
18
|
-
Retrieves Security Center insight counts aggregated by insight type.`).option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,array:!0,description:`Issue class`}).option(`issue-type`,{type:`string`,array:!0,description:`Issue type`}).option(`product`,{type:`string`,array:!0,description:`Product`}).option(`source`,{type:`string`,array:!0,description:`Source`}).option(`severity`,{type:`string`,array:!0,description:`Severity`}).option(`subject`,{type:`string`,array:!0,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`by-type`,describe:`Retrieves Security Center Insight Counts by Type`,builder:F,handler:async e=>l({command:`security-insights count by-type`,classification:{safeFlags:[`dismissed`,`dry-run`]}},e,async()=>{let l={dismissed:e.dismissed,issue_class:e[`issue-class`],issue_type:e[`issue-type`],product:e.product,source:e.source,severity:e.severity,subject:e.subject};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 count by-type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/type`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},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(P,{account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})},L={command:`count`,describe:`Operations for count`,builder:e=>e.command(D).command(A).command(N).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var R={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/${t.issue_id}/dismiss`,body:`json`};function z(e){return e.usage(`$0 security-insights dismiss <issue-id>
|
|
19
|
-
|
|
20
|
-
Archives a Security Center insight for an account or zone, removing it from the active insights list while preserving historical data.`).positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss field`}).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:`dismiss <issue-id>`,describe:`Archives Security Center Insight`,builder:z,handler:async e=>l({command:`security-insights dismiss`,classification:{safeFlags:[`dismiss`,`dry-run`]}},e,async()=>{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 dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/dismiss`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i),"issue-id":String(e[`issue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({dismiss:e.dismiss}):u(e.body)});return}let l=await n(e),f=e.zone===void 0?`accounts`:`zones`,p=f===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();if(f===`zones`?e.zoneId=p:e.accountId=p,e.body){let t=u(e.body),n=await c(`Updating`,async()=>l.send(R,{body:t,account_or_zone:f,account_or_zone_id:p,issue_id:e[`issue-id`]}));o(n,{successLabel:`Updated`});return}let m=d({dismiss:e.dismiss}),h=await c(`Updating`,async()=>l.send(R,{body:m,account_or_zone:f,account_or_zone_id:p,issue_id:e[`issue-id`]}));o(h,{successLabel:`Updated`})})};var V={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights`,query:[`dismissed`,`issue_class`,`issue_type`,`product`,`source`,`severity`,`subject`,`issue_class~neq`,`issue_type~neq`,`product~neq`,`severity~neq`,`subject~neq`,`page`,`per_page`]};function H(e){return e.usage(`$0 security-insights list
|
|
21
|
-
|
|
22
|
-
Lists all Security Center insights for the account or zone, showing security findings and recommendations.`).option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,array:!0,description:`Issue class`}).option(`issue-type`,{type:`string`,array:!0,description:`Issue type`}).option(`product`,{type:`string`,array:!0,description:`Product`}).option(`source`,{type:`string`,array:!0,description:`Source`}).option(`severity`,{type:`string`,array:!0,description:`Severity`}).option(`subject`,{type:`string`,array:!0,description:`Subject`}).option(`page`,{type:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Retrieves Security Center Insights`,builder:H,handler:async e=>l({command:`security-insights list`,classification:{safeFlags:[`dismissed`,`dry-run`]}},e,async()=>{let l={dismissed:e.dismissed,issue_class:e[`issue-class`],issue_type:e[`issue-type`],product:e.product,source:e.source,severity:e.severity,subject:e.subject,page:e.page,per_page:e[`per-page`]};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 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},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(V,{account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})};var W={method:`GET`,path:t=>e`/accounts/${t.account_id}/security-center/partners/${t.partner}/settings`};function G(e){return e.usage(`$0 security-insights partners settings get <partner>
|
|
23
|
-
|
|
24
|
-
Returns whether the account has enabled the selected partner integration and, if enabled, whether the account has been matched with the partner. An integration that has not been configured is returned as disabled.`).positional(`partner`,{type:`string`,description:`The partner integration identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <partner>`,describe:`Retrieves Partner Integration Settings`,builder:G,handler:async e=>l({command:`security-insights partners settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf security-insights partners settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/security-center/partners/${e.partner==null?`<partner>`:encodeURIComponent(String(e.partner))}/settings`,pathParams:{partner:String(e.partner??``)},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(W,{account_id:l,partner:e.partner}));o(u,{successLabel:`Loaded`})})};var q={method:`POST`,path:t=>e`/accounts/${t.account_id}/security-center/partners/${t.partner}/settings`,body:`json`};function J(e){return e.usage(`$0 security-insights partners settings update <partner>
|
|
25
|
-
|
|
26
|
-
Enables or disables the selected partner integration for the account. Enabling the integration for the first time also schedules an account scan for that partner.`).positional(`partner`,{type:`string`,description:`The partner integration identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether the partner integration is enabled for the account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`update <partner>`,describe:`Updates Partner Integration Settings`,builder:J,handler:async e=>l({command:`security-insights partners settings update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf security-insights partners settings update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/security-center/partners/${e.partner==null?`<partner>`:encodeURIComponent(String(e.partner))}/settings`,pathParams:{partner:String(e.partner??``)},bodyKind:`json`,body:e.body===void 0?d({enabled:e.enabled}):u(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=u(e.body),n=await c(`Creating`,async()=>i.send(q,{body:t,account_id:l,partner:e.partner}));o(n,{successLabel:`Created`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let f=d({enabled:e.enabled}),p=await c(`Creating`,async()=>i.send(q,{body:f,account_id:l,partner:e.partner}));o(p,{successLabel:`Created`})})},X={command:`settings`,describe:`Operations for partners.settings`,builder:e=>e.command(K).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.usage(`$0 security-insights partners shadow-hosts list
|
|
27
|
-
|
|
28
|
-
Lists partner-discovered hosts beneath the zone that are not in the account.`).option(`partner`,{type:`string`,description:`The partner integration identifier.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number for premium partner asset results.`}).option(`per-page`,{type:`number`,description:`Number of premium partner asset results per page. Values other than 1 must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Lists Partner-Discovered Shadow Hosts for a Zone`,builder:ie,handler:async e=>l({command:`security-insights partners shadow-hosts list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){s({command:`cf security-insights partners shadow-hosts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/partners/${e.partner==null?`<partner>`:encodeURIComponent(String(e.partner))}/shadow-hosts`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),partner:String(e.partner??``)},query:t,bodyKind:`none`});return}let r=await n(e);e.zoneId=await i({zone:e.zone},r,{quiet:e.quiet});let a=new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),o=await c(`Loading`,async()=>m(`/zones/${e.zoneId}/security-center/partners/${encodeURIComponent(String(e.partner))}/shadow-hosts${a?`?`+a:``}`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));p(o.toString(`utf-8`))})},oe={command:`shadow-hosts`,describe:`Operations for partners.shadow-hosts`,builder:e=>e.command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.usage(`$0 security-insights partners shadow-zone-hosts list
|
|
29
|
-
|
|
30
|
-
Lists hosts discovered beneath a shadow-zone domain. This endpoint is available only to premium accounts and supports JSON and CSV output.`).option(`partner`,{type:`string`,description:`The partner integration identifier.`,demandOption:!0}).option(`domain`,{type:`string`,description:`The shadow-zone domain.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number for premium partner asset results.`}).option(`per-page`,{type:`number`,description:`Number of premium partner asset results per page. Values other than 1 must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`list`,describe:`Lists Hosts in a Partner-Discovered Shadow Zone`,builder:se,handler:async e=>l({command:`security-insights partners shadow-zone-hosts list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await r();s({command:`cf security-insights partners shadow-zone-hosts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/security-center/partners/${e.partner==null?`<partner>`:encodeURIComponent(String(e.partner))}/shadow-zones/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}/hosts`,pathParams:{partner:String(e.partner??``),domain:String(e.domain??``)},query:i,bodyKind:`none`});return}await n(e);let o=e.local?t:await a();e.accountId=o;let l=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await c(`Loading`,async()=>m(`/accounts/${o}/security-center/partners/${encodeURIComponent(String(e.partner))}/shadow-zones/${encodeURIComponent(String(e.domain))}/hosts${l?`?`+l:``}`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));p(u.toString(`utf-8`))})},le={command:`shadow-zone-hosts`,describe:`Operations for partners.shadow-zone-hosts`,builder:e=>e.command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.usage(`$0 security-insights partners shadow-zones list
|
|
31
|
-
|
|
32
|
-
Lists domains discovered by the selected partner that are not in the account. Baseline accounts receive the total count only; premium accounts receive paginated items and may request CSV output.`).option(`partner`,{type:`string`,description:`The partner integration identifier.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number for premium partner asset results.`}).option(`per-page`,{type:`number`,description:`Number of premium partner asset results per page. Values other than 1 must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`list`,describe:`Lists Partner-Discovered Shadow Zones`,builder:ue,handler:async e=>l({command:`security-insights partners shadow-zones list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await r();s({command:`cf security-insights partners shadow-zones list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/security-center/partners/${e.partner==null?`<partner>`:encodeURIComponent(String(e.partner))}/shadow-zones`,pathParams:{partner:String(e.partner??``)},query:i,bodyKind:`none`});return}await n(e);let o=e.local?t:await a();e.accountId=o;let l=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await c(`Loading`,async()=>m(`/accounts/${o}/security-center/partners/${encodeURIComponent(String(e.partner))}/shadow-zones${l?`?`+l:``}`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));p(u.toString(`utf-8`))})},fe={command:`shadow-zones`,describe:`Operations for partners.shadow-zones`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},pe={command:`partners`,describe:`Operations for partners`,builder:e=>e.command(X).command(oe).command(le).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var me={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/scans`};function he(e){return e.usage(`$0 security-insights scans list
|
|
33
|
-
|
|
34
|
-
Returns the most recent on-demand scans for the account or zone, up to a maximum of 5. Each scan includes its ID, start time, and current status. This includes both account or zone-wide and zone-scoped scans. Also returns quota information showing how many scans have been used and how many remain in the current 24-hour window.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`list`,describe:`Get Recent account or zone Scans`,builder:he,handler:async e=>l({command:`security-insights scans list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{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 scans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/scans`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();u===`zones`?e.zoneId=d:e.accountId=d;let f=await c(`Loading`,async()=>l.send(me,{account_or_zone:u,account_or_zone_id:d}));o(f,{successLabel:`Loaded`})})};var Z={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/security-center/insights/scans`,body:`json`};function _e(e){return e.usage(`$0 security-insights scans start
|
|
35
|
-
|
|
36
|
-
Initiates an on-demand security scan for the entire account or zone, scanning all zones associated with the account or zone. Rate limited to 5 scans per account or zone per 24-hour window.`).option(`issue-type`,{type:`string`,description:`The issue_type field`,choices:[`compliance_violation`,`email_security`,`exposed_infrastructure`,`insecure_configuration`,`weak_authentication`,`configuration_suggestion`]}).coerce(`issue-type`,e=>f(e,`issue-type`,`text`)).option(`issue-class`,{type:`string`,description:`The issue_class field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for starting an on-demand scan. Specify issue_type or issue_class to scope the scan, or provide an empty object to scan all issue types.`}).conflicts(`issue-type`,[`issue-class`]).conflicts(`issue-class`,[`issue-type`])}const ve={command:`start`,describe:`Start On-Demand account or zone Scan`,builder:_e,handler:async e=>l({command:`security-insights scans start`,classification:{safeFlags:[`issue-type`,`dry-run`]}},e,async()=>{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 scans start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/security-center/insights/scans`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:e.body===void 0?d({issue_type:e[`issue-type`],issue_class:f(e[`issue-class`],`issue-class`,`text`)}):u(e.body)});return}let l=await n(e),p=e.zone===void 0?`accounts`:`zones`,m=p===`zones`?await i({zone:e.zone},l,{quiet:e.quiet}):e.local?t:await a();if(p===`zones`?e.zoneId=m:e.accountId=m,e.body){let t=u(e.body),n=await c(`Creating`,async()=>l.send(Z,{body:t,account_or_zone:p,account_or_zone_id:m}));o(n,{successLabel:`Created`});return}let h=d({issue_type:e[`issue-type`],issue_class:f(e[`issue-class`],`issue-class`,`text`)}),g=await c(`Creating`,async()=>l.send(Z,{body:h,account_or_zone:p,account_or_zone_id:m}));o(g,{successLabel:`Created`})})},ye={command:`scans`,describe:`Operations for scans`,builder:e=>e.command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var be={method:`GET`,path:t=>e`/accounts/${t.account_id}/security-center/state`};function xe(e){return e.usage(`$0 security-insights state get
|
|
37
|
-
|
|
38
|
-
Returns account-level Security Center state: whether scans are enabled for the account and whether the account was recently reactivated from a dormant state.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get`,describe:`Retrieves Account State`,builder:xe,handler:async e=>l({command:`security-insights state get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();s({command:`cf security-insights state get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/security-center/state`,pathParams:{},bodyKind:`none`});return}let i=await n(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(be,{account_id:l}));o(u,{successLabel:`Loaded`})})};var $={method:`PUT`,path:t=>e`/accounts/${t.account_id}/security-center/state`,body:`json`};function Se(e){return e.usage(`$0 security-insights state update
|
|
39
|
-
|
|
40
|
-
Updates account-level Security Center state. Currently supports enabling or disabling scans for the account. Returns the account's state after the update.`).option(`scans-enabled`,{type:`boolean`,description:`Enable or disable scans for the account.`}).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 Ce={command:`update`,describe:`Updates Account State`,builder:Se,handler:async e=>l({command:`security-insights state update`,classification:{safeFlags:[`scans-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();s({command:`cf security-insights state update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/security-center/state`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({scans_enabled:e[`scans-enabled`]}):u(e.body)});return}let i=await n(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=u(e.body),n=await c(`Updating`,async()=>i.send($,{body:t,account_id:l}));o(n,{successLabel:`Updated`});return}if(e[`scans-enabled`]===void 0)throw Error(`--scans-enabled is required (or pass --body with this field set).`);let f=d({scans_enabled:e[`scans-enabled`]}),p=await c(`Updating`,async()=>i.send($,{body:f,account_id:l}));o(p,{successLabel:`Updated`})})},we={command:`state`,describe:`Operations for state`,builder:e=>e.command(Q).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Te={command:`security-insights`,describe:`security-insights`,builder:e=>e.command(b).command(B).command(U).command(re).command(w).command(L).command(pe).command(ye).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Te as default};
|