cf 1.0.0-beta.25 → 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 +2015 -3426
- package/dist/_meta/hand-written-commands.json +16 -1
- package/dist/_meta/schemas.json +9249 -2339
- package/dist/abuse-reports-RxXqfDEW.mjs +24 -0
- package/dist/{access-__sFDSFL.mjs → access-BxEprr2f.mjs} +1 -1
- package/dist/{accounts-CmggwRjh.mjs → accounts-DU2ZNYqP.mjs} +17 -11
- package/dist/{acm-AAhRZUAU.mjs → acm-CBCIKBJ4.mjs} +1 -1
- package/dist/{addressing-DVeJNPZc.mjs → addressing-BKxiLRHk.mjs} +1 -1
- package/dist/{agent-memory-DQhWO6sc.mjs → agent-memory-DkBpQYUL.mjs} +1 -1
- package/dist/{ai-CULO9sno.mjs → ai-DqEN_hhg.mjs} +2 -2
- package/dist/{ai-audit-udn4HF34.mjs → ai-audit-BmzOgt6x.mjs} +1 -1
- package/dist/{ai-gateway-Bm2MMdec.mjs → ai-gateway-B0uiYVHq.mjs} +3 -3
- package/dist/ai-search-DbZIxdio.mjs +74 -0
- package/dist/{ai-security-DXy9ht-9.mjs → ai-security-CvZfP2JC.mjs} +1 -1
- package/dist/{alerting-CssnaN2i.mjs → alerting-BjGwBxZT.mjs} +1 -1
- package/dist/{analytics-BVo7Ax0w.mjs → analytics-C7kT_H-W.mjs} +4 -4
- package/dist/{analytics-engine-BBd0Bydx.mjs → analytics-engine-BHpcNSdD.mjs} +1 -1
- package/dist/{api-security-C-D9OKtH.mjs → api-security-BbcvDtff.mjs} +2 -2
- package/dist/{argo-DSziwzvA.mjs → argo-D1VONzu-.mjs} +1 -1
- package/dist/{artifacts-nVMgn4dn.mjs → artifacts-2R2sxIKO.mjs} +3 -3
- package/dist/{audit-logs-DIZ5oA_y.mjs → audit-logs-LoBB1OO_.mjs} +1 -1
- package/dist/auth-CspwoBlp.mjs +2 -0
- package/dist/{auth-JsvLULHA.mjs → auth-D499YE2n.mjs} +3 -3
- package/dist/{auth-CB9wjyad.mjs → auth-FK2eLQ02.mjs} +1 -1
- package/dist/{auth-token-BAgw7kYP.mjs → auth-token-BwpERbnG.mjs} +1 -1
- package/dist/{autoconfig-CajkMb3B.mjs → autoconfig-B2w-woU0.mjs} +85 -83
- package/dist/{basin-catalog-BRvGeKm3.mjs → basin-catalog-AgOHGiPI.mjs} +2 -2
- package/dist/billing-DRNww0iC.mjs +24 -0
- package/dist/{blocks-D2tE8dp2.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-VOL5P4s3.mjs → botnet-feed-DCYB5kYZ.mjs} +1 -1
- package/dist/{brand-protection-CSVHQ9Pt.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-BfkzV5_c.mjs → build-DO_GNhRl.mjs} +1 -1
- package/dist/{builds-y5BQCJ81.mjs → builds-CoazxuN-.mjs} +26 -26
- package/dist/{cache-Bvr988Hj.mjs → cache-jlLJLSu7.mjs} +1 -1
- package/dist/{cf-DgLg6Hop.mjs → cf-hP0SOgC6.mjs} +2 -2
- package/dist/{chunk-2HLTAS5V-B92NbX1j.mjs → chunk-AAQI36FL-e6E5HW1g.mjs} +1 -1
- package/dist/{chunk-DSGVRFIS-Dq2PrGsi.mjs → chunk-DSGVRFIS-DQwKND2c.mjs} +1 -1
- package/dist/chunk-SOBRPAPT-BKzUiNx_.mjs +363 -0
- package/dist/{cli-BTxJfFus.mjs → cli-Nqf58-1c.mjs} +3 -3
- package/dist/{client-side-security-CFmO0uz9.mjs → client-side-security-VmZzMy-m.mjs} +1 -1
- package/dist/{cloud-connector-CtwPdFBa.mjs → cloud-connector-bMlFnqP0.mjs} +1 -1
- package/dist/{cloudflared-DPkNN1Qv.mjs → cloudflared-Ba4KWdTO.mjs} +1 -1
- package/dist/{cloudforce-one-DHrMaxnU.mjs → cloudforce-one-CCaIBOAo.mjs} +121 -119
- package/dist/{command-CDYTsmxe.mjs → command-BASaTmJc.mjs} +1 -1
- package/dist/{command-BWyx7dNO.mjs → command-BiIVclNA.mjs} +1 -1
- package/dist/{command-CXwKBbj9.mjs → command-Bih1HLr3.mjs} +1 -1
- package/dist/{command-Ct3tf-P5.mjs → command-BxZBNPxG.mjs} +1 -1
- package/dist/{command-DPOjEs1B.mjs → command-ByYf12-8.mjs} +1 -1
- package/dist/{command-CmK8-DJ9.mjs → command-C0qCuw03.mjs} +1 -1
- package/dist/{command-DqWBPiew.mjs → command-C2FVMd1b.mjs} +1 -1
- package/dist/{command-ckixJeTm.mjs → command-C4OgtX_x.mjs} +1 -1
- package/dist/{command-CCDzJjIB.mjs → command-C5Kqc5Km.mjs} +1 -1
- package/dist/{command-lJJ7sEZe.mjs → command-CFxyp8Uo.mjs} +1 -1
- package/dist/{command-ClneauMx.mjs → command-CZAR85ba.mjs} +1 -1
- package/dist/{command-BXCk1OsI.mjs → command-CelQVrZL.mjs} +1 -1
- package/dist/{command-YFWLEK8W.mjs → command-CrAlzysj.mjs} +1 -1
- package/dist/{command-6_Ms3TZv.mjs → command-pMoNdd22.mjs} +1 -1
- package/dist/{completions-B1rYgw_a.mjs → completions-DRzBiqpv.mjs} +1 -1
- package/dist/{connector-interrupts-DecTdK6X.mjs → connector-interrupts-CrTeSyaM.mjs} +1 -1
- package/dist/{connector-telemetry-events-wePxPACj.mjs → connector-telemetry-events-BbAOUt9h.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-D8sXR1qx.mjs → connector-telemetry-snapshots-DcpBx7Qx.mjs} +1 -1
- package/dist/{connectors-C-6RQ_Q1.mjs → connectors-D1WFLJoE.mjs} +1 -1
- package/dist/{containers-D65Gpj9Q.mjs → containers-BOBEs1Gk.mjs} +4 -4
- package/dist/containers-DINLx5_i.mjs +380 -0
- package/dist/{content-scan-DbIDQ-Yu.mjs → content-scan-D1GfPSL0.mjs} +1 -1
- package/dist/{context-DCon1tRZ.mjs → context-Dp4CXG22.mjs} +1 -1
- package/dist/{cps-DGLmzCzp.mjs → cps-D4uhzg3k.mjs} +1 -1
- package/dist/{csam-scanner-R7Ih-Dnw.mjs → csam-scanner-DOOUBeBM.mjs} +1 -3
- package/dist/custom-csrs-DtdFo5YZ.mjs +18 -0
- package/dist/{custom-hostnames-BFWR-tR_.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-CTj0dYET.mjs → delegate-B4bKqF7i.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-BVTA83rN.mjs → deploy-BaC5Ty7F.mjs} +1 -1
- package/dist/{deploy-context-CO8ZSRwx.mjs → deploy-context-DTTgNGro.mjs} +1 -1
- package/dist/{deploy-input-PhKRxa_2.mjs → deploy-input-mAy06fAI.mjs} +1 -1
- package/dist/{dev-CM5GLHNn.mjs → dev-De-HszNT.mjs} +1 -1
- package/dist/{diagnostics-DPjl0aCm.mjs → diagnostics-D1CUs2o9.mjs} +1 -1
- package/dist/{dist-ataVE8ob.mjs → dist-D5qkmHhC.mjs} +2 -2
- package/dist/{dls-BLTIVlbh.mjs → dls-DWBiYzY1.mjs} +1 -1
- package/dist/{dns-firewall-D1bb1byu.mjs → dns-firewall-DH9xIT5H.mjs} +8 -8
- package/dist/{dns-DkqVq-nB.mjs → dns-wMjf1t6-.mjs} +14 -8
- package/dist/{docs-tOv_OllI.mjs → docs-BA7qslb2.mjs} +1 -1
- package/dist/{dotenv-qsoPELMm.mjs → dotenv-DKRemNCH.mjs} +1 -1
- package/dist/{durable-objects-OJhns_to.mjs → durable-objects-DF0MYpnV.mjs} +1 -1
- package/dist/{email-auth-BbsIBNlu.mjs → email-auth-BShMFXn4.mjs} +1 -1
- package/dist/email-domains-CDSbVclP.mjs +14 -0
- package/dist/{email-routing-DnitWE1A.mjs → email-routing-CBCkbg_F.mjs} +4 -2
- package/dist/{email-security-DiWtb7cx.mjs → email-security-CnNa1YON.mjs} +4 -4
- package/dist/{email-sending-DuDjXykw.mjs → email-sending-CpDSw-Eb.mjs} +16 -16
- package/dist/error-sanitization-B025CygB.mjs +2 -0
- package/dist/{error-sanitization-ahuAGEjT.mjs → error-sanitization-DG8WSzHe.mjs} +1 -1
- package/dist/{errors-CCFmptqJ.mjs → errors-DatLr-iR.mjs} +1 -1
- package/dist/{field-extractors-DNNnkBZH.mjs → field-extractors-BwGdMnTr.mjs} +1 -1
- package/dist/{firewall-C7eZRNVF.mjs → firewall-CY_oem-d.mjs} +25 -9
- package/dist/{flagship-BczjsrJ5.mjs → flagship-Bat5EZCk.mjs} +1 -1
- package/dist/{fraud-wE0UM2SM.mjs → fraud-CSUKLh8X.mjs} +2 -2
- package/dist/global-options-DiKj2cQy.mjs +2 -0
- package/dist/{google-tag-gateway-6mvtxcJK.mjs → google-tag-gateway-C2skt6t-.mjs} +1 -1
- package/dist/{healthchecks-aIB3DebS.mjs → healthchecks-uC43QKQd.mjs} +1 -1
- package/dist/{hyperdrive-DHRP8SJS.mjs → hyperdrive-FcBbpew4.mjs} +3 -3
- package/dist/iam-8T74DNhH.mjs +62 -0
- package/dist/{images-CLgvxd0t.mjs → images-C3JUaf6b.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-B_DBTMXU.mjs → init-BEVVz4_P.mjs} +1 -1
- package/dist/{intel-jnoIVlYG.mjs → intel-DRy4rHrt.mjs} +6 -7
- package/dist/{interactive-1g0dnrA8.mjs → interactive-CKHdGvkh.mjs} +1 -1
- package/dist/{internal-Ba3b-Z8J.mjs → internal-CamuESs0.mjs} +1 -1
- package/dist/{ips-CQ4gFfex.mjs → ips-DinCNnWj.mjs} +1 -1
- package/dist/k2-wsanPL3y.mjs +10 -0
- package/dist/{kv-DQfnNE-w.mjs → kv-BLSPcEnH.mjs} +1 -1
- package/dist/{lazy-command-DjGzxiUT.mjs → lazy-command-WB1FOuew.mjs} +1 -1
- package/dist/{leaked-credential-checks-CaqjG3Oz.mjs → leaked-credential-checks-CSZd9hBQ.mjs} +1 -1
- package/dist/{live-BfobGv8W.mjs → live-B6AsI_E5.mjs} +1 -1
- package/dist/{load-balancers-BzSCp2Uh.mjs → load-balancers-gap5u4b1.mjs} +19 -7
- package/dist/local-CFsO9Tkg.mjs +2 -0
- package/dist/{local-BNmz58v4.mjs → local-CgBhtmON.mjs} +1 -1
- package/dist/{local-runtime-DvH92pV8.mjs → local-runtime-CmlJ20uJ.mjs} +1 -1
- package/dist/{login-B9wYab6S.mjs → login-BJHaTERg.mjs} +1 -1
- package/dist/login-BfuOf-Yi.mjs +2 -0
- package/dist/logpush-qhlxsioM.mjs +68 -0
- package/dist/{logs-Dan7xU-k.mjs → logs-bI54CJ0w.mjs} +23 -7
- package/dist/{magic-network-monitoring-TAjt04vN.mjs → magic-network-monitoring-CX3TaMTu.mjs} +1 -1
- package/dist/{magic-transit-BSuLHnQ5.mjs → magic-transit-BwDyySHJ.mjs} +20 -20
- package/dist/{managed-defense-CTnIZLg4.mjs → managed-defense-CsBBkfeQ.mjs} +2 -2
- package/dist/{managed-transforms-BETvesjp.mjs → managed-transforms-CUC-uAbW.mjs} +1 -1
- package/dist/{mcp-DhjMGaKc.mjs → mcp-CyI0sDmL.mjs} +3 -3
- package/dist/{mesh-jxLLG3t4.mjs → mesh-Czr0UCP4.mjs} +2 -2
- package/dist/{migrate-Bkhk38nJ.mjs → migrate-DKDWYrz2.mjs} +1 -1
- package/dist/{monetization-BqDgHlPv.mjs → monetization-NUgfDtSy.mjs} +7 -3
- package/dist/{network-D6BRpgOv.mjs → network-B42zrBic.mjs} +1 -1
- package/dist/{network-interconnects-tP41GbnL.mjs → network-interconnects-DuIBe8fK.mjs} +4 -4
- package/dist/{o11y-h4cIC_1T.mjs → o11y-oEUpMC3O.mjs} +6 -6
- package/dist/{oauth-CuM12iNb.mjs → oauth-BLQ1-y3R.mjs} +1 -1
- package/dist/{oauth-nDH3nTCa.mjs → oauth-BmSFLp_s.mjs} +1 -1
- package/dist/observability-BxhJQCgZ.mjs +4 -0
- package/dist/organization-CEnlXwrl.mjs +70 -0
- package/dist/{organizations-7Q3d9vcW.mjs → organizations-Dt86ToxE.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-XBMPCdSL.mjs → origin-post-quantum-encryption-lX-uaJSL.mjs} +1 -1
- package/dist/package-CiRJBRHO.mjs +2 -0
- package/dist/{page-rules-BlT5xlhH.mjs → page-rules-J6LhwR-s.mjs} +1 -1
- package/dist/{pages-CIbL62L2.mjs → pages-BksdnChs.mjs} +4 -4
- package/dist/{pay-per-crawl-BzsBqo_m.mjs → pay-per-crawl-BLcbHRoR.mjs} +1 -1
- package/dist/{pay-per-use-DtejLYJ8.mjs → pay-per-use-VatiU-Nt.mjs} +4 -2
- package/dist/{pipelines-LjLb8jq6.mjs → pipelines-B5AoB3f3.mjs} +5 -5
- package/dist/precursor-D3VH2MXT.mjs +4 -0
- package/dist/{previews-zRYO9uO9.mjs → previews-DzJ85fsr.mjs} +1 -1
- package/dist/{progress-_Jux05O5.mjs → progress-DLri-rA7.mjs} +1 -1
- package/dist/{prompt-SNVLBS1b.mjs → prompt-D0dXwuME.mjs} +1 -1
- package/dist/{queues-Ci4rGGC4.mjs → queues-BsAck4To.mjs} +5 -5
- package/dist/{r2-qm2hgS43.mjs → r2-BYjdHDEZ.mjs} +38 -38
- package/dist/{radar-C_ydbJe_.mjs → radar-CvLtu-Vr.mjs} +1 -1
- package/dist/{raw-fetch-D3ydyJYW.mjs → raw-fetch-DQeDx1wT.mjs} +1 -1
- package/dist/{ready-hk-_B8z3.mjs → ready-gsGEaWLL.mjs} +1 -1
- package/dist/{realtime-BAvjYmYw.mjs → realtime-DiCEgFTC.mjs} +81 -79
- package/dist/{registrar-DD7WZaP2.mjs → registrar-D4wdgWpo.mjs} +8 -8
- package/dist/{registrar-sandbox-DbxloH5s.mjs → registrar-sandbox-B6yopzdG.mjs} +2 -2
- package/dist/{reporting-CRVg3J1C.mjs → reporting-BiHgnT8L.mjs} +1 -1
- package/dist/{request-headers-Cn01EsbI.mjs → request-headers-CoxHUNcB.mjs} +1 -1
- package/dist/{request-tracers-BWs0rdFS.mjs → request-tracers-817HTytF.mjs} +1 -1
- package/dist/{resource-sharing-yipIkdbd.mjs → resource-sharing-CW9xxtq5.mjs} +12 -12
- package/dist/{rules-CCtaBLiN.mjs → rules-CRhe_ca9.mjs} +1 -1
- package/dist/rulesets-CKyc-Xlx.mjs +42 -0
- package/dist/{rum-gDOKylu_.mjs → rum-BfnWHW_d.mjs} +1 -1
- package/dist/{run-Br8sYjNF.mjs → run-Ciw_GIrC.mjs} +1 -1
- package/dist/run-DD45EQTm.mjs +2 -0
- package/dist/{schema-cache-Cb64Nqbt.mjs → schema-cache-BIo0Gi2H.mjs} +1 -1
- package/dist/schema-flags-DrqvwQNw.mjs +4 -0
- package/dist/{scim-CM8Xah56.mjs → scim-C4iRWNYB.mjs} +1 -1
- package/dist/{secrets-store-BEnXiYCC.mjs → secrets-store-DgtzZRze.mjs} +1 -1
- package/dist/security-insights-SlUGW3F_.mjs +62 -0
- package/dist/{security-txt-BF0PWAEW.mjs → security-txt-C3YS0REz.mjs} +1 -1
- package/dist/{session-B7vOqdZU.mjs → session-D2yuwO4i.mjs} +1 -1
- package/dist/{shared-CBMFY1VY.mjs → shared--uVkAAd7.mjs} +1 -1
- package/dist/{signed-url-VDDQlllt.mjs → signed-url-ClLk45_J.mjs} +1 -1
- package/dist/{smart-shield-DQku_wYi.mjs → smart-shield-Dn95hqUH.mjs} +1 -1
- package/dist/{snippets-B3FCEMuh.mjs → snippets-BNUKOajz.mjs} +1 -1
- package/dist/{spawn-9sE67p7c.mjs → spawn-DuT4snxu.mjs} +1 -1
- package/dist/{spectrum-nLirlVue.mjs → spectrum-Cj0BMtg2.mjs} +3 -3
- package/dist/{speed-C1hCyMPy.mjs → speed-BrVeZRyX.mjs} +1 -1
- package/dist/{sql-DVQOKThL.mjs → sql-BX1pBqj3.mjs} +2 -2
- package/dist/src-DPnUfK4c.mjs +131 -0
- package/dist/{ssl-CYDRgr24.mjs → ssl-Bx4LCutF.mjs} +3 -3
- package/dist/{startup-profile-BLvw_Wmc.mjs → startup-profile-DqaYNT0b.mjs} +1 -1
- package/dist/startup-profile-tZNb2HGz.mjs +2 -0
- package/dist/{state-B8n0QU04.mjs → state-BmzOLELo.mjs} +1 -1
- package/dist/state-Uwfrmw5I.mjs +2 -0
- package/dist/{stream-DHyejrI6.mjs → stream-BRzr6yh0.mjs} +1 -1
- package/dist/{tags-DOL6dKQE.mjs → tags-xVzjZxdt.mjs} +11 -5
- package/dist/{telemetry-DJ8-Q2pU.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-CMAmH4Vh.mjs → tunnels-DQVXKUKA.mjs} +3 -3
- package/dist/{turnstile-DTJjDMFp.mjs → turnstile-B_Ugzgom.mjs} +1 -1
- package/dist/ui-FYultowZ.mjs +2 -0
- package/dist/{update-check-DDGKWkmi.mjs → update-check-DHUo4FOJ.mjs} +1 -1
- package/dist/{update-check-BkCdHK-3.mjs → update-check-DRr0eRhB.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization-BbWOra1u.mjs → url-normalization-CZRQH_pJ.mjs} +1 -1
- package/dist/{url-scanner-Bj-eS_3C.mjs → url-scanner-BH4PLy16.mjs} +1 -1
- package/dist/{user-CMzTHHVX.mjs → user-Bn82Qw0Y.mjs} +10 -12
- package/dist/{vectorize-D4H7_KPs.mjs → vectorize-DoVVz_sh.mjs} +1 -1
- package/dist/version-Zr2oF8mY.mjs +2 -0
- package/dist/{waiting-rooms-CqMbVu9s.mjs → waiting-rooms-QUW131o3.mjs} +5 -3
- package/dist/{web-assets-BgfzyF8t.mjs → web-assets-CgQXsp8m.mjs} +2 -2
- package/dist/{web3-ByCe47FI.mjs → web3-TY9s6Swn.mjs} +3 -3
- package/dist/workers-B3uJqJKc.mjs +39 -0
- package/dist/{workers-builds-2N71_8MZ.mjs → workers-builds-BgGY0IGk.mjs} +2 -2
- package/dist/{workers-for-platforms-BMN4QXgT.mjs → workers-for-platforms-5RkV9MVp.mjs} +2 -2
- package/dist/workers-vpc-Bt4OQbwM.mjs +12 -0
- package/dist/{workflows-COiyqt-B.mjs → workflows-6m85DdqF.mjs} +7 -7
- package/dist/{wrangler-migration-CqSg8IDj.mjs → wrangler-migration-BbmGOu8l.mjs} +3 -3
- package/dist/{zaraz-DjwhCH8A.mjs → zaraz-8WSJ7l0L.mjs} +2 -2
- package/dist/{zero-trust-BmpuDOmH.mjs → zero-trust-DK0cqDZv.mjs} +483 -405
- package/dist/{zones-XYQiz5kF.mjs → zones-DTAcguf6.mjs} +3 -3
- package/package.json +14 -14
- package/dist/abuse-reports-BIS9MZn7.mjs +0 -24
- package/dist/ai-search-GRN_gXgU.mjs +0 -74
- package/dist/auth-Bls_1yRW.mjs +0 -2
- package/dist/billing-BhPoqyKC.mjs +0 -22
- package/dist/bot-management-BfjX5DuH.mjs +0 -9
- package/dist/browser-run-cxOd2cZE.mjs +0 -40
- package/dist/build-DCdLWwOg.mjs +0 -2
- package/dist/chunk-3PJ54H4K-CbRAWQWI.mjs +0 -363
- package/dist/containers-C_byVTZF.mjs +0 -380
- package/dist/custom-csrs-D0RnVoJ7.mjs +0 -10
- package/dist/custom-nameservers-Dn_9Ssti.mjs +0 -8
- package/dist/custom-pages-HqIQcb77.mjs +0 -20
- package/dist/d1-CopIY9RT.mjs +0 -89
- package/dist/email-domains-pWZi1M4q.mjs +0 -12
- package/dist/error-sanitization-rodO1WCL.mjs +0 -2
- package/dist/iam-6t7-ScrS.mjs +0 -48
- package/dist/k2-Bsm6rzNX.mjs +0 -10
- package/dist/local-ChR3YIMU.mjs +0 -2
- package/dist/login-ierSCYE6.mjs +0 -2
- package/dist/logpush-DgfiSd1b.mjs +0 -44
- package/dist/magic-cloud-networking-DP8fWC4a.mjs +0 -68
- package/dist/oauth-clients-B0voUiXM.mjs +0 -14
- package/dist/oauth-scopes-Bhns1ZHW.mjs +0 -4
- package/dist/organization-Cy55HoRR.mjs +0 -73
- package/dist/package-DK3JX4I3.mjs +0 -2
- package/dist/precursor-BKp5_Ag4.mjs +0 -4
- package/dist/rulesets-DBEvCNDS.mjs +0 -34
- package/dist/run-LOgTLpob.mjs +0 -2
- package/dist/schema-flags-BcbbCWR5.mjs +0 -4
- package/dist/security-insights-Be5GvdBA.mjs +0 -40
- package/dist/src-Bh2gHpI7.mjs +0 -131
- package/dist/startup-profile-ByxSdhEl.mjs +0 -2
- package/dist/state-BTOzaT5L.mjs +0 -2
- package/dist/telemetry-kjElc1zT.mjs +0 -2
- package/dist/tenant-2EdATz2Y.mjs +0 -10
- package/dist/tenant-custom-nameservers-DhEpJNST.mjs +0 -8
- package/dist/ui-7zujR-O7.mjs +0 -2
- package/dist/version-DIIJ2ixL.mjs +0 -2
- package/dist/workers-BiLsPkYD.mjs +0 -39
- package/dist/workers-vpc-3o7dMg7-.mjs +0 -12
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,t as i}from"./context-Dp4CXG22.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-DLri-rA7.mjs";import{t as c}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as l,n as u,r as d,t as f}from"./body-parser-BKcZS9iJ.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";import{a as m,i as h,n as g}from"./prompt-D0dXwuME.mjs";var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/shares`,body:`json`};function v(e){return e.usage(`$0 resource-sharing create
|
|
3
3
|
|
|
4
|
-
Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`).option(`name`,{type:`string`,description:`The name of the share.`}).option(`recipients`,{type:`string`,description:`The recipients field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`resources`,{type:`string`,description:`The resources field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const
|
|
4
|
+
Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`).option(`name`,{type:`string`,description:`The name of the share.`}).option(`recipients`,{type:`string`,description:`The recipients field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`resources`,{type:`string`,description:`The resources field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Trigger a share creation`,builder:v,handler:async e=>c({command:`resource-sharing create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),recipients:l(e.recipients,`recipients`),resources:l(e.resources,`resources`)}):u(e.body)});return}let c=await n(e),d=e.local?t:await i();if(e.accountId=d,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(_,{body:t,account_id:d}));a(n,{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await m(`name`,`The name of the share.`)),e.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);if(e.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let h=f({name:p(e.name,`name`,`text`),recipients:l(e.recipients,`recipients`),resources:l(e.resources,`resources`)}),g=await s(`Creating`,async()=>c.send(_,{body:h,account_id:d}));a(g,{successLabel:`Created`})})};var te={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}`};function ne(e){return e.usage(`$0 resource-sharing delete <share-id>
|
|
5
5
|
|
|
6
|
-
Deletion is not immediate, an updated share object with a new status will be returned.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const re={command:`delete <share-id>`,describe:`Trigger a share deletion`,builder:ne,handler:async e=>c({command:`resource-sharing delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await g({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await s(`Deleting`,async()=>c.send(te,{account_id:l,share_id:e[`share-id`]}));a(u,{successLabel:`Deleted`})})};var y={method:`POST`,path:t=>e`/accounts/${t.
|
|
6
|
+
Deletion is not immediate, an updated share object with a new status will be returned.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const re={command:`delete <share-id>`,describe:`Trigger a share deletion`,builder:ne,handler:async e=>c({command:`resource-sharing delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await g({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await s(`Deleting`,async()=>c.send(te,{account_id:l,share_id:e[`share-id`]}));a(u,{successLabel:`Deleted`})})};var y={method:`POST`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/excluded-recipients`,body:`json`};function b(e){return e.usage(`$0 resource-sharing excluded-recipients create <share-id>
|
|
7
7
|
|
|
8
|
-
Excludes a single account from an organization-targeted share. The share continues to target the entire organization, but the excluded account is skipped during reconciliation.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`
|
|
8
|
+
Excludes a single account from an organization-targeted share. The share continues to target the entire organization, but the excluded account is skipped during reconciliation.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create <share-id>`,describe:`Trigger an account exclusion from a share`,builder:b,handler:async e=>c({command:`resource-sharing excluded-recipients create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing excluded-recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(y,{body:t,account_id:l,share_id:e[`share-id`]}));a(n,{successLabel:`Created`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var S={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/excluded-recipients/${t.excluded_recipient_id}`};function C(e){return e.usage(`$0 resource-sharing excluded-recipients delete <excluded-recipient-id>
|
|
9
9
|
|
|
10
10
|
Removes a single account from a share's excluded-recipient list. The account becomes eligible to receive the share again on the next reconciliation cycle.`).positional(`excluded-recipient-id`,{type:`string`,description:`Share Excluded Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete <excluded-recipient-id>`,describe:`Trigger an account un-exclusion from a share`,builder:C,handler:async e=>c({command:`resource-sharing excluded-recipients delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing excluded-recipients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients/${e[`excluded-recipient-id`]==null?`<excluded-recipient-id>`:encodeURIComponent(String(e[`excluded-recipient-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"excluded-recipient-id":String(e[`excluded-recipient-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await g({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(S,{account_id:l,share_id:e[`share-id`],excluded_recipient_id:e[`excluded-recipient-id`]}));a(u,{successLabel:`Deleted`})})};var T={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/excluded-recipients/${t.excluded_recipient_id}`};function E(e){return e.usage(`$0 resource-sharing excluded-recipients get <excluded-recipient-id>
|
|
11
11
|
|
|
12
|
-
Gets a single excluded recipient of a share by its identifier tag.`).positional(`excluded-recipient-id`,{type:`string`,description:`Share Excluded Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <excluded-recipient-id>`,describe:`Get share excluded recipient by ID`,builder:E,handler:async e=>c({command:`resource-sharing excluded-recipients get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing excluded-recipients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients/${e[`excluded-recipient-id`]==null?`<excluded-recipient-id>`:encodeURIComponent(String(e[`excluded-recipient-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"excluded-recipient-id":String(e[`excluded-recipient-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(T,{account_id:l,share_id:e[`share-id`],excluded_recipient_id:e[`excluded-recipient-id`]}));a(u,{successLabel:`Loaded`})})};var O={method:`GET`,path:t=>e`/accounts/${t.
|
|
12
|
+
Gets a single excluded recipient of a share by its identifier tag.`).positional(`excluded-recipient-id`,{type:`string`,description:`Share Excluded Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <excluded-recipient-id>`,describe:`Get share excluded recipient by ID`,builder:E,handler:async e=>c({command:`resource-sharing excluded-recipients get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing excluded-recipients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients/${e[`excluded-recipient-id`]==null?`<excluded-recipient-id>`:encodeURIComponent(String(e[`excluded-recipient-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"excluded-recipient-id":String(e[`excluded-recipient-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(T,{account_id:l,share_id:e[`share-id`],excluded_recipient_id:e[`excluded-recipient-id`]}));a(u,{successLabel:`Loaded`})})};var O={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/excluded-recipients`,query:[`page`,`per_page`]};function k(e){return e.usage(`$0 resource-sharing excluded-recipients list
|
|
13
13
|
|
|
14
|
-
Lists the accounts excluded from an organization-targeted share. Only valid for shares with \`target_type=organization\`.`).option(`
|
|
14
|
+
Lists the accounts excluded from an organization-targeted share. Only valid for shares with \`target_type=organization\`.`).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).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 A={command:`list`,describe:`List share excluded recipients by share ID`,builder:k,handler:async e=>c({command:`resource-sharing excluded-recipients list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await r();o({command:`cf resource-sharing excluded-recipients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"share-id":String(e[`share-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(O,{account_id:u,share_id:e[`share-id`],...c}));a(d,{successLabel:`Loaded`})})};var j={method:`PUT`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/excluded-recipients`,body:`json`,response:!1};function M(e){return e.usage(`$0 resource-sharing excluded-recipients update <share-id>
|
|
15
15
|
|
|
16
|
-
Reconciles a share's excluded recipients to match the given list. Only valid for shares with \`target_type=organization\`.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`
|
|
16
|
+
Reconciles a share's excluded recipients to match the given list. Only valid for shares with \`target_type=organization\`.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`update <share-id>`,describe:`Trigger excluded-account reconciliation on a share`,builder:M,handler:async e=>c({command:`resource-sharing excluded-recipients update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing excluded-recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(j,{body:t,account_id:l,share_id:e[`share-id`]}));a(n,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},P={command:`excluded-recipients`,describe:`Operations for excluded-recipients`,builder:e=>e.command(x).command(w).command(D).command(A).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var F={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}`,query:[`include_resources`,`include_recipient_counts`]};function I(e){return e.usage(`$0 resource-sharing get <share-id>
|
|
17
17
|
|
|
18
18
|
Fetches share by ID.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <share-id>`,describe:`Get account share by ID`,builder:I,handler:async e=>c({command:`resource-sharing get`,classification:{safeFlags:[`include-resources`,`include-recipient-counts`,`dry-run`]}},e,async()=>{let c={include_resources:e[`include-resources`],include_recipient_counts:e[`include-recipient-counts`]};if(e.dryRun){let t=await r();o({command:`cf resource-sharing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(F,{account_id:u,share_id:e[`share-id`],...c}));a(d,{successLabel:`Loaded`})})};var R={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares`,query:[`status`,`kind`,`target_type`,`resource_types`,`order`,`direction`,`page`,`per_page`,`include_resources`,`include_recipient_counts`,`tag`]};function z(e){return e.usage(`$0 resource-sharing list
|
|
19
19
|
|
|
20
|
-
Lists all account shares.`).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(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`tag`,{type:`string`,array:!0,description:"Filter shares by tag. Each value is either `key=value` (matches shares whose tags contain that key/value pair) or `key` alone (matches shares that have any value for that key). May be repeated; multiple `tag` parameters are ANDed together. Maximum 20 `tag` parameters per request."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`List account shares`,builder:z,handler:async e=>c({command:`resource-sharing list`,classification:{safeFlags:[`status`,`kind`,`target-type`,`order`,`direction`,`include-resources`,`include-recipient-counts`,`dry-run`]}},e,async()=>{let c={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`],include_resources:e[`include-resources`],include_recipient_counts:e[`include-recipient-counts`],tag:e.tag};if(e.dryRun){let e=await r();o({command:`cf resource-sharing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/shares`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(R,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var V={method:`POST`,path:t=>e`/accounts/${t.
|
|
20
|
+
Lists all account shares.`).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(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`tag`,{type:`string`,array:!0,description:"Filter shares by tag. Each value is either `key=value` (matches shares whose tags contain that key/value pair) or `key` alone (matches shares that have any value for that key). May be repeated; multiple `tag` parameters are ANDed together. Maximum 20 `tag` parameters per request."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`List account shares`,builder:z,handler:async e=>c({command:`resource-sharing list`,classification:{safeFlags:[`status`,`kind`,`target-type`,`order`,`direction`,`include-resources`,`include-recipient-counts`,`dry-run`]}},e,async()=>{let c={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`],include_resources:e[`include-resources`],include_recipient_counts:e[`include-recipient-counts`],tag:e.tag};if(e.dryRun){let e=await r();o({command:`cf resource-sharing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/shares`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(R,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var V={method:`POST`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/recipients`,body:`json`};function H(e){return e.usage(`$0 resource-sharing recipients create <share-id>
|
|
21
21
|
|
|
22
|
-
Adds a single recipient to an account-targeted resource share, granting them access to the shared resources. The recipient account must belong to the same organization as the share owner. To replace the entire recipient list in one call, use \`PUT /accounts/{account_id}/shares/{share_id}/recipients\` instead.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`
|
|
22
|
+
Adds a single recipient to an account-targeted resource share, granting them access to the shared resources. The recipient account must belong to the same organization as the share owner. To replace the entire recipient list in one call, use \`PUT /accounts/{account_id}/shares/{share_id}/recipients\` instead.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization identifier.`}).option(`recipient-account-id`,{type:`string`,description:`The account that will receive the share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Optionally specify `recipient_account_id` to target a specific account, or `organization_id` to target the caller's whole organization. If neither is provided, the caller's organization is used. The legacy field `account_id` is accepted as a synonym for `recipient_account_id` during the deprecation period (see `x-sunset` on that field). "})}const U={command:`create <share-id>`,describe:`Trigger a recipient addition to a share`,builder:H,handler:async e=>c({command:`resource-sharing recipients create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({organization_id:p(e[`organization-id`],`organization-id`,`text`),recipient_account_id:p(e[`recipient-account-id`],`recipient-account-id`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(V,{body:t,account_id:l,share_id:e[`share-id`]}));a(n,{successLabel:`Created`});return}let d=f({organization_id:p(e[`organization-id`],`organization-id`,`text`),recipient_account_id:p(e[`recipient-account-id`],`recipient-account-id`,`text`)}),m=await s(`Creating`,async()=>c.send(V,{body:d,account_id:l,share_id:e[`share-id`]}));a(m,{successLabel:`Created`})})};var W={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/recipients/${t.recipient_id}`};function G(e){return e.usage("$0 resource-sharing recipients delete <recipient-id>\n\nPerforms a **soft delete**: sets the recipient's `desired_association_status` to `disassociated`, which signals the background reconciliation workflow (Temporal) to remove the shared resources from the recipient account. The recipient record remains in the database for audit purposes and is still returned by `GET /accounts/{account_id}/shares/{share_id}/recipients` with its updated status. Resource access is not fully removed until the workflow completes and `current_association_status` transitions to `disassociated`. The recipient record itself is never physically deleted.").positional(`recipient-id`,{type:`string`,description:`Share Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const K={command:`delete <recipient-id>`,describe:`Trigger a recipient removal from a share`,builder:G,handler:async e=>c({command:`resource-sharing recipients delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing recipients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients/${e[`recipient-id`]==null?`<recipient-id>`:encodeURIComponent(String(e[`recipient-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"recipient-id":String(e[`recipient-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await g({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await s(`Deleting`,async()=>c.send(W,{account_id:l,share_id:e[`share-id`],recipient_id:e[`recipient-id`]}));a(u,{successLabel:`Deleted`})})};var ie={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/recipients/${t.recipient_id}`,query:[`include_resources`]};function q(e){return e.usage(`$0 resource-sharing recipients get <recipient-id>
|
|
23
23
|
|
|
24
|
-
Get share recipient by ID.`).positional(`recipient-id`,{type:`string`,description:`Share Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <recipient-id>`,describe:`Get share recipient by ID`,builder:
|
|
24
|
+
Get share recipient by ID.`).positional(`recipient-id`,{type:`string`,description:`Share Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <recipient-id>`,describe:`Get share recipient by ID`,builder:q,handler:async e=>c({command:`resource-sharing recipients get`,classification:{safeFlags:[`include-resources`,`dry-run`]}},e,async()=>{let c={include_resources:e[`include-resources`]};if(e.dryRun){let t=await r();o({command:`cf resource-sharing recipients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients/${e[`recipient-id`]==null?`<recipient-id>`:encodeURIComponent(String(e[`recipient-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"recipient-id":String(e[`recipient-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(ie,{account_id:u,share_id:e[`share-id`],recipient_id:e[`recipient-id`],...c}));a(d,{successLabel:`Loaded`})})};var Y={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/recipients`,query:[`include_resources`,`page`,`per_page`]};function ae(e){return e.usage('$0 resource-sharing recipients list\n\nList share recipients by share ID. Returns **all** recipients regardless of their `association_status` (associating, associated, disassociating, disassociated). Callers that want only "active" recipients must filter client-side on the `association_status` field.').option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).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 oe={command:`list`,describe:`List share recipients by share ID`,builder:ae,handler:async e=>c({command:`resource-sharing recipients list`,classification:{safeFlags:[`include-resources`,`dry-run`]}},e,async()=>{let c={include_resources:e[`include-resources`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await r();o({command:`cf resource-sharing recipients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"share-id":String(e[`share-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(Y,{account_id:u,share_id:e[`share-id`],...c}));a(d,{successLabel:`Loaded`})})};var se={method:`PUT`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/recipients`,body:`json`,response:!1};function ce(e){return e.usage(`$0 resource-sharing recipients update <share-id>
|
|
25
25
|
|
|
26
|
-
Replaces the full recipient list for an account-targeted share. The server computes the diff between the current and desired recipients: new accounts are added, accounts no longer in the list are marked for disassociation, and unchanged accounts are left as-is. Returns an error if the share targets an organization (\`target_type=organization\`); org-targeted shares derive their recipients dynamically from org membership and cannot be modified through this endpoint.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`
|
|
26
|
+
Replaces the full recipient list for an account-targeted share. The server computes the diff between the current and desired recipients: new accounts are added, accounts no longer in the list are marked for disassociation, and unchanged accounts are left as-is. Returns an error if the share targets an organization (\`target_type=organization\`); org-targeted shares derive their recipients dynamically from org membership and cannot be modified through this endpoint.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const le={command:`update <share-id>`,describe:`Trigger recipient reconciliation on a share`,builder:ce,handler:async e=>c({command:`resource-sharing recipients update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(se,{body:t,account_id:l,share_id:e[`share-id`]}));a(n,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},ue={command:`recipients`,describe:`Update share recipients`,builder:e=>e.command(U).command(K).command(J).command(oe).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/resources`,body:`json`};function de(e){return e.usage(`$0 resource-sharing resources create <share-id>
|
|
27
27
|
|
|
28
28
|
Adds a resource to an existing share, making it available to share recipients.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`meta`,{type:`string`,description:`Resource Metadata. Provide as a JSON object or @path/to/file.json.`}).option(`resource-account-id`,{type:`string`,description:`Account identifier.`}).option(`resource-id`,{type:`string`,description:`Share Resource identifier.`}).option(`resource-type`,{type:`string`,description:`Resource Type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).coerce(`resource-type`,e=>p(e,`resource-type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`create <share-id>`,describe:`Trigger a resource addition to a share`,builder:de,handler:async e=>c({command:`resource-sharing resources create`,classification:{safeFlags:[`resource-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing resources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({meta:d(e.meta,`meta`,!0),resource_account_id:p(e[`resource-account-id`],`resource-account-id`,`text`),resource_id:p(e[`resource-id`],`resource-id`,`text`),resource_type:e[`resource-type`]},[[`meta`]]):u(e.body,[{path:[`meta`],flag:`meta`}])});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body,[{path:[`meta`],flag:`meta`}]),n=await s(`Creating`,async()=>c.send(X,{body:t,account_id:l,share_id:e[`share-id`]}));a(n,{successLabel:`Created`});return}if(e.meta===void 0)throw Error(`--meta is required (or pass --body with this field set).`);e[`resource-account-id`]===void 0&&(e[`resource-account-id`]=await m(`resource-account-id`,`Account identifier.`)),e[`resource-id`]===void 0&&(e[`resource-id`]=await m(`resource-id`,`Share Resource identifier.`)),e[`resource-type`]===void 0&&(e[`resource-type`]=await h(`resource-type`,`Resource Type.`,[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]));let g=f({meta:d(e.meta,`meta`,!0),resource_account_id:p(e[`resource-account-id`],`resource-account-id`,`text`),resource_id:p(e[`resource-id`],`resource-id`,`text`),resource_type:e[`resource-type`]},[[`meta`]]),_=await s(`Creating`,async()=>c.send(X,{body:g,account_id:l,share_id:e[`share-id`]}));a(_,{successLabel:`Created`})})};var pe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/resources/${t.share_resource_id}`};function me(e){return e.usage(`$0 resource-sharing resources delete <share-resource-id>
|
|
29
29
|
|
|
@@ -33,4 +33,4 @@ Get share resource by ID.`).positional(`share-resource-id`,{type:`string`,descri
|
|
|
33
33
|
|
|
34
34
|
List share resources by share ID.`).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter share resources by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`resource-type`,{type:`string`,description:`Filter share resources by resource_type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).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 xe={command:`list`,describe:`List share resources by share ID`,builder:be,handler:async e=>c({command:`resource-sharing resources list`,classification:{safeFlags:[`status`,`resource-type`,`dry-run`]}},e,async()=>{let c={status:e.status,resource_type:e[`resource-type`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await r();o({command:`cf resource-sharing resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources`,pathParams:{"share-id":String(e[`share-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(ye,{account_id:u,share_id:e[`share-id`],...c}));a(d,{successLabel:`Loaded`})})};var Z={method:`PUT`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/resources/${t.share_resource_id}`,body:`json`};function Q(e){return e.usage(`$0 resource-sharing resources update <share-resource-id>
|
|
35
35
|
|
|
36
|
-
Update is not immediate, an updated share resource object with a new status will be returned.`).positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`meta`,{type:`string`,description:`Resource Metadata. Provide as a JSON object 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 Se={command:`update <share-resource-id>`,describe:`Trigger a resource metadata update in a share`,builder:Q,handler:async e=>c({command:`resource-sharing resources update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing resources update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources/${e[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(e[`share-resource-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"share-resource-id":String(e[`share-resource-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({meta:d(e.meta,`meta`,!0)},[[`meta`]]):u(e.body,[{path:[`meta`],flag:`meta`}])});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body,[{path:[`meta`],flag:`meta`}]),n=await s(`Updating`,async()=>c.send(Z,{body:t,account_id:l,share_id:e[`share-id`],share_resource_id:e[`share-resource-id`]}));a(n,{successLabel:`Updated`});return}if(e.meta===void 0)throw Error(`--meta is required (or pass --body with this field set).`);let p=f({meta:d(e.meta,`meta`,!0)},[[`meta`]]),m=await s(`Updating`,async()=>c.send(Z,{body:p,account_id:l,share_id:e[`share-id`],share_resource_id:e[`share-resource-id`]}));a(m,{successLabel:`Updated`})})},Ce={command:`resources`,describe:`Individual resources (zones, configs) that have been shared with recipients`,builder:e=>e.command(fe).command(he).command(ve).command(xe).command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $={method:`PUT`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}`,body:`json`};function we(e){return e.usage("$0 resource-sharing update <share-id>\n\nUpdates the share's display name and tags. This endpoint does **not** modify recipients or resources — those are managed via dedicated subresource endpoints: - **Recipients**: Use `POST /accounts/{account_id}/shares/{share_id}/recipients` to add a single recipient, `PUT /accounts/{account_id}/shares/{share_id}/recipients` to replace the full recipient list, or `DELETE /accounts/{account_id}/shares/{share_id}/recipients/{recipient_id}` to remove a recipient. - **Resources**: Use the share's resource subresource endpoints. Updating is not immediate; an updated share object with a new status will be returned.").positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request body for `PUT /accounts/{account_id}/shares/{share_id}`. The share's display `name` and `tags` can be updated via this endpoint. To modify recipients, use the `/accounts/{account_id}/shares/{share_id}/recipients` subresource endpoints (POST, PUT, DELETE). "})}const Te={command:`update <share-id>`,describe:`Trigger a share rename`,builder:we,handler:async e=>c({command:`resource-sharing update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send($,{body:t,account_id:l,share_id:e[`share-id`]}));a(n,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await m(`name`,`The name of the share.`));let d=f({name:p(e.name,`name`,`text`)}),h=await s(`Updating`,async()=>c.send($,{body:d,account_id:l,share_id:e[`share-id`]}));a(h,{successLabel:`Updated`})})},Ee={command:`resource-sharing`,describe:`Share Cloudflare resources (zones, accounts) across organizations with granular access controls`,builder:e=>e.command(
|
|
36
|
+
Update is not immediate, an updated share resource object with a new status will be returned.`).positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`meta`,{type:`string`,description:`Resource Metadata. Provide as a JSON object 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 Se={command:`update <share-resource-id>`,describe:`Trigger a resource metadata update in a share`,builder:Q,handler:async e=>c({command:`resource-sharing resources update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing resources update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources/${e[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(e[`share-resource-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"share-resource-id":String(e[`share-resource-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({meta:d(e.meta,`meta`,!0)},[[`meta`]]):u(e.body,[{path:[`meta`],flag:`meta`}])});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body,[{path:[`meta`],flag:`meta`}]),n=await s(`Updating`,async()=>c.send(Z,{body:t,account_id:l,share_id:e[`share-id`],share_resource_id:e[`share-resource-id`]}));a(n,{successLabel:`Updated`});return}if(e.meta===void 0)throw Error(`--meta is required (or pass --body with this field set).`);let p=f({meta:d(e.meta,`meta`,!0)},[[`meta`]]),m=await s(`Updating`,async()=>c.send(Z,{body:p,account_id:l,share_id:e[`share-id`],share_resource_id:e[`share-resource-id`]}));a(m,{successLabel:`Updated`})})},Ce={command:`resources`,describe:`Individual resources (zones, configs) that have been shared with recipients`,builder:e=>e.command(fe).command(he).command(ve).command(xe).command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $={method:`PUT`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}`,body:`json`};function we(e){return e.usage("$0 resource-sharing update <share-id>\n\nUpdates the share's display name and tags. This endpoint does **not** modify recipients or resources — those are managed via dedicated subresource endpoints: - **Recipients**: Use `POST /accounts/{account_id}/shares/{share_id}/recipients` to add a single recipient, `PUT /accounts/{account_id}/shares/{share_id}/recipients` to replace the full recipient list, or `DELETE /accounts/{account_id}/shares/{share_id}/recipients/{recipient_id}` to remove a recipient. - **Resources**: Use the share's resource subresource endpoints. Updating is not immediate; an updated share object with a new status will be returned.").positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request body for `PUT /accounts/{account_id}/shares/{share_id}`. The share's display `name` and `tags` can be updated via this endpoint. To modify recipients, use the `/accounts/{account_id}/shares/{share_id}/recipients` subresource endpoints (POST, PUT, DELETE). "})}const Te={command:`update <share-id>`,describe:`Trigger a share rename`,builder:we,handler:async e=>c({command:`resource-sharing update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send($,{body:t,account_id:l,share_id:e[`share-id`]}));a(n,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await m(`name`,`The name of the share.`));let d=f({name:p(e.name,`name`,`text`)}),h=await s(`Updating`,async()=>c.send($,{body:d,account_id:l,share_id:e[`share-id`]}));a(h,{successLabel:`Updated`})})},Ee={command:`resource-sharing`,describe:`Share Cloudflare resources (zones, accounts) across organizations with granular access controls`,builder:e=>e.command(ee).command(re).command(L).command(B).command(Te).command(P).command(ue).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ee as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,t as i}from"./context-Dp4CXG22.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-DLri-rA7.mjs";import{t as c}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as l,n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-D0dXwuME.mjs";var g={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/bulk_operations/${t.operation_id}`};function _(e){return e.usage("$0 rules lists bulk-operations get <operation-id>\n\nGets the current status of an asynchronous operation on a list. The `status` property can have one of the following values: `pending`, `running`, `completed`, or `failed`. If the status is `failed`, the `error` property will contain a message describing the error.").positional(`operation-id`,{type:`string`,description:`The unique operation ID of the asynchronous action.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <operation-id>`,describe:`Get bulk operation status`,builder:_,handler:async e=>c({command:`rules lists bulk-operations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists bulk-operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/bulk_operations/${e[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(e[`operation-id`]))}`,pathParams:{"operation-id":String(e[`operation-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(g,{account_id:l,operation_id:e[`operation-id`]}));a(u,{successLabel:`Loaded`})})},y={command:`bulk-operations`,describe:`Operations for lists.bulk-operations`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/rules/lists`,body:`json`};function x(e){return e.usage(`$0 rules lists create
|
|
3
3
|
|
|
4
4
|
Creates a new list of the specified kind.`).option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`kind`,{type:`string`,description:`The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).`,choices:[`ip`,`redirect`,`hostname`,`asn`]}).coerce(`kind`,e=>f(e,`kind`,`text`)).option(`name`,{type:`string`,description:`An informative name for the list. Use this name in filter and rule expressions.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`create`,describe:`Create a list`,builder:x,handler:async e=>c({command:`rules lists create`,classification:{safeFlags:[`kind`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(b,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}e.kind===void 0&&(e.kind=await m(`kind`,`The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).`,[`ip`,`redirect`,`hostname`,`asn`])),e.name===void 0&&(e.name=await p(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let h=d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}),g=await s(`Creating`,async()=>c.send(b,{body:h,account_id:l}));a(g,{successLabel:`Created`})})};var C={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`};function w(e){return e.usage(`$0 rules lists delete <list-id>
|
|
5
5
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{i as n,n as r}from"./auth-FK2eLQ02.mjs";import{a as i,i as a,t as o}from"./context-Dp4CXG22.mjs";import{t as s}from"./output-BJEgbI0G.mjs";import{t as c}from"./dry-run-gy0Hl9xo.mjs";import{t as l}from"./progress-DLri-rA7.mjs";import{t as u}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.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-D0dXwuME.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.
|
|
5
|
+
|
|
6
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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>
|
|
7
|
+
|
|
8
|
+
Deletes all versions of an existing account or zone ruleset.
|
|
9
|
+
|
|
10
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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>
|
|
11
|
+
|
|
12
|
+
Fetches the latest version of the account or zone entry point ruleset for a given phase.
|
|
13
|
+
|
|
14
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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>
|
|
15
|
+
|
|
16
|
+
Updates an account or zone entry point ruleset, creating a new version.
|
|
17
|
+
|
|
18
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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`})})},D={command:`entrypoint`,describe:`Operations for entrypoint`,builder:e=>e.command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.usage(`$0 rulesets get <id>
|
|
19
|
+
|
|
20
|
+
Fetches the latest version of an account or zone ruleset.
|
|
21
|
+
|
|
22
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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 k={command:`get <id>`,describe:`Get an account or zone ruleset`,builder:O,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 A={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets`,query:[`cursor`,`per_page`]};function j(e){return e.usage(`$0 rulesets list
|
|
23
|
+
|
|
24
|
+
Fetches all rulesets.
|
|
25
|
+
|
|
26
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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 M={command:`list`,describe:`List account or zone rulesets`,builder:j,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(A,{account_or_zone:d,account_or_zone_id:f,...n}));s(p,{successLabel:`Loaded`})})};var N={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 P(e){return e.usage(`$0 rulesets rules create <ruleset-id>
|
|
27
|
+
|
|
28
|
+
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.
|
|
29
|
+
|
|
30
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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)`})}const F={command:`create <ruleset-id>`,describe:`Create an account or zone ruleset rule`,builder:P,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(N,{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(N,{body:g,account_or_zone:d,account_or_zone_id:p,ruleset_id:e[`ruleset-id`],...n}));s(_,{successLabel:`Created`})})};var I={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 L(e){return e.usage(`$0 rulesets rules delete <rule-id>
|
|
31
|
+
|
|
32
|
+
Deletes an existing rule from an account or zone ruleset.
|
|
33
|
+
|
|
34
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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 R={command:`delete <rule-id>`,describe:`Delete an account or zone ruleset rule`,builder:L,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(I,{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 z={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 B(e){return e.usage(`$0 rulesets rules update <rule-id>
|
|
35
|
+
|
|
36
|
+
Updates an existing rule in an account or zone ruleset.
|
|
37
|
+
|
|
38
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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)`})}const V={command:`update <rule-id>`,describe:`Update an account or zone ruleset rule`,builder:B,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(z,{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(z,{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`})})},H={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(F).command(R).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}`,query:[`dry_run`],body:`json`};function W(e){return e.usage(`$0 rulesets update <ruleset-id>
|
|
39
|
+
|
|
40
|
+
Updates an account or zone ruleset, creating a new version.
|
|
41
|
+
|
|
42
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).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 G={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:W,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(U,{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(U,{body:v,account_or_zone:p,account_or_zone_id:_,ruleset_id:e[`ruleset-id`],...n}));s(y,{successLabel:`Updated`})})},K={command:`rulesets`,describe:`rulesets`,builder:e=>e.command(b).command(S).command(k).command(M).command(G).command(D).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,t as i}from"./context-Dp4CXG22.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-DLri-rA7.mjs";import{t as c}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as l,n as u,t as d}from"./body-parser-BKcZS9iJ.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-D0dXwuME.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`,body:`json`};function h(e){return e.usage(`$0 rum rules bulk-create
|
|
3
3
|
|
|
4
4
|
Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:h,handler:async e=>c({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({delete_rules:e[`delete-rules`],rules:l(e.rules,`rules`)}):u(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:f,ruleset_id:e[`ruleset-id`]}));a(n,{successLabel:`Created`});return}let p=d({delete_rules:e[`delete-rules`],rules:l(e.rules,`rules`)}),h=await s(`Creating`,async()=>c.send(m,{body:p,account_id:f,ruleset_id:e[`ruleset-id`]}));a(h,{successLabel:`Created`})})};var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule`,body:`json`};function v(e){return e.usage(`$0 rum rules create <ruleset-id>
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./agent-context-Dtyy4aKL.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{$ as n}from"./dist-
|
|
2
|
+
import{t as e}from"./agent-context-Dtyy4aKL.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{$ as n}from"./dist-D5qkmHhC.mjs";import{n as r}from"./version-Zr2oF8mY.mjs";import{n as i,t as a}from"./delegate-B4bKqF7i.mjs";import{i as o,r as s}from"./lifecycle-oud60haK.mjs";import{t as c}from"./interactive-wQM7Blhm.mjs";import{n as l}from"./interactive-CKHdGvkh.mjs";import{t as u}from"./request-headers-CoxHUNcB.mjs";import{n as d,t as f}from"./state-BmzOLELo.mjs";import{t as p}from"./error-sanitization-DG8WSzHe.mjs";import{r as m}from"./sanitization-DkVWMHkc.mjs";import h from"node:os";import{createHash as g,randomUUID as _}from"node:crypto";const v=/* @__PURE__ */ new Date(`2026-01-01T00:00:00.000Z`),y=`CF_SEND_TELEMETRY`,b=`WRANGLER_SEND_METRICS`,x=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function S(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function C(){let e=S(process.env[y]);if(e!==void 0)return{enabled:e,source:`env`};let t=S(process.env[b]);if(t!==void 0)return{enabled:t,source:`wrangler-env`}}function w(){return C()?.enabled}function T(){let e=f();if(typeof e.deviceId==`string`&&x.test(e.deviceId))return e.deviceId;let t=_();return d({deviceId:t}),t}function E(){return f().deviceId===void 0}function D(){if(n())return{enabled:!1,source:`do-not-track`};let e=C();if(e!==void 0)return e;let t=f().telemetry?.preference;return t?.enabled===!1?{enabled:!1,source:`config`}:t?.enabled===!0&&typeof t.date==`string`&&new Date(t.date)>=v?{enabled:!0,source:`config`}:{enabled:!0,source:`default`}}function O(e){switch(e){case`do-not-track`:return`DO_NOT_TRACK`;case`env`:return y;case`wrangler-env`:return b;default:return}}function k(e){d({telemetry:{preference:{enabled:e,date:(/* @__PURE__ */ new Date()).toISOString()}}})}function A(){return f().telemetry?.bannerLastShown}function j(e){d({telemetry:{bannerLastShown:e}})}const M=/^\d{1,5}\.\d{1,5}\.\d{1,5}(?:-[0-9A-Za-z.-]{1,40})?(?:\+[0-9A-Za-z.-]{1,40})?$/;function N(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function P(){return h.version()}function F(){return process.arch}function I(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function L(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function R(e=process.env,t=process.ppid){if(!e.CF_DELEGATION)return!1;let n=e[a];return n===void 0||n===String(t)}function z(e=process.env,t=process.ppid){if(!e.CF_DELEGATION_PID||!R(e,t))return;let n=e[i];if(!(typeof n!=`string`||n.length>64||!M.test(n)))return n}function B(e,t,n){return g(`sha256`).update(`cf-agent-session-v1\0`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`).slice(0,32)}function V(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let H;function U(){if(H)return H;let[t,n,i]=r.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),a=Date.now(),s=0,d=E(),{enabled:f}=D(),p=e(),m=p.harness?.id??null,h=p.matches.find(e=>e.sessionId),g=R(),_=z();function v(){let e=V(),o=T();return{product:`cf`,cliVersion:r,cliMajor:t??0,cliMinor:n??0,cliPatch:i??0,...e?{prereleaseLabel:e}:{},osPlatform:N(),osVersion:P(),arch:F(),nodeVersion:I(),packageManager:L(),deviceId:o,amplitude_session_id:a,amplitude_event_id:s++,...h?.sessionId?{agentSessionKey:B(o,h.harness.id,h.sessionId)}:{},isFirstUsage:d,isCI:c,isInteractive:l(),cliMode:u(),agent:m,delegated:g,..._?{globalCliVersion:_}:{}}}function y(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};if(process.env.DEBUG&&console.error(`Telemetry ${f?`sending`:`would send`}: ${JSON.stringify(n)}`),f)return fetch(`https://sparrow.cloudflare.com/api/v1/event`,{method:`POST`,signal:AbortSignal.timeout(1e3),headers:{Accept:`*/*`,"Content-Type":`application/json`,"Sparrow-Source-Key":`50598e014ed44c739ec8074fdc16057c`},mode:`cors`,keepalive:!0,body:JSON.stringify(n)}).then(()=>void 0).catch(e=>{process.env.DEBUG&&console.error(`Telemetry failed to send:`,e instanceof Error?e.message:String(e))})}return H={enabled:f,sendCommandEvent(e,t){if(f)try{o(y(e,{...v(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,t={}){if(f)try{o(y(e,{...v(),...t}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},H}const W=/* @__PURE__ */ new Set([`SIGINT`,`SIGTERM`]),G=1024;function K(e){if(e instanceof t)return e.cancelled||e.signal&&W.has(e.signal)?`cancelled`:e.code===0?`success`:`error`}async function q(e,t,n){let r;try{r=U()}catch{return n()}if(s(),e.sendMetrics===!1||!r.enabled)return n();let i={...e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:m(t,process.argv.slice(2),e.classification),command:e.command};r.sendCommandEvent(`cf command started`,i);let a=e.searchQuery===void 0?{}:{searchQuery:e.searchQuery.slice(0,G),...e.searchQuery.length>G?{searchQueryTruncated:!0}:{}},o=Date.now();try{let e=await n();return r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:`success`,durationMs:Date.now()-o}),e}catch(e){let t=K(e)??`error`;throw r.sendCommandEvent(`cf command finished`,{...i,...a,outcome:t,durationMs:Date.now()-o,...t===`error`?p(e):{}}),e}}function J(e,t){return{...e,handler:n=>q(t,n,()=>e.handler(n))}}export{v as a,w as c,D as d,j as f,y as i,O as l,J as n,A as o,k as p,U as r,T as s,q as t,E as u};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./version-
|
|
2
|
+
import{n as e}from"./version-Zr2oF8mY.mjs";import{a as t}from"./cf-hP0SOgC6.mjs";import{mkdirSync as n,readFileSync as r,writeFileSync as i}from"node:fs";import{dirname as a,join as o}from"node:path";import{createHash as s}from"node:crypto";function c(n,r){let i=s(`sha256`).update([e,...r].join(` `)).digest(`hex`).slice(0,32);return o(t(),`cache`,n,`${i}.json`)}function l(e,t,n,i){try{let a=JSON.parse(r(c(e,t),`utf-8`));return typeof a?.fetchedAt==`number`&&Date.now()-a.fetchedAt<=n?i(a.value):void 0}catch{return}}function u(e,t,r){try{let o=c(e,t);n(a(o),{recursive:!0}),i(o,JSON.stringify({fetchedAt:Date.now(),value:r}),`utf-8`)}catch{}}const d=5e3;function f(e,t=/* @__PURE__ */ new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=/* @__PURE__ */ new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>f(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>f(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>f(e,t)))||n.if!==void 0&&!f(n.if,t)||n.then!==void 0&&!f(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!f(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>f(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>f(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function p(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!f(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function m(e,t){return l(e,t,36e5,e=>f(e)?e:void 0)}function h(e,t,n){u(e,t,n)}function g(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
|
|
3
3
|
`)[0]??``).replace(/\.$/,``);return/^"?timeout"?$/i.test(r)?`the request timed out`:r}export{h as a,m as i,g as n,l as o,p as r,u as s,d as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./theme-BGHWSKCw.mjs";import{i as t,r as n}from"./global-options-DiKj2cQy.mjs";import{s as r}from"./body-parser-BKcZS9iJ.mjs";import{n as i}from"./input-validation-D7z60HJH.mjs";import{o as a}from"./prompt-D0dXwuME.mjs";import{isDeepStrictEqual as o}from"node:util";const s=/* @__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 c(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 l(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=>s.has(e)||e.startsWith(`x-`))&&c(e).every(e=>l(e,t))}function u(e){return l(e,/* @__PURE__ */ new WeakSet)}function d(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 f(e){let t=e.path.at(-1)??e.name,n=a(e.schema.title?.trim()||d(t)),r=e.description?a(e.description.trim()):void 0;return!r||r.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${r}`}function p(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const m=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);function h(e){return e.every(e=>!m.has(e))}function g(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function _(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function v(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 y(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 b(e){let t=ee(e);if(t.length>1){let e=new Set(t.map(b));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 b(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(y));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&v(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 ee(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function x(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 S(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>o(e,t)))}function C(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>w(e,t))]),r=n[0];return n.length>0&&n.every(e=>o(e,r))?r:void 0}function w(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>w(e,t))]}function te(e,t){return{type:x(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:S(e.enum,t.enum),const:C(`const`,[e,t]),default:C(`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 T(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=T(s);r=x(r,e.type),i??=e.title,a??=e.description,o=S(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:te(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:C(`const`,[e]),default:C(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function E(e){return{...e,oneOf:void 0,anyOf:void 0}}function D(e){return(e.allOf??[]).flatMap(e=>[e,...D(e)])}function O(e){return[e,...D(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function k(e){return Object.keys(T(E(e)).properties??{}).length>0||O(e).some(e=>e.some(k))}function A(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function j(e){let t=T(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=>A(e))||O(e).some(e=>e.every(j))?!0:e.allOf?.some(j)??!1:A(t.const)}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`))return;for(let r of t)n.push({value:r,label:t.length===1&&e.title?a(e.title):void 0})}return n}function ne(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})):M(e)}function N(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(t?.length&&t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))for(let r of t){let t=W(r),i=e.title?a(e.title):void 0;n.push(i?`${t} (${i})`:t)}else if(e.pattern&&b(e)===`string`){let t=a(e.pattern),r=e.title?a(e.title):void 0;n.push(r?`${t} (${r})`:t)}else return}return n.length>0?n:void 0}function P(e,t,n,r,i){if(!h(e))return;let a=i??b(t);if(a===void 0)return;let o=a===`json`?void 0:ne(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]));return{name:e.map(p).join(`-`),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 re(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 ie(e,t){let n=re(e.type,t.type),r=e.schema.description??t.schema.description,i=n===`json`||n===`string-or-array`?{description:r}:{type:n===`number`?`number`:n,description:r};return{...e,type:n,required:e.required&&t.required,requiredWhen:F(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:o(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ae(e,t){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set,a=(e,t,n)=>{let a=r.get(e);n?i.has(e)||r.set(e,a===void 0?t:ie(a,t)):(i.add(e),r.set(e,t))},s=(e,t,s)=>{for(let c of[e,...D(e)]){let l=c.if,u=c.then?T(c.then):void 0,d=u?.required;if(!l||!d?.length)continue;let f=Object.keys(l),p=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))||p!==void 0&&!p.includes(`object`))continue;let m=new Set(l.required??[]),_=l.properties??{};if(Object.keys(_).some(e=>!m.has(e)))continue;let v=[],y=!0;for(let e of m){if(!h([...t,e])){y=!1;break}let n=g(_,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=>o(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&&g(e.properties,c)===void 0&&!i.has(l);if(!f||p){let e=g(u?.properties,c),n=e===void 0?void 0:P([...t,c],T(e),!1);n&&(a(l,n,s),f=r.get(l))}!s&&f&&!f.requiredIf?.some(e=>o(e,d))&&(f.requiredIf=[...f.requiredIf??[],d])}}},c=(e,t,i,o=!1)=>{let l=T(E(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(!h(l)||n.has(d))continue;let f=T(u),p=k(u),m=p&&j(u),g=!o&&e.has(s),_=g&&i===void 0,v=g&&i!==void 0?i:void 0;if(m){c(u,l,g?i:l,o);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=P(l,u,_,v);e&&a(d,{...e,requiredContainer:!0},o)}continue}let y=P(l,f,_,v,p?`json`:void 0);y&&a(d,y,o)}}for(let n of O(e))for(let e of n)c(e,t,i,!0);for(let n of[e,...D(e)])n.if&&n.then&&c(n.then,t,i,!0);s(l,t,o)};return c(e,[]),oe([...r.values()],t.commandFlags).sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function oe(e,n){let r=t(n),i=new Set(e.map(e=>e.name));return e.flatMap(e=>{if(r(e.name)===void 0)return[e];let t=`input-${e.name}`;return r(t)!==void 0||i.has(t)?[]:(i.add(t),[{...e,name:t}])})}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 se(t,n){if(t.length===0)return`${e.brand(a(n))}\n (no input fields)`;let r=process.stdout.columns??80,i=t.map(e=>`--${a(e.name)}`),o=Math.min(Math.max(...i.map(e=>e.length))+2,42),s=t.map((e,t)=>{let n=[`[${e.type}]`];e.required?n.push(`[required]`):e.requiredWhen&&n.push(`[required with --${a(e.requiredWhen.map(p).join(`-`))}-*]`),e.requiredIf&&n.push(`[conditionally required]`),e.choices&&n.push(`[choices: ${e.choices.map(t=>{let n=a(t),r=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return r?`${a(r)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&n.push(`[must be: ${a(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&n.push(`[default: ${a(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=n.join(` `),c=Math.max(r-o-4,20)-s.length-1,l=e.description===void 0?void 0:a(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,d=i[t]??``;return` ${d.length<o?d.padEnd(o):`${d} `}${[u,s].filter(Boolean).join(` `)}`});return[e.brand(a(n)),...s].join(`
|
|
4
|
+
`)}const ce=[`_`,`$0`,`--`,...n.flatMap(e=>[e,_(e)])];function I(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=_(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function le(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=>ue(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 ue(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=>o(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:i})=>{let a=de(e,t,n),s=a.found||r===void 0?a:R(r,e),c=!a.found||a.descriptor===void 0||!F(a.descriptor.path,e)?s.value:G(a.descriptor,s.value,[]);return s.found&&(i===void 0||i.some(e=>o(c,e)))}))??!1)}function de(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,_(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 a(U(e))}function G(e,t,n){let r=r=>{n.push(`--${a(e.name)} expects ${r} (got '${W(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(U(t)),i=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?i.includes(`integer`)&&!i.includes(`number`)&&!Number.isInteger(n)?r(`an integer`):n:r(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`||t!==`false`&&r(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return r(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:r(`a JSON ${e.type}`)}case`json`:{let n=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];if(n.length===1&&n[0]===`null`)return t===null||t===`null`?null:r(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return i(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:r(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return i(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`boolean`?r(`a string`):typeof n==`string`?i(n,e.name,`text`):U(n)}}}function K(e){return Array.from(e).length}function q(e,t,n){let r=a(e.name),{const:i,pattern:s,minLength:c,maxLength:l,minimum:u,maximum:d,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(i!==void 0&&!o(t,i)){n.push(`--${r} must be ${a(JSON.stringify(i)??`undefined`)}`);return}let m=e.schema.enum??M(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>o(t,e)))n.push(`--${r} 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(`--${r} does not match the required format (${a(s)})`),c!==void 0&&e<c&&n.push(`--${r} must be at least ${c} characters`),l!==void 0&&e>l&&n.push(`--${r} must be at most ${l} characters`)}typeof t==`number`&&(u!==void 0&&(f===!0?t<=u:t<u)&&n.push(f===!0?`--${r} must be greater than ${u}`:`--${r} must be at least ${u}`),d!==void 0&&(p===!0?t>=d:t>d)&&n.push(p===!0?`--${r} must be less than ${d}`:`--${r} must be at most ${d}`),typeof f==`number`&&t<=f&&n.push(`--${r} must be greater than ${f}`),typeof p==`number`&&t>=p&&n.push(`--${r} must be less than ${p}`))}}function fe(e,t){let n=[],r=G(e,t,n);if(r===void 0||(q(e,r,n),n.length>0))return n[0];let i=Z(e.schema,r);return i.length>0?`--${a(e.name)} ${i[0]?.replace(/^the request body /,``)}`:void 0}function 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 pe(e){return e.map(e=>e===`integer`?`an integer`:`a${/^[aeiou]/.test(e)?`n`:``} ${e}`).join(` or `)}function Y(e){return e.length===0?`the request body`:`\`/${e.map(e=>a(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n){let r=[],i=Y(n),s=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(s.length>0&&!s.some(e=>J(e,t)))return[`${i} must be ${pe(s)}`];if(e.const!==void 0&&!o(t,e.const))return[`${i} must be ${a(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>o(t,e)))return[`${i} 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=N(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match exactly one allowed shape`]}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n).length===0)){let t=N(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match an allowed shape`]}for(let i of e.allOf??[])r.push(...X(i,t,n));if(e.if&&X(e.if,t,n).length===0&&e.then&&r.push(...X(e.then,t,n)),typeof t==`string`){let n=K(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&r.push(`${i} does not match the required format (${a(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&r.push(`${i} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&r.push(`${i} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&r.push(e.exclusiveMinimum===!0?`${i} must be greater than ${e.minimum}`:`${i} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&r.push(e.exclusiveMaximum===!0?`${i} must be less than ${e.maximum}`:`${i} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&r.push(`${i} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&r.push(`${i} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&r.push(`${i} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)){if(e.minItems!==void 0&&t.length<e.minItems&&r.push(`${i} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&r.push(`${i} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>o(e,t)))&&r.push(`${i} must contain unique items`),e.items&&!Array.isArray(e.items))for(let[i,a]of t.entries())r.push(...X(e.items,a,[...n,String(i)]));else if(Array.isArray(e.items))for(let[i,a]of e.items.entries())i<t.length&&r.push(...X(a,t[i],[...n,String(i)]))}if(typeof t==`object`&&t&&!Array.isArray(t)){let a=t,o=e.properties??{};for(let t of e.required??[])Object.hasOwn(a,t)||r.push(`${Y([...n,t])} is required`);for(let[t,i]of Object.entries(a)){let a=Object.hasOwn(o,t)?o[t]:void 0;a?r.push(...X(a,i,[...n,t])):e.additionalProperties===!1?r.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&r.push(...X(e.additionalProperties,i,[...n,t]))}let s=Object.keys(a).length;e.minProperties!==void 0&&s<e.minProperties&&r.push(`${i} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&s>e.maxProperties&&r.push(`${i} must contain at most ${e.maxProperties} properties`)}return r}function Z(e,t){return[...new Set(X(e,t,[]))]}const me=[`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=>s.has(e)||e.startsWith(`x-`));for(let t of me){let n=e[t];n!==void 0&&Object.assign(r,{[t]:n})}if(e.properties!==void 0){let t=Object.entries(e.properties).map(([e,t])=>{let n=Q(t);return i&&=n.exact,[e,n.schema]});r.properties=Object.fromEntries(t)}if(e.additionalProperties!==void 0&&!Object.hasOwn(t,`patternProperties`)){if(typeof e.additionalProperties==`boolean`)r.additionalProperties=e.additionalProperties;else{let t=Q(e.additionalProperties);r.additionalProperties=t.schema,i&&=t.exact}}if(e.items!==void 0&&!Object.hasOwn(t,`prefixItems`)){if(Array.isArray(e.items))r.items=e.items.map(e=>{let t=Q(e);return i&&=t.exact,t.schema});else{let t=Q(e.items);r.items=t.schema,i&&=t.exact}}let a=(e.allOf??[]).map(e=>{let t=Q(e);return i&&=t.exact,t.schema});if(e.anyOf?.length&&(r.anyOf=e.anyOf.map(e=>{let t=Q(e);return i&&=t.exact,t.schema})),e.oneOf?.length){let t=e.oneOf.map(Q),n=t.every(e=>e.exact);i&&=n,n?r.oneOf=t.map(e=>e.schema):a.push({anyOf:t.map(e=>e.schema)})}if(e.if&&e.then){let t=Q(e.if),n=Q(e.then);i&&=t.exact&&n.exact,t.exact&&a.push({if:t.schema,then:n.schema})}return a.length>0&&(r.allOf=a),{schema:r,exact:i}}function he(e,t){return Z(Q(e).schema,t)}function ge(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([...ce,...t]),r=/* @__PURE__ */ new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(p(t))&&r.set(p(t),t);return[...r.values()].sort()}function _e(e,t,n={}){let i=[],o=n.baseBody!==void 0,s=n.baseBody===void 0?{}:structuredClone(n.baseBody),c=e.filter(({path:e})=>h(e)),l=[...n.reserved??[],...H(c)];for(let e of c){let n=I(e,t);if(n===void 0){!o&&z(e,c,t)&&!B(e.path,c,t)&&!(e.requiredContainer&&V(e,c,t))&&i.push(`--${a(e.name)} is required`);continue}let l=G(e,n,i);l!==void 0&&(q(e,l,i),o?ge(s,e.path,l):r(s,e.path,l))}if(o)for(let e of L(c,s))I(e,t)===void 0&&i.push(`--${a(e.name)} is required`);for(let e of $(t,l))i.push(`Unknown flag --${a(e)}`);return{body:s,errors:i}}export{L as a,ae as c,Z as d,he as f,le as i,$ as l,H as n,se as o,u as r,f as s,_e as t,fe as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{i as n,n as r}from"./auth-FK2eLQ02.mjs";import{a as i,t as a}from"./context-Dp4CXG22.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-DLri-rA7.mjs";import{t as l}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{n as u,t as d}from"./input-validation-D7z60HJH.mjs";import{n as f}from"./prompt-D0dXwuME.mjs";function ee(e){return e.usage("$0 scim groups create\n\nCreates a new SCIM Group (user group) for the account. The `displayName` must not be empty and must not begin with `CF` (reserved for system groups).").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const p={command:`create`,describe:`Create SCIM Group`,builder:ee,handler:async e=>l({command:`scim groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:e.body});return}let l=await r(e),f=e.local?t:await a();if(e.accountId=f,e.file){let t=d(e.file),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Created`})}else if(e.body){let t=u(e.body,`body`,`binary`),r=await c(`Creating`,async()=>n(l,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Created`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var m={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/scim/v2/Groups/${t.group_id}`,response:!1};function h(e){return e.usage(`$0 scim groups delete <group-id>
|
|
3
3
|
|
|
4
4
|
Deletes a SCIM Group (custom user groups only). System groups backed by Cloudflare permission groups cannot be deleted via SCIM. Returns 204 No Content on success.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <group-id>`,describe:`Delete SCIM Group`,builder:h,handler:async e=>l({command:`scim groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await f({force:!!e.force,message:`Are you sure? This action cannot be undone.`}))return;let u=await c(`Deleting`,async()=>n.send(m,{account_id:l,group_id:e[`group-id`]}));o(u,{successLabel:`Deleted`})})};function _(e){return e.usage("$0 scim groups edit <group-id>\n\nPartially updates a SCIM Group via PATCH operations (RFC 7644 Section 3.5.2). Supports add, remove, and replace operations on `members`, `displayName`, and `externalId`. For system groups (prefixed `cloudflare-v1-`), only member management operations are supported.").positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const v={command:`edit <group-id>`,describe:`Patch SCIM Group`,builder:_,handler:async e=>l({command:`scim groups edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf scim groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/scim/v2/Groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`octet-stream`,body:e.body});return}let l=await r(e),f=e.local?t:await a();if(e.accountId=f,e.file){let t=d(e.file),r=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(e[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Updated`})}else if(e.body){let t=u(e.body,`body`,`binary`),r=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(e[`group-id`]))}`,{body:t,headers:{"Content-Type":`application/scim+json`}}));o(r,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var y={method:`GET`,path:t=>e`/accounts/${t.account_id}/scim/v2/Groups/${t.group_id}`};function b(e){return e.usage(`$0 scim groups get <group-id>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,t as i}from"./context-Dp4CXG22.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-DLri-rA7.mjs";import{t as c}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{n as l,t as u}from"./body-parser-BKcZS9iJ.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,n as p}from"./prompt-D0dXwuME.mjs";var m={method:`GET`,path:t=>e`/accounts/${t.account_id}/secrets_store/quota`};function h(e){return e.usage(`$0 secrets-store quota get
|
|
3
3
|
|
|
4
4
|
Lists the number of secrets used in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`View secret usage`,builder:h,handler:async e=>c({command:`secrets-store quota get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(m,{account_id:l}));a(u,{successLabel:`Loaded`})})},_={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var v={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/secrets_store/stores/${t.store_id}/secrets`,body:`json`};function y(e){return e.usage(`$0 secrets-store secrets bulk-delete
|
|
5
5
|
|