cf 1.0.0-beta.27 → 1.0.0-beta.28
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 +5787 -1914
- package/dist/_meta/hand-written-commands.json +2 -2
- package/dist/_meta/schemas.json +796 -557
- package/dist/{abuse-reports-RxXqfDEW.mjs → abuse-reports-D9edOyag.mjs} +5 -5
- package/dist/{access-BxEprr2f.mjs → access-CKCCSrrU.mjs} +1 -1
- package/dist/{accounts-DU2ZNYqP.mjs → accounts-CNb9U9bK.mjs} +22 -22
- package/dist/{acm-CBCIKBJ4.mjs → acm-CdKTAToZ.mjs} +3 -3
- package/dist/{addressing-BKxiLRHk.mjs → addressing-eZI_C-b0.mjs} +18 -18
- package/dist/{agent-memory-DkBpQYUL.mjs → agent-memory-BBHCEE7h.mjs} +7 -7
- package/dist/{ai-DqEN_hhg.mjs → ai-Csl_QNwv.mjs} +7 -7
- package/dist/ai-audit-DlqWsQi-.mjs +6 -0
- package/dist/{ai-gateway-B0uiYVHq.mjs → ai-gateway-Lj4On37s.mjs} +13 -13
- package/dist/{ai-search-DbZIxdio.mjs → ai-search-BxyhS3X7.mjs} +17 -17
- package/dist/{ai-security-CvZfP2JC.mjs → ai-security-DvU2iYkY.mjs} +3 -3
- package/dist/{alerting-BjGwBxZT.mjs → alerting-r0G2X9y9.mjs} +10 -10
- package/dist/{analytics-C7kT_H-W.mjs → analytics-C6bfqm-W.mjs} +7 -7
- package/dist/analytics-engine-BlIecoOe.mjs +4 -0
- package/dist/api-Dnt6lRJG.mjs +3 -0
- package/dist/{api-security-BbcvDtff.mjs → api-security-DZ7GWOqD.mjs} +26 -26
- package/dist/argo-Bh0_cj49.mjs +14 -0
- package/dist/{artifacts-2R2sxIKO.mjs → artifacts-VZJWVq_6.mjs} +16 -16
- package/dist/{audit-logs-LoBB1OO_.mjs → audit-logs-B8cGL4B9.mjs} +1 -1
- package/dist/auth-B-h0BHg7.mjs +2 -0
- package/dist/auth-B6tswVxH.mjs +2 -0
- package/dist/{auth-D499YE2n.mjs → auth-clmqFEWU.mjs} +3 -3
- package/dist/{auth-token-BwpERbnG.mjs → auth-token-DW4dJVdj.mjs} +1 -1
- package/dist/{autoconfig-B2w-woU0.mjs → autoconfig-C0ynlGHf.mjs} +47 -47
- package/dist/{basin-catalog-AgOHGiPI.mjs → basin-catalog-TehR1sKZ.mjs} +11 -11
- package/dist/billing-B2KusU6g.mjs +22 -0
- package/dist/{blocks-C8vyXIAT.mjs → blocks-BFulF68V.mjs} +1 -1
- package/dist/body-parser-DoewLePl.mjs +2 -0
- package/dist/{body-unions-CjpNjwSW.mjs → body-unions-DNs981Ia.mjs} +1 -1
- package/dist/{bot-management-fwxKIbaB.mjs → bot-management-CXHXgrQC.mjs} +2 -2
- package/dist/{botnet-feed-DCYB5kYZ.mjs → botnet-feed-UyK7Rfp6.mjs} +1 -1
- package/dist/brand-protection-kv1ba80i.mjs +14 -0
- package/dist/browser-run-D-vRoZmf.mjs +40 -0
- package/dist/build-BzJGqb2o.mjs +2 -0
- package/dist/build-FFxzigo4.mjs +2 -0
- package/dist/{builds-CoazxuN-.mjs → builds-BbxINHRP.mjs} +15 -15
- package/dist/cache-BacNNtLu.mjs +36 -0
- package/dist/{cf-hP0SOgC6.mjs → cf-BQ_LRiut.mjs} +2 -2
- package/dist/{chunk-DSGVRFIS-DQwKND2c.mjs → chunk-DSGVRFIS-BaNZNW-M.mjs} +1 -1
- package/dist/{chunk-SOBRPAPT-BKzUiNx_.mjs → chunk-SOBRPAPT-QTjnHSNs.mjs} +1 -1
- package/dist/{cli-Nqf58-1c.mjs → cli-B7vslRfu.mjs} +1 -1
- package/dist/{client-side-security-VmZzMy-m.mjs → client-side-security-bzB9JosR.mjs} +6 -6
- package/dist/{cloud-connector-bMlFnqP0.mjs → cloud-connector-BHtf37R5.mjs} +2 -2
- package/dist/{cloudflared-Ba4KWdTO.mjs → cloudflared-QDdHMUEY.mjs} +1 -1
- package/dist/{cloudforce-one-CCaIBOAo.mjs → cloudforce-one-DWBPQDA3.mjs} +71 -71
- package/dist/{command-C4OgtX_x.mjs → command-AVwd7XjE.mjs} +1 -1
- package/dist/{command-C5Kqc5Km.mjs → command-B87T_f2f.mjs} +1 -1
- package/dist/{command-CelQVrZL.mjs → command-CEHhi3t0.mjs} +1 -1
- package/dist/{command-ByYf12-8.mjs → command-CYmQE79n.mjs} +1 -1
- package/dist/{command-pMoNdd22.mjs → command-CbxXc5IW.mjs} +1 -1
- package/dist/{command-Bih1HLr3.mjs → command-Ce8CVLth.mjs} +1 -1
- package/dist/{command-MxFFWqMg.mjs → command-CqDudQZs.mjs} +1 -1
- package/dist/{command-BASaTmJc.mjs → command-D4YcwpVp.mjs} +1 -1
- package/dist/{command-BxZBNPxG.mjs → command-D895kdlh.mjs} +1 -1
- package/dist/{command-CrAlzysj.mjs → command-D9Qyi1B0.mjs} +1 -1
- package/dist/{command-BiIVclNA.mjs → command-DeutqL1n.mjs} +1 -1
- package/dist/{command-C0qCuw03.mjs → command-Dl9ICrRK.mjs} +1 -1
- package/dist/{command-CZAR85ba.mjs → command-DtCSe8Hy.mjs} +1 -1
- package/dist/{command-C2FVMd1b.mjs → command-DwzVtmb3.mjs} +1 -1
- package/dist/{command-CFxyp8Uo.mjs → command-wtBubtZ4.mjs} +1 -1
- package/dist/{completions-DRzBiqpv.mjs → completions-BvdKtzsX.mjs} +1 -1
- package/dist/{connector-interrupts-CrTeSyaM.mjs → connector-interrupts-dUPW6Ya_.mjs} +2 -2
- package/dist/{connector-telemetry-events-BbAOUt9h.mjs → connector-telemetry-events-DWVCqnhn.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-DcpBx7Qx.mjs → connector-telemetry-snapshots-CeMP3qeI.mjs} +1 -1
- package/dist/{connectors-D1WFLJoE.mjs → connectors-DZFGNw3i.mjs} +4 -4
- package/dist/containers-B06OGOEB.mjs +380 -0
- package/dist/{containers-BOBEs1Gk.mjs → containers-DCzQCo79.mjs} +8 -8
- package/dist/{content-scan-D1GfPSL0.mjs → content-scan-XhnNJqXf.mjs} +4 -4
- package/dist/{context-Dp4CXG22.mjs → context-BY1Eh_Qe.mjs} +1 -1
- package/dist/{cps-D4uhzg3k.mjs → cps-CohlxvuN.mjs} +2 -2
- package/dist/create-DmLDMvrj.mjs +2 -0
- package/dist/{csam-scanner-DOOUBeBM.mjs → csam-scanner-BV4bHq8v.mjs} +2 -2
- package/dist/{custom-csrs-DtdFo5YZ.mjs → custom-csrs-BVdMQjYq.mjs} +2 -2
- package/dist/{custom-hostnames-ccdlELaD.mjs → custom-hostnames-r-CxhSa1.mjs} +5 -5
- package/dist/{custom-nameservers-p3gDjfva.mjs → custom-nameservers-CapMDyly.mjs} +2 -2
- package/dist/{custom-pages-DAkKVzgR.mjs → custom-pages-BVIniWfq.mjs} +5 -5
- package/dist/{d1-CDIyRdh4.mjs → d1-nJCOJZb8.mjs} +20 -22
- package/dist/{delegate-B4bKqF7i.mjs → delegate-CcL6RoGw.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-BaC5Ty7F.mjs → deploy-DJMnWFNk.mjs} +1 -1
- package/dist/{deploy-context-DTTgNGro.mjs → deploy-context-YCW3eqP1.mjs} +15 -15
- package/dist/{deploy-input-mAy06fAI.mjs → deploy-input-CQLBXFEB.mjs} +1 -1
- package/dist/{dev-De-HszNT.mjs → dev-GsYHvMah.mjs} +1 -1
- package/dist/{diagnostics-D1CUs2o9.mjs → diagnostics-C3nqxsAO.mjs} +4 -4
- package/dist/{dist-D5qkmHhC.mjs → dist-D-ihn_mV.mjs} +42 -33
- package/dist/{dls-DWBiYzY1.mjs → dls-N1x8sAK3.mjs} +3 -3
- package/dist/{dns-wMjf1t6-.mjs → dns-DATWP-PF.mjs} +25 -25
- package/dist/{dns-firewall-DH9xIT5H.mjs → dns-firewall-n3Y2ui6W.mjs} +4 -4
- package/dist/{docs-BA7qslb2.mjs → docs-CRc_WOXh.mjs} +1 -1
- package/dist/{dry-run-gy0Hl9xo.mjs → dry-run-kJbjn4kG.mjs} +1 -1
- package/dist/{durable-objects-DF0MYpnV.mjs → durable-objects-DHK9w-vO.mjs} +2 -2
- package/dist/{email-auth-BShMFXn4.mjs → email-auth-ptdqNSTZ.mjs} +1 -1
- package/dist/{email-domains-CDSbVclP.mjs → email-domains-uL22-zRY.mjs} +2 -2
- package/dist/{email-routing-CBCkbg_F.mjs → email-routing-CV43rMJC.mjs} +12 -12
- package/dist/{email-security-CnNa1YON.mjs → email-security-DK_SJ0yi.mjs} +38 -38
- package/dist/{email-sending-CpDSw-Eb.mjs → email-sending-CTQafGec.mjs} +11 -11
- package/dist/{error-sanitization-DG8WSzHe.mjs → error-sanitization-BkgtZ0Vx.mjs} +1 -1
- package/dist/error-sanitization-D069tpKk.mjs +2 -0
- package/dist/{errors-DatLr-iR.mjs → errors-VG1mgwJl.mjs} +1 -1
- package/dist/{field-extractors-BwGdMnTr.mjs → field-extractors-jcZ_bAGc.mjs} +2 -2
- package/dist/{firewall-CY_oem-d.mjs → firewall-CW-fAI9m.mjs} +12 -12
- package/dist/{flagship-Bat5EZCk.mjs → flagship-RiLnDwfJ.mjs} +8 -8
- package/dist/{fraud-CSUKLh8X.mjs → fraud-DvfBBTe8.mjs} +2 -2
- package/dist/get-3XNn0upb.mjs +2 -0
- package/dist/{google-tag-gateway-C2skt6t-.mjs → google-tag-gateway-C5WYsSXv.mjs} +2 -2
- package/dist/{healthchecks-uC43QKQd.mjs → healthchecks-BA1fmzTm.mjs} +5 -5
- package/dist/{hyperdrive-FcBbpew4.mjs → hyperdrive-Ch6klUp3.mjs} +4 -4
- package/dist/{iam-8T74DNhH.mjs → iam-LlGEzRCq.mjs} +14 -14
- package/dist/{images-C3JUaf6b.mjs → images-C5WqUXkK.mjs} +11 -11
- package/dist/index.mjs +1 -1
- package/dist/{init-BEVVz4_P.mjs → init-EVsjBrOz.mjs} +2 -2
- package/dist/{intel-DRy4rHrt.mjs → intel-vcWyslaX.mjs} +14 -14
- package/dist/{interactive-CKHdGvkh.mjs → interactive-BCDFSPtq.mjs} +1 -1
- package/dist/{internal-CamuESs0.mjs → internal-BhV9WjLp.mjs} +1 -1
- package/dist/{ips-DinCNnWj.mjs → ips-CqHjVsqd.mjs} +1 -1
- package/dist/k2-CZT2Pd5J.mjs +10 -0
- package/dist/kv-Ipa7dnvF.mjs +12 -0
- package/dist/{lazy-command-WB1FOuew.mjs → lazy-command-DbKVgdGT.mjs} +1 -1
- package/dist/{leaked-credential-checks-CSZd9hBQ.mjs → leaked-credential-checks-EzT4TTjO.mjs} +4 -4
- package/dist/{live-B6AsI_E5.mjs → live-C9L1bNuE.mjs} +1 -1
- package/dist/{load-balancers-gap5u4b1.mjs → load-balancers-Cb3VkSfc.mjs} +21 -21
- package/dist/local-D5Vq6ooZ.mjs +2 -0
- package/dist/{local-CgBhtmON.mjs → local-DIJ7SIKC.mjs} +1 -1
- package/dist/{local-runtime-CmlJ20uJ.mjs → local-runtime-BZjgkacr.mjs} +1 -1
- package/dist/{login-BJHaTERg.mjs → login-DG5ebyab.mjs} +1 -1
- package/dist/login-DRJugxya.mjs +2 -0
- package/dist/{logpush-qhlxsioM.mjs → logpush-C5Gw7F_9.mjs} +16 -16
- package/dist/{logs-bI54CJ0w.mjs → logs-y3REfHbb.mjs} +8 -8
- package/dist/magic-network-monitoring-BZBGZB6M.mjs +34 -0
- package/dist/{magic-transit-BwDyySHJ.mjs → magic-transit-BPV_POf5.mjs} +129 -129
- package/dist/{managed-defense-CsBBkfeQ.mjs → managed-defense-BaUBSUcz.mjs} +3 -3
- package/dist/{managed-transforms-CUC-uAbW.mjs → managed-transforms-CjkjLzMC.mjs} +2 -2
- package/dist/{mcp-CyI0sDmL.mjs → mcp-RPtrISTy.mjs} +6 -6
- package/dist/{mesh-Czr0UCP4.mjs → mesh-DZ4QHBPE.mjs} +5 -5
- package/dist/{migrate-DKDWYrz2.mjs → migrate-CRIUqGi2.mjs} +1 -1
- package/dist/{monetization-NUgfDtSy.mjs → monetization-CVZqM8Xo.mjs} +4 -4
- package/dist/{network-B42zrBic.mjs → network-DLt2JUo1.mjs} +15 -15
- package/dist/{network-interconnects-DuIBe8fK.mjs → network-interconnects-9nS5jL__.mjs} +10 -10
- package/dist/{o11y-oEUpMC3O.mjs → o11y-ySxrnP1Z.mjs} +45 -43
- package/dist/{oauth-BmSFLp_s.mjs → oauth-CFVUl-Wv.mjs} +1 -1
- package/dist/{oauth-BLQ1-y3R.mjs → oauth-Cidoyxfp.mjs} +1 -1
- package/dist/{observability-BxhJQCgZ.mjs → observability-C-KNh__y.mjs} +1 -1
- package/dist/ohttp-gateway-B5nCl4s3.mjs +8 -0
- package/dist/organizations-DbeeWUL4.mjs +71 -0
- package/dist/output-BZQEl3mK.mjs +2 -0
- package/dist/package-B7RgwuFR.mjs +2 -0
- package/dist/{page-rules-J6LhwR-s.mjs → page-rules-DRw763O1.mjs} +4 -4
- package/dist/{pages-BksdnChs.mjs → pages-DfQnxiTk.mjs} +12 -12
- package/dist/{pay-per-crawl-BLcbHRoR.mjs → pay-per-crawl-EHYtSKxX.mjs} +13 -13
- package/dist/{pay-per-use-VatiU-Nt.mjs → pay-per-use-wdEhl8k4.mjs} +11 -11
- package/dist/{pipelines-B5AoB3f3.mjs → pipelines-DbyrI6F4.mjs} +11 -11
- package/dist/{precursor-D3VH2MXT.mjs → precursor-Dx8lN4UJ.mjs} +2 -2
- package/dist/previews-DEVNSip2.mjs +6 -0
- package/dist/{progress-DLri-rA7.mjs → progress-yvPscjYg.mjs} +1 -1
- package/dist/{prompt-D0dXwuME.mjs → prompt-CEpZ-lQZ.mjs} +1 -1
- package/dist/{queues-BsAck4To.mjs → queues-DgMc7Z6A.mjs} +18 -18
- package/dist/{r2-BYjdHDEZ.mjs → r2-BpTVicIq.mjs} +21 -21
- package/dist/{radar-CvLtu-Vr.mjs → radar-DW-S1VUh.mjs} +11 -11
- package/dist/{raw-fetch-DQeDx1wT.mjs → raw-fetch-Cl5spWC3.mjs} +1 -1
- package/dist/{ready-gsGEaWLL.mjs → ready-d0li0X6r.mjs} +1 -1
- package/dist/{realtime-DiCEgFTC.mjs → realtime-DMKHLYF4.mjs} +41 -41
- package/dist/{registrar-D4wdgWpo.mjs → registrar-D23gfKBi.mjs} +5 -5
- package/dist/{registrar-sandbox-B6yopzdG.mjs → registrar-sandbox-lVLB1-mC.mjs} +4 -4
- package/dist/{reporting-BiHgnT8L.mjs → reporting-WX8P3Y0k.mjs} +2 -2
- package/dist/{request-headers-CoxHUNcB.mjs → request-headers-C0FpeBhz.mjs} +1 -1
- package/dist/{request-tracers-817HTytF.mjs → request-tracers-qd7XOAka.mjs} +2 -2
- package/dist/resource-sharing-B2ZSt_cA.mjs +36 -0
- package/dist/{rules-CRhe_ca9.mjs → rules-CB0QQTB3.mjs} +5 -5
- package/dist/{rulesets-CKyc-Xlx.mjs → rulesets-DmqwixUC.mjs} +6 -6
- package/dist/{rum-BfnWHW_d.mjs → rum-BZ_24qZU.mjs} +9 -9
- package/dist/{run-Ciw_GIrC.mjs → run-BOKI1uWa.mjs} +1 -1
- package/dist/run-DBqOjD1P.mjs +2 -0
- package/dist/{schema-DuLIZRhA.mjs → schema-Dj9STsWI.mjs} +1 -1
- package/dist/{schema-cache-BIo0Gi2H.mjs → schema-cache-5NkOj7Y3.mjs} +1 -1
- package/dist/{schema-flags-DrqvwQNw.mjs → schema-flags-CXm9iIv6.mjs} +1 -1
- package/dist/{scim-C4iRWNYB.mjs → scim-DchxaJfE.mjs} +8 -8
- package/dist/{secrets-store-DgtzZRze.mjs → secrets-store-oAft1cFE.mjs} +5 -5
- package/dist/{security-insights-SlUGW3F_.mjs → security-insights-DMm0qg_m.mjs} +15 -15
- package/dist/{security-txt-C3YS0REz.mjs → security-txt-CIt0494b.mjs} +2 -2
- package/dist/{session-D2yuwO4i.mjs → session-vzNfUhPl.mjs} +1 -1
- package/dist/{shared--uVkAAd7.mjs → shared-MK-_lkbn.mjs} +1 -1
- package/dist/{signed-url-ClLk45_J.mjs → signed-url-gNangfwc.mjs} +1 -1
- package/dist/{smart-shield-Dn95hqUH.mjs → smart-shield-Boy_qbqd.mjs} +6 -6
- package/dist/{snippets-BNUKOajz.mjs → snippets-DdoDYXW-.mjs} +3 -3
- package/dist/{spawn-DuT4snxu.mjs → spawn-B5F4OIHG.mjs} +1 -1
- package/dist/{spectrum-Cj0BMtg2.mjs → spectrum-DLYIHelC.mjs} +3 -3
- package/dist/{speed-BrVeZRyX.mjs → speed-DugG9Tm9.mjs} +2 -2
- package/dist/{sql-BX1pBqj3.mjs → sql-Bb56llsb.mjs} +2 -2
- package/dist/src-BoSDeQ9m.mjs +133 -0
- package/dist/{ssl-Bx4LCutF.mjs → ssl-Bg4X3WGk.mjs} +24 -24
- package/dist/startup-profile-DQVkZZpb.mjs +2 -0
- package/dist/{startup-profile-DqaYNT0b.mjs → startup-profile-DZL2DC44.mjs} +1 -1
- package/dist/state-DW3QZtfh.mjs +2 -0
- package/dist/{state-BmzOLELo.mjs → state-mr5ux1Nb.mjs} +1 -1
- package/dist/{stream-BRzr6yh0.mjs → stream-BuZYDbNR.mjs} +21 -21
- package/dist/{tags-xVzjZxdt.mjs → tags-SKz2odE_.mjs} +3 -3
- package/dist/{telemetry-CJ9URio3.mjs → telemetry-B4zmCpT0.mjs} +1 -1
- package/dist/telemetry-DkDUr4KK.mjs +2 -0
- package/dist/{tenant-custom-nameservers-M7Fxqh2W.mjs → tenant-custom-nameservers-BhkhBerL.mjs} +2 -2
- package/dist/tenants-DD-GMq0K.mjs +13 -0
- package/dist/{tools-C-vmgYSv.mjs → tools-KW_4hvzY.mjs} +1 -1
- package/dist/{tunnels-DQVXKUKA.mjs → tunnels-D90ztENM.mjs} +6 -6
- package/dist/{turnstile-B_Ugzgom.mjs → turnstile-DhSU_Xar.mjs} +4 -4
- package/dist/ui-xjCox-gU.mjs +2 -0
- package/dist/{update-check-DHUo4FOJ.mjs → update-check-CRttabfu.mjs} +1 -1
- package/dist/{update-check-DRr0eRhB.mjs → update-check-HltjTMDE.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization-CZRQH_pJ.mjs → url-normalization-K7gkmPvG.mjs} +2 -2
- package/dist/{url-scanner-BH4PLy16.mjs → url-scanner-BRdWwka4.mjs} +3 -3
- package/dist/{user-Bn82Qw0Y.mjs → user-Cmb1_Wu5.mjs} +50 -50
- package/dist/{vectorize-DoVVz_sh.mjs → vectorize-BTBerJME.mjs} +11 -11
- package/dist/verify-B9ILCohg.mjs +2 -0
- package/dist/verify-BCuWaO-L.mjs +2 -0
- package/dist/version-6Bpy6Bgt.mjs +2 -0
- package/dist/{waiting-rooms-QUW131o3.mjs → waiting-rooms-LymmKIGr.mjs} +13 -13
- package/dist/{web-assets-CgQXsp8m.mjs → web-assets-LHPQsrnY.mjs} +21 -21
- package/dist/{web3-TY9s6Swn.mjs → web3-BsOio0Ae.mjs} +12 -12
- package/dist/workers-BnLiOjZf.mjs +39 -0
- package/dist/{workers-builds-BgGY0IGk.mjs → workers-builds-sKpITeRk.mjs} +4 -4
- package/dist/{workers-for-platforms-5RkV9MVp.mjs → workers-for-platforms-BGp6yr6P.mjs} +9 -9
- package/dist/{workers-vpc-Bt4OQbwM.mjs → workers-vpc-D8lefWDo.mjs} +3 -3
- package/dist/{workflows-6m85DdqF.mjs → workflows-B-ZIG3y7.mjs} +22 -22
- package/dist/{wrangler-migration-BbmGOu8l.mjs → wrangler-migration-6E6wT_LZ.mjs} +66 -57
- package/dist/{zaraz-8WSJ7l0L.mjs → zaraz-BBKki5WS.mjs} +11 -11
- package/dist/{zero-trust-DK0cqDZv.mjs → zero-trust-BZDXM5r6.mjs} +165 -165
- package/dist/{zones-DTAcguf6.mjs → zones-B-UV_DGE.mjs} +24 -24
- package/package.json +14 -14
- package/dist/ai-audit-BmzOgt6x.mjs +0 -6
- package/dist/analytics-engine-BHpcNSdD.mjs +0 -4
- package/dist/api-X3wKppsT.mjs +0 -3
- package/dist/argo-D1VONzu-.mjs +0 -14
- package/dist/auth-CspwoBlp.mjs +0 -2
- package/dist/auth-FK2eLQ02.mjs +0 -2
- package/dist/billing-DRNww0iC.mjs +0 -24
- package/dist/body-parser-BKcZS9iJ.mjs +0 -2
- package/dist/brand-protection-BVICLzBc.mjs +0 -26
- package/dist/browser-run-CEk-NIgP.mjs +0 -40
- package/dist/build-CRm2TQq8.mjs +0 -2
- package/dist/build-DO_GNhRl.mjs +0 -2
- package/dist/cache-jlLJLSu7.mjs +0 -36
- package/dist/containers-DINLx5_i.mjs +0 -380
- package/dist/create-BtmuVqVL.mjs +0 -2
- package/dist/error-sanitization-B025CygB.mjs +0 -2
- package/dist/get-Be821dio.mjs +0 -2
- package/dist/k2-wsanPL3y.mjs +0 -10
- package/dist/kv-BLSPcEnH.mjs +0 -12
- package/dist/local-CFsO9Tkg.mjs +0 -2
- package/dist/login-BfuOf-Yi.mjs +0 -2
- package/dist/magic-network-monitoring-CX3TaMTu.mjs +0 -34
- package/dist/organization-CEnlXwrl.mjs +0 -70
- package/dist/organizations-Dt86ToxE.mjs +0 -4
- package/dist/origin-post-quantum-encryption-lX-uaJSL.mjs +0 -6
- package/dist/output-BJEgbI0G.mjs +0 -2
- package/dist/package-CiRJBRHO.mjs +0 -2
- package/dist/previews-DzJ85fsr.mjs +0 -6
- package/dist/resource-sharing-CW9xxtq5.mjs +0 -36
- package/dist/run-DD45EQTm.mjs +0 -2
- package/dist/src-DPnUfK4c.mjs +0 -131
- package/dist/startup-profile-tZNb2HGz.mjs +0 -2
- package/dist/state-Uwfrmw5I.mjs +0 -2
- package/dist/telemetry-Pt5GpCKD.mjs +0 -2
- package/dist/ui-FYultowZ.mjs +0 -2
- package/dist/version-Zr2oF8mY.mjs +0 -2
- package/dist/workers-B3uJqJKc.mjs +0 -39
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-DIJ7SIKC.mjs";import{n}from"./auth-B-h0BHg7.mjs";import{a as r,t as i}from"./context-BY1Eh_Qe.mjs";import{t as a}from"./output-BZQEl3mK.mjs";import{t as o}from"./dry-run-kJbjn4kG.mjs";import{t as s}from"./progress-yvPscjYg.mjs";import{t as c}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{a as l,n as u,r as d,t as f}from"./body-parser-DoewLePl.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";import{a as m,i as h,n as g}from"./prompt-CEpZ-lQZ.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
|
+
|
|
4
|
+
Creates a share that makes a resource available to specific accounts in the caller's organization, or to the whole organization.`).option(`excluded-recipients`,{type:`string`,description:"Accounts to exclude from an organization-targeted share. Only allowed when `recipients` contains no account entries. The share owner cannot be excluded. Duplicate entries are ignored. Provide as a JSON array of objects or @path/to/file.json."}).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(`tags`,{type:`string`,description:`Tags associated with the share. 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 y={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({excluded_recipients:l(e[`excluded-recipients`],`excluded-recipients`),name:p(e.name,`name`,`text`),recipients:l(e.recipients,`recipients`),resources:l(e.resources,`resources`),tags:d(e.tags,`tags`)},[[`tags`]]):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),h=await n(e),g=e.local?t:await i();if(e.accountId=g,e.body!==void 0){let e=c,t=await s(`Creating`,async()=>h.send(_,{body:e,account_id:g}));a(t,{successLabel:`Created`});return}e.name===void 0&&(e.name=await m(`name`,`The name of the share.`));let v=f({excluded_recipients:l(e[`excluded-recipients`],`excluded-recipients`),name:p(e.name,`name`,`text`),recipients:l(e.recipients,`recipients`),resources:l(e.resources,`resources`),tags:d(e.tags,`tags`)},[[`tags`]]),y=await s(`Creating`,async()=>h.send(_,{body:v,account_id:g}));a(y,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}`};function ee(e){return e.usage(`$0 resource-sharing delete <share-id>
|
|
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 te={command:`delete <share-id>`,describe:`Trigger a share deletion`,builder:ee,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(b,{account_id:l,share_id:e[`share-id`]}));a(u,{successLabel:`Deleted`})})};var ne={method:`POST`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/excluded-recipients`,body:`json`};function re(e){return e.usage(`$0 resource-sharing excluded-recipients create <share-id>
|
|
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(`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:re,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}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let c=e.body===void 0?void 0:u(e.body),l=await n(e),d=e.local?t:await i();if(e.accountId=d,e.body!==void 0){let t=c,n=await s(`Creating`,async()=>l.send(ne,{body:t,account_id:d,share_id:e[`share-id`]}));a(n,{successLabel:`Created`})}})};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
|
+
|
|
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,message:`Removing the exclusion makes the share apply to this account.`}))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
|
+
|
|
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
|
+
|
|
14
|
+
Lists the accounts excluded from an organization-targeted share. Returns an empty list for account-targeted shares.`).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when omitted."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when omitted."}).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
|
+
|
|
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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const 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`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},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,[],1e3)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let c=e.body===void 0?void 0:u(e.body,[],1e3),l=await n(e),d=e.local?t:await i();if(e.accountId=d,await g({force:!!e.force,message:`Accounts omitted from the list are no longer excluded and will receive the share.`})&&e.body!==void 0){let t=c,n=await s(`Updating`,async()=>l.send(j,{body:t,account_id:d,share_id:e[`share-id`]}));a(n,{successLabel:`Updated`})}})},P={command:`excluded-recipients`,describe:`Accounts excluded from an organization-targeted share`,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`,`include_tags_from`]};function I(e){return e.usage(`$0 resource-sharing get <share-id>
|
|
17
|
+
|
|
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(`include-tags-from`,{type:`string`,description:"Include share tags in the response. `api` reads tags from the tag service; `mirror` reads a local, eventually consistent replica. If the tag lookup fails, the response omits `tags`.",choices:[`api`,`mirror`]}).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`,`include-tags-from`,`dry-run`]}},e,async()=>{let c={include_resources:e[`include-resources`],include_recipient_counts:e[`include-recipient-counts`],include_tags_from:e[`include-tags-from`]};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`,`include_tags_from`,`tag`]};function z(e){return e.usage(`$0 resource-sharing list
|
|
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 omitted."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when omitted."}).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(`include-tags-from`,{type:`string`,description:"Include share tags in the response. `api` reads tags from the tag service; `mirror` reads a local, eventually consistent replica. If the tag lookup fails, the response omits `tags`.",choices:[`api`,`mirror`]}).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`,`include-tags-from`,`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`],include_tags_from:e[`include-tags-from`],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
|
+
|
|
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(`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:"Specify the account receiving the share using `recipient_account_id`. The legacy field `account_id` is accepted as a synonym 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({recipient_account_id:p(e[`recipient-account-id`],`recipient-account-id`,`text`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await n(e),d=e.local?t:await i();if(e.accountId=d,e.body!==void 0){let t=c,n=await s(`Creating`,async()=>l.send(V,{body:t,account_id:d,share_id:e[`share-id`]}));a(n,{successLabel:`Created`});return}let m=f({recipient_account_id:p(e[`recipient-account-id`],`recipient-account-id`,`text`)}),h=await s(`Creating`,async()=>l.send(V,{body:m,account_id:d,share_id:e[`share-id`]}));a(h,{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 q={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/recipients/${t.recipient_id}`,query:[`include_resources`]};function J(e){return e.usage(`$0 resource-sharing recipients get <recipient-id>
|
|
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 ie={command:`get <recipient-id>`,describe:`Get share recipient by ID`,builder:J,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(q,{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 omitted."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when omitted."}).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
|
+
|
|
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\`) and the list is non-empty; 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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const 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`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},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,[],100)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let c=e.body===void 0?void 0:u(e.body,[],100),l=await n(e),d=e.local?t:await i();if(e.accountId=d,await g({force:!!e.force,message:`Accounts omitted from the list are disassociated from the share.`})&&e.body!==void 0){let t=c,n=await s(`Updating`,async()=>l.send(se,{body:t,account_id:d,share_id:e[`share-id`]}));a(n,{successLabel:`Updated`})}})},ue={command:`recipients`,describe:`Accounts that receive a share`,builder:e=>e.command(U).command(K).command(ie).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
|
+
|
|
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:"The account that owns the resource. Must match the `account_id` in the path."}).option(`resource-id`,{type:`string`,description:`Identifier assigned by the service that owns the shared resource.`}).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=e.body===void 0?void 0:u(e.body,[{path:[`meta`],flag:`meta`}]),l=await n(e),g=e.local?t:await i();if(e.accountId=g,e.body!==void 0){let t=c,n=await s(`Creating`,async()=>l.send(X,{body:t,account_id:g,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`,"The account that owns the resource. Must match the `account_id` in the path.")),e[`resource-id`]===void 0&&(e[`resource-id`]=await m(`resource-id`,`Identifier assigned by the service that owns the shared resource.`)),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 _=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`]]),v=await s(`Creating`,async()=>l.send(X,{body:_,account_id:g,share_id:e[`share-id`]}));a(v,{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
|
+
|
|
30
|
+
Deletion 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(`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 he={command:`delete <share-resource-id>`,describe:`Trigger a resource deletion from a share`,builder:me,handler:async e=>c({command:`resource-sharing resources 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 resources 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`]))}/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:`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(pe,{account_id:l,share_id:e[`share-id`],share_resource_id:e[`share-resource-id`]}));a(u,{successLabel:`Deleted`})})};var ge={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/resources/${t.share_resource_id}`};function _e(e){return e.usage(`$0 resource-sharing resources get <share-resource-id>
|
|
31
|
+
|
|
32
|
+
Get share resource by ID.`).positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,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 ve={command:`get <share-resource-id>`,describe:`Get share resource by ID`,builder:_e,handler:async e=>c({command:`resource-sharing resources get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing resources 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`]))}/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:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(ge,{account_id:l,share_id:e[`share-id`],share_resource_id:e[`share-resource-id`]}));a(u,{successLabel:`Loaded`})})};var ye={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/resources`,query:[`status`,`resource_type`,`page`,`per_page`]};function be(e){return e.usage(`$0 resource-sharing resources list
|
|
33
|
+
|
|
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 omitted."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when omitted."}).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>\n\nUpdates the resource's `meta`. Only resources with `status=active` can be updated.").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=e.body===void 0?void 0:u(e.body,[{path:[`meta`],flag:`meta`}]),l=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body!==void 0){let t=c,n=await s(`Updating`,async()=>l.send(Z,{body:t,account_id:p,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 m=f({meta:d(e.meta,`meta`,!0)},[[`meta`]]),h=await s(`Updating`,async()=>l.send(Z,{body:m,account_id:p,share_id:e[`share-id`],share_resource_id:e[`share-resource-id`]}));a(h,{successLabel:`Updated`})})},Ce={command:`resources`,describe:`Resources attached to a share`,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>
|
|
35
|
+
|
|
36
|
+
Updates the share's display name and tags. Omitting \`tags\` leaves the existing tags unchanged. Recipients and resources are managed via their subresource endpoints.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the share.`}).option(`tags`,{type:`string`,description:`Tags associated with the share. 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:"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 update`,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`),tags:d(e.tags,`tags`)},[[`tags`]]):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await n(e),h=e.local?t:await i();if(e.accountId=h,e.body!==void 0){let t=c,n=await s(`Updating`,async()=>l.send($,{body:t,account_id:h,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 g=f({name:p(e.name,`name`,`text`),tags:d(e.tags,`tags`)},[[`tags`]]),_=await s(`Updating`,async()=>l.send($,{body:g,account_id:h,share_id:e[`share-id`]}));a(_,{successLabel:`Updated`})})},Ee={command:`resource-sharing`,describe:`Share account-level resources (WAF custom rulesets, Gateway policies and settings, Access IdP federation grants) with other accounts in the same organization`,builder:e=>e.command(y).command(te).command(L).command(B).command(Te).command(P).command(ue).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ee as default};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-DIJ7SIKC.mjs";import{n}from"./auth-B-h0BHg7.mjs";import{a as r,t as i}from"./context-BY1Eh_Qe.mjs";import{t as a}from"./output-BZQEl3mK.mjs";import{t as o}from"./dry-run-kJbjn4kG.mjs";import{t as s}from"./progress-yvPscjYg.mjs";import{t as c}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{a as l,n as u,t as d}from"./body-parser-DoewLePl.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-CEpZ-lQZ.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
|
-
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),
|
|
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=e.body===void 0?void 0:u(e.body),l=await n(e),h=e.local?t:await i();if(e.accountId=h,e.body!==void 0){let e=c,t=await s(`Creating`,async()=>l.send(b,{body:e,account_id:h}));a(t,{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 g=d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}),_=await s(`Creating`,async()=>l.send(b,{body:g,account_id:h}));a(_,{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
|
|
|
6
6
|
Deletes a specific list and all its items.`).positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,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 T={command:`delete <list-id>`,describe:`Delete a list`,builder:w,handler:async e=>c({command:`rules lists delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force,message:`This operation deletes the custom list and every item it contains.`}))return;let u=await s(`Deleting`,async()=>c.send(C,{account_id:l,list_id:e[`list-id`]}));a(u,{successLabel:`Deleted`})})};var E={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`};function D(e){return e.usage(`$0 rules lists get <list-id>
|
|
7
7
|
|
|
8
|
-
Fetches the details of a list.`).positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <list-id>`,describe:`Get a list`,builder:D,handler:async e=>c({command:`rules lists get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-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(E,{account_id:l,list_id:e[`list-id`]}));a(u,{successLabel:`Loaded`})})};var k={method:`POST`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function A(e){return e.usage("$0 rules lists items create <list-id>\n\nAppends new items to the list. This operation is asynchronous. To get the current operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,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 j={command:`create <list-id>`,describe:`Create list items`,builder:A,handler:async e=>c({command:`rules lists items create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists items create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let c=await n(e),
|
|
8
|
+
Fetches the details of a list.`).positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <list-id>`,describe:`Get a list`,builder:D,handler:async e=>c({command:`rules lists get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-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(E,{account_id:l,list_id:e[`list-id`]}));a(u,{successLabel:`Loaded`})})};var k={method:`POST`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function A(e){return e.usage("$0 rules lists items create <list-id>\n\nAppends new items to the list. This operation is asynchronous. To get the current operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,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 j={command:`create <list-id>`,describe:`Create list items`,builder:A,handler:async e=>c({command:`rules lists items create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists items create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let c=e.body===void 0?void 0:u(e.body),l=await n(e),d=e.local?t:await i();if(e.accountId=d,e.body!==void 0){let t=c,n=await s(`Creating`,async()=>l.send(k,{body:t,account_id:d,list_id:e[`list-id`]}));a(n,{successLabel:`Created`})}})};var M={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function N(e){return e.usage("$0 rules lists items delete <list-id>\n\nRemoves one or more items from a list. This operation is asynchronous. To get the current operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`items`,{type:`string`,description:`The list items to delete, identified by their unique IDs. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`delete <list-id>`,describe:`Delete list items`,builder:N,handler:async e=>c({command:`rules lists items delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists items delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({items:l(e.items,`items`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),f=await n(e),p=e.local?t:await i();if(e.accountId=p,!await h({force:!!e.force,message:`This operation deletes the selected items from the custom list.`}))return;if(e.body!==void 0){let t=c,n=await s(`Deleting`,async()=>f.send(M,{body:t,account_id:p,list_id:e[`list-id`]}));a(n,{successLabel:`Deleted`});return}let m=d({items:l(e.items,`items`)}),g=await s(`Deleting`,async()=>f.send(M,{body:m,account_id:p,list_id:e[`list-id`]}));a(g,{successLabel:`Deleted`})})};var F={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items/${t.item_id}`};function I(e){return e.usage(`$0 rules lists items get <item-id>
|
|
9
9
|
|
|
10
10
|
Fetches a list item in the list.`).positional(`item-id`,{type:`string`,description:`Defines the unique ID of the item in the List.`,demandOption:!0}).option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <item-id>`,describe:`Get a list item`,builder:I,handler:async e=>c({command:`rules lists items get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists items get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items/${e[`item-id`]==null?`<item-id>`:encodeURIComponent(String(e[`item-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``),"item-id":String(e[`item-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(F,{account_id:l,list_id:e[`list-id`],item_id:e[`item-id`]}));a(u,{successLabel:`Loaded`})})};var R={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,query:[`cursor`,`per_page`,`search`]};function z(e){return e.usage(`$0 rules lists items list
|
|
11
11
|
|
|
12
|
-
Fetches all the items in the list.`).option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`cursor`,{type:`string`,description:"The pagination cursor. An opaque string token that indicates where to continue when requesting the next/previous set of records. The response provides cursor values under `result_info.cursors`. You should make no assumptions about a cursor's content or length."}).option(`per-page`,{type:`number`,description:`Amount of results to include in each paginated response. A non-negative 32 bit integer.`}).option(`search`,{type:`string`,description:`A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`Get list items`,builder:z,handler:async e=>c({command:`rules lists items list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={cursor:e.cursor,per_page:e[`per-page`],search:e.search};if(e.dryRun){let t=await r();o({command:`cf rules lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-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(R,{account_id:u,list_id:e[`list-id`],...c}));a(d,{successLabel:`Loaded`})})};var V={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function H(e){return e.usage("$0 rules lists items update <list-id>\n\nRemoves all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get the current operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,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 U={command:`update <list-id>`,describe:`Update all list items`,builder:H,handler:async e=>c({command:`rules lists items update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists items update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let c=await n(e),
|
|
12
|
+
Fetches all the items in the list.`).option(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`cursor`,{type:`string`,description:"The pagination cursor. An opaque string token that indicates where to continue when requesting the next/previous set of records. The response provides cursor values under `result_info.cursors`. You should make no assumptions about a cursor's content or length."}).option(`per-page`,{type:`number`,description:`Amount of results to include in each paginated response. A non-negative 32 bit integer.`}).option(`search`,{type:`string`,description:`A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`Get list items`,builder:z,handler:async e=>c({command:`rules lists items list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={cursor:e.cursor,per_page:e[`per-page`],search:e.search};if(e.dryRun){let t=await r();o({command:`cf rules lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-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(R,{account_id:u,list_id:e[`list-id`],...c}));a(d,{successLabel:`Loaded`})})};var V={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}/items`,body:`json`};function H(e){return e.usage("$0 rules lists items update <list-id>\n\nRemoves all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get the current operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.").positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,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 U={command:`update <list-id>`,describe:`Update all list items`,builder:H,handler:async e=>c({command:`rules lists items update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists items update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let c=e.body===void 0?void 0:u(e.body),l=await n(e),d=e.local?t:await i();if(e.accountId=d,e.body!==void 0){let t=c,n=await s(`Updating`,async()=>l.send(V,{body:t,account_id:d,list_id:e[`list-id`]}));a(n,{successLabel:`Updated`})}})},W={command:`items`,describe:`Operations for lists.items`,builder:e=>e.command(j).command(P).command(L).command(B).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var G={method:`GET`,path:t=>e`/accounts/${t.account_id}/rules/lists`};function K(e){return e.usage(`$0 rules lists list
|
|
13
13
|
|
|
14
14
|
Fetches all lists in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`Get lists`,builder:K,handler:async e=>c({command:`rules lists list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf rules lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rules/lists`,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(G,{account_id:l}));a(u,{successLabel:`Loaded`})})};var J={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`,body:`json`};function Y(e){return e.usage(`$0 rules lists update <list-id>
|
|
15
15
|
|
|
16
|
-
Updates the description of a list.`).positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the list.`}).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:`update <list-id>`,describe:`Update a list`,builder:Y,handler:async e=>c({command:`rules lists update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`)}):u(e.body)});return}let c=await n(e),
|
|
16
|
+
Updates the description of a list.`).positional(`list-id`,{type:`string`,description:`The unique ID of the list.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the list.`}).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:`update <list-id>`,describe:`Update a list`,builder:Y,handler:async e=>c({command:`rules lists update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body!==void 0){let t=c,n=await s(`Updating`,async()=>l.send(J,{body:t,account_id:p,list_id:e[`list-id`]}));a(n,{successLabel:`Updated`});return}let m=d({description:f(e.description,`description`,`text`)}),h=await s(`Updating`,async()=>l.send(J,{body:m,account_id:p,list_id:e[`list-id`]}));a(h,{successLabel:`Updated`})})},Z={command:`lists`,describe:`Custom account-level lists of IPs, hostnames, ASNs, or redirects used in rule expressions`,builder:e=>e.command(S).command(T).command(O).command(q).command(X).command(y).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`rules`,describe:`Resources used by Cloudflare rules and rulesets`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Q as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-DIJ7SIKC.mjs";import{i as n,n as r}from"./auth-B-h0BHg7.mjs";import{a as i,i as a,t as o}from"./context-BY1Eh_Qe.mjs";import{t as s}from"./output-BZQEl3mK.mjs";import{t as c}from"./dry-run-kJbjn4kG.mjs";import{t as l}from"./progress-yvPscjYg.mjs";import{t as u}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{a as d,n as f,s as p,t as m}from"./body-parser-DoewLePl.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{a as g,n as _}from"./prompt-CEpZ-lQZ.mjs";var v={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets`,query:[`dry_run`],body:`json`};function y(e){return e.usage(`$0 rulesets create
|
|
3
3
|
|
|
4
4
|
Creates a ruleset.
|
|
5
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),
|
|
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=e.body===void 0?void 0:f(e.body),p=await r(e),_=e.zone===void 0?`accounts`:`zones`,y=_===`zones`?await a({zone:e.zone},p,{quiet:e.quiet}):e.local?t:await o();if(_===`zones`?e.zoneId=y:e.accountId=y,e.body!==void 0){let e=u;new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await l(`Creating`,async()=>p.send(v,{body:e,account_or_zone:_,account_or_zone_id:y,...n}));s(t,{successLabel:`Created`});return}e.id===void 0&&(e.id=await g(`id`,`The unique ID of the ruleset.`));let b=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 x=await l(`Creating`,async()=>p.send(v,{body:b,account_or_zone:_,account_or_zone_id:y,...n}));s(x,{successLabel:`Created`})})};function x(e){return e.usage(`$0 rulesets delete <id>
|
|
7
7
|
|
|
8
8
|
Deletes all versions of an existing account or zone ruleset.
|
|
9
9
|
|
|
@@ -15,7 +15,7 @@ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE
|
|
|
15
15
|
|
|
16
16
|
Updates an account or zone entry point ruleset, creating a new version.
|
|
17
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),
|
|
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 _=e.body===void 0?void 0:f(e.body),v=await r(e),y=e.zone===void 0?`accounts`:`zones`,b=y===`zones`?await a({zone:e.zone},v,{quiet:e.quiet}):e.local?t:await o();if(y===`zones`?e.zoneId=b:e.accountId=b,e.body!==void 0){let t=_,r=new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i=await l(`Updating`,async()=>n(v,`PUT`,`/${y}/${b}/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 x={};e.description!==void 0&&p(x,[`description`],h(e.description,`description`,`text`)),e.id!==void 0&&p(x,[`id`],h(e.id,`id`,`text`)),e.name!==void 0&&p(x,[`name`],h(e.name,`name`,`text`)),e.rules!==void 0&&p(x,[`rules`],d(e.rules,`rules`));let S=new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),C=await l(`Updating`,async()=>n(v,`PUT`,`/${y}/${b}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint${S?`?`+S:``}`,{body:x}));s(C,{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
19
|
|
|
20
20
|
Fetches the latest version of an account or zone ruleset.
|
|
21
21
|
|
|
@@ -27,7 +27,7 @@ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE
|
|
|
27
27
|
|
|
28
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
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),
|
|
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=e.body===void 0?void 0:f(e.body),d=await r(e),p=e.zone===void 0?`accounts`:`zones`,g=p===`zones`?await a({zone:e.zone},d,{quiet:e.quiet}):e.local?t:await o();if(p===`zones`?e.zoneId=g:e.accountId=g,e.body!==void 0){let t=u;new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let r=await l(`Creating`,async()=>d.send(N,{body:t,account_or_zone:p,account_or_zone_id:g,ruleset_id:e[`ruleset-id`],...n}));s(r,{successLabel:`Created`});return}let _=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 v=await l(`Creating`,async()=>d.send(N,{body:_,account_or_zone:p,account_or_zone_id:g,ruleset_id:e[`ruleset-id`],...n}));s(v,{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
31
|
|
|
32
32
|
Deletes an existing rule from an account or zone ruleset.
|
|
33
33
|
|
|
@@ -35,8 +35,8 @@ Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE
|
|
|
35
35
|
|
|
36
36
|
Updates an existing rule in an account or zone ruleset.
|
|
37
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),
|
|
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=e.body===void 0?void 0:f(e.body),d=await r(e),p=e.zone===void 0?`accounts`:`zones`,g=p===`zones`?await a({zone:e.zone},d,{quiet:e.quiet}):e.local?t:await o();if(p===`zones`?e.zoneId=g:e.accountId=g,e.body!==void 0){let t=u;new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let r=await l(`Updating`,async()=>d.send(z,{body:t,account_or_zone:p,account_or_zone_id:g,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...n}));s(r,{successLabel:`Updated`});return}let _=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 v=await l(`Updating`,async()=>d.send(z,{body:_,account_or_zone:p,account_or_zone_id:g,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...n}));s(v,{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
39
|
|
|
40
40
|
Updates an account or zone ruleset, creating a new version.
|
|
41
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),
|
|
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=e.body===void 0?void 0:f(e.body),p=await r(e),_=e.zone===void 0?`accounts`:`zones`,v=_===`zones`?await a({zone:e.zone},p,{quiet:e.quiet}):e.local?t:await o();if(_===`zones`?e.zoneId=v:e.accountId=v,e.body!==void 0){let t=u;new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let r=await l(`Updating`,async()=>p.send(U,{body:t,account_or_zone:_,account_or_zone_id:v,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 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(`Updating`,async()=>p.send(U,{body:y,account_or_zone:_,account_or_zone_id:v,ruleset_id:e[`ruleset-id`],...n}));s(b,{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,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-DIJ7SIKC.mjs";import{n}from"./auth-B-h0BHg7.mjs";import{a as r,t as i}from"./context-BY1Eh_Qe.mjs";import{t as a}from"./output-BZQEl3mK.mjs";import{t as o}from"./dry-run-kJbjn4kG.mjs";import{t as s}from"./progress-yvPscjYg.mjs";import{t as c}from"./run-BOKI1uWa.mjs";import"./telemetry-DkDUr4KK.mjs";import{a as l,n as u,t as d}from"./body-parser-DoewLePl.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-CEpZ-lQZ.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
|
-
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),
|
|
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=e.body===void 0?void 0:u(e.body),f=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body!==void 0){let t=c,n=await s(`Creating`,async()=>f.send(m,{body:t,account_id:p,ruleset_id:e[`ruleset-id`]}));a(n,{successLabel:`Created`});return}let h=d({delete_rules:e[`delete-rules`],rules:l(e.rules,`rules`)}),g=await s(`Creating`,async()=>f.send(m,{body:h,account_id:p,ruleset_id:e[`ruleset-id`]}));a(g,{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
|
|
|
6
|
-
Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:v,handler:async e=>c({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules 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`]))}/rule`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):u(e.body)});return}let c=await n(e),
|
|
6
|
+
Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:v,handler:async e=>c({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules 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`]))}/rule`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body!==void 0){let t=c,n=await s(`Creating`,async()=>l.send(_,{body:t,account_id:p,ruleset_id:e[`ruleset-id`]}));a(n,{successLabel:`Created`});return}let m=d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),h=await s(`Creating`,async()=>l.send(_,{body:m,account_id:p,ruleset_id:e[`ruleset-id`]}));a(h,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`};function x(e){return e.usage(`$0 rum rules delete <rule-id>
|
|
7
7
|
|
|
8
8
|
Deletes an existing rule from a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <rule-id>`,describe:`Delete a Web Analytics rule`,builder:x,handler:async e=>c({command:`rum rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await p({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(b,{account_id:l,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(u,{successLabel:`Deleted`})})};var C={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rules`};function w(e){return e.usage(`$0 rum rules list
|
|
9
9
|
|
|
10
10
|
Lists all the rules in a Web Analytics ruleset.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List rules in Web Analytics ruleset`,builder:w,handler:async e=>c({command:`rum rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules list`,method:`GET`,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:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(C,{account_id:l,ruleset_id:e[`ruleset-id`]}));a(u,{successLabel:`Loaded`})})};var E={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rum/v2/${t.ruleset_id}/rule/${t.rule_id}`,body:`json`};function D(e){return e.usage(`$0 rum rules update <rule-id>
|
|
11
11
|
|
|
12
|
-
Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:D,handler:async e=>c({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):u(e.body)});return}let c=await n(e),
|
|
12
|
+
Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:D,handler:async e=>c({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/v2/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rule/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body!==void 0){let t=c,n=await s(`Updating`,async()=>l.send(E,{body:t,account_id:p,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(n,{successLabel:`Updated`});return}let m=d({host:f(e.host,`host`,`text`),inclusive:e.inclusive,is_paused:e[`is-paused`],paths:e.paths}),h=await s(`Updating`,async()=>l.send(E,{body:m,account_id:p,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`]}));a(h,{successLabel:`Updated`})})},k={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(g).command(y).command(S).command(T).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var A={method:`POST`,path:t=>e`/accounts/${t.account_id}/rum/site_info`,body:`json`};function j(e){return e.usage(`$0 rum site-info create
|
|
13
13
|
|
|
14
|
-
Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Create a Web Analytics site`,builder:j,handler:async e=>c({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):u(e.body)});return}let c=await n(e),
|
|
14
|
+
Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Create a Web Analytics site`,builder:j,handler:async e=>c({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body!==void 0){let e=c,t=await s(`Creating`,async()=>l.send(A,{body:e,account_id:p}));a(t,{successLabel:`Created`});return}let m=d({auto_install:e[`auto-install`],host:f(e.host,`host`,`text`),zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),h=await s(`Creating`,async()=>l.send(A,{body:m,account_id:p}));a(h,{successLabel:`Created`})})};var N={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function P(e){return e.usage(`$0 rum site-info delete <site-id>
|
|
15
15
|
|
|
16
|
-
Deletes an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete <site-id>`,describe:`Delete a Web Analytics site`,builder:P,handler:async e=>c({command:`rum site-info delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await p({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(N,{account_id:l,site_id:e[`site-id`]}));a(u,{successLabel:`Deleted`})})};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function
|
|
16
|
+
Deletes an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete <site-id>`,describe:`Delete a Web Analytics site`,builder:P,handler:async e=>c({command:`rum site-info delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await p({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(N,{account_id:l,site_id:e[`site-id`]}));a(u,{successLabel:`Deleted`})})};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`};function L(e){return e.usage(`$0 rum site-info get <site-id>
|
|
17
17
|
|
|
18
|
-
Retrieves a Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
18
|
+
Retrieves a Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <site-id>`,describe:`Get a Web Analytics site`,builder:L,handler:async e=>c({command:`rum site-info get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-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(I,{account_id:l,site_id:e[`site-id`]}));a(u,{successLabel:`Loaded`})})};var R={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/site_tag/list`,query:[`all`]};function z(e){return e.usage(`$0 rum site-info list-site-tags
|
|
19
19
|
|
|
20
20
|
Returns all site tags for an account as an array of site tag strings. This endpoint returns all results without pagination.`).option(`all`,{type:`boolean`,description:`When true, includes sites that are disabled or paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list-site-tags`,describe:`List Web Analytics site tags`,builder:z,handler:async e=>c({command:`rum site-info list-site-tags`,classification:{safeFlags:[`all`,`dry-run`]}},e,async()=>{let c={all:e.all};if(e.dryRun){let e=await r();o({command:`cf rum site-info list-site-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/site_tag/list`,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:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/zone_tag/list`};function H(e){return e.usage(`$0 rum site-info list-zone-tags
|
|
21
21
|
|
|
@@ -23,6 +23,6 @@ Returns all zone tags associated with Web Analytics sites for an account. These
|
|
|
23
23
|
|
|
24
24
|
Lists all Web Analytics sites of an account.`).option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`List Web Analytics sites`,builder:G,handler:async e=>c({command:`rum site-info list`,classification:{safeFlags:[`order-by`,`dry-run`]}},e,async()=>{let c={per_page:e[`per-page`],page:e.page,order_by:e[`order-by`]};if(e.dryRun){let e=await r();o({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/list`,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(W,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/rum/site_info/${t.site_id}`,body:`json`};function J(e){return e.usage(`$0 rum site-info update <site-id>
|
|
25
25
|
|
|
26
|
-
Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:J,handler:async e=>c({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):u(e.body)});return}let c=await n(e),
|
|
26
|
+
Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:J,handler:async e=>c({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/${e[`site-id`]==null?`<site-id>`:encodeURIComponent(String(e[`site-id`]))}`,pathParams:{"site-id":String(e[`site-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body!==void 0){let t=c,n=await s(`Updating`,async()=>l.send(q,{body:t,account_id:p,site_id:e[`site-id`]}));a(n,{successLabel:`Updated`});return}let m=d({auto_install:e[`auto-install`],enabled:e.enabled,host:f(e.host,`host`,`text`),lite:e.lite,zone_tag:f(e[`zone-tag`],`zone-tag`,`text`)}),h=await s(`Updating`,async()=>l.send(q,{body:m,account_id:p,site_id:e[`site-id`]}));a(h,{successLabel:`Updated`})})};var X={method:`GET`,path:t=>e`/accounts/${t.account_id}/rum/site_info/validate/${t.hostname}`};function Z(e){return e.usage(`$0 rum site-info validate-hostname <hostname>
|
|
27
27
|
|
|
28
|
-
Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`).positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`validate-hostname <hostname>`,describe:`Validate a Web Analytics site hostname`,builder:Z,handler:async e=>c({command:`rum site-info validate-hostname`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/validate/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{hostname:String(e.hostname??``)},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(X,{account_id:l,hostname:e.hostname}));a(u,{successLabel:`Loaded`})})},$={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(M).command(F).command(
|
|
28
|
+
Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`).positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`validate-hostname <hostname>`,describe:`Validate a Web Analytics site hostname`,builder:Z,handler:async e=>c({command:`rum site-info validate-hostname`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rum/site_info/validate/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{hostname:String(e.hostname??``)},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(X,{account_id:l,hostname:e.hostname}));a(u,{successLabel:`Loaded`})})},$={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(M).command(F).command(ee).command(K).command(B).command(U).command(Y).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(k).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{te as default};
|
|
@@ -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-D-ihn_mV.mjs";import{n as r}from"./version-6Bpy6Bgt.mjs";import{n as i,t as a}from"./delegate-CcL6RoGw.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-BCDFSPtq.mjs";import{t as u}from"./request-headers-C0FpeBhz.mjs";import{n as d,t as f}from"./state-mr5ux1Nb.mjs";import{t as p}from"./error-sanitization-BkgtZ0Vx.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,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./metadata-Df5kCWJv.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{t as n}from"./output-
|
|
2
|
+
import{n as e}from"./metadata-Df5kCWJv.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{t as n}from"./output-BZQEl3mK.mjs";function r(e){return typeof e==`object`&&!!e&&`version`in e&&`schemas`in e&&typeof e.version==`string`&&typeof e.schemas==`object`}const i={command:`schema [command..]`,describe:`Show API schema details for a command`,builder:e=>e.positional(`command`,{describe:`Command path segments (e.g., dns records create)`,type:`string`,array:!0,default:[]}).option(`list`,{type:`boolean`,describe:`List all available schemas`,default:!1}),handler:async i=>{let a=e(import.meta.url,`schemas.json`,r);if(!a)throw console.error("Error: Could not load schemas.json. Run `pnpm generate` first."),new t(1);if(i.list){let e=Object.entries(a.schemas).map(([e,t])=>({command:`cf ${e}`,httpMethod:t.httpMethod,apiPath:t.path,operationId:t.operationId}));n(e);return}if(i.command.length===0)throw console.error(`Usage: cf schema <command...> or cf schema --list`),console.error(`Example: cf schema dns records create`),new t(1);let o=i.command.join(` `),s=a.schemas[o];if(!s){let e=Object.keys(a.schemas).filter(e=>e.includes(o)||o.includes(e));if(e.length>0){console.error(`Schema not found for "${o}". Did you mean:`);for(let t of e)console.error(` cf schema ${t}`)}else console.error(`Schema not found for "${o}". Use --list to see available schemas.`);throw new t(1)}n(s)}};export{i as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./version-
|
|
2
|
+
import{n as e}from"./version-6Bpy6Bgt.mjs";import{a as t}from"./cf-BQ_LRiut.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};
|