cf 1.0.0-beta.17 → 1.0.0-beta.18
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 +6117 -4540
- package/dist/_meta/schemas.json +5016 -3257
- package/dist/{abuse-reports-C4LxDvUM.mjs → abuse-reports-Ce-g5uZP.mjs} +6 -6
- package/dist/{access-DnWW2AAT.mjs → access-BtsMwesh.mjs} +1 -1
- package/dist/{accounts-8UcHNm3S.mjs → accounts-X5QVzEUW.mjs} +27 -21
- package/dist/{acm-qRM3iy4Z.mjs → acm-C_NepMi6.mjs} +1 -1
- package/dist/{addressing-CAb8z2Dq.mjs → addressing-BkQY1hoA.mjs} +18 -18
- package/dist/{agent-memory-oIUP4ZV5.mjs → agent-memory-1OPgC3lK.mjs} +6 -6
- package/dist/{ai-DnhytGdc.mjs → ai-Bb0_Zknm.mjs} +1 -1
- package/dist/{ai-audit-B7_5EOcN.mjs → ai-audit-DuEjVdML.mjs} +1 -1
- package/dist/{ai-gateway-b3FFu6UV.mjs → ai-gateway-Cm2vWMSI.mjs} +42 -42
- package/dist/ai-search-DDRpxyOM.mjs +79 -0
- package/dist/{ai-security-KUs94UW-.mjs → ai-security-A2STvE1b.mjs} +5 -5
- package/dist/{alerting-CCmyEPzN.mjs → alerting-CIwSk-Ks.mjs} +1 -1
- package/dist/{analytics-BAvBj6qx.mjs → analytics-H--uM3DA.mjs} +7 -7
- package/dist/{analytics-engine-DAJp89gM.mjs → analytics-engine-Alu7cllT.mjs} +1 -1
- package/dist/{api-security-BItVQymb.mjs → api-security-D-pcnhUL.mjs} +26 -26
- package/dist/{argo-DsJCvfml.mjs → argo-Lvmcx3am.mjs} +1 -1
- package/dist/{artifacts-DzHXeah6.mjs → artifacts-xT5S-mVa.mjs} +1 -1
- package/dist/{audit-logs-D9XxsVZm.mjs → audit-logs-DEoRBLkU.mjs} +1 -1
- package/dist/{auth-C530fHKQ.mjs → auth-B73lQS2h.mjs} +1 -1
- package/dist/auth-DMzEmOhG.mjs +2 -0
- package/dist/{auth-MNz2D-PD.mjs → auth-Db1KT0vm.mjs} +1 -1
- package/dist/{auth-token-Cw4c0y89.mjs → auth-token-D9XIPlwf.mjs} +1 -1
- package/dist/{basin-catalog-DcMiZV9J.mjs → basin-catalog-DFHt3cWi.mjs} +1 -1
- package/dist/{billing-COgAWTYh.mjs → billing-Bm2JNSGa.mjs} +6 -6
- package/dist/body-parser-DnBfDdx3.mjs +2 -0
- package/dist/{bot-management-Dx3lh9Fi.mjs → bot-management-CSr38g-O.mjs} +4 -4
- package/dist/{botnet-feed-C8496Nhl.mjs → botnet-feed-ebeWWSJj.mjs} +1 -1
- package/dist/{brand-protection-B0p8Sv6s.mjs → brand-protection-BCn9Mv-d.mjs} +5 -5
- package/dist/browser-run-BcWxzhAn.mjs +42 -0
- package/dist/{builds-DmEFTQTa.mjs → builds-BMwDzi7G.mjs} +39 -39
- package/dist/{cache-BUh85NRr.mjs → cache-_VaTLC5T.mjs} +1 -1
- package/dist/{cli-DJhpXf38.mjs → cli-P3q5DG3W.mjs} +1 -1
- package/dist/{client-side-security-km3-4L_4.mjs → client-side-security-CjSXrpa9.mjs} +1 -1
- package/dist/{cloud-connector-BoKFprDD.mjs → cloud-connector-BPJBeP06.mjs} +1 -1
- package/dist/{cloudforce-one-DN5N3C3w.mjs → cloudforce-one-DXX31GMi.mjs} +189 -189
- package/dist/{command-B694oLDo.mjs → command-BXiA79DP.mjs} +1 -1
- package/dist/{command-rx0Kb5pn.mjs → command-BbsPxJBT.mjs} +1 -1
- package/dist/{command-RC9WM5jq.mjs → command-Bkc04OyY.mjs} +1 -1
- package/dist/{command-Bmee6uwe.mjs → command-BtTc28ql.mjs} +1 -1
- package/dist/{command-CAs3SxlI.mjs → command-CBZhxmKD.mjs} +1 -1
- package/dist/{command-CCq-Z2Ua.mjs → command-CL7LLXM7.mjs} +1 -1
- package/dist/{command-DerHAjQL.mjs → command-CYyfigfC.mjs} +1 -1
- package/dist/{command-D1JR8Fb7.mjs → command-CxWLFv5Y.mjs} +1 -1
- package/dist/{command-CiApsRql.mjs → command-DDcBC4px.mjs} +1 -1
- package/dist/{command-CbQFbfps.mjs → command-NoxvOARP.mjs} +1 -1
- package/dist/{completions-11latun5.mjs → completions-CrDmwKnK.mjs} +1 -1
- package/dist/{connector-interrupts-wvQcZsO1.mjs → connector-interrupts-V4HGULCM.mjs} +1 -1
- package/dist/{connector-telemetry-events-C0GGCIQk.mjs → connector-telemetry-events-D9mTcfbJ.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-ZXzsFgea.mjs → connector-telemetry-snapshots-COrPVKol.mjs} +1 -1
- package/dist/{connectors-DXIUG4Zi.mjs → connectors-DvVlxGDx.mjs} +1 -1
- package/dist/{containers-DCH6MFjY.mjs → containers-Bt2zFsFd.mjs} +8 -8
- package/dist/{containers-WMWKhLkp.mjs → containers-BtcOgwm5.mjs} +2 -2
- package/dist/{content-scan-CRDmR7rD.mjs → content-scan-DldLmTjy.mjs} +1 -1
- package/dist/{context-q-6bMSL-.mjs → context-C_a8oSY9.mjs} +1 -1
- package/dist/cps-REo1OWP1.mjs +6 -0
- package/dist/csam-scanner-CIbbdoJK.mjs +10 -0
- package/dist/{custom-csrs-BV017SqE.mjs → custom-csrs-iGNc3rSZ.mjs} +1 -1
- package/dist/{custom-hostnames-DI_dFaof.mjs → custom-hostnames-BNxYbTyu.mjs} +15 -15
- package/dist/{custom-nameservers-BLoE8VGG.mjs → custom-nameservers-BMJoTSlQ.mjs} +1 -1
- package/dist/custom-pages-Qdemt1Fm.mjs +21 -0
- package/dist/{d1-Dbs8HItA.mjs → d1-DvCiQibO.mjs} +8 -8
- package/dist/{deploy-5utIiOMN.mjs → deploy-K664XPOb.mjs} +1 -1
- package/dist/{deploy-context-C0iVbWRG.mjs → deploy-context-ClNVJYlR.mjs} +13 -13
- package/dist/{diagnostics-C9B07eJY.mjs → diagnostics-Cw0mtcep.mjs} +2 -2
- package/dist/{dls-lbM3i4x-.mjs → dls-DoqfqutH.mjs} +1 -1
- package/dist/{dns-QTMPGYMa.mjs → dns-DC6WcO3m.mjs} +21 -21
- package/dist/{dns-firewall-Bfv0S44I.mjs → dns-firewall-DpQH9BCE.mjs} +9 -9
- package/dist/{docs-bV3hPwQL.mjs → docs-CqNRBHab.mjs} +1 -1
- package/dist/{durable-objects-0JvGTV27.mjs → durable-objects-CJDDy3CC.mjs} +1 -1
- package/dist/{email-auth-PzRqG0ex.mjs → email-auth--NHg1TjG.mjs} +1 -1
- package/dist/{email-routing-BgHL0Rbz.mjs → email-routing-COjENK55.mjs} +13 -13
- package/dist/{email-security-CSTKIecn.mjs → email-security-rdjH95T2.mjs} +38 -38
- package/dist/{email-sending-BSwuAir8.mjs → email-sending-26VJhR6Q.mjs} +18 -18
- package/dist/{field-extractors-B_lFnwaL.mjs → field-extractors-DBOvGOwz.mjs} +2 -2
- package/dist/{firewall-BsZxVitA.mjs → firewall-D8K93ffF.mjs} +20 -20
- package/dist/{flagship-qBohOZaM.mjs → flagship-CHdmCmvQ.mjs} +11 -11
- package/dist/{fraud-vGNdrSm-.mjs → fraud-CY4TV5Vc.mjs} +1 -1
- package/dist/{google-tag-gateway-BHdOg4VW.mjs → google-tag-gateway-DzSt4wlz.mjs} +1 -1
- package/dist/healthchecks-B52Mf3uL.mjs +22 -0
- package/dist/{hostnames-CLlaMqHu.mjs → hostnames-BMITIM8P.mjs} +1 -1
- package/dist/{hyperdrive-CXTqaIqk.mjs → hyperdrive-CHsW0r6Z.mjs} +1 -1
- package/dist/{iam-Dl_n_Lqq.mjs → iam-o1n9eUXf.mjs} +9 -9
- package/dist/{images-vMtXk2Rf.mjs → images-CJHAGxX6.mjs} +37 -37
- package/dist/index.mjs +1 -1
- package/dist/{init-_7djeBVw.mjs → init-CqQDL6i3.mjs} +1 -1
- package/dist/{intel-Bq4GGXv-.mjs → intel-B3S1gxUg.mjs} +1 -1
- package/dist/{ips-BcvZS46g.mjs → ips-q_UJMiy8.mjs} +1 -1
- package/dist/{k2-DL4hrVTj.mjs → k2-BNqVZnDN.mjs} +2 -2
- package/dist/{kv-BLo9wMgb.mjs → kv-B0nXSOcW.mjs} +1 -1
- package/dist/{lazy-command-CRcT6Dx-.mjs → lazy-command-4ccdBqrc.mjs} +1 -1
- package/dist/{leaked-credential-checks-Dx4RXMyN.mjs → leaked-credential-checks-BXwIjlTs.mjs} +1 -1
- package/dist/load-balancers-DJtMztJ0.mjs +76 -0
- package/dist/{login-Du_W6b9o.mjs → login-D-1FiBNv.mjs} +1 -1
- package/dist/{login-DT6Q1UJw.mjs → login-chQP8825.mjs} +1 -1
- package/dist/{logo-matches-C-1J0Oc3.mjs → logo-matches-qVYq8tWL.mjs} +1 -1
- package/dist/{logos-BuhvSu_H.mjs → logos-tnIahhcu.mjs} +1 -1
- package/dist/{logpush-DgZtF9vG.mjs → logpush-D4s3pJRw.mjs} +24 -24
- package/dist/{logs-CaKOk-1v.mjs → logs-cw7UL5V2.mjs} +3 -3
- package/dist/{magic-cloud-networking-CKxXYT8r.mjs → magic-cloud-networking-CLEHztNY.mjs} +1 -1
- package/dist/{magic-network-monitoring-BykFGQCz.mjs → magic-network-monitoring-DRwygeVq.mjs} +9 -9
- package/dist/{magic-transit-DYULsrUP.mjs → magic-transit-BFopRdPs.mjs} +170 -170
- package/dist/{managed-defense-DIb_uN25.mjs → managed-defense-D5kpmq0T.mjs} +9 -9
- package/dist/{managed-transforms-an3wQ0DW.mjs → managed-transforms-CT4jjnzJ.mjs} +2 -2
- package/dist/{matches-DkLSWb5X.mjs → matches-ClJ_24EY.mjs} +1 -1
- package/dist/{mcp-BcV1XqE8.mjs → mcp-50os3IRG.mjs} +10 -10
- package/dist/{mesh-CSSlZ-0F.mjs → mesh-jxtQP8sS.mjs} +2 -2
- package/dist/{monetization-B-nJ0SyI.mjs → monetization-D6cCDi-h.mjs} +4 -4
- package/dist/{network-ZzxQ_Dcz.mjs → network-dnWHB2uY.mjs} +27 -25
- package/dist/{network-interconnects-CI9NXQpe.mjs → network-interconnects-Cf8qSVdt.mjs} +1 -1
- package/dist/{o11y-LG6Y9LUZ.mjs → o11y-oMSg1pG4.mjs} +49 -49
- package/dist/{oauth-CP82E1_0.mjs → oauth-BfBdHhPS.mjs} +1 -1
- package/dist/{oauth-Bx693Af5.mjs → oauth-DDOiiH7h.mjs} +1 -1
- package/dist/{oauth-clients-BA30rTEl.mjs → oauth-clients-XDmoe-b4.mjs} +1 -1
- package/dist/{oauth-scopes-hseWES1v.mjs → oauth-scopes-D9VYGuTs.mjs} +1 -1
- package/dist/organization-94lHeeOs.mjs +75 -0
- package/dist/{organizations-CcgZPmFl.mjs → organizations-BJf3UTFi.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-BhdlaolV.mjs → origin-post-quantum-encryption-DMytVSUZ.mjs} +1 -1
- package/dist/{page-rules-DFfqfllI.mjs → page-rules-BUI-50oz.mjs} +4 -4
- package/dist/pages-CcdpCzHs.mjs +54 -0
- package/dist/pay-per-crawl-B1uHZn9j.mjs +38 -0
- package/dist/{pay-per-use-C_HxhpM4.mjs → pay-per-use-t066I5wm.mjs} +7 -7
- package/dist/{pipelines-DUMIVwof.mjs → pipelines-Co6S044l.mjs} +8 -8
- package/dist/precursor-BftyvS86.mjs +4 -0
- package/dist/previews-BLhnhElx.mjs +7 -0
- package/dist/{progress-DaQ4MzBI.mjs → progress-Q5w9PNTT.mjs} +1 -1
- package/dist/{prompt-KWYZvJWM.mjs → prompt-C0hKSr-R.mjs} +1 -1
- package/dist/{queries-DoyhspQf.mjs → queries-4MubO6Sz.mjs} +3 -3
- package/dist/{queues-BPxTU2rU.mjs → queues-CteS5M92.mjs} +17 -17
- package/dist/{r2-CQt4S7o7.mjs → r2-2QpT_Gso.mjs} +24 -24
- package/dist/{radar-CALpR1vq.mjs → radar-ODKaK4FJ.mjs} +1 -1
- package/dist/{raw-fetch-Cy09TjHc.mjs → raw-fetch-CEOuoKl9.mjs} +1 -1
- package/dist/{realtime-BiHKBoI4.mjs → realtime-DkfU8uEX.mjs} +84 -84
- package/dist/registrar-DM6JTVPS.mjs +43 -0
- package/dist/{registrar-sandbox-BttFwYqE.mjs → registrar-sandbox-BPNGf65G.mjs} +11 -9
- package/dist/{reporting-8aRJD5HX.mjs → reporting-5yFNXbJg.mjs} +1 -1
- package/dist/{request-headers-CqfJOkpO.mjs → request-headers-DXvswze2.mjs} +1 -1
- package/dist/request-tracers-BarLZY95.mjs +4 -0
- package/dist/{resource-sharing-uVVpMW0w.mjs → resource-sharing-BVEwBPs8.mjs} +19 -19
- package/dist/{rules-CFOuN3t2.mjs → rules-_C31X4Jz.mjs} +6 -6
- package/dist/{rulesets-DkhV2Hny.mjs → rulesets-8RwxoFhG.mjs} +6 -6
- package/dist/{rum-BnMW0Tlb.mjs → rum-CAUcpXpM.mjs} +6 -6
- package/dist/{run-Clc3P2u7.mjs → run-DtFLvOHB.mjs} +1 -1
- package/dist/run-LcOb9rhI.mjs +2 -0
- package/dist/{schema-flags-b096XMpt.mjs → schema-flags-DibfxEF6.mjs} +1 -1
- package/dist/{scim-tvZm6A-r.mjs → scim-DX5XrQ4w.mjs} +1 -1
- package/dist/{secrets-store-DuNxSh1_.mjs → secrets-store-DSqqrr25.mjs} +1 -1
- package/dist/{security-insights-C17c9ZYZ.mjs → security-insights-FSktO04S.mjs} +1 -1
- package/dist/{security-txt-D4pRk7-w.mjs → security-txt-D2g3lQdg.mjs} +1 -1
- package/dist/{shared-zePemxHi.mjs → shared-eefMO8R4.mjs} +1 -1
- package/dist/smart-shield-IVb2sR0C.mjs +24 -0
- package/dist/{snippets-BIcZ6vSW.mjs → snippets-cWwWficN.mjs} +2 -2
- package/dist/{spectrum-DjDX0geK.mjs → spectrum-DYiIBYRB.mjs} +1 -1
- package/dist/{speed-DiPoFJMm.mjs → speed-C7uiW2Wf.mjs} +1 -1
- package/dist/{sql-DLjCt_R3.mjs → sql-TGV8qQMj.mjs} +1 -1
- package/dist/{src-CutrsNl4.mjs → src-BUH-P_zd.mjs} +5 -5
- package/dist/ssl-xQP_HbWN.mjs +139 -0
- package/dist/{stream-uhn_Zsni.mjs → stream-CfWgj8Cr.mjs} +55 -55
- package/dist/{submit-C3suIDBX.mjs → submit-DxGr1T40.mjs} +1 -1
- package/dist/tags-LEJ2VYhQ.mjs +23 -0
- package/dist/{telemetry-DYjsavEr.mjs → telemetry-BHne10Yy.mjs} +1 -1
- package/dist/telemetry-BavSU4ku.mjs +2 -0
- package/dist/{tenant-DK88yQM4.mjs → tenant-7d5vwc6K.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-BZ1JD1Yf.mjs → tenant-custom-nameservers-BkxlPr5O.mjs} +1 -1
- package/dist/{tunnels-DjbomhCa.mjs → tunnels-DlGODvwT.mjs} +4 -4
- package/dist/{turnstile-DXrbEy2A.mjs → turnstile-DhLkdhij.mjs} +5 -5
- package/dist/update-check-nLfkSfdz.mjs +2 -0
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{update-check-BhhtSXVZ.mjs → update-check-wvjOsnGK.mjs} +1 -1
- package/dist/{url-info-a0mY4UsC.mjs → url-info-CeoV5dBc.mjs} +1 -1
- package/dist/{url-normalization-DiwpDIhc.mjs → url-normalization-9NoaoRNh.mjs} +1 -1
- package/dist/{url-scanner-D0egjBe5.mjs → url-scanner-w_-Sumz-.mjs} +8 -8
- package/dist/{user-DDH9lxf5.mjs → user-D33B3alX.mjs} +59 -59
- package/dist/{vectorize-DaT3amFV.mjs → vectorize-Wp9De13y.mjs} +17 -17
- package/dist/version-B2RUUqGT.mjs +2 -0
- package/dist/{waiting-rooms-BGMpu9gS.mjs → waiting-rooms-BE8FloRd.mjs} +13 -13
- package/dist/{web-assets-NqNglLSI.mjs → web-assets-ew0iaP7c.mjs} +35 -35
- package/dist/{web3-UnCUuIfB.mjs → web3-BUyXBaqq.mjs} +6 -6
- package/dist/{workers-builds-Cy6fdtm5.mjs → workers-builds-DzU9NGno.mjs} +7 -7
- package/dist/{workers-for-platforms-JscCHivQ.mjs → workers-for-platforms-B4xzFNxJ.mjs} +25 -22
- package/dist/{workers-DfA9ugmb.mjs → workers-pP5tsDbD.mjs} +25 -22
- package/dist/{workers-vpc-FDZQBqOu.mjs → workers-vpc-Bre_t9Al.mjs} +1 -1
- package/dist/{workflows-Dq-k81hU.mjs → workflows-DXYGKtqq.mjs} +1 -1
- package/dist/zaraz-DoH4QD0u.mjs +22 -0
- package/dist/{zero-trust-CZ685QhO.mjs → zero-trust-DKt20rzE.mjs} +461 -458
- package/dist/{zone-DcZIUTWt.mjs → zone-BXM3p0JR.mjs} +1 -1
- package/dist/{zones-BVdvYUCv.mjs → zones-CJdtqEBx.mjs} +21 -21
- package/package.json +9 -9
- package/dist/account-tags-zvHRQZxb.mjs +0 -15
- package/dist/ai-search-CtfW5fzl.mjs +0 -79
- package/dist/auth-Ccm5viK_.mjs +0 -2
- package/dist/body-parser-DkHKPkJ7.mjs +0 -2
- package/dist/browser-run-ChXohmNG.mjs +0 -42
- package/dist/certificate-authorities-BTLdA7EQ.mjs +0 -6
- package/dist/client-certificates-B3UxH_Au.mjs +0 -13
- package/dist/cps-Due0P5IW.mjs +0 -6
- package/dist/csam-scanner-DvLrPw45.mjs +0 -10
- package/dist/ct-alerting-BtEGkRJi.mjs +0 -5
- package/dist/custom-certificates-CMLXTTEc.mjs +0 -17
- package/dist/custom-pages-ubava9Qm.mjs +0 -21
- package/dist/dcv-delegation-sGGt6UU_.mjs +0 -4
- package/dist/healthchecks-DAYYLZ6u.mjs +0 -22
- package/dist/keyless-certificates-0pzjkZb6.mjs +0 -13
- package/dist/keys-BSV5IXdU.mjs +0 -4
- package/dist/load-balancers-CCCWoQXv.mjs +0 -76
- package/dist/mtls-certificates-ukwDz6Lc.mjs +0 -13
- package/dist/organization-DMr_z6n4.mjs +0 -71
- package/dist/origin-ca-certificates-BZxUbB5N.mjs +0 -11
- package/dist/origin-tls-client-auth-DzbZvtmi.mjs +0 -30
- package/dist/pages-BkcL5rC4.mjs +0 -54
- package/dist/pay-per-crawl-Dulm7Xy5.mjs +0 -38
- package/dist/precursor-DsGbA_YJ.mjs +0 -4
- package/dist/previews-Cma3-M7K.mjs +0 -7
- package/dist/registrar-gERQ3b85.mjs +0 -43
- package/dist/request-tracers-DcnwQg3K.mjs +0 -4
- package/dist/resource-tagging-SlsUtLsq.mjs +0 -4
- package/dist/run-CHNyLZLG.mjs +0 -2
- package/dist/smart-shield-2egm1Vaw.mjs +0 -24
- package/dist/ssl-vNzK0c9S.mjs +0 -45
- package/dist/tags-Dy2jG-Dt.mjs +0 -4
- package/dist/telemetry-Bdv5LZZs.mjs +0 -2
- package/dist/update-check-Dld7rbLd.mjs +0 -2
- package/dist/values-Bfr5-bL6.mjs +0 -4
- package/dist/version-CAuKDZAG.mjs +0 -2
- package/dist/zaraz-Dpr1pLDx.mjs +0 -22
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-Db1KT0vm.mjs";import{a as r,t as i}from"./context-C_a8oSY9.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-Q5w9PNTT.mjs";import{t as c}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-DnBfDdx3.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";import{a as m,i as h,n as g}from"./prompt-C0hKSr-R.mjs";var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/shares`,body:`json`};function ee(e){return e.usage(`$0 resource-sharing create
|
|
3
3
|
|
|
4
|
-
Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`).option(`name`,{type:`string`,description:`The name of the share.`}).option(`recipients`,{type:`string`,description:`The recipients field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`resources`,{type:`string`,description:`The resources field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const
|
|
4
|
+
Creates a new resource share for sharing Cloudflare resources with other accounts or organizations.`).option(`name`,{type:`string`,description:`The name of the share.`}).option(`recipients`,{type:`string`,description:`The recipients field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`resources`,{type:`string`,description:`The resources field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Trigger a share creation`,builder:ee,handler:async e=>c({command:`resource-sharing create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`),recipients:l(e.recipients,`recipients`),resources:l(e.resources,`resources`)}):u(e.body)});return}let c=await n(e),d=e.local?t:await i();if(e.accountId=d,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(_,{body:t,account_id:d}));a(n,{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await m(`name`,`The name of the share.`)),e.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);if(e.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let h=f({name:p(e.name,`name`,`text`),recipients:l(e.recipients,`recipients`),resources:l(e.resources,`resources`)}),g=await s(`Creating`,async()=>c.send(_,{body:h,account_id:d}));a(g,{successLabel:`Created`})})};var te={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}`};function ne(e){return e.usage(`$0 resource-sharing delete <share-id>
|
|
5
5
|
|
|
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
|
|
7
|
-
`);return}let u=await s(`Deleting`,async()=>c.send(
|
|
6
|
+
Deletion is not immediate, an updated share object with a new status will be returned.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const re={command:`delete <share-id>`,describe:`Trigger a share deletion`,builder:ne,handler:async e=>c({command:`resource-sharing delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await g({force:!!e.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}let u=await s(`Deleting`,async()=>c.send(te,{account_id:l,share_id:e[`share-id`]}));a(u,{successLabel:`Deleted`})})};var y={method:`POST`,path:t=>e`/accounts/${t.account_id_path}/shares/${t.share_id}/excluded-recipients`,body:`json`};function b(e){return e.usage(`$0 resource-sharing excluded-recipients create <share-id>
|
|
8
8
|
|
|
9
|
-
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(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`account-id`,{type:`string`,description:`The account to exclude from the organization-targeted share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create <share-id>`,describe:`Trigger an account exclusion from a share`,builder:b,handler:async e=>c({command:`resource-sharing excluded-recipients create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf resource-sharing excluded-recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?
|
|
9
|
+
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(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`account-id`,{type:`string`,description:`The account to exclude from the organization-targeted share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create <share-id>`,describe:`Trigger an account exclusion from a share`,builder:b,handler:async e=>c({command:`resource-sharing excluded-recipients create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf resource-sharing excluded-recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({account_id:p(e[`account-id`],`account-id`,`text`)}):u(e.body)});return}let t=await n(e);if(e.body){let n=u(e.body),r=await s(`Creating`,async()=>t.send(y,{body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]}));a(r,{successLabel:`Created`});return}e[`account-id`]===void 0&&(e[`account-id`]=await m(`account-id`,`The account to exclude from the organization-targeted share.`));let r=f({account_id:p(e[`account-id`],`account-id`,`text`)}),i=await s(`Creating`,async()=>t.send(y,{body:r,account_id_path:e[`account-id-path`],share_id:e[`share-id`]}));a(i,{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>
|
|
10
10
|
|
|
11
|
-
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
|
|
11
|
+
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})){process.stderr.write(`Aborted.
|
|
12
12
|
`);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>
|
|
13
13
|
|
|
14
14
|
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_path}/shares/${t.share_id}/excluded-recipients`,query:[`page`,`per_page`]};function k(e){return e.usage(`$0 resource-sharing excluded-recipients list
|
|
15
15
|
|
|
16
|
-
Lists the accounts excluded from an organization-targeted share. Only valid for shares with \`target_type=organization\`.`).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page
|
|
16
|
+
Lists the accounts excluded from an organization-targeted share. Only valid for shares with \`target_type=organization\`.`).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page` is supplied without `per_page`. May be omitted entirely along with `page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List share excluded recipients by share ID`,builder:k,handler:async e=>c({command:`resource-sharing excluded-recipients list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf resource-sharing excluded-recipients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},query:t,bodyKind:`none`});return}let r=await n(e),i=await s(`Loading`,async()=>r.send(O,{account_id_path:e[`account-id-path`],share_id:e[`share-id`],...t}));a(i,{successLabel:`Loaded`})})};var j={method:`PUT`,path:t=>e`/accounts/${t.account_id_path}/shares/${t.share_id}/excluded-recipients`,body:`json`,response:!1};function M(e){return e.usage(`$0 resource-sharing excluded-recipients update <share-id>
|
|
17
17
|
|
|
18
|
-
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(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`update <share-id>`,describe:`Trigger excluded-account reconciliation on a share`,builder:M,handler:async e=>c({command:`resource-sharing excluded-recipients update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf resource-sharing excluded-recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:
|
|
18
|
+
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(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`update <share-id>`,describe:`Trigger excluded-account reconciliation on a share`,builder:M,handler:async e=>c({command:`resource-sharing excluded-recipients update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf resource-sharing excluded-recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/excluded-recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let t=await n(e);if(e.body){let n=u(e.body),r=await s(`Updating`,async()=>t.send(j,{body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]}));a(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},P={command:`excluded-recipients`,describe:`Operations for excluded-recipients`,builder:e=>e.command(x).command(w).command(D).command(A).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var F={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}`,query:[`include_resources`,`include_recipient_counts`]};function I(e){return e.usage(`$0 resource-sharing get <share-id>
|
|
19
19
|
|
|
20
20
|
Fetches share by ID.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <share-id>`,describe:`Get account share by ID`,builder:I,handler:async e=>c({command:`resource-sharing get`,classification:{safeFlags:[`include-resources`,`include-recipient-counts`,`dry-run`]}},e,async()=>{let c={include_resources:e[`include-resources`],include_recipient_counts:e[`include-recipient-counts`]};if(e.dryRun){let t=await r();o({command:`cf resource-sharing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(F,{account_id:u,share_id:e[`share-id`],...c}));a(d,{successLabel:`Loaded`})})};var R={method:`GET`,path:t=>e`/accounts/${t.account_id}/shares`,query:[`status`,`kind`,`target_type`,`resource_types`,`order`,`direction`,`page`,`per_page`,`include_resources`,`include_recipient_counts`,`tag`]};function z(e){return e.usage(`$0 resource-sharing list
|
|
21
21
|
|
|
22
|
-
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`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page
|
|
22
|
+
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`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page` is supplied without `per_page`. May be omitted entirely along with `page` to receive a non-paginated response."}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`include-recipient-counts`,{type:`boolean`,description:`Include recipient counts in the response.`}).option(`tag`,{type:`string`,description:"Filter shares by tag. Each value is either `key=value` (matches shares whose tags contain that key/value pair) or `key` alone (matches shares that have any value for that key). May be repeated; multiple `tag` parameters are ANDed together. Maximum 20 `tag` parameters per request."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:`List account shares`,builder:z,handler:async e=>c({command:`resource-sharing list`,classification:{safeFlags:[`status`,`kind`,`target-type`,`order`,`direction`,`include-resources`,`include-recipient-counts`,`dry-run`]}},e,async()=>{let c={status:e.status,kind:e.kind,target_type:e[`target-type`],resource_types:e[`resource-types`],order:e.order,direction:e.direction,page:e.page,per_page:e[`per-page`],include_resources:e[`include-resources`],include_recipient_counts:e[`include-recipient-counts`],tag:e.tag};if(e.dryRun){let e=await r();o({command:`cf resource-sharing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/shares`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(R,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var V={method:`POST`,path:t=>e`/accounts/${t.account_id_path}/shares/${t.share_id}/recipients`,body:`json`};function H(e){return e.usage(`$0 resource-sharing recipients create <share-id>
|
|
23
23
|
|
|
24
|
-
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(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`account-id`,{type:`string`,description:"Deprecated alias for `recipient_account_id`. Use `recipient_account_id` instead.\nThe body field collided with the URL path parameter of the same name, which prevented SDK generators from distinguishing the source account (in the URL) from the recipient account (in the body). Both names will continue to be accepted until 2027-05-26 (see `x-sunset`).\n"}).option(`organization-id`,{type:`string`,description:`Organization identifier.`}).option(`recipient-account-id`,{type:`string`,description:`The account that will receive the share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Optionally specify `recipient_account_id` to target a specific account, or `organization_id` to target the caller's whole organization. If neither is provided, the caller's organization is used. The legacy field `account_id` is accepted as a synonym for `recipient_account_id` during the deprecation period (see `x-sunset` on that field). "})}const U={command:`create <share-id>`,describe:`Trigger a recipient addition to a share`,builder:H,handler:async e=>c({command:`resource-sharing recipients create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf resource-sharing recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?
|
|
25
|
-
`);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
|
|
24
|
+
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(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`account-id`,{type:`string`,description:"Deprecated alias for `recipient_account_id`. Use `recipient_account_id` instead.\nThe body field collided with the URL path parameter of the same name, which prevented SDK generators from distinguishing the source account (in the URL) from the recipient account (in the body). Both names will continue to be accepted until 2027-05-26 (see `x-sunset`).\n"}).option(`organization-id`,{type:`string`,description:`Organization identifier.`}).option(`recipient-account-id`,{type:`string`,description:`The account that will receive the share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Optionally specify `recipient_account_id` to target a specific account, or `organization_id` to target the caller's whole organization. If neither is provided, the caller's organization is used. The legacy field `account_id` is accepted as a synonym for `recipient_account_id` during the deprecation period (see `x-sunset` on that field). "})}const U={command:`create <share-id>`,describe:`Trigger a recipient addition to a share`,builder:H,handler:async e=>c({command:`resource-sharing recipients create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf resource-sharing recipients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({account_id:p(e[`account-id`],`account-id`,`text`),organization_id:p(e[`organization-id`],`organization-id`,`text`),recipient_account_id:p(e[`recipient-account-id`],`recipient-account-id`,`text`)}):u(e.body)});return}let t=await n(e);if(e.body){let n=u(e.body),r=await s(`Creating`,async()=>t.send(V,{body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]}));a(r,{successLabel:`Created`});return}let r=f({account_id:p(e[`account-id`],`account-id`,`text`),organization_id:p(e[`organization-id`],`organization-id`,`text`),recipient_account_id:p(e[`recipient-account-id`],`recipient-account-id`,`text`)}),i=await s(`Creating`,async()=>t.send(V,{body:r,account_id_path:e[`account-id-path`],share_id:e[`share-id`]}));a(i,{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.`})){process.stderr.write(`Aborted.
|
|
25
|
+
`);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 ie(e){return e.usage(`$0 resource-sharing recipients get <recipient-id>
|
|
26
26
|
|
|
27
|
-
Get share recipient by ID.`).positional(`recipient-id`,{type:`string`,description:`Share Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <recipient-id>`,describe:`Get share recipient by ID`,builder:
|
|
27
|
+
Get share recipient by ID.`).positional(`recipient-id`,{type:`string`,description:`Share Recipient identifier tag.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`include-resources`,{type:`boolean`,description:`Include resources in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <recipient-id>`,describe:`Get share recipient by ID`,builder:ie,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_path}/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(`account-id-path`,{type:`string`,description:`Account identifier.`,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(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page` is supplied without `per_page`. May be omitted entirely along with `page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List share recipients by share ID`,builder:ae,handler:async e=>c({command:`resource-sharing recipients list`,classification:{safeFlags:[`include-resources`,`dry-run`]}},e,async()=>{let t={include_resources:e[`include-resources`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf resource-sharing recipients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},query:t,bodyKind:`none`});return}let r=await n(e),i=await s(`Loading`,async()=>r.send(Y,{account_id_path:e[`account-id-path`],share_id:e[`share-id`],...t}));a(i,{successLabel:`Loaded`})})};var se={method:`PUT`,path:t=>e`/accounts/${t.account_id_path}/shares/${t.share_id}/recipients`,body:`json`,response:!1};function ce(e){return e.usage(`$0 resource-sharing recipients update <share-id>
|
|
28
28
|
|
|
29
|
-
Replaces the full recipient list for an account-targeted share. The server computes the diff between the current and desired recipients: new accounts are added, accounts no longer in the list are marked for disassociation, and unchanged accounts are left as-is. Returns an error if the share targets an organization (\`target_type=organization\`); org-targeted shares derive their recipients dynamically from org membership and cannot be modified through this endpoint.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,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
|
|
29
|
+
Replaces the full recipient list for an account-targeted share. The server computes the diff between the current and desired recipients: new accounts are added, accounts no longer in the list are marked for disassociation, and unchanged accounts are left as-is. Returns an error if the share targets an organization (\`target_type=organization\`); org-targeted shares derive their recipients dynamically from org membership and cannot be modified through this endpoint.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`account-id-path`,{type:`string`,description:`Account identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const le={command:`update <share-id>`,describe:`Trigger recipient reconciliation on a share`,builder:ce,handler:async e=>c({command:`resource-sharing recipients update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf resource-sharing recipients update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e[`account-id-path`]==null?`<account-id-path>`:encodeURIComponent(String(e[`account-id-path`]))}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/recipients`,pathParams:{"account-id-path":String(e[`account-id-path`]??``),"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:u(e.body)});return}let t=await n(e);if(e.body){let n=u(e.body),r=await s(`Updating`,async()=>t.send(se,{body:n,account_id_path:e[`account-id-path`],share_id:e[`share-id`]}));a(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},ue={command:`recipients`,describe:`Update share recipients`,builder:e=>e.command(U).command(K).command(J).command(oe).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/resources`,body:`json`};function de(e){return e.usage(`$0 resource-sharing resources create <share-id>
|
|
30
30
|
|
|
31
|
-
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(`resource-account-id`,{type:`string`,description:`Account identifier.`}).option(`resource-id`,{type:`string`,description:`Share Resource identifier.`}).option(`resource-type`,{type:`string`,description:`Resource Type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).coerce(`resource-type`,e=>
|
|
31
|
+
Adds a resource to an existing share, making it available to share recipients.`).positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`meta`,{type:`string`,description:`Resource Metadata. Provide as a JSON object or @path/to/file.json.`}).option(`resource-account-id`,{type:`string`,description:`Account identifier.`}).option(`resource-id`,{type:`string`,description:`Share Resource identifier.`}).option(`resource-type`,{type:`string`,description:`Resource Type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).coerce(`resource-type`,e=>p(e,`resource-type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`create <share-id>`,describe:`Trigger a resource addition to a share`,builder:de,handler:async e=>c({command:`resource-sharing resources create`,classification:{safeFlags:[`resource-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing resources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({meta:d(e.meta,`meta`,!0),resource_account_id:p(e[`resource-account-id`],`resource-account-id`,`text`),resource_id:p(e[`resource-id`],`resource-id`,`text`),resource_type:e[`resource-type`]},[[`meta`]]):u(e.body,[{path:[`meta`],flag:`meta`}])});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body,[{path:[`meta`],flag:`meta`}]),n=await s(`Creating`,async()=>c.send(X,{body:t,account_id:l,share_id:e[`share-id`]}));a(n,{successLabel:`Created`});return}if(e.meta===void 0)throw Error(`--meta is required (or pass --body with this field set).`);e[`resource-account-id`]===void 0&&(e[`resource-account-id`]=await m(`resource-account-id`,`Account identifier.`)),e[`resource-id`]===void 0&&(e[`resource-id`]=await m(`resource-id`,`Share Resource identifier.`)),e[`resource-type`]===void 0&&(e[`resource-type`]=await h(`resource-type`,`Resource Type.`,[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]));let g=f({meta:d(e.meta,`meta`,!0),resource_account_id:p(e[`resource-account-id`],`resource-account-id`,`text`),resource_id:p(e[`resource-id`],`resource-id`,`text`),resource_type:e[`resource-type`]},[[`meta`]]),_=await s(`Creating`,async()=>c.send(X,{body:g,account_id:l,share_id:e[`share-id`]}));a(_,{successLabel:`Created`})})};var pe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/resources/${t.share_resource_id}`};function me(e){return e.usage(`$0 resource-sharing resources delete <share-resource-id>
|
|
32
32
|
|
|
33
|
-
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
|
|
34
|
-
`);return}let u=await s(`Deleting`,async()=>c.send(
|
|
33
|
+
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.`})){process.stderr.write(`Aborted.
|
|
34
|
+
`);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>
|
|
35
35
|
|
|
36
|
-
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
|
|
36
|
+
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
|
|
37
37
|
|
|
38
|
-
List share resources by share ID.`).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter share resources by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`resource-type`,{type:`string`,description:`Filter share resources by resource_type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page
|
|
38
|
+
List share resources by share ID.`).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter share resources by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`resource-type`,{type:`string`,description:`Filter share resources by resource_type.`,choices:[`custom-ruleset`,`gateway-policy`,`gateway-destination-ip`,`gateway-block-page-settings`,`gateway-extended-email-matching`,`idp-federation-grant`,`trust-grant`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page` is supplied without `per_page`. May be omitted entirely along with `page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`list`,describe:`List share resources by share ID`,builder:be,handler:async e=>c({command:`resource-sharing resources list`,classification:{safeFlags:[`status`,`resource-type`,`dry-run`]}},e,async()=>{let c={status:e.status,resource_type:e[`resource-type`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await r();o({command:`cf resource-sharing resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources`,pathParams:{"share-id":String(e[`share-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(ye,{account_id:u,share_id:e[`share-id`],...c}));a(d,{successLabel:`Loaded`})})};var Z={method:`PUT`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}/resources/${t.share_resource_id}`,body:`json`};function Q(e){return e.usage(`$0 resource-sharing resources update <share-resource-id>
|
|
39
39
|
|
|
40
|
-
Update is not immediate, an updated share resource object with a new status will be returned.`).positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`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
|
|
40
|
+
Update is not immediate, an updated share resource object with a new status will be returned.`).positional(`share-resource-id`,{type:`string`,description:`Share Resource identifier.`,demandOption:!0}).option(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`meta`,{type:`string`,description:`Resource Metadata. Provide as a JSON object or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Se={command:`update <share-resource-id>`,describe:`Trigger a resource metadata update in a share`,builder:Q,handler:async e=>c({command:`resource-sharing resources update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing resources update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}/resources/${e[`share-resource-id`]==null?`<share-resource-id>`:encodeURIComponent(String(e[`share-resource-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``),"share-resource-id":String(e[`share-resource-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({meta:d(e.meta,`meta`,!0)},[[`meta`]]):u(e.body,[{path:[`meta`],flag:`meta`}])});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body,[{path:[`meta`],flag:`meta`}]),n=await s(`Updating`,async()=>c.send(Z,{body:t,account_id:l,share_id:e[`share-id`],share_resource_id:e[`share-resource-id`]}));a(n,{successLabel:`Updated`});return}if(e.meta===void 0)throw Error(`--meta is required (or pass --body with this field set).`);let p=f({meta:d(e.meta,`meta`,!0)},[[`meta`]]),m=await s(`Updating`,async()=>c.send(Z,{body:p,account_id:l,share_id:e[`share-id`],share_resource_id:e[`share-resource-id`]}));a(m,{successLabel:`Updated`})})},Ce={command:`resources`,describe:`Individual resources (zones, configs) that have been shared with recipients`,builder:e=>e.command(fe).command(he).command(ve).command(xe).command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $={method:`PUT`,path:t=>e`/accounts/${t.account_id}/shares/${t.share_id}`,body:`json`};function we(e){return e.usage("$0 resource-sharing update <share-id>\n\nUpdates the share's display name and tags. This endpoint does **not** modify recipients or resources — those are managed via dedicated subresource endpoints: - **Recipients**: Use `POST /accounts/{account_id}/shares/{share_id}/recipients` to add a single recipient, `PUT /accounts/{account_id}/shares/{share_id}/recipients` to replace the full recipient list, or `DELETE /accounts/{account_id}/shares/{share_id}/recipients/{recipient_id}` to remove a recipient. - **Resources**: Use the share's resource subresource endpoints. Updating is not immediate; an updated share object with a new status will be returned.").positional(`share-id`,{type:`string`,description:`Share identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the share.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request body for `PUT /accounts/{account_id}/shares/{share_id}`. The share's display `name` and `tags` can be updated via this endpoint. To modify recipients, use the `/accounts/{account_id}/shares/{share_id}/recipients` subresource endpoints (POST, PUT, DELETE). "})}const Te={command:`update <share-id>`,describe:`Trigger a share rename`,builder:we,handler:async e=>c({command:`resource-sharing update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf resource-sharing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/shares/${e[`share-id`]==null?`<share-id>`:encodeURIComponent(String(e[`share-id`]))}`,pathParams:{"share-id":String(e[`share-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({name:p(e.name,`name`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send($,{body:t,account_id:l,share_id:e[`share-id`]}));a(n,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await m(`name`,`The name of the share.`));let d=f({name:p(e.name,`name`,`text`)}),h=await s(`Updating`,async()=>c.send($,{body:d,account_id:l,share_id:e[`share-id`]}));a(h,{successLabel:`Updated`})})},Ee={command:`resource-sharing`,describe:`Share Cloudflare resources (zones, accounts) across organizations with granular access controls`,builder:e=>e.command(v).command(re).command(L).command(B).command(Te).command(P).command(ue).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ee as default};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-Db1KT0vm.mjs";import{a as r,t as i}from"./context-C_a8oSY9.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-Q5w9PNTT.mjs";import{t as c}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{i as l,n as u,t as d}from"./body-parser-DnBfDdx3.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-C0hKSr-R.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`)}):
|
|
4
|
+
Creates a new list of the specified kind.`).option(`description`,{type:`string`,description:`An informative summary of the list.`}).option(`kind`,{type:`string`,description:`The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).`,choices:[`ip`,`redirect`,`hostname`,`asn`]}).coerce(`kind`,e=>f(e,`kind`,`text`)).option(`name`,{type:`string`,description:`An informative name for the list. Use this name in filter and rule expressions.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`create`,describe:`Create a list`,builder:x,handler:async e=>c({command:`rules lists create`,classification:{safeFlags:[`kind`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf rules lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/rules/lists`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(b,{body:t,account_id:l}));a(n,{successLabel:`Created`});return}e.kind===void 0&&(e.kind=await m(`kind`,`The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).`,[`ip`,`redirect`,`hostname`,`asn`])),e.name===void 0&&(e.name=await p(`name`,`An informative name for the list. Use this name in filter and rule expressions.`));let h=d({description:f(e.description,`description`,`text`),kind:e.kind,name:f(e.name,`name`,`text`)}),g=await s(`Creating`,async()=>c.send(b,{body:h,account_id:l}));a(g,{successLabel:`Created`})})};var C={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/rules/lists/${t.list_id}`};function w(e){return e.usage(`$0 rules lists delete <list-id>
|
|
5
5
|
|
|
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.`})){process.stderr.write(`Aborted.
|
|
7
7
|
`);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>
|
|
8
8
|
|
|
9
|
-
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:
|
|
10
|
-
`);return}if(e.body){let t=
|
|
9
|
+
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),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(k,{body:t,account_id:l,list_id:e[`list-id`]}));a(n,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var M={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/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=await n(e),f=e.local?t:await i();if(e.accountId=f,!await h({force:!!e.force,message:`This operation deletes the selected items from the custom list.`})){process.stderr.write(`Aborted.
|
|
10
|
+
`);return}if(e.body){let t=u(e.body),n=await s(`Deleting`,async()=>c.send(M,{body:t,account_id:f,list_id:e[`list-id`]}));a(n,{successLabel:`Deleted`});return}let p=d({items:l(e.items,`items`)}),m=await s(`Deleting`,async()=>c.send(M,{body:p,account_id:f,list_id:e[`list-id`]}));a(m,{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>
|
|
11
11
|
|
|
12
12
|
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
|
|
13
13
|
|
|
14
|
-
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:
|
|
14
|
+
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),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(V,{body:t,account_id:l,list_id:e[`list-id`]}));a(n,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},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
|
|
15
15
|
|
|
16
16
|
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>
|
|
17
17
|
|
|
18
|
-
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`)}):
|
|
18
|
+
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),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(J,{body:t,account_id:l,list_id:e[`list-id`]}));a(n,{successLabel:`Updated`});return}let p=d({description:f(e.description,`description`,`text`)}),m=await s(`Updating`,async()=>c.send(J,{body:p,account_id:l,list_id:e[`list-id`]}));a(m,{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,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{i as n,n as r}from"./auth-
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{i as n,n as r}from"./auth-Db1KT0vm.mjs";import{a as i,i as a,t as o}from"./context-C_a8oSY9.mjs";import{t as s}from"./output-Co4xdFf6.mjs";import{t as c}from"./dry-run-C2KjGX10.mjs";import{t as l}from"./progress-Q5w9PNTT.mjs";import{t as u}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{a as d,i as f,n as p,t as m}from"./body-parser-DnBfDdx3.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{n as g}from"./prompt-C0hKSr-R.mjs";var _={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets`,query:[`dry_run`],body:`json`};function v(e){return e.usage(`$0 rulesets create
|
|
3
3
|
|
|
4
|
-
Creates a ruleset.`).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`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_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).coerce(`phase`,e=>h(e,`phase`,`text`)).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create an account or zone ruleset`,builder:v,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`),name:h(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:
|
|
4
|
+
Creates a ruleset.`).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`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_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).coerce(`phase`,e=>h(e,`phase`,`text`)).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create an account or zone ruleset`,builder:v,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`),name:h(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:f(e.rules,`rules`)}):p(e.body)});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,g=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();if(d===`zones`?e.zoneId=g:e.accountId=g,e.body){let t=p(e.body);new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let r=await l(`Creating`,async()=>u.send(_,{body:t,account_or_zone:d,account_or_zone_id:g,...n}));s(r,{successLabel:`Created`});return}let v=m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:f(e.rules,`rules`)});new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let y=await l(`Creating`,async()=>u.send(_,{body:v,account_or_zone:d,account_or_zone_id:g,...n}));s(y,{successLabel:`Created`})})};function b(e){return e.usage(`$0 rulesets delete <id>
|
|
5
5
|
|
|
6
6
|
Deletes all versions of an existing account or zone ruleset.`).positional(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <id>`,describe:`Delete an account or zone ruleset`,builder:b,handler:async e=>u({command:`rulesets delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let u={dry_run:e[`validate-only`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),id:String(e.id??``)},query:u,bodyKind:`none`});return}let d=await r(e),f=e.zone===void 0?`accounts`:`zones`,p=f===`zones`?await a({zone:e.zone},d,{quiet:e.quiet}):e.local?t:await o();if(f===`zones`?e.zoneId=p:e.accountId=p,!await g({force:!!e.force})){process.stderr.write(`Aborted.
|
|
7
7
|
`);return}let m=await l(`Deleting`,async()=>n(d,`DELETE`,`/${f}/${p}/rulesets/${encodeURIComponent(String(e.id))}`,{query:u}));s(m,{successLabel:`Deleted`})})};function S(e){return e.usage(`$0 rulesets entrypoint get <phase>
|
|
8
8
|
|
|
9
9
|
Fetches the latest version of the account or zone entry point ruleset for a given phase.`).positional(`phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <phase>`,describe:`Get an account or zone entry point ruleset`,builder:S,handler:async e=>u({command:`rulesets entrypoint get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets entrypoint get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${e.phase==null?`<phase>`:encodeURIComponent(String(e.phase))}/entrypoint`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),phase:String(e.phase??``)},bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>n(u,`GET`,`/${d}/${f}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint`));s(p,{successLabel:`Loaded`})})};function w(e){return e.usage(`$0 rulesets entrypoint update <phase>
|
|
10
10
|
|
|
11
|
-
Updates an account or zone entry point ruleset, creating a new version.`).positional(`phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`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 T={command:`update <phase>`,describe:`Update an account or zone entry point ruleset`,builder:w,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`),name:h(e.name,`name`,`text`),rules:
|
|
11
|
+
Updates an account or zone entry point ruleset, creating a new version.`).positional(`phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`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 T={command:`update <phase>`,describe:`Update an account or zone entry point ruleset`,builder:w,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`),name:h(e.name,`name`,`text`),rules:f(e.rules,`rules`)}):p(e.body)});return}let g=await r(e),_=e.zone===void 0?`accounts`:`zones`,v=_===`zones`?await a({zone:e.zone},g,{quiet:e.quiet}):e.local?t:await o();if(_===`zones`?e.zoneId=v:e.accountId=v,e.body){let t=p(e.body),r=new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i=await l(`Updating`,async()=>n(g,`PUT`,`/${_}/${v}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint${r?`?`+r:``}`,{body:t}));s(i,{successLabel:`Updated`});return}let y={};e.description!==void 0&&d(y,[`description`],h(e.description,`description`,`text`)),e.name!==void 0&&d(y,[`name`],h(e.name,`name`,`text`)),e.rules!==void 0&&d(y,[`rules`],f(e.rules,`rules`));let b=new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),x=await l(`Updating`,async()=>n(g,`PUT`,`/${_}/${v}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint${b?`?`+b:``}`,{body:y}));s(x,{successLabel:`Updated`})})};function E(e){return e.usage(`$0 rulesets entrypoint versions get <ruleset-version>
|
|
12
12
|
|
|
13
13
|
Fetches a specific version of an account or zone entry point ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <ruleset-version>`,describe:`Get an account or zone entry point ruleset version`,builder:E,handler:async e=>u({command:`rulesets entrypoint versions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets entrypoint versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/phases/${e.phase==null?`<phase>`:encodeURIComponent(String(e.phase))}/entrypoint/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),phase:String(e.phase??``),"ruleset-version":String(e[`ruleset-version`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>n(u,`GET`,`/${d}/${f}/rulesets/phases/${encodeURIComponent(String(e.phase))}/entrypoint/versions/${encodeURIComponent(String(e[`ruleset-version`]))}`));s(p,{successLabel:`Loaded`})})};function O(e){return e.usage(`$0 rulesets entrypoint versions list
|
|
14
14
|
|
|
@@ -18,14 +18,14 @@ Fetches the latest version of an account or zone ruleset.`).positional(`id`,{typ
|
|
|
18
18
|
|
|
19
19
|
Fetches all rulesets.`).option(`cursor`,{type:`string`,description:`The cursor to use for the next page.`}).option(`per-page`,{type:`number`,description:`The number of rulesets to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`List account or zone rulesets`,builder:F,handler:async e=>u({command:`rulesets list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,r=e.zone===void 0?`accounts`:`zones`,a=e.zone??t??`<account-id>`;c({command:`cf rulesets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/rulesets`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a)},query:n,bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>u.send(P,{account_or_zone:d,account_or_zone_id:f,...n}));s(p,{successLabel:`Loaded`})})};var L={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}/rules`,query:[`dry_run`],body:`json`};function R(e){return e.usage(`$0 rulesets rules create <ruleset-id>
|
|
20
20
|
|
|
21
|
-
Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const z={command:`create <ruleset-id>`,describe:`Create an account or zone ruleset rule`,builder:R,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`]}}):
|
|
21
|
+
Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const z={command:`create <ruleset-id>`,describe:`Create an account or zone ruleset rule`,builder:R,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`]}}):p(e.body)});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();if(d===`zones`?e.zoneId=f:e.accountId=f,e.body){let t=p(e.body);new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let r=await l(`Creating`,async()=>u.send(L,{body:t,account_or_zone:d,account_or_zone_id:f,ruleset_id:e[`ruleset-id`],...n}));s(r,{successLabel:`Created`});return}let g=m({position:{before:h(e[`position-before`],`position-before`,`text`),after:h(e[`position-after`],`position-after`,`text`),index:e[`position-index`]}});new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let _=await l(`Creating`,async()=>u.send(L,{body:g,account_or_zone:d,account_or_zone_id:f,ruleset_id:e[`ruleset-id`],...n}));s(_,{successLabel:`Created`})})};var B={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 V(e){return e.usage(`$0 rulesets rules delete <rule-id>
|
|
22
22
|
|
|
23
23
|
Deletes an existing rule from an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ee={command:`delete <rule-id>`,describe:`Delete an account or zone ruleset rule`,builder:V,handler:async e=>u({command:`rulesets rules delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let n={dry_run:e[`validate-only`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,r=e.zone===void 0?`accounts`:`zones`,a=e.zone??t??`<account-id>`;c({command:`cf rulesets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/rulesets/${e[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(e[`ruleset-id`]))}/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a),"ruleset-id":String(e[`ruleset-id`]??``),"rule-id":String(e[`rule-id`]??``)},query:n,bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();if(d===`zones`?e.zoneId=f:e.accountId=f,!await g({force:!!e.force})){process.stderr.write(`Aborted.
|
|
24
24
|
`);return}let p=await l(`Deleting`,async()=>u.send(B,{account_or_zone:d,account_or_zone_id:f,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...n}));s(p,{successLabel:`Deleted`})})};var H={method:`PATCH`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}/rules/${t.rule_id}`,query:[`dry_run`],body:`json`};function U(e){return e.usage(`$0 rulesets rules update <rule-id>
|
|
25
25
|
|
|
26
|
-
Updates an existing rule in an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const W={command:`update <rule-id>`,describe:`Update an account or zone ruleset rule`,builder:U,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`]}}):
|
|
26
|
+
Updates an existing rule in an account or zone ruleset.`).positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const W={command:`update <rule-id>`,describe:`Update an account or zone ruleset rule`,builder:U,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`]}}):p(e.body)});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();if(d===`zones`?e.zoneId=f:e.accountId=f,e.body){let t=p(e.body);new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let r=await l(`Updating`,async()=>u.send(H,{body:t,account_or_zone:d,account_or_zone_id:f,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...n}));s(r,{successLabel:`Updated`});return}let g=m({position:{before:h(e[`position-before`],`position-before`,`text`),after:h(e[`position-after`],`position-after`,`text`),index:e[`position-index`]}});new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let _=await l(`Updating`,async()=>u.send(H,{body:g,account_or_zone:d,account_or_zone_id:f,ruleset_id:e[`ruleset-id`],rule_id:e[`rule-id`],...n}));s(_,{successLabel:`Updated`})})},G={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(z).command(ee).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var K={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/rulesets/${t.ruleset_id}`,query:[`dry_run`],body:`json`};function q(e){return e.usage(`$0 rulesets update <ruleset-id>
|
|
27
27
|
|
|
28
|
-
Updates an account or zone ruleset, creating a new version.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`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_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 J={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:q,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`),name:h(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:
|
|
28
|
+
Updates an account or zone ruleset, creating a new version.`).positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`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_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 J={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:q,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`),name:h(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:f(e.rules,`rules`)}):p(e.body)});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,g=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();if(d===`zones`?e.zoneId=g:e.accountId=g,e.body){let t=p(e.body);new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let r=await l(`Updating`,async()=>u.send(K,{body:t,account_or_zone:d,account_or_zone_id:g,ruleset_id:e[`ruleset-id`],...n}));s(r,{successLabel:`Updated`});return}let _=m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`),kind:e.kind,phase:e.phase,rules:f(e.rules,`rules`)});new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let v=await l(`Updating`,async()=>u.send(K,{body:_,account_or_zone:d,account_or_zone_id:g,ruleset_id:e[`ruleset-id`],...n}));s(v,{successLabel:`Updated`})})};function Y(e){return e.usage(`$0 rulesets versions by-tag get <tag>
|
|
29
29
|
|
|
30
30
|
Fetches the rules of a managed account or zone ruleset version for a given tag.`).positional(`tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <tag>`,describe:`List an account or zone ruleset version's rules by tag`,builder:Y,handler:async e=>u({command:`rulesets versions by-tag get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf rulesets versions by-tag get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/rulesets/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions/${e[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(e[`ruleset-version`]))}/by_tag/${e.tag==null?`<tag>`:encodeURIComponent(String(e.tag))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),id:String(e.id??``),"ruleset-version":String(e[`ruleset-version`]??``),tag:String(e.tag??``)},bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>n(u,`GET`,`/${d}/${f}/rulesets/${encodeURIComponent(String(e.id))}/versions/${encodeURIComponent(String(e[`ruleset-version`]))}/by_tag/${encodeURIComponent(String(e.tag))}`));s(p,{successLabel:`Loaded`})})},Z={command:`by-tag`,describe:`Operations for versions.by-tag`,builder:e=>e.command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.usage(`$0 rulesets versions delete <ruleset-version>
|
|
31
31
|
|