cf 1.0.0-beta.13 → 1.0.0-beta.15
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/README.md +10 -0
- package/dist/_meta/commands.json +5039 -2465
- package/dist/_meta/hand-written-commands.json +375 -22
- package/dist/_meta/schemas.json +2607 -1038
- package/dist/abuse-reports-CnQBtN1G.mjs +24 -0
- package/dist/access-BzmXSwzj.mjs +2 -0
- package/dist/account-tags-2qPWbW17.mjs +15 -0
- package/dist/accounts-B0Byg-AV.mjs +132 -0
- package/dist/acm-DgAu0cnk.mjs +15 -0
- package/dist/addressing-J1oa0ML2.mjs +105 -0
- package/dist/agent-memory-4KGou-tm.mjs +34 -0
- package/dist/ai-WY7wVQfA.mjs +31 -0
- package/dist/ai-audit-D38HaEoZ.mjs +6 -0
- package/dist/ai-gateway-C0gIipT8.mjs +80 -0
- package/dist/ai-search-ClwnPU-9.mjs +79 -0
- package/dist/ai-security-BIsvFPYV.mjs +10 -0
- package/dist/alerting-MHhv28oO.mjs +56 -0
- package/dist/analytics-BfBz7bqB.mjs +17 -0
- package/dist/analytics_engine-CXVdBF1n.mjs +4 -0
- package/dist/api-eMuS5GI1.mjs +3 -0
- package/dist/api-security-DUCfcdC1.mjs +154 -0
- package/dist/argo-CUlzI4v3.mjs +14 -0
- package/dist/artifacts-BLfWGzBg.mjs +43 -0
- package/dist/audit-logs-CsfIm2QS.mjs +4 -0
- package/dist/auth-8Sm4uLGM.mjs +2 -0
- package/dist/auth-C6u9qIGO.mjs +2 -0
- package/dist/auth-CGRemu5W.mjs +2 -0
- package/dist/{auth-token-pNQrX_9O.mjs → auth-token-DkkYg4DP.mjs} +1 -1
- package/dist/{autoconfig-sD7Frryg.mjs → autoconfig-B0ESZ8DJ.mjs} +2 -2
- package/dist/basin-catalog-CrKRYJ0b.mjs +46 -0
- package/dist/billing-NxehgXrR.mjs +23 -0
- package/dist/blocks-Bat9A8V_.mjs +5 -0
- package/dist/bot-management-C993iQKL.mjs +9 -0
- package/dist/botnet-feed-CZ4vYk5y.mjs +11 -0
- package/dist/brand-protection-ADVgIi0l.mjs +27 -0
- package/dist/browser-run-CEptKZYl.mjs +42 -0
- package/dist/build-Bm6kGyzo.mjs +2 -0
- package/dist/{build-HmSXqjGn.mjs → build-sBpqm9ga.mjs} +1 -1
- package/dist/builds-DqtiTH7p.mjs +71 -0
- package/dist/cache-hX5QxmI0.mjs +45 -0
- package/dist/certificate-authorities-BOcybjc1.mjs +6 -0
- package/dist/cf-Bq4pA4n6.mjs +18 -0
- package/dist/{chunk-TAK63GWY-DdMktrgc.mjs → chunk-2HLTAS5V-D7COzUOd.mjs} +2 -2
- package/dist/chunk-2K52M2W5-CYxfQXUq.mjs +363 -0
- package/dist/{chunk-DSGVRFIS-C1_SEtRK.mjs → chunk-DSGVRFIS-C5SqiTOz.mjs} +1 -1
- package/dist/{cli-DeJc9U8z.mjs → cli-R8h3OKZI.mjs} +1 -1
- package/dist/client-certificates-Bez_ArKE.mjs +13 -0
- package/dist/client-side-security-CSmA50Bv.mjs +63 -0
- package/dist/cloud-connector-0Wivqi7S.mjs +6 -0
- package/dist/{cloudflared--1Ws1RJy.mjs → cloudflared-By8BzYXc.mjs} +1 -1
- package/dist/cloudforce-one-J-rU6k1U.mjs +405 -0
- package/dist/{command-Dh7RmjFu.mjs → command-0BOb1pgV.mjs} +1 -1
- package/dist/{command-DUhX8Dcr.mjs → command-BCJN-ZM2.mjs} +1 -1
- package/dist/{command-BvfKhMl7.mjs → command-BG-kLOnS.mjs} +1 -1
- package/dist/{command-Cu7dcaHT.mjs → command-BIsI-mMX.mjs} +1 -1
- package/dist/{command-83uVfXh9.mjs → command-BKDbbA-L.mjs} +1 -1
- package/dist/command-BWQIKu6I.mjs +2 -0
- package/dist/{command-D3fyhdy-.mjs → command-Bdy69UFU.mjs} +1 -1
- package/dist/{command-BDe67N_n.mjs → command-Bgb-3yPg.mjs} +1 -1
- package/dist/{command-_rqD0hXF.mjs → command-C6w1OdoC.mjs} +1 -1
- package/dist/{command-oNVwyjGB.mjs → command-CKW6UhTh.mjs} +1 -1
- package/dist/{command-Bpzp8Mz2.mjs → command-DCQgsd2U.mjs} +1 -1
- package/dist/{command-CcuLC6CJ.mjs → command-DIs-Nqtl.mjs} +1 -1
- package/dist/command-DPn5ANHs.mjs +2 -0
- package/dist/{command-CG6RvZs0.mjs → command-DZfKHiru.mjs} +1 -1
- package/dist/{command-BlIb6RR2.mjs → command-DppVezAB.mjs} +1 -1
- package/dist/{completions-D06AO7A8.mjs → completions-CpNGTlUX.mjs} +1 -1
- package/dist/config.mjs +0 -0
- package/dist/connector-interrupts-CH-DaLuo.mjs +6 -0
- package/dist/connector-telemetry-events-X3Fod9nl.mjs +6 -0
- package/dist/connector-telemetry-snapshots-D-WR4npQ.mjs +6 -0
- package/dist/connectors-CORKD31m.mjs +15 -0
- package/dist/containers-BboUbx3k.mjs +78 -0
- package/dist/containers-Di3_Vopq.mjs +376 -0
- package/dist/content-scan-DXGREAXa.mjs +14 -0
- package/dist/{context-q7UaYK69.mjs → context-A6T-NKPI.mjs} +2 -2
- package/dist/cps-1BoOLtTq.mjs +6 -0
- package/dist/create-OXylMu6m.mjs +2 -0
- package/dist/csamScanner-CHfbfeup.mjs +10 -0
- package/dist/ct-alerting-DlH4ILQo.mjs +5 -0
- package/dist/custom-certificates-zJqJZ2Th.mjs +17 -0
- package/dist/custom-csrs-DoLIGqYL.mjs +11 -0
- package/dist/custom-hostnames-YfV-aoAK.mjs +27 -0
- package/dist/custom-nameservers-BV43gmgt.mjs +9 -0
- package/dist/custom-pages-CoOU1Cdx.mjs +21 -0
- package/dist/d1-DujBmzLa.mjs +94 -0
- package/dist/dcv-delegation-CPLsVYOl.mjs +4 -0
- package/dist/delegate.mjs +0 -0
- package/dist/deploy-context-tEhwEXnA.mjs +56 -0
- package/dist/{deploy-input-Cc0_2QlW.mjs → deploy-input-BqJ7GVZ-.mjs} +1 -1
- package/dist/{deploy-CWNm1-5v.mjs → deploy-wNujfGUJ.mjs} +1 -1
- package/dist/{dev-ZA8itQE7.mjs → dev-EtnMYA7K.mjs} +1 -1
- package/dist/diagnostics-B3TYPVRi.mjs +15 -0
- package/dist/dist-DZRTPMMA.mjs +449 -0
- package/dist/dls-CWm1HRF0.mjs +17 -0
- package/dist/dns-CjAFU7Z9.mjs +144 -0
- package/dist/dns-firewall-BooBP9ap.mjs +71 -0
- package/dist/docs-C5XB7HdG.mjs +3 -0
- package/dist/{dotenv-DpXaxfho.mjs → dotenv-usOKkeW7.mjs} +3 -3
- package/dist/{dry-run-DRj2_uV3.mjs → dry-run-C2KjGX10.mjs} +1 -1
- package/dist/durable-objects-CSrMQDCE.mjs +6 -0
- package/dist/email-auth-Bp1Mui-n.mjs +6 -0
- package/dist/email-routing-CVF6SwQt.mjs +45 -0
- package/dist/email-security-mYZtazae.mjs +158 -0
- package/dist/email-sending-BqaKU_Xu.mjs +47 -0
- package/dist/error-sanitization-CIQOep3I.mjs +2 -0
- package/dist/error-sanitization-pOyzm2F1.mjs +2 -0
- package/dist/fieldExtractors-CAGZVmYg.mjs +9 -0
- package/dist/firewall-DgTDsYOt.mjs +36 -0
- package/dist/flagship-Db3PxxyZ.mjs +28 -0
- package/dist/fraud-BEOQczy8.mjs +22 -0
- package/dist/get-By1q8YlI.mjs +2 -0
- package/dist/get-CRKvqCu6.mjs +2 -0
- package/dist/get-iPUHxD1r.mjs +2 -0
- package/dist/google-tag-gateway-DjLQ9wo0.mjs +6 -0
- package/dist/hand-written-dry-run-B82fRl2N.mjs +2 -0
- package/dist/healthchecks-C3ScnKss.mjs +22 -0
- package/dist/{hostnames-sF999-6H.mjs → hostnames-DU0k-xO9.mjs} +6 -6
- package/dist/hyperdrive-IpCCLCRd.mjs +37 -0
- package/dist/iam-96CYM8Vw.mjs +52 -0
- package/dist/images-AB9EgZgT.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-1w_mcgk3.mjs → init-D2nPoW4f.mjs} +2 -2
- package/dist/intel-BKb4RLvS.mjs +76 -0
- package/dist/ips-z9APCV_b.mjs +4 -0
- package/dist/k2-Bv-HiJ29.mjs +11 -0
- package/dist/keyless-certificates-ChgSGHq4.mjs +13 -0
- package/dist/keys-BhngDsDa.mjs +4 -0
- package/dist/kv-CB5MQVGP.mjs +15 -0
- package/dist/{lazy-command-BDiIwpss.mjs → lazy-command-CaZ1kdlW.mjs} +1 -1
- package/dist/leaked-credential-checks-Bsi2WpSU.mjs +18 -0
- package/dist/load-balancers-0gXZNCeI.mjs +76 -0
- package/dist/{local-DlT72Xpn.mjs → local-Dil4fTWX.mjs} +1 -1
- package/dist/local-DxWDQDnG.mjs +2 -0
- package/dist/{local-runtime-CokO6qaX.mjs → local-runtime-B7TKFu6E.mjs} +1 -1
- package/dist/login-CiQGR8ha.mjs +5 -0
- package/dist/login-Ik98G4K6.mjs +2 -0
- package/dist/logo-matches-DmoF5Otu.mjs +6 -0
- package/dist/logos-BL6ohIMH.mjs +7 -0
- package/dist/logpush-UVopW68t.mjs +46 -0
- package/dist/logs-BVfxiEiM.mjs +36 -0
- package/dist/magic-cloud-networking-B5S3aM6f.mjs +71 -0
- package/dist/magic-network-monitoring-CDSJPP47.mjs +36 -0
- package/dist/magic-transit-TcDTKM43.mjs +386 -0
- package/dist/managed-defense-C88HL0pg.mjs +18 -0
- package/dist/managed-transforms-Ja41Tahl.mjs +9 -0
- package/dist/matches-BL_Y-9Yq.mjs +6 -0
- package/dist/mcp-BWp5Q09R.mjs +32 -0
- package/dist/mesh-lFPLRWhV.mjs +26 -0
- package/dist/{migrate-CZNq63Uj.mjs → migrate-6e5mJ79R.mjs} +1 -1
- package/dist/monetization-BIc4Bwo2.mjs +20 -0
- package/dist/mtls-certificates-CVBw-Jli.mjs +13 -0
- package/dist/network-Wig0qbaC.mjs +50 -0
- package/dist/network-interconnects-C16z1HuQ.mjs +72 -0
- package/dist/o11y-Bhy4qDRm.mjs +93 -0
- package/dist/oauth-CfEedDZi.mjs +4 -0
- package/dist/oauth-clients-eXjmK5yf.mjs +16 -0
- package/dist/{oauth-mspHHU5U.mjs → oauth-oWaW7ICv.mjs} +1 -1
- package/dist/oauth-scopes-DZWn50EA.mjs +4 -0
- package/dist/organization-QdAQTrKa.mjs +71 -0
- package/dist/organizations-CgAQYdK5.mjs +4 -0
- package/dist/origin-ca-certificates-BklXqp8X.mjs +11 -0
- package/dist/origin-post-quantum-encryption-Dg16ueT4.mjs +6 -0
- package/dist/origin-tls-client-auth-d8bDU5zU.mjs +30 -0
- package/dist/output-Co4xdFf6.mjs +2 -0
- package/dist/page-rules-CgMkC6YR.mjs +39 -0
- package/dist/pages-CkBtOOf8.mjs +54 -0
- package/dist/path-DRw6Y-nd.mjs +2 -0
- package/dist/pay-per-crawl-CnGXOWyz.mjs +38 -0
- package/dist/pay-per-use-HbfxpATr.mjs +33 -0
- package/dist/pipelines-CnO9CCs0.mjs +44 -0
- package/dist/precursor-Bc55XJdQ.mjs +4 -0
- package/dist/previews-C7vZrajd.mjs +7 -0
- package/dist/progress-D5po7ScB.mjs +2 -0
- package/dist/prompt-BAJpE3jV.mjs +4 -0
- package/dist/queries-BJAH4B74.mjs +9 -0
- package/dist/queues-D4G8vvwi.mjs +57 -0
- package/dist/r2-CJ8rD6Jb.mjs +128 -0
- package/dist/{radar-DrQLcbkq.mjs → radar-DgaxOdcd.mjs} +150 -150
- package/dist/raw-fetch-yY-wX5Xx.mjs +2 -0
- package/dist/realtime-DU09m7L7.mjs +172 -0
- package/dist/registrar-Cj7OfvGs.mjs +43 -0
- package/dist/registrar-sandbox-CA0Mua-j.mjs +56 -0
- package/dist/{registry-CHowrQsZ.mjs → registry-CRnk93ur.mjs} +1 -1
- package/dist/reporting-3kDVF5c8.mjs +14 -0
- package/dist/{request-headers-DiJeDAn1.mjs → request-headers-D_eQn93b.mjs} +1 -1
- package/dist/request-tracers-VBD4R3s3.mjs +4 -0
- package/dist/resolve-BpgXeklt.mjs +2 -0
- package/dist/resolve-C3FmNlSO.mjs +2 -0
- package/dist/resource-sharing-BtUF3psS.mjs +40 -0
- package/dist/resource-tagging--90INP8_.mjs +4 -0
- package/dist/rules-CcwPngVo.mjs +18 -0
- package/dist/rulesets-CfdruY82.mjs +37 -0
- package/dist/rum-RLkdfSL7.mjs +30 -0
- package/dist/run-CUNhH5CQ.mjs +2 -0
- package/dist/{run-BvHwWWUX.mjs → run-DASYqJsY.mjs} +1 -1
- package/dist/{schema-elj12WOx.mjs → schema-S3pUZwpI.mjs} +1 -1
- package/dist/{schema-flags-BzoBGPWk.mjs → schema-flags-CShtn7ya.mjs} +1 -1
- package/dist/scim-BZYsTPIL.mjs +18 -0
- package/dist/secrets-store-C_-FkSH_.mjs +24 -0
- package/dist/security-insights-BVBEaZmD.mjs +40 -0
- package/dist/security-txt--IoHrHee.mjs +9 -0
- package/dist/session-Cq3YNLoI.mjs +2 -0
- package/dist/shared-zNQNv1im.mjs +2 -0
- package/dist/smart-shield-CByC4_60.mjs +24 -0
- package/dist/snippets-DB-jiZAV.mjs +20 -0
- package/dist/{spawn-IysxuTNW.mjs → spawn-DQttFH05.mjs} +1 -1
- package/dist/spectrum-Bs2g1BmK.mjs +83 -0
- package/dist/speed-Bq4evEnJ.mjs +24 -0
- package/dist/sql-XGci7hZC.mjs +4 -0
- package/dist/src-GiuwAT55.mjs +125 -0
- package/dist/ssl-KJTLW1NR.mjs +45 -0
- package/dist/{startup-profile-CdJWgNjd.mjs → startup-profile-BOaseXnO.mjs} +1 -1
- package/dist/startup-profile-BwEZFVGS.mjs +2 -0
- package/dist/{state-BDSvdSdP.mjs → state-Boubf1X6.mjs} +1 -1
- package/dist/state-CODDG9Nx.mjs +2 -0
- package/dist/stream-BotgYspF.mjs +102 -0
- package/dist/submit-C5VytaHP.mjs +4 -0
- package/dist/{tags-CA1xMM96.mjs → tags-3Hq-B9qp.mjs} +2 -2
- package/dist/{telemetry-Cm39QJ-M.mjs → telemetry-3FJOXl_C.mjs} +1 -1
- package/dist/telemetry-BhKfwxyh.mjs +2 -0
- package/dist/tenant-BgX5onPc.mjs +10 -0
- package/dist/tenant-custom-nameservers-BVG8v1Xo.mjs +9 -0
- package/dist/theme-BGHWSKCw.mjs +6 -0
- package/dist/{tools-CSc5DmFi.mjs → tools-BCCRUENY.mjs} +1 -1
- package/dist/tunnels-CThOI3qH.mjs +29 -0
- package/dist/turnstile-BgZaUx-g.mjs +33 -0
- package/dist/ui-BtIBQeaG.mjs +2 -0
- package/dist/update-check-Yy7Ivq2V.mjs +2 -0
- package/dist/{update-check-CMXSdres.mjs → update-check-jb89ih_g.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/url-info-DQERN0Xq.mjs +4 -0
- package/dist/url-normalization-Cb1hofqv.mjs +9 -0
- package/dist/url-scanner-gHgx1bW7.mjs +16 -0
- package/dist/user-CdKzIuSi.mjs +112 -0
- package/dist/values-EwA8Sx0w.mjs +4 -0
- package/dist/vectorize-DejgIJIv.mjs +32 -0
- package/dist/version-B6MnUIqV.mjs +2 -0
- package/dist/waiting-rooms-BNR1HvAP.mjs +53 -0
- package/dist/web-assets-iglnzkTV.mjs +64 -0
- package/dist/web3-JBUU6IVt.mjs +28 -0
- package/dist/workers-CDp4kLTJ.mjs +40 -0
- package/dist/workers-builds-CSb9Dglt.mjs +14 -0
- package/dist/workers-for-platforms-D4srNZvt.mjs +40 -0
- package/dist/workers-vpc-LPC8TadH.mjs +13 -0
- package/dist/workflows-DN_VqWJC.mjs +52 -0
- package/dist/{wrangler-migration-C6FKHER1.mjs → wrangler-migration-DxTB5yPT.mjs} +1 -1
- package/dist/zaraz-DDErl5yc.mjs +22 -0
- package/dist/zero-trust-M88XX3uD.mjs +957 -0
- package/dist/zone-BsGvedmN.mjs +4 -0
- package/dist/zones-l_sRKrVl.mjs +124 -0
- package/package.json +17 -20
- package/dist/Page-BShsqCXr.mjs +0 -2
- package/dist/abuse-reports-BjU1s8cf.mjs +0 -24
- package/dist/access-C_G2MZnA.mjs +0 -2
- package/dist/account-tags-CaXDDeZ4.mjs +0 -15
- package/dist/accounts-BALwxDQY.mjs +0 -131
- package/dist/acm-CP9EaXQN.mjs +0 -15
- package/dist/addressing-DRlaxqrI.mjs +0 -93
- package/dist/agent-memory-vGhlfZBx.mjs +0 -34
- package/dist/ai-CJtbWfB9.mjs +0 -31
- package/dist/ai-audit-C0BJNqZZ.mjs +0 -6
- package/dist/ai-gateway-BQtv3U3x.mjs +0 -80
- package/dist/ai-search-DGU1Y5By.mjs +0 -79
- package/dist/ai-security-CFTaYk_X.mjs +0 -10
- package/dist/alerting-1hun27JC.mjs +0 -56
- package/dist/analytics-DXUSjvzT.mjs +0 -17
- package/dist/analytics_engine-CQsnL09C.mjs +0 -4
- package/dist/api-security-BXhrfR6-.mjs +0 -154
- package/dist/argo-LPUCTnee.mjs +0 -14
- package/dist/args-CfbYkeXd.mjs +0 -2
- package/dist/artifacts-Dt6easua.mjs +0 -43
- package/dist/audit-logs-CVznAM2Z.mjs +0 -4
- package/dist/auth-CGLsxbc6.mjs +0 -2
- package/dist/auth-CrmVwfpJ.mjs +0 -2
- package/dist/auth-eQr-kQCH.mjs +0 -2
- package/dist/banner-D03JEqRs.mjs +0 -2
- package/dist/basin-catalog-ZQICw-zF.mjs +0 -46
- package/dist/billing-Dy1-dV_B.mjs +0 -23
- package/dist/bot-management-DTgPwL7O.mjs +0 -9
- package/dist/botnet-feed-xb98Cj3Y.mjs +0 -11
- package/dist/brand-protection-Ck3okE2k.mjs +0 -27
- package/dist/browser-run-DJGJSzFX.mjs +0 -42
- package/dist/build-B1L6xrgC.mjs +0 -2
- package/dist/builds-CYxcZtkG.mjs +0 -71
- package/dist/cache-D9tSfovH.mjs +0 -45
- package/dist/certificate-authorities-CpiveTFC.mjs +0 -6
- package/dist/cf-BxsXrVeh.mjs +0 -18
- package/dist/chunk-NDZDTP46-Bjx_wtJe.mjs +0 -361
- package/dist/cli-types-9oYmRTHJ.mjs +0 -2
- package/dist/client-certificates-CF6YZyvP.mjs +0 -13
- package/dist/client-side-security-BLoe9kS5.mjs +0 -63
- package/dist/cloud-connector-DXRUHsjt.mjs +0 -6
- package/dist/cloudforce-one-CBLxXi6v.mjs +0 -447
- package/dist/command-DwXiDOeH.mjs +0 -2
- package/dist/command-UiHLJ8Ji.mjs +0 -2
- package/dist/connector-interrupts-DelTmNyw.mjs +0 -6
- package/dist/connector-telemetry-events-BwxR3G8d.mjs +0 -6
- package/dist/connector-telemetry-snapshots-Bqq-hrpJ.mjs +0 -6
- package/dist/connectors-D-m3rEpk.mjs +0 -15
- package/dist/containers-CVNfEjJs.mjs +0 -78
- package/dist/containers-DeoZyeQe.mjs +0 -375
- package/dist/content-scan-W0BNzbQp.mjs +0 -14
- package/dist/cps-BZ6hqRb5.mjs +0 -6
- package/dist/csamScanner-Bo1t3CLh.mjs +0 -10
- package/dist/ct-alerting-E03faC7p.mjs +0 -5
- package/dist/custom-certificates-CUySSPzi.mjs +0 -17
- package/dist/custom-csrs-gNpWkJPQ.mjs +0 -11
- package/dist/custom-hostnames-abGBAbx7.mjs +0 -27
- package/dist/custom-nameservers-BgNXol1P.mjs +0 -9
- package/dist/custom-pages-DMKX3aoD.mjs +0 -21
- package/dist/d1-CE08YqYk.mjs +0 -93
- package/dist/dcv-delegation-B5YUEWu0.mjs +0 -4
- package/dist/deploy-context-Dr6bxNcB.mjs +0 -56
- package/dist/diagnostics-UMbG6m4n.mjs +0 -15
- package/dist/dist-BHEmAAHr.mjs +0 -487
- package/dist/dls-DIl16mLp.mjs +0 -17
- package/dist/dns-QUpgljRG.mjs +0 -144
- package/dist/dns-firewall-BZwJXHLj.mjs +0 -71
- package/dist/durable-objects-BCj4ykpU.mjs +0 -6
- package/dist/email-auth-DlHIYhCk.mjs +0 -6
- package/dist/email-routing-UKVS4DYy.mjs +0 -45
- package/dist/email-security-CZjfRIg0.mjs +0 -158
- package/dist/email-sending-Dquc880C.mjs +0 -47
- package/dist/error-sanitization-DE_zSrXw.mjs +0 -2
- package/dist/error-sanitization-DOCQ9Ykh.mjs +0 -2
- package/dist/errors-_sob7Ihu.mjs +0 -3
- package/dist/fieldExtractors-BbwDRquU.mjs +0 -9
- package/dist/firewall--mTfDnCJ.mjs +0 -36
- package/dist/flagship-cfoSwwM9.mjs +0 -28
- package/dist/fraud-Dcsq3EYK.mjs +0 -22
- package/dist/google-tag-gateway-DPKSkZQi.mjs +0 -6
- package/dist/healthchecks-D78hIIBC.mjs +0 -22
- package/dist/hyperdrive-qWACKfA4.mjs +0 -37
- package/dist/iam-Bvg_PayW.mjs +0 -52
- package/dist/images-DI_lEZ4L.mjs +0 -71
- package/dist/intel-BxElBUMP.mjs +0 -76
- package/dist/ips-DWoaKxi7.mjs +0 -4
- package/dist/k2-tFjaftl-.mjs +0 -11
- package/dist/keyless-certificates-BrvxHU4J.mjs +0 -13
- package/dist/keys-DcwTYKRf.mjs +0 -4
- package/dist/kv-htXS-7uP.mjs +0 -15
- package/dist/leaked-credential-checks-bvGrLOmQ.mjs +0 -18
- package/dist/load-balancers-BNTUt4yG.mjs +0 -76
- package/dist/local-DlDumOSC.mjs +0 -2
- package/dist/login-BGF_I_LT.mjs +0 -5
- package/dist/login-Ccw-mYwT.mjs +0 -2
- package/dist/logo-matches-tE8LTKgg.mjs +0 -6
- package/dist/logos-Bj845Mcw.mjs +0 -7
- package/dist/logpush-Cs8JdvKi.mjs +0 -46
- package/dist/logs-C92XZvNu.mjs +0 -36
- package/dist/magic-cloud-networking-hNp5MMw-.mjs +0 -71
- package/dist/magic-network-monitoring-68GuWAnv.mjs +0 -36
- package/dist/magic-transit-DNd7gu4j.mjs +0 -383
- package/dist/managed-defense-B_wCAuFD.mjs +0 -18
- package/dist/managed-transforms-DZdxHPOh.mjs +0 -9
- package/dist/matches-B65CkflD.mjs +0 -6
- package/dist/mcp-DrJW5ayK.mjs +0 -32
- package/dist/mesh-DfVzYTn1.mjs +0 -26
- package/dist/monetization-BGaI8CMO.mjs +0 -20
- package/dist/mtls-certificates-BsU2emDD.mjs +0 -13
- package/dist/network-BEMD8P0U.mjs +0 -50
- package/dist/network-interconnects-DMu_fcbo.mjs +0 -68
- package/dist/o11y-C1a4gDGF.mjs +0 -93
- package/dist/oauth-Bj5Ne1o8.mjs +0 -9
- package/dist/oauth-clients-p4Etdqy_.mjs +0 -16
- package/dist/oauth-scopes-B2IabFza.mjs +0 -4
- package/dist/organization-CdXt7AVZ.mjs +0 -75
- package/dist/organizations-5S6xEp7T.mjs +0 -4
- package/dist/origin-ca-certificates-_VJAoK1D.mjs +0 -11
- package/dist/origin-post-quantum-encryption-GcldDsT2.mjs +0 -6
- package/dist/origin-tls-client-auth-DZHld9fA.mjs +0 -30
- package/dist/output-BOe-3AQG.mjs +0 -2
- package/dist/page-rules-o1tAMMsD.mjs +0 -39
- package/dist/pages-CmiOhjSl.mjs +0 -54
- package/dist/pay-per-crawl-BsnOxGYU.mjs +0 -38
- package/dist/pay-per-use-BXWMCSyE.mjs +0 -33
- package/dist/pipelines-DWLQC0F6.mjs +0 -44
- package/dist/precursor-B6DjBib6.mjs +0 -4
- package/dist/previews-dUKEBGSM.mjs +0 -4
- package/dist/progress-BtkTVcHI.mjs +0 -2
- package/dist/prompt-RlgRrmbm.mjs +0 -3
- package/dist/queries-yLwoJRHV.mjs +0 -9
- package/dist/queues-CnJRaE1o.mjs +0 -57
- package/dist/r2-CuC6-zQX.mjs +0 -128
- package/dist/raw-fetch-B4NvWuZD.mjs +0 -2
- package/dist/realtime-CjsnzHxD.mjs +0 -172
- package/dist/registrar-BgOsxTnX.mjs +0 -43
- package/dist/registrar-sandbox-3ikBD9fB.mjs +0 -56
- package/dist/reporting-hE127s5r.mjs +0 -14
- package/dist/request-tracers-BCwLxmPN.mjs +0 -4
- package/dist/resolve-CaTBV-c6.mjs +0 -2
- package/dist/resolve-DCGSzUDQ.mjs +0 -2
- package/dist/resource-sharing-2qvWUuMa.mjs +0 -40
- package/dist/resource-tagging-Dwx7iL3v.mjs +0 -4
- package/dist/rules-DxVQ6jIg.mjs +0 -18
- package/dist/rulesets-Cdh8YjI9.mjs +0 -37
- package/dist/rum-a4CMq4Qu.mjs +0 -30
- package/dist/run-CkbrPJPx.mjs +0 -2
- package/dist/scim-B8XlXl8v.mjs +0 -18
- package/dist/secrets-store-Cqhedh_i.mjs +0 -24
- package/dist/security-insights-le2-DteL.mjs +0 -40
- package/dist/security-txt-cCArWXur.mjs +0 -9
- package/dist/session-C1BhT1ZJ.mjs +0 -2
- package/dist/shared-BPjcpXuA.mjs +0 -2
- package/dist/smart-shield-Csyh8hwB.mjs +0 -24
- package/dist/snippets-DUWx25q6.mjs +0 -20
- package/dist/spectrum-Da3UYSOR.mjs +0 -83
- package/dist/speed-NxlMnB2e.mjs +0 -24
- package/dist/sql-CNdHAlQ8.mjs +0 -4
- package/dist/src-JfLDUxFr.mjs +0 -125
- package/dist/ssl-BtaX2WEJ.mjs +0 -45
- package/dist/startup-profile-B2l0ChVu.mjs +0 -2
- package/dist/state-JB4_BU1o.mjs +0 -2
- package/dist/stream-C1Ijjzn4.mjs +0 -102
- package/dist/submit-MdkuU_Pt.mjs +0 -4
- package/dist/telemetry-BsYO3nxG.mjs +0 -2
- package/dist/tenant-BB6Oszcl.mjs +0 -10
- package/dist/tenant-custom-nameservers-BsbgYAEo.mjs +0 -9
- package/dist/theme-CQ_TYifs.mjs +0 -6
- package/dist/tunnels-CRFtyHWz.mjs +0 -29
- package/dist/turnstile-DBXWo_Xe.mjs +0 -33
- package/dist/ui-YmjF66Ct.mjs +0 -5
- package/dist/update-check-C2oVEbXx.mjs +0 -2
- package/dist/url-info-t-XAs0Mk.mjs +0 -4
- package/dist/url-normalization-Cs4F8e0a.mjs +0 -9
- package/dist/url-scanner-CBIoDbTx.mjs +0 -16
- package/dist/user-CevdOMoa.mjs +0 -112
- package/dist/values-CjNlkbIh.mjs +0 -4
- package/dist/vectorize-9d9tPmg5.mjs +0 -32
- package/dist/version-BdVUXLnK.mjs +0 -2
- package/dist/waiting-rooms--5WmrWb3.mjs +0 -53
- package/dist/web-assets-BHot_MU8.mjs +0 -64
- package/dist/web3-CYfWAF6b.mjs +0 -28
- package/dist/workers-S17M0n3h.mjs +0 -40
- package/dist/workers-builds-Dw7ho3So.mjs +0 -14
- package/dist/workers-for-platforms-A3yjyLh3.mjs +0 -40
- package/dist/workers-vpc-BZ2xXtC3.mjs +0 -13
- package/dist/workflows-BgGrVpSR.mjs +0 -43
- package/dist/zaraz-BsD2dMI3.mjs +0 -22
- package/dist/zero-trust-CA3iGQbG.mjs +0 -837
- package/dist/zone-D2M4EZD0.mjs +0 -4
- package/dist/zones-BoOC_JzC.mjs +0 -124
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,i as r,t as i}from"./context-q7UaYK69.mjs";import{t as a}from"./output-BOe-3AQG.mjs";import{t as o}from"./dry-run-DRj2_uV3.mjs";import{t as s}from"./progress-BtkTVcHI.mjs";import{t as c}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as l,r as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-RlgRrmbm.mjs";function m(e){return e.usage(`$0 rulesets create
|
|
3
|
-
|
|
4
|
-
Creates a ruleset.`).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`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`]}).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`]}).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 h={command:`create`,describe:`Create an account or zone ruleset`,builder:m,handler:async p=>c({command:`rulesets create`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await t(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await i();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Creating`,async()=>m.rulesets.create({...e,account_or_zone:h,account_or_zone_id:g,...c}));a(t,{successLabel:`Created`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let v=await s(`Creating`,async()=>m.rulesets.create({..._,account_or_zone:h,account_or_zone_id:g,...c}));a(v,{successLabel:`Created`})})};function g(e){return e.usage(`$0 rulesets delete <id>
|
|
5
|
-
|
|
6
|
-
Deletes all versions of an existing account or zone ruleset.`).positional(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <id>`,describe:`Delete an account or zone ruleset`,builder:g,handler:async l=>c({command:`rulesets delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}`,pathParams:{"account-or-zone":String(t),id:String(l.id??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();if(d===`zones`?l.zoneId=f:l.accountId=f,!await p({force:!!l.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}let m=await s(`Deleting`,async()=>u.rulesets.delete({account_or_zone:d,account_or_zone_id:f,id:l.id,...c}));a(m,{successLabel:`Deleted`})})};function v(e){return e.usage(`$0 rulesets entrypoint get <phase>
|
|
8
|
-
|
|
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 y={command:`get <phase>`,describe:`Get an account or zone entry point ruleset`,builder:v,handler:async l=>c({command:`rulesets entrypoint get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets entrypoint get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${l.phase==null?`<phase>`:encodeURIComponent(String(l.phase))}/entrypoint`,pathParams:{"account-or-zone":String(t),phase:String(l.phase??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d;let f=await s(`Loading`,async()=>c.rulesets.entrypoint.get({account_or_zone:u,account_or_zone_id:d,phase:l.phase}));a(f,{successLabel:`Loaded`})})};function b(e){return e.usage(`$0 rulesets entrypoint update <phase>
|
|
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 x={command:`update <phase>`,describe:`Update an account or zone entry point ruleset`,builder:b,handler:async p=>c({command:`rulesets entrypoint update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets entrypoint update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${p.phase==null?`<phase>`:encodeURIComponent(String(p.phase))}/entrypoint`,pathParams:{"account-or-zone":String(t),phase:String(p.phase??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await t(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await i();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Updating`,async()=>m.rulesets.entrypoint.update({...e,account_or_zone:h,account_or_zone_id:g,phase:p.phase,...c}));a(t,{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let v=await s(`Updating`,async()=>m.rulesets.entrypoint.update({..._,account_or_zone:h,account_or_zone_id:g,phase:p.phase,...c}));a(v,{successLabel:`Updated`})})};function S(e){return e.usage(`$0 rulesets entrypoint versions get <ruleset-version>
|
|
12
|
-
|
|
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 C={command:`get <ruleset-version>`,describe:`Get an account or zone entry point ruleset version`,builder:S,handler:async l=>c({command:`rulesets entrypoint versions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets entrypoint versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${l.phase==null?`<phase>`:encodeURIComponent(String(l.phase))}/entrypoint/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(l[`ruleset-version`]??``),phase:String(l.phase??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d;let f=await s(`Loading`,async()=>c.rulesets.entrypoint.versions.get({account_or_zone:u,account_or_zone_id:d,phase:l.phase,ruleset_version:l[`ruleset-version`]}));a(f,{successLabel:`Loaded`})})};function w(e){return e.usage(`$0 rulesets entrypoint versions list
|
|
14
|
-
|
|
15
|
-
Fetches the versions of an account or zone entry point ruleset.`).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List an account or zone entry point ruleset's versions`,builder:w,handler:async l=>c({command:`rulesets entrypoint versions list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets entrypoint versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${l.phase==null?`<phase>`:encodeURIComponent(String(l.phase))}/entrypoint/versions`,pathParams:{"account-or-zone":String(t),phase:String(l.phase??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d;let f=await s(`Loading`,async()=>c.rulesets.entrypoint.versions.list({account_or_zone:u,account_or_zone_id:d,phase:l.phase}));a(f,{successLabel:`Loaded`})})},E={command:`versions`,describe:`Operations for entrypoint.versions`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`entrypoint`,describe:`Operations for entrypoint`,builder:e=>e.command(y).command(x).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.usage(`$0 rulesets get <id>
|
|
16
|
-
|
|
17
|
-
Fetches the latest version of an account or zone ruleset.`).positional(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <id>`,describe:`Get an account or zone ruleset`,builder:O,handler:async l=>c({command:`rulesets get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}`,pathParams:{"account-or-zone":String(t),id:String(l.id??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d;let f=await s(`Loading`,async()=>c.rulesets.get({account_or_zone:u,account_or_zone_id:d,id:l.id}));a(f,{successLabel:`Loaded`})})};function A(e){return e.usage(`$0 rulesets list
|
|
18
|
-
|
|
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 j={command:`list`,describe:`List account or zone rulesets`,builder:A,handler:async l=>c({command:`rulesets list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={cursor:l.cursor,per_page:l[`per-page`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();d===`zones`?l.zoneId=f:l.accountId=f;let p=await s(`Loading`,async()=>u.rulesets.list({account_or_zone:d,account_or_zone_id:f,...c}));a(p,{successLabel:`Loaded`})})};function M(e){return e.usage(`$0 rulesets rules create <ruleset-id>
|
|
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 N={command:`create <ruleset-id>`,describe:`Create an account or zone ruleset rule`,builder:M,handler:async u=>c({command:`rulesets rules create`,classification:{safeFlags:[`validate-only`,`dry-run`]}},u,async()=>{let c={dry_run:u[`validate-only`]};if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await t(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await i();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Creating`,async()=>p.rulesets.rules.create({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],...c}));a(t,{successLabel:`Created`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let _=await s(`Creating`,async()=>p.rulesets.rules.create({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],...c}));a(_,{successLabel:`Created`})})};function P(e){return e.usage(`$0 rulesets rules delete <rule-id>
|
|
22
|
-
|
|
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 F={command:`delete <rule-id>`,describe:`Delete an account or zone ruleset rule`,builder:P,handler:async l=>c({command:`rulesets rules delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rules/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(l[`rule-id`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();if(d===`zones`?l.zoneId=f:l.accountId=f,!await p({force:!!l.force})){process.stderr.write(`Aborted.
|
|
24
|
-
`);return}let m=await s(`Deleting`,async()=>u.rulesets.rules.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`],...c}));a(m,{successLabel:`Deleted`})})};function I(e){return e.usage(`$0 rulesets rules update <rule-id>
|
|
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 L={command:`update <rule-id>`,describe:`Update an account or zone ruleset rule`,builder:I,handler:async u=>c({command:`rulesets rules update`,classification:{safeFlags:[`validate-only`,`dry-run`]}},u,async()=>{let c={dry_run:u[`validate-only`]};if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules/${u[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(u[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(u[`rule-id`]??``),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await t(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await i();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Updating`,async()=>p.rulesets.rules.update({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c}));a(t,{successLabel:`Updated`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let _=await s(`Updating`,async()=>p.rulesets.rules.update({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c}));a(_,{successLabel:`Updated`})})},R={command:`rules`,describe:`Operations for rules`,builder:e=>e.command(N).command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage(`$0 rulesets update <ruleset-id>
|
|
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`]}).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`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`update <ruleset-id>`,describe:`Update an account or zone ruleset`,builder:z,handler:async p=>c({command:`rulesets update`,classification:{safeFlags:[`validate-only`,`kind`,`phase`,`dry-run`]}},p,async()=>{let c={dry_run:p[`validate-only`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${p[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(p[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(p[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await t(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await i();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Updating`,async()=>m.rulesets.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c}));a(t,{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let v=await s(`Updating`,async()=>m.rulesets.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c}));a(v,{successLabel:`Updated`})})};function V(e){return e.usage(`$0 rulesets versions by-tag get <tag>
|
|
29
|
-
|
|
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 H={command:`get <tag>`,describe:`List an account or zone ruleset version's rules by tag`,builder:V,handler:async l=>c({command:`rulesets versions by-tag get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets versions by-tag get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}/by_tag/${l.tag==null?`<tag>`:encodeURIComponent(String(l.tag))}`,pathParams:{"account-or-zone":String(t),tag:String(l.tag??``),"ruleset-version":String(l[`ruleset-version`]??``),id:String(l.id??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d;let f=await s(`Loading`,async()=>c.rulesets.versions.byTag.get({account_or_zone:u,account_or_zone_id:d,id:l.id,ruleset_version:l[`ruleset-version`],tag:l.tag}));a(f,{successLabel:`Loaded`})})},U={command:`by-tag`,describe:`Operations for versions.by-tag`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 rulesets versions delete <ruleset-version>
|
|
31
|
-
|
|
32
|
-
Deletes an existing version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`validate-only`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const G={command:`delete <ruleset-version>`,describe:`Delete an account or zone ruleset version`,builder:W,handler:async l=>c({command:`rulesets versions delete`,classification:{safeFlags:[`validate-only`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`validate-only`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(l[`ruleset-version`]??``),id:String(l.id??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();if(d===`zones`?l.zoneId=f:l.accountId=f,!await p({force:!!l.force})){process.stderr.write(`Aborted.
|
|
33
|
-
`);return}let m=await s(`Deleting`,async()=>u.rulesets.versions.delete({account_or_zone:d,account_or_zone_id:f,id:l.id,ruleset_version:l[`ruleset-version`],...c}));a(m,{successLabel:`Deleted`})})};function K(e){return e.usage(`$0 rulesets versions get <ruleset-version>
|
|
34
|
-
|
|
35
|
-
Fetches a specific version of an account or zone ruleset.`).positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <ruleset-version>`,describe:`Get an account or zone ruleset version`,builder:K,handler:async l=>c({command:`rulesets versions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(l[`ruleset-version`]??``),id:String(l.id??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d;let f=await s(`Loading`,async()=>c.rulesets.versions.get({account_or_zone:u,account_or_zone_id:d,id:l.id,ruleset_version:l[`ruleset-version`]}));a(f,{successLabel:`Loaded`})})};function J(e){return e.usage(`$0 rulesets versions list
|
|
36
|
-
|
|
37
|
-
Fetches the versions of an account or zone ruleset.`).option(`id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List an account or zone ruleset's versions`,builder:J,handler:async l=>c({command:`rulesets versions list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l.id==null?`<id>`:encodeURIComponent(String(l.id))}/versions`,pathParams:{"account-or-zone":String(t),id:String(l.id??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d;let f=await s(`Loading`,async()=>c.rulesets.versions.list({account_or_zone:u,account_or_zone_id:d,id:l.id}));a(f,{successLabel:`Loaded`})})},X={command:`versions`,describe:`Operations for versions`,builder:e=>e.command(G).command(q).command(Y).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Z={command:`rulesets`,describe:`rulesets`,builder:e=>e.command(h).command(_).command(k).command(j).command(B).command(D).command(R).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Z as default};
|
package/dist/rum-a4CMq4Qu.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as c,r as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{n as f}from"./prompt-RlgRrmbm.mjs";import{t as p}from"./cli-types-9oYmRTHJ.mjs";function m(e){return e.usage(`$0 rum rules bulk-create
|
|
3
|
-
|
|
4
|
-
Modifies one or more rules in a Web Analytics ruleset with a single request.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`bulk-create`,describe:`Update Web Analytics rules`,builder:m,handler:async d=>s({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){let e=await n();a({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/v2/${d[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(d[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(d[`ruleset-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)}):c(d.body)});return}let s=await t(d),f=d.local?e:await r();if(d.accountId=f,d.body){let e=c(d.body),t=await o(`Creating`,async()=>s.rum.rules.bulkCreate({...e,account_id:f,ruleset_id:d[`ruleset-id`]}));i(t,{successLabel:`Created`});return}let p=u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)}),m=await o(`Creating`,async()=>s.rum.rules.bulkCreate({...p,account_id:f,ruleset_id:d[`ruleset-id`]}));i(m,{successLabel:`Created`})})};function g(e){return e.usage(`$0 rum rules create <ruleset-id>
|
|
5
|
-
|
|
6
|
-
Creates a new rule in a Web Analytics ruleset.`).positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create <ruleset-id>`,describe:`Create a Web Analytics rule`,builder:g,handler:async l=>s({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/v2/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(l[`ruleset-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths}):c(l.body)});return}let s=await t(l),f=l.local?e:await r();if(l.accountId=f,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.rum.rules.create({body:e,account_id:f,ruleset_id:l[`ruleset-id`]}));i(t,{successLabel:`Created`});return}let p=u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths}),m=await o(`Creating`,async()=>s.rum.rules.create({body:p,account_id:f,ruleset_id:l[`ruleset-id`]}));i(m,{successLabel:`Created`})})};function v(e){return e.usage(`$0 rum rules delete <rule-id>
|
|
7
|
-
|
|
8
|
-
Deletes an existing rule from a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <rule-id>`,describe:`Delete a Web Analytics rule`,builder:v,handler:async c=>s({command:`rum rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/v2/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rule/${c[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(c[`rule-id`]))}`,pathParams:{"ruleset-id":String(c[`ruleset-id`]??``),"rule-id":String(c[`rule-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
9
|
-
`);return}let u=await o(`Deleting`,async()=>s.rum.rules.delete({account_id:l,ruleset_id:c[`ruleset-id`],rule_id:c[`rule-id`]}));i(u,{successLabel:`Deleted`})})};function b(e){return e.usage(`$0 rum rules list
|
|
10
|
-
|
|
11
|
-
Lists all the rules in a Web Analytics ruleset.`).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List rules in Web Analytics ruleset`,builder:b,handler:async c=>s({command:`rum rules list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/v2/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(c[`ruleset-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.rum.rules.list({account_id:l,ruleset_id:c[`ruleset-id`]}));i(u,{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 rum rules update <rule-id>
|
|
12
|
-
|
|
13
|
-
Updates a rule in a Web Analytics ruleset.`).positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <rule-id>`,describe:`Update a Web Analytics rule`,builder:S,handler:async l=>s({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/v2/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rule/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"ruleset-id":String(l[`ruleset-id`]??``),"rule-id":String(l[`rule-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths}):c(l.body)});return}let s=await t(l),f=l.local?e:await r();if(l.accountId=f,l.body){let e=c(l.body),t=await o(`Updating`,async()=>s.rum.rules.update({body:e,account_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`]}));i(t,{successLabel:`Updated`});return}let p=u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths}),m=await o(`Updating`,async()=>s.rum.rules.update({body:p,account_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`]}));i(m,{successLabel:`Updated`})})},w={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.usage(`$0 rum site-info create
|
|
14
|
-
|
|
15
|
-
Creates a new Web Analytics site.`).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Create a Web Analytics site`,builder:T,handler:async l=>s({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({auto_install:l[`auto-install`],host:d(l.host,`host`,`text`),zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)}):c(l.body)});return}let s=await t(l),f=l.local?e:await r();if(l.accountId=f,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.rum.siteInfo.create({...e,account_id:f}));i(t,{successLabel:`Created`});return}let p=u({auto_install:l[`auto-install`],host:d(l.host,`host`,`text`),zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)}),m=await o(`Creating`,async()=>s.rum.siteInfo.create({...p,account_id:f}));i(m,{successLabel:`Created`})})};function D(e){return e.usage(`$0 rum site-info delete <site-id>
|
|
16
|
-
|
|
17
|
-
Deletes an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete <site-id>`,describe:`Delete a Web Analytics site`,builder:D,handler:async c=>s({command:`rum site-info delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/${c[`site-id`]==null?`<site-id>`:encodeURIComponent(String(c[`site-id`]))}`,pathParams:{"site-id":String(c[`site-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
18
|
-
`);return}let u=await o(`Deleting`,async()=>s.rum.siteInfo.delete({account_id:l,site_id:c[`site-id`]}));i(u,{successLabel:`Deleted`})})};function k(e){return e.usage(`$0 rum site-info get <site-id>
|
|
19
|
-
|
|
20
|
-
Retrieves a Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <site-id>`,describe:`Get a Web Analytics site`,builder:k,handler:async c=>s({command:`rum site-info get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/${c[`site-id`]==null?`<site-id>`:encodeURIComponent(String(c[`site-id`]))}`,pathParams:{"site-id":String(c[`site-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.rum.siteInfo.get({account_id:l,site_id:c[`site-id`]}));i(u,{successLabel:`Loaded`})})};function j(e){return e.usage(`$0 rum site-info list-site-tags
|
|
21
|
-
|
|
22
|
-
Returns all site tags for an account as an array of site tag strings. This endpoint returns all results without pagination.`).option(`all`,{type:`boolean`,description:`When true, includes sites that are disabled or paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list-site-tags`,describe:`List Web Analytics site tags`,builder:j,handler:async c=>s({command:`rum site-info list-site-tags`,classification:{safeFlags:[`all`,`dry-run`]}},c,async()=>{let s={all:c.all};if(c.dryRun){let e=await n();a({command:`cf rum site-info list-site-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/site_tag/list`,pathParams:{},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.rum.siteInfo.listSiteTags({account_id:u,...s}));i(d,{successLabel:`Loaded`})})};function N(e){return e.usage(`$0 rum site-info list-zone-tags
|
|
23
|
-
|
|
24
|
-
Returns all zone tags associated with Web Analytics sites for an account. These can be used to filter or exclude zones in the zone selection input. This endpoint returns all results without pagination.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list-zone-tags`,describe:`List Web Analytics zone tags`,builder:N,handler:async c=>s({command:`rum site-info list-zone-tags`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf rum site-info list-zone-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/zone_tag/list`,pathParams:{},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.rum.siteInfo.listZoneTags({account_id:l}));i(u,{successLabel:`Loaded`})})};function F(e){return e.usage(`$0 rum site-info list
|
|
25
|
-
|
|
26
|
-
Lists all Web Analytics sites of an account.`).option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`List Web Analytics sites`,builder:p(F),handler:async c=>s({command:`rum site-info list`,classification:{safeFlags:[`order-by`,`dry-run`]}},c,async()=>{let s={per_page:c[`per-page`],page:c.page,order_by:c[`order-by`]};if(c.dryRun){let e=await n();a({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/list`,pathParams:{},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.rum.siteInfo.list({account_id:u,...s}));i(d,{successLabel:`Loaded`})})};function L(e){return e.usage(`$0 rum site-info update <site-id>
|
|
27
|
-
|
|
28
|
-
Updates an existing Web Analytics site.`).positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`update <site-id>`,describe:`Update a Web Analytics site`,builder:L,handler:async l=>s({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/${l[`site-id`]==null?`<site-id>`:encodeURIComponent(String(l[`site-id`]))}`,pathParams:{"site-id":String(l[`site-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({auto_install:l[`auto-install`],enabled:l.enabled,host:d(l.host,`host`,`text`),lite:l.lite,zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)}):c(l.body)});return}let s=await t(l),f=l.local?e:await r();if(l.accountId=f,l.body){let e=c(l.body),t=await o(`Updating`,async()=>s.rum.siteInfo.update({...e,account_id:f,site_id:l[`site-id`]}));i(t,{successLabel:`Updated`});return}let p=u({auto_install:l[`auto-install`],enabled:l.enabled,host:d(l.host,`host`,`text`),lite:l.lite,zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)}),m=await o(`Updating`,async()=>s.rum.siteInfo.update({...p,account_id:f,site_id:l[`site-id`]}));i(m,{successLabel:`Updated`})})};function z(e){return e.usage(`$0 rum site-info validate-hostname <hostname>
|
|
29
|
-
|
|
30
|
-
Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`).positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`validate-hostname <hostname>`,describe:`Validate a Web Analytics site hostname`,builder:z,handler:async c=>s({command:`rum site-info validate-hostname`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/rum/site_info/validate/${c.hostname==null?`<hostname>`:encodeURIComponent(String(c.hostname))}`,pathParams:{hostname:String(c.hostname??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.rum.siteInfo.validateHostname({account_id:l,hostname:c.hostname}));i(u,{successLabel:`Loaded`})})},V={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(E).command(O).command(A).command(I).command(M).command(P).command(R).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(w).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
|
package/dist/run-CkbrPJPx.mjs
DELETED
package/dist/scim-B8XlXl8v.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-DlT72Xpn.mjs";import{i as t,n}from"./auth-CGLsxbc6.mjs";import{a as r,t as i}from"./context-q7UaYK69.mjs";import{t as a}from"./output-BOe-3AQG.mjs";import{t as o}from"./dry-run-DRj2_uV3.mjs";import{t as s}from"./progress-BtkTVcHI.mjs";import{t as c}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as l,t as u}from"./input-validation-D7z60HJH.mjs";import{n as d}from"./prompt-RlgRrmbm.mjs";import{t as f}from"./cli-types-9oYmRTHJ.mjs";function p(e){return e.usage("$0 scim groups create\n\nCreates a new SCIM Group (user group) for the account. The `displayName` must not be empty and must not begin with `CF` (reserved for system groups).").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const m={command:`create`,describe:`Create SCIM Group`,builder:p,handler:async d=>c({command:`scim groups create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){let e=await r();o({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:d.body});return}let c=await n(d),f=d.local?e:await i();if(d.accountId=f,d.file){let e=u(d.file),n=await s(`Creating`,async()=>t(c,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Created`});return}if(d.body){let e=l(d.body,`body`,`binary`),n=await s(`Creating`,async()=>t(c,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Created`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function h(e){return e.usage(`$0 scim groups delete <group-id>
|
|
3
|
-
|
|
4
|
-
Deletes a SCIM Group (custom user groups only). System groups backed by Cloudflare permission groups cannot be deleted via SCIM. Returns 204 No Content on success.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <group-id>`,describe:`Delete SCIM Group`,builder:h,handler:async t=>c({command:`scim groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await d({force:!!t.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}let u=await s(`Deleting`,async()=>c.scim.groups.delete({account_id:l,group_id:t[`group-id`]}));a(u,{successLabel:`Deleted`})})};function _(e){return e.usage("$0 scim groups edit <group-id>\n\nPartially updates a SCIM Group via PATCH operations (RFC 7644 Section 3.5.2). Supports add, remove, and replace operations on `members`, `displayName`, and `externalId`. For system groups (prefixed `cloudflare-v1-`), only member management operations are supported.").positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const v={command:`edit <group-id>`,describe:`Patch SCIM Group`,builder:_,handler:async d=>c({command:`scim groups edit`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){let e=await r();o({command:`cf scim groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups/${d[`group-id`]==null?`<group-id>`:encodeURIComponent(String(d[`group-id`]))}`,pathParams:{"group-id":String(d[`group-id`]??``)},bodyKind:`octet-stream`,body:d.body});return}let c=await n(d),f=d.local?e:await i();if(d.accountId=f,d.file){let e=u(d.file),n=await s(`Updating`,async()=>t(c,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(d[`group-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Updated`});return}if(d.body){let e=l(d.body,`body`,`binary`),n=await s(`Updating`,async()=>t(c,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(d[`group-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Updated`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function y(e){return e.usage(`$0 scim groups get <group-id>
|
|
6
|
-
|
|
7
|
-
Retrieves a single SCIM Group resource by group ID.`).positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <group-id>`,describe:`Get SCIM Group`,builder:y,handler:async t=>c({command:`scim groups get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf scim groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.scim.groups.get({account_id:l,group_id:t[`group-id`]}));a(u,{successLabel:`Loaded`})})};function x(e){return e.usage("$0 scim groups list\n\nLists SCIM Group resources for the account. Returns both system groups (backed by Cloudflare permission groups, prefixed `cloudflare-v1-`) and custom user groups. Supports filtering by `displayName` using SCIM filter syntax.").option(`start-index`,{type:`number`,description:`The 1-based index of the first result in the current set of list results. Values less than 1 are treated as 1.`}).option(`count`,{type:`number`,description:`Specifies the desired maximum number of query results per page.`}).option(`filter`,{type:`string`,description:'SCIM filter expression (RFC 7644 Section 3.4.2.2). Only `displayName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`List SCIM Groups`,builder:x,handler:async t=>c({command:`scim groups list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={startIndex:t[`start-index`],count:t.count,filter:t.filter};if(t.dryRun){let e=await r();o({command:`cf scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.scim.groups.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function C(e){return e.usage("$0 scim groups update <group-id>\n\nReplaces the mutable attributes of a SCIM Group (RFC 7644 Section 3.5.1), including its complete member set. Omitting `externalId` clears it, and omitting `members` replaces the member set with an empty list. For system groups (prefixed `cloudflare-v1-`), only the member set is replaced.").positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const w={command:`update <group-id>`,describe:`Replace SCIM Group`,builder:C,handler:async d=>c({command:`scim groups update`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){let e=await r();o({command:`cf scim groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Groups/${d[`group-id`]==null?`<group-id>`:encodeURIComponent(String(d[`group-id`]))}`,pathParams:{"group-id":String(d[`group-id`]??``)},bodyKind:`octet-stream`,body:d.body});return}let c=await n(d),f=d.local?e:await i();if(d.accountId=f,d.file){let e=u(d.file),n=await s(`Updating`,async()=>t(c,`PUT`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(d[`group-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Updated`});return}if(d.body){let e=l(d.body,`body`,`binary`),n=await s(`Updating`,async()=>t(c,`PUT`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(d[`group-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Updated`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},T={command:`groups`,describe:`Groups operations`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.usage("$0 scim resource-types get <resource-type-id>\n\nReturns a single SCIM resource type by ID (RFC 7643 Section 6). Valid IDs are `User` and `Group`.").positional(`resource-type-id`,{type:`string`,description:`The resource type identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <resource-type-id>`,describe:`Get SCIM Resource Type`,builder:f(E),handler:async t=>c({command:`scim resource-types get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf scim resource-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/ResourceTypes/${t[`resource-type-id`]==null?`<resource-type-id>`:encodeURIComponent(String(t[`resource-type-id`]))}`,pathParams:{"resource-type-id":String(t[`resource-type-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.scim.resourceTypes.get({account_id:l,resource_type_id:t[`resource-type-id`]}));a(u,{successLabel:`Loaded`})})};function O(e){return e.usage(`$0 scim resource-types list
|
|
8
|
-
|
|
9
|
-
Returns the list of SCIM resource types supported by the Cloudflare SCIM service (RFC 7643 Section 6, RFC 7644 Section 4). Clients use this to discover available resource categories (e.g. Users, Groups) and their associated schemas. Query parameters are not supported on this endpoint.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`List SCIM Resource Types`,builder:O,handler:async t=>c({command:`scim resource-types list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf scim resource-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/ResourceTypes`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.scim.resourceTypes.list({account_id:l}));a(u,{successLabel:`Loaded`})})},A={command:`resource-types`,describe:`Resource Types operations`,builder:e=>e.command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.usage("$0 scim schemas get <schema-id>\n\nReturns a single SCIM schema definition by schema URI ID (RFC 7643 Section 7). Valid IDs are `urn:ietf:params:scim:schemas:core:2.0:User` and `urn:ietf:params:scim:schemas:core:2.0:Group`.").positional(`schema-id`,{type:`string`,description:`The schema URI identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <schema-id>`,describe:`Get SCIM Schema`,builder:j,handler:async t=>c({command:`scim schemas get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf scim schemas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Schemas/${t[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(t[`schema-id`]))}`,pathParams:{"schema-id":String(t[`schema-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.scim.schemas.get({account_id:l,schema_id:t[`schema-id`]}));a(u,{successLabel:`Loaded`})})};function N(e){return e.usage(`$0 scim schemas list
|
|
10
|
-
|
|
11
|
-
Returns the list of SCIM schemas supported by the Cloudflare SCIM service (RFC 7643 Section 7, RFC 7644 Section 4). Clients use this to introspect the attributes of each resource type. Query parameters are not supported on this endpoint.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`List SCIM Schemas`,builder:N,handler:async t=>c({command:`scim schemas list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf scim schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Schemas`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.scim.schemas.list({account_id:l}));a(u,{successLabel:`Loaded`})})},F={command:`schemas`,describe:`Schemas operations`,builder:e=>e.command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.usage(`$0 scim service-provider-config get
|
|
12
|
-
|
|
13
|
-
Returns the SCIM 2.0 Service Provider configuration (RFC 7643 Section 5). IdPs use this endpoint to auto-configure their SCIM integration with Cloudflare, discovering which optional features (patch, bulk, filter, etc.) are supported.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get`,describe:`Get SCIM Service Provider Config`,builder:I,handler:async t=>c({command:`scim service-provider-config get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf scim service-provider-config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/ServiceProviderConfig`,pathParams:{},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.scim.serviceProviderConfig.get({account_id:l}));a(u,{successLabel:`Loaded`})})},R={command:`service-provider-config`,describe:`Service Provider Config operations`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage("$0 scim users create\n\nProvisions a new account member via SCIM. The `userName` field must be a valid email address and must match the primary email in `emails`. The account must be an Enterprise account with SCIM entitlements enabled.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const B={command:`create`,describe:`Create SCIM User`,builder:z,handler:async d=>c({command:`scim users create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){let e=await r();o({command:`cf scim users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users`,pathParams:{},bodyKind:`octet-stream`,body:d.body});return}let c=await n(d),f=d.local?e:await i();if(d.accountId=f,d.file){let e=u(d.file),n=await s(`Creating`,async()=>t(c,`POST`,`/accounts/${f}/scim/v2/Users`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Created`});return}if(d.body){let e=l(d.body,`body`,`binary`),n=await s(`Creating`,async()=>t(c,`POST`,`/accounts/${f}/scim/v2/Users`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Created`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function V(e){return e.usage(`$0 scim users delete <user-id>
|
|
14
|
-
|
|
15
|
-
Deprovisions a SCIM User by removing their membership from this account (RFC 7644 Section 3.6). This does not delete the global Cloudflare user.`).positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,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 H={command:`delete <user-id>`,describe:`Delete SCIM User`,builder:V,handler:async t=>c({command:`scim users delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf scim users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();if(t.accountId=l,!await d({force:!!t.force,message:`Are you sure you want to remove this user from the account?`})){process.stderr.write(`Aborted.
|
|
16
|
-
`);return}let u=await s(`Deleting`,async()=>c.scim.users.delete({account_id:l,user_id:t[`user-id`]}));a(u,{successLabel:`Deleted`})})};function U(e){return e.usage('$0 scim users edit <user-id>\n\nPartially updates a SCIM User via PATCH operations (RFC 7644 Section 3.5.2). Supports updating `userName`, `name.givenName`, `name.familyName`, and `active`. Setting `active: false` deprovisions the user (removes them from the account). For IdP compatibility, `emails[type eq "work"].value` is also accepted as an alias for `userName`.').positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const W={command:`edit <user-id>`,describe:`Patch SCIM User`,builder:U,handler:async d=>c({command:`scim users edit`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){let e=await r();o({command:`cf scim users edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users/${d[`user-id`]==null?`<user-id>`:encodeURIComponent(String(d[`user-id`]))}`,pathParams:{"user-id":String(d[`user-id`]??``)},bodyKind:`octet-stream`,body:d.body});return}let c=await n(d),f=d.local?e:await i();if(d.accountId=f,d.file){let e=u(d.file),n=await s(`Updating`,async()=>t(c,`PATCH`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(d[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Updated`});return}if(d.body){let e=l(d.body,`body`,`binary`),n=await s(`Updating`,async()=>t(c,`PATCH`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(d[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Updated`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function G(e){return e.usage(`$0 scim users get <user-id>
|
|
17
|
-
|
|
18
|
-
Retrieves a single account member as a SCIM User resource by user tag.`).positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <user-id>`,describe:`Get SCIM User`,builder:G,handler:async t=>c({command:`scim users get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();o({command:`cf scim users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let c=await n(t),l=t.local?e:await i();t.accountId=l;let u=await s(`Loading`,async()=>c.scim.users.get({account_id:l,user_id:t[`user-id`]}));a(u,{successLabel:`Loaded`})})};function q(e){return e.usage('$0 scim users list\n\nLists account members as SCIM User resources. Supports optional filtering by `userName` (email) using the SCIM filter syntax (e.g. `userName eq "user@example.com"`). Pagination is controlled via `startIndex` and `count` query parameters per RFC 7644 Section 3.4.2.4.').option(`start-index`,{type:`number`,description:`The 1-based index of the first result in the current set of list results. Values less than 1 are treated as 1.`}).option(`count`,{type:`number`,description:`Specifies the desired maximum number of query results per page.`}).option(`filter`,{type:`string`,description:'SCIM filter expression (RFC 7644 Section 3.4.2.2). Only `userName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`List SCIM Users`,builder:q,handler:async t=>c({command:`scim users list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={startIndex:t[`start-index`],count:t.count,filter:t.filter};if(t.dryRun){let e=await r();o({command:`cf scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await i();t.accountId=u;let d=await s(`Loading`,async()=>l.scim.users.list({account_id:u,...c}));a(d,{successLabel:`Loaded`})})};function Y(e){return e.usage("$0 scim users update <user-id>\n\nReplaces a SCIM User resource (RFC 7644 Section 3.5.1). Fully replaces the mutable attributes of the user. Supports updating `userName`, `name`, `emails`, and `active`.").positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const X={command:`update <user-id>`,describe:`Replace SCIM User`,builder:Y,handler:async d=>c({command:`scim users update`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){let e=await r();o({command:`cf scim users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/scim/v2/Users/${d[`user-id`]==null?`<user-id>`:encodeURIComponent(String(d[`user-id`]))}`,pathParams:{"user-id":String(d[`user-id`]??``)},bodyKind:`octet-stream`,body:d.body});return}let c=await n(d),f=d.local?e:await i();if(d.accountId=f,d.file){let e=u(d.file),n=await s(`Updating`,async()=>t(c,`PUT`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(d[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Updated`});return}if(d.body){let e=l(d.body,`body`,`binary`),n=await s(`Updating`,async()=>t(c,`PUT`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(d[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}}));a(n,{successLabel:`Updated`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Z={command:`users`,describe:`Users operations`,builder:e=>e.command(B).command(H).command(W).command(K).command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`scim`,describe:`SCIM 2.0 provisioning — manage users, groups, and identity provider sync for your account`,builder:e=>e.command(T).command(A).command(F).command(R).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Q as default};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as c,t as l}from"./body-parser-DkHKPkJ7.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{a as d,n as f}from"./prompt-RlgRrmbm.mjs";import{t as p}from"./cli-types-9oYmRTHJ.mjs";function m(e){return e.usage(`$0 secrets-store quota get
|
|
3
|
-
|
|
4
|
-
Lists the number of secrets used in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get`,describe:`View secret usage`,builder:m,handler:async c=>s({command:`secrets-store quota get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf secrets-store quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/quota`,pathParams:{},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.secretsStore.quota.get({account_id:l}));i(u,{successLabel:`Loaded`})})},g={command:`quota`,describe:`Account quota limits for secrets stores, secrets count, and storage capacity`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.usage(`$0 secrets-store secrets bulk-delete
|
|
5
|
-
|
|
6
|
-
Deletes one or more secrets.`).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`List of secret identifier tags to delete.`}).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:`Request body for bulk deleting secrets.`})}const v={command:`bulk-delete`,describe:`Delete secrets`,builder:_,handler:async u=>s({command:`secrets-store secrets bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},u,async()=>{if(u.dryRun){let e=await n();a({command:`cf secrets-store secrets bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/stores/${u[`store-id`]==null?`<store-id>`:encodeURIComponent(String(u[`store-id`]))}/secrets`,pathParams:{"store-id":String(u[`store-id`]??``)},bodyKind:`json`,body:u.body===void 0?l({ids:u.ids}):c(u.body)});return}let s=await t(u),d=u.local?e:await r();if(u.accountId=d,!await f({force:!!u.force,message:`This operation permanently deletes the specified secrets and cannot be undone.`})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}if(u.body){let e=c(u.body),t=await o(`Deleting`,async()=>s.secretsStore.secrets.bulkDelete({...e,account_id:d,store_id:u[`store-id`]}));i(t,{successLabel:`Deleted`});return}if(u.ids===void 0)throw Error(`--ids is required (or pass --body with this field set).`);let p=l({ids:u.ids}),m=await o(`Deleting`,async()=>s.secretsStore.secrets.bulkDelete({...p,account_id:d,store_id:u[`store-id`]}));i(m,{successLabel:`Deleted`})})};function y(e){return e.usage(`$0 secrets-store secrets create <store-id>
|
|
8
|
-
|
|
9
|
-
Creates a secret in the account.`).positional(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create <store-id>`,describe:`Create a secret`,builder:y,handler:async l=>s({command:`secrets-store secrets create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=await n();a({command:`cf secrets-store secrets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/stores/${l[`store-id`]==null?`<store-id>`:encodeURIComponent(String(l[`store-id`]))}/secrets`,pathParams:{"store-id":String(l[`store-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await t(l),u=l.local?e:await r();if(l.accountId=u,l.body){let e=c(l.body),t=await o(`Creating`,async()=>s.secretsStore.secrets.create({body:e,account_id:u,store_id:l[`store-id`]}));i(t,{successLabel:`Created`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function x(e){return e.usage(`$0 secrets-store secrets delete <secret-id>
|
|
10
|
-
|
|
11
|
-
Deletes a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <secret-id>`,describe:`Delete a secret`,builder:x,handler:async c=>s({command:`secrets-store secrets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf secrets-store secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/stores/${c[`store-id`]==null?`<store-id>`:encodeURIComponent(String(c[`store-id`]))}/secrets/${c[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(c[`secret-id`]))}`,pathParams:{"store-id":String(c[`store-id`]??``),"secret-id":String(c[`secret-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
12
|
-
`);return}let u=await o(`Deleting`,async()=>s.secretsStore.secrets.delete({account_id:l,store_id:c[`store-id`],secret_id:c[`secret-id`]}));i(u,{successLabel:`Deleted`})})};function C(e){return e.usage(`$0 secrets-store secrets duplicate <secret-id>
|
|
13
|
-
|
|
14
|
-
Creates a duplicate of the secret, keeping the value.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`name`,{type:`string`,description:`The name of the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`duplicate <secret-id>`,describe:`Duplicate Secret`,builder:C,handler:async f=>s({command:`secrets-store secrets duplicate`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){let e=await n();a({command:`cf secrets-store secrets duplicate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/stores/${f[`store-id`]==null?`<store-id>`:encodeURIComponent(String(f[`store-id`]))}/secrets/${f[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(f[`secret-id`]))}/duplicate`,pathParams:{"store-id":String(f[`store-id`]??``),"secret-id":String(f[`secret-id`]??``)},bodyKind:`json`,body:f.body===void 0?l({comment:u(f.comment,`comment`,`text`),name:u(f.name,`name`,`text`),scopes:f.scopes}):c(f.body)});return}let s=await t(f),p=f.local?e:await r();if(f.accountId=p,f.body){let e=c(f.body),t=await o(`Creating`,async()=>s.secretsStore.secrets.duplicate({...e,account_id:p,store_id:f[`store-id`],secret_id:f[`secret-id`]}));i(t,{successLabel:`Created`});return}if(f.name===void 0&&(f.name=await d(`name`,`The name of the secret.`)),f.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);let m=l({comment:u(f.comment,`comment`,`text`),name:u(f.name,`name`,`text`),scopes:f.scopes}),h=await o(`Creating`,async()=>s.secretsStore.secrets.duplicate({...m,account_id:p,store_id:f[`store-id`],secret_id:f[`secret-id`]}));i(h,{successLabel:`Created`})})};function T(e){return e.usage(`$0 secrets-store secrets edit <secret-id>
|
|
15
|
-
|
|
16
|
-
Updates a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Freeform text describing the secret.`}).option(`scopes`,{type:`string`,array:!0,description:`The list of services that can use this secret.`}).option(`value`,{type:`string`,description:`The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - the API never returns this value; it exists only to create or modify secrets.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`edit <secret-id>`,describe:`Patch a secret`,builder:T,handler:async d=>s({command:`secrets-store secrets edit`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){let e=await n();a({command:`cf secrets-store secrets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/stores/${d[`store-id`]==null?`<store-id>`:encodeURIComponent(String(d[`store-id`]))}/secrets/${d[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(d[`secret-id`]))}`,pathParams:{"store-id":String(d[`store-id`]??``),"secret-id":String(d[`secret-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({comment:u(d.comment,`comment`,`text`),scopes:d.scopes,value:u(d.value,`value`,`text`)}):c(d.body),sensitiveBodyPaths:[[`value`]]});return}let s=await t(d),f=d.local?e:await r();if(d.accountId=f,d.body){let e=c(d.body),t=await o(`Updating`,async()=>s.secretsStore.secrets.edit({...e,account_id:f,store_id:d[`store-id`],secret_id:d[`secret-id`]}));i(t,{successLabel:`Updated`});return}let p=l({comment:u(d.comment,`comment`,`text`),scopes:d.scopes,value:u(d.value,`value`,`text`)}),m=await o(`Updating`,async()=>s.secretsStore.secrets.edit({...p,account_id:f,store_id:d[`store-id`],secret_id:d[`secret-id`]}));i(m,{successLabel:`Updated`})})};function D(e){return e.usage(`$0 secrets-store secrets get <secret-id>
|
|
17
|
-
|
|
18
|
-
Returns details of a single secret.`).positional(`secret-id`,{type:`string`,description:`Secret identifier.`,demandOption:!0}).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <secret-id>`,describe:`Get a secret by ID`,builder:D,handler:async c=>s({command:`secrets-store secrets get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf secrets-store secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/stores/${c[`store-id`]==null?`<store-id>`:encodeURIComponent(String(c[`store-id`]))}/secrets/${c[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(c[`secret-id`]))}`,pathParams:{"store-id":String(c[`store-id`]??``),"secret-id":String(c[`secret-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.secretsStore.secrets.get({account_id:l,store_id:c[`store-id`],secret_id:c[`secret-id`]}));i(u,{successLabel:`Loaded`})})};function k(e){return e.usage(`$0 secrets-store secrets list
|
|
19
|
-
|
|
20
|
-
Lists all store secrets.`).option(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number.`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page.`}).option(`search`,{type:`string`,description:`Search secrets using a filter string, filtering across name and comment.`}).option(`order`,{type:`string`,description:`Order secrets by values in the given field.`,choices:[`name`,`comment`,`created`,`modified`,`status`]}).option(`scopes`,{type:`string`,description:`Only secrets with the given scopes will be returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List store secrets`,builder:p(k),handler:async c=>s({command:`secrets-store secrets list`,classification:{safeFlags:[`direction`,`order`,`dry-run`]}},c,async()=>{let s={direction:c.direction,page:c.page,per_page:c[`per-page`],search:c.search,order:c.order,scopes:c.scopes};if(c.dryRun){let e=await n();a({command:`cf secrets-store secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/stores/${c[`store-id`]==null?`<store-id>`:encodeURIComponent(String(c[`store-id`]))}/secrets`,pathParams:{"store-id":String(c[`store-id`]??``)},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.secretsStore.secrets.list({account_id:u,store_id:c[`store-id`],...s}));i(d,{successLabel:`Loaded`})})},j={command:`secrets`,describe:`Encrypted key-value secrets within a store. Pass --store-id to scope.`,builder:e=>e.command(v).command(b).command(S).command(w).command(E).command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.usage(`$0 secrets-store stores get <store-id>
|
|
21
|
-
|
|
22
|
-
Returns details of a single store.`).positional(`store-id`,{type:`string`,description:`Store identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <store-id>`,describe:`Get a store by ID`,builder:M,handler:async c=>s({command:`secrets-store stores get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf secrets-store stores get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/stores/${c[`store-id`]==null?`<store-id>`:encodeURIComponent(String(c[`store-id`]))}`,pathParams:{"store-id":String(c[`store-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.secretsStore.stores.get({account_id:l,store_id:c[`store-id`]}));i(u,{successLabel:`Loaded`})})};function P(e){return e.usage(`$0 secrets-store stores list
|
|
23
|
-
|
|
24
|
-
Lists all the stores in an account.`).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:`Page number.`}).option(`per-page`,{type:`number`,description:`Number of objects to return per page.`}).option(`order`,{type:`string`,description:`Order stores by values in the given field.`,choices:[`name`,`created`,`modified`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`List account stores`,builder:p(P),handler:async c=>s({command:`secrets-store stores list`,classification:{safeFlags:[`direction`,`order`,`dry-run`]}},c,async()=>{let s={direction:c.direction,page:c.page,per_page:c[`per-page`],order:c.order};if(c.dryRun){let e=await n();a({command:`cf secrets-store stores list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/secrets_store/stores`,pathParams:{},query:s,bodyKind:`none`});return}let l=await t(c),u=c.local?e:await r();c.accountId=u;let d=await o(`Loading`,async()=>l.secretsStore.stores.list({account_id:u,...s}));i(d,{successLabel:`Loaded`})})},I={command:`stores`,describe:`Secret stores that hold encrypted key-value secrets accessible by Workers and services`,builder:e=>e.command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},L={command:`secrets-store`,describe:`Centralized secret management — store API keys, tokens, and credentials for use across Workers and other products`,builder:e=>e.command(g).command(j).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{L as default};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,i as r,t as i}from"./context-q7UaYK69.mjs";import{t as a}from"./output-BOe-3AQG.mjs";import{t as o}from"./dry-run-DRj2_uV3.mjs";import{t as s}from"./progress-BtkTVcHI.mjs";import{t as c}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as l,t as u}from"./body-parser-DkHKPkJ7.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{t as f}from"./cli-types-9oYmRTHJ.mjs";import{n as p,t as m}from"./raw-fetch-B4NvWuZD.mjs";function h(e){return e.usage(`$0 security-insights audit-logs get <issue-id>
|
|
3
|
-
|
|
4
|
-
Lists audit log entries for a specific Security Center insight, showing changes to its status and classification over time.`).positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`cursor`,{type:`string`,description:`Opaque cursor for pagination. Use the cursor value from result_info of the previous response.`}).option(`field-changed`,{type:`string`,description:`Filter by the field that was changed.`,choices:[`status`,`user_classification`]}).option(`changed-by`,{type:`string`,description:`Filter by the actor that made the change.`}).option(`since`,{type:`string`,description:`Filter entries changed at or after this timestamp (RFC 3339).`}).option(`before`,{type:`string`,description:`Filter entries changed before this timestamp (RFC 3339).`}).option(`order`,{type:`string`,description:`Sort order for results. Use 'asc' for oldest first or 'desc' for newest first.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <issue-id>`,describe:`Retrieves Issue Audit Log`,builder:f(h),handler:async l=>c({command:`security-insights audit-logs get`,classification:{safeFlags:[`field-changed`,`order`,`dry-run`]}},l,async()=>{let c={per_page:l[`per-page`],cursor:l.cursor,field_changed:l[`field-changed`],changed_by:l[`changed-by`],since:l.since,before:l.before,order:l.order};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf security-insights audit-logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/${l[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(l[`issue-id`]))}/audit-log`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"issue-id":String(l[`issue-id`]??``)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();d===`zones`?l.zoneId=f:l.accountId=f;let p=await s(`Loading`,async()=>u.securityInsights.auditLogs.get({account_or_zone:d,account_or_zone_id:f,issue_id:l[`issue-id`],...c}));a(p,{successLabel:`Loaded`})})};function ee(e){return e.usage(`$0 security-insights audit-logs list
|
|
5
|
-
|
|
6
|
-
Lists audit log entries for all Security Center insights in the account or zone, showing changes to insight status and classification.`).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`cursor`,{type:`string`,description:`Opaque cursor for pagination. Use the cursor value from result_info of the previous response.`}).option(`field-changed`,{type:`string`,description:`Filter by the field that was changed.`,choices:[`status`,`user_classification`]}).option(`changed-by`,{type:`string`,description:`Filter by the actor that made the change.`}).option(`since`,{type:`string`,description:`Filter entries changed at or after this timestamp (RFC 3339).`}).option(`before`,{type:`string`,description:`Filter entries changed before this timestamp (RFC 3339).`}).option(`order`,{type:`string`,description:`Sort order for results. Use 'asc' for oldest first or 'desc' for newest first.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Retrieves account or zone Audit Log`,builder:f(ee),handler:async l=>c({command:`security-insights audit-logs list`,classification:{safeFlags:[`field-changed`,`order`,`dry-run`]}},l,async()=>{let c={per_page:l[`per-page`],cursor:l.cursor,field_changed:l[`field-changed`],changed_by:l[`changed-by`],since:l.since,before:l.before,order:l.order};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf security-insights audit-logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/audit-log`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();d===`zones`?l.zoneId=f:l.accountId=f;let p=await s(`Loading`,async()=>u.securityInsights.auditLogs.list({account_or_zone:d,account_or_zone_id:f,...c}));a(p,{successLabel:`Loaded`})})},v={command:`audit-logs`,describe:`Operations for audit-logs`,builder:e=>e.command(g).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.usage(`$0 security-insights classify <issue-id>
|
|
7
|
-
|
|
8
|
-
Updates the user classification for a Security Center insight. Valid values are 'false_positive' or 'accept_risk'. To reset, set classification to null. Cannot change directly between classification values - must reset to null first.`).positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`classification`,{type:`string`,description:`User-defined classification for the insight. Can be 'false_positive', 'accept_risk', 'other', or null.`,choices:[`false_positive`,`accept_risk`,`other`]}).option(`rationale`,{type:`string`,description:`Rationale for the classification change. Required when classification is 'accept_risk' or 'other'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`classify <issue-id>`,describe:`Updates Security Center Insight Classification`,builder:y,handler:async f=>c({command:`security-insights classify`,classification:{safeFlags:[`classification`,`dry-run`]}},f,async()=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf security-insights classify`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/${f[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(f[`issue-id`]))}/classification`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"issue-id":String(f[`issue-id`]??``)},bodyKind:`json`,body:f.body===void 0?u({classification:d(f.classification,`classification`,`text`),rationale:d(f.rationale,`rationale`,`text`)}):l(f.body)});return}let c=await t(f),p=f.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:f.zone},c,{quiet:f.quiet}):f.local?e:await i();if(p===`zones`?f.zoneId=m:f.accountId=m,f.body){let e=l(f.body),t=await s(`Updating`,async()=>c.securityInsights.classify({...e,account_or_zone:p,account_or_zone_id:m,issue_id:f[`issue-id`]}));a(t,{successLabel:`Updated`});return}let h=u({classification:d(f.classification,`classification`,`text`),rationale:d(f.rationale,`rationale`,`text`)}),g=await s(`Updating`,async()=>c.securityInsights.classify({...h,account_or_zone:p,account_or_zone_id:m,issue_id:f[`issue-id`]}));a(g,{successLabel:`Updated`})})};function x(e){return e.usage(`$0 security-insights context get <issue-id>
|
|
9
|
-
|
|
10
|
-
Returns the full context payload for an insight. This endpoint is used for insights with large payloads that are not included inline in the list response.`).positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <issue-id>`,describe:`Retrieves Security Center Insight Context`,builder:x,handler:async r=>c({command:`security-insights context get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){let e=await n();o({command:`cf security-insights context get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/security-center/insights/${r[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(r[`issue-id`]))}/context`,pathParams:{"issue-id":String(r[`issue-id`]??``)},bodyKind:`none`});return}let c=await t(r),l=r.local?e:await i();r.accountId=l;let u=await s(`Loading`,async()=>c.securityInsights.context.get({account_id:l,issue_id:r[`issue-id`]}));a(u,{successLabel:`Loaded`})})},C={command:`context`,describe:`Operations for context`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.usage(`$0 security-insights count by-class
|
|
11
|
-
|
|
12
|
-
Retrieves Security Center insight counts aggregated by classification class.`).option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`source`,{type:`string`,description:`Source`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`by-class`,describe:`Retrieves Security Center Insight Counts by Class`,builder:f(w),handler:async l=>c({command:`security-insights count by-class`,classification:{safeFlags:[`dismissed`,`dry-run`]}},l,async()=>{let c={dismissed:l.dismissed,issue_class:l[`issue-class`],issue_type:l[`issue-type`],product:l.product,source:l.source,severity:l.severity,subject:l.subject};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf security-insights count by-class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/class`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();d===`zones`?l.zoneId=f:l.accountId=f;let p=await s(`Loading`,async()=>u.securityInsights.count.byClass({account_or_zone:d,account_or_zone_id:f,...c}));a(p,{successLabel:`Loaded`})})};function E(e){return e.usage(`$0 security-insights count by-partner
|
|
13
|
-
|
|
14
|
-
Retrieves the uncapped count of active, non-dismissed, unclassified RiskRecon insights for the account or zone.`).option(`source`,{type:`string`,description:`Source`,choices:[`riskrecon`],demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`by-partner`,describe:`Retrieves a Partner Security Center Insight Count`,builder:f(E),handler:async l=>c({command:`security-insights count by-partner`,classification:{safeFlags:[`source`,`dry-run`]}},l,async()=>{let c={source:l.source};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf security-insights count by-partner`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/partner-count`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();d===`zones`?l.zoneId=f:l.accountId=f;let p=await s(`Loading`,async()=>u.securityInsights.count.byPartner({account_or_zone:d,account_or_zone_id:f,...c}));a(p,{successLabel:`Loaded`})})};function O(e){return e.usage(`$0 security-insights count by-severity
|
|
15
|
-
|
|
16
|
-
Retrieves Security Center insight counts aggregated by severity level (critical, high, medium, low).`).option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`source`,{type:`string`,description:`Source`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`by-severity`,describe:`Retrieves Security Center Insight Counts by Severity`,builder:f(O),handler:async l=>c({command:`security-insights count by-severity`,classification:{safeFlags:[`dismissed`,`dry-run`]}},l,async()=>{let c={dismissed:l.dismissed,issue_class:l[`issue-class`],issue_type:l[`issue-type`],product:l.product,source:l.source,severity:l.severity,subject:l.subject};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf security-insights count by-severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/severity`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();d===`zones`?l.zoneId=f:l.accountId=f;let p=await s(`Loading`,async()=>u.securityInsights.count.bySeverity({account_or_zone:d,account_or_zone_id:f,...c}));a(p,{successLabel:`Loaded`})})};function A(e){return e.usage(`$0 security-insights count by-type
|
|
17
|
-
|
|
18
|
-
Retrieves Security Center insight counts aggregated by insight type.`).option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`source`,{type:`string`,description:`Source`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`by-type`,describe:`Retrieves Security Center Insight Counts by Type`,builder:f(A),handler:async l=>c({command:`security-insights count by-type`,classification:{safeFlags:[`dismissed`,`dry-run`]}},l,async()=>{let c={dismissed:l.dismissed,issue_class:l[`issue-class`],issue_type:l[`issue-type`],product:l.product,source:l.source,severity:l.severity,subject:l.subject};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf security-insights count by-type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/type`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();d===`zones`?l.zoneId=f:l.accountId=f;let p=await s(`Loading`,async()=>u.securityInsights.count.byType({account_or_zone:d,account_or_zone_id:f,...c}));a(p,{successLabel:`Loaded`})})},M={command:`count`,describe:`Operations for count`,builder:e=>e.command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.usage(`$0 security-insights dismiss <issue-id>
|
|
19
|
-
|
|
20
|
-
Archives a Security Center insight for an account or zone, removing it from the active insights list while preserving historical data.`).positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`dismiss <issue-id>`,describe:`Archives Security Center Insight`,builder:N,handler:async d=>c({command:`security-insights dismiss`,classification:{safeFlags:[`dismiss`,`dry-run`]}},d,async()=>{if(d.dryRun){let e=d.zone===void 0?await n():void 0,t=d.zone===void 0?`accounts`:`zones`,r=d.zone??e??`<account-id>`;o({command:`cf security-insights dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/${d[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(d[`issue-id`]))}/dismiss`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"issue-id":String(d[`issue-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({dismiss:d.dismiss}):l(d.body)});return}let c=await t(d),f=d.zone===void 0?`accounts`:`zones`,p=f===`zones`?await r({zone:d.zone},c,{quiet:d.quiet}):d.local?e:await i();if(f===`zones`?d.zoneId=p:d.accountId=p,d.body){let e=l(d.body),t=await s(`Updating`,async()=>c.securityInsights.dismiss({...e,account_or_zone:f,account_or_zone_id:p,issue_id:d[`issue-id`]}));a(t,{successLabel:`Updated`});return}let m=u({dismiss:d.dismiss}),h=await s(`Updating`,async()=>c.securityInsights.dismiss({...m,account_or_zone:f,account_or_zone_id:p,issue_id:d[`issue-id`]}));a(h,{successLabel:`Updated`})})};function F(e){return e.usage(`$0 security-insights list
|
|
21
|
-
|
|
22
|
-
Lists all Security Center insights for the account or zone, showing security findings and recommendations.`).option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`source`,{type:`string`,description:`Source`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Retrieves Security Center Insights`,builder:f(F),handler:async l=>c({command:`security-insights list`,classification:{safeFlags:[`dismissed`,`dry-run`]}},l,async()=>{let c={dismissed:l.dismissed,issue_class:l[`issue-class`],issue_type:l[`issue-type`],product:l.product,source:l.source,severity:l.severity,subject:l.subject,page:l.page,per_page:l[`per-page`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf security-insights list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await t(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await i();d===`zones`?l.zoneId=f:l.accountId=f;let p=await s(`Loading`,async()=>u.securityInsights.list({account_or_zone:d,account_or_zone_id:f,...c}));a(p,{successLabel:`Loaded`})})};function te(e){return e.usage(`$0 security-insights partners settings get <partner>
|
|
23
|
-
|
|
24
|
-
Returns whether the account has enabled the selected partner integration. An integration that has never been configured is returned as disabled.`).positional(`partner`,{type:`string`,description:`The partner integration identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <partner>`,describe:`Retrieves Partner Integration Settings`,builder:f(te),handler:async r=>c({command:`security-insights partners settings get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){let e=await n();o({command:`cf security-insights partners settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/security-center/partners/${r.partner==null?`<partner>`:encodeURIComponent(String(r.partner))}/settings`,pathParams:{partner:String(r.partner??``)},bodyKind:`none`});return}let c=await t(r),l=r.local?e:await i();r.accountId=l;let u=await s(`Loading`,async()=>c.securityInsights.partners.settings.get({account_id:l,partner:r.partner}));a(u,{successLabel:`Loaded`})})};function R(e){return e.usage(`$0 security-insights partners settings update <partner>
|
|
25
|
-
|
|
26
|
-
Enables or disables the selected partner integration for the account. Enabling the integration for the first time also schedules an account scan for that partner.`).positional(`partner`,{type:`string`,description:`The partner integration identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether the partner integration is enabled for the account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const z={command:`update <partner>`,describe:`Updates Partner Integration Settings`,builder:f(R),handler:async r=>c({command:`security-insights partners settings update`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){let e=await n();o({command:`cf security-insights partners settings update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/security-center/partners/${r.partner==null?`<partner>`:encodeURIComponent(String(r.partner))}/settings`,pathParams:{partner:String(r.partner??``)},bodyKind:`json`,body:r.body===void 0?u({enabled:r.enabled}):l(r.body)});return}let c=await t(r),d=r.local?e:await i();if(r.accountId=d,r.body){let e=l(r.body),t=await s(`Creating`,async()=>c.securityInsights.partners.settings.update({body:e,account_id:d,partner:r.partner}));a(t,{successLabel:`Created`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let f=u({enabled:r.enabled}),p=await s(`Creating`,async()=>c.securityInsights.partners.settings.update({body:f,account_id:d,partner:r.partner}));a(p,{successLabel:`Created`})})},B={command:`settings`,describe:`Operations for partners.settings`,builder:e=>e.command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.usage(`$0 security-insights partners shadow-hosts list
|
|
27
|
-
|
|
28
|
-
Lists partner-discovered hosts beneath the zone that are not in the account.`).option(`partner`,{type:`string`,description:`The partner integration identifier.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number for premium partner asset results.`}).option(`per-page`,{type:`number`,description:`Number of premium partner asset results per page. Values other than 1 must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`Lists Partner-Discovered Shadow Hosts for a Zone`,builder:V,handler:async e=>c({command:`security-insights partners shadow-hosts list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf security-insights partners shadow-hosts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/security-center/partners/${e.partner==null?`<partner>`:encodeURIComponent(String(e.partner))}/shadow-hosts`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),partner:String(e.partner??``)},query:n,bodyKind:`none`});return}let i=await t(e);e.zoneId=await r({zone:e.zone},i,{quiet:e.quiet});let a=new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),c=await s(`Loading`,async()=>m(`/zones/${e.zoneId}/security-center/partners/${encodeURIComponent(String(e.partner))}/shadow-hosts${a?`?`+a:``}`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));p(c.toString(`utf-8`))})},U={command:`shadow-hosts`,describe:`Operations for partners.shadow-hosts`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 security-insights partners shadow-zone-hosts list
|
|
29
|
-
|
|
30
|
-
Lists hosts discovered beneath a shadow-zone domain. This endpoint is available only to premium accounts and supports JSON and CSV output.`).option(`partner`,{type:`string`,description:`The partner integration identifier.`,demandOption:!0}).option(`domain`,{type:`string`,description:`The shadow-zone domain.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number for premium partner asset results.`}).option(`per-page`,{type:`number`,description:`Number of premium partner asset results per page. Values other than 1 must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`Lists Hosts in a Partner-Discovered Shadow Zone`,builder:W,handler:async r=>c({command:`security-insights partners shadow-zone-hosts list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let a={page:r.page,per_page:r[`per-page`]};if(r.dryRun){let e=await n();o({command:`cf security-insights partners shadow-zone-hosts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/security-center/partners/${r.partner==null?`<partner>`:encodeURIComponent(String(r.partner))}/shadow-zones/${r.domain==null?`<domain>`:encodeURIComponent(String(r.domain))}/hosts`,pathParams:{partner:String(r.partner??``),domain:String(r.domain??``)},query:a,bodyKind:`none`});return}await t(r);let c=r.local?e:await i();r.accountId=c;let l=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await s(`Loading`,async()=>m(`/accounts/${c}/security-center/partners/${encodeURIComponent(String(r.partner))}/shadow-zones/${encodeURIComponent(String(r.domain))}/hosts${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));p(u.toString(`utf-8`))})},K={command:`shadow-zone-hosts`,describe:`Operations for partners.shadow-zone-hosts`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.usage(`$0 security-insights partners shadow-zones list
|
|
31
|
-
|
|
32
|
-
Lists domains discovered by the selected partner that are not in the account. Baseline accounts receive the total count only; premium accounts receive paginated items and may request CSV output.`).option(`partner`,{type:`string`,description:`The partner integration identifier.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number for premium partner asset results.`}).option(`per-page`,{type:`number`,description:`Number of premium partner asset results per page. Values other than 1 must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`Lists Partner-Discovered Shadow Zones`,builder:q,handler:async r=>c({command:`security-insights partners shadow-zones list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let a={page:r.page,per_page:r[`per-page`]};if(r.dryRun){let e=await n();o({command:`cf security-insights partners shadow-zones list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/security-center/partners/${r.partner==null?`<partner>`:encodeURIComponent(String(r.partner))}/shadow-zones`,pathParams:{partner:String(r.partner??``)},query:a,bodyKind:`none`});return}await t(r);let c=r.local?e:await i();r.accountId=c;let l=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await s(`Loading`,async()=>m(`/accounts/${c}/security-center/partners/${encodeURIComponent(String(r.partner))}/shadow-zones${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));p(u.toString(`utf-8`))})},Y={command:`shadow-zones`,describe:`Operations for partners.shadow-zones`,builder:e=>e.command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},X={command:`partners`,describe:`Operations for partners`,builder:e=>e.command(B).command(U).command(K).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.usage(`$0 security-insights scans list
|
|
33
|
-
|
|
34
|
-
Returns the most recent on-demand scans for the account or zone, up to a maximum of 5. Each scan includes its ID, start time, and current status. This includes both account or zone-wide and zone-scoped scans. Also returns quota information showing how many scans have been used and how many remain in the current 24-hour window.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`Get Recent account or zone Scans`,builder:Z,handler:async l=>c({command:`security-insights scans list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf security-insights scans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/scans`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await t(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await i();u===`zones`?l.zoneId=d:l.accountId=d;let f=await s(`Loading`,async()=>c.securityInsights.scans.list({account_or_zone:u,account_or_zone_id:d}));a(f,{successLabel:`Loaded`})})};function ne(e){return e.usage(`$0 security-insights scans start
|
|
35
|
-
|
|
36
|
-
Initiates an on-demand security scan for the entire account or zone, scanning all zones associated with the account or zone. Rate limited to 5 scans per account or zone per 24-hour window.`).option(`issue-type`,{type:`string`,description:`The issue_type field`,choices:[`compliance_violation`,`email_security`,`exposed_infrastructure`,`insecure_configuration`,`weak_authentication`,`configuration_suggestion`]}).option(`issue-class`,{type:`string`,description:`The issue_class field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for starting an on-demand scan. Specify issue_type or issue_class to scope the scan, or provide an empty object to scan all issue types.`}).conflicts(`issue-type`,[`issue-class`]).conflicts(`issue-class`,[`issue-type`])}const re={command:`start`,describe:`Start On-Demand account or zone Scan`,builder:ne,handler:async f=>c({command:`security-insights scans start`,classification:{safeFlags:[`issue-type`,`dry-run`]}},f,async()=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf security-insights scans start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/security-center/insights/scans`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?u({issue_type:d(f[`issue-type`],`issue-type`,`text`),issue_class:d(f[`issue-class`],`issue-class`,`text`)}):l(f.body)});return}let c=await t(f),p=f.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:f.zone},c,{quiet:f.quiet}):f.local?e:await i();if(p===`zones`?f.zoneId=m:f.accountId=m,f.body){let e=l(f.body),t=await s(`Creating`,async()=>c.securityInsights.scans.start({body:e,account_or_zone:p,account_or_zone_id:m}));a(t,{successLabel:`Created`});return}let h=u({issue_type:d(f[`issue-type`],`issue-type`,`text`),issue_class:d(f[`issue-class`],`issue-class`,`text`)}),g=await s(`Creating`,async()=>c.securityInsights.scans.start({body:h,account_or_zone:p,account_or_zone_id:m}));a(g,{successLabel:`Created`})})},ie={command:`scans`,describe:`Operations for scans`,builder:e=>e.command(Q).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.usage(`$0 security-insights state get
|
|
37
|
-
|
|
38
|
-
Returns account-level Security Center state: whether scans are enabled for the account and whether the account was recently reactivated from a dormant state.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get`,describe:`Retrieves Account State`,builder:ae,handler:async r=>c({command:`security-insights state get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){let e=await n();o({command:`cf security-insights state get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/security-center/state`,pathParams:{},bodyKind:`none`});return}let c=await t(r),l=r.local?e:await i();r.accountId=l;let u=await s(`Loading`,async()=>c.securityInsights.state.get({account_id:l}));a(u,{successLabel:`Loaded`})})};function $(e){return e.usage(`$0 security-insights state update
|
|
39
|
-
|
|
40
|
-
Updates account-level Security Center state. Currently supports enabling or disabling scans for the account. Returns the account's state after the update.`).option(`scans-enabled`,{type:`boolean`,description:`Enable or disable scans for the account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const se={command:`update`,describe:`Updates Account State`,builder:$,handler:async r=>c({command:`security-insights state update`,classification:{safeFlags:[`scans-enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){let e=await n();o({command:`cf security-insights state update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/security-center/state`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({scans_enabled:r[`scans-enabled`]}):l(r.body)});return}let c=await t(r),d=r.local?e:await i();if(r.accountId=d,r.body){let e=l(r.body),t=await s(`Updating`,async()=>c.securityInsights.state.update({...e,account_id:d}));a(t,{successLabel:`Updated`});return}if(r[`scans-enabled`]===void 0)throw Error(`--scans-enabled is required (or pass --body with this field set).`);let f=u({scans_enabled:r[`scans-enabled`]}),p=await s(`Updating`,async()=>c.securityInsights.state.update({...f,account_id:d}));a(p,{successLabel:`Updated`})})},ce={command:`state`,describe:`Operations for state`,builder:e=>e.command(oe).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`security-insights`,describe:`security-insights`,builder:e=>e.command(b).command(P).command(I).command(v).command(C).command(M).command(X).command(ie).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{le as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./auth-CGLsxbc6.mjs";import{i as t}from"./context-q7UaYK69.mjs";import{t as n}from"./output-BOe-3AQG.mjs";import{t as r}from"./dry-run-DRj2_uV3.mjs";import{t as i}from"./progress-BtkTVcHI.mjs";import{t as a}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as o,t as s}from"./body-parser-DkHKPkJ7.mjs";import{n as c}from"./input-validation-D7z60HJH.mjs";import{n as l}from"./prompt-RlgRrmbm.mjs";function u(e){return e.usage(`$0 security-txt delete
|
|
3
|
-
|
|
4
|
-
Removes the security.txt file configuration for a zone. The /.well-known/security.txt endpoint will no longer be served.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const d={command:`delete`,describe:`Deletes security.txt`,builder:u,handler:async o=>a({command:`security-txt delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf security-txt delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await e(o),s=await t({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await l({force:!!o.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}let c=await i(`Deleting`,async()=>a.securityTxt.delete({zone_id:s}));n(c,{successLabel:`Deleted`})})};function f(e){return e.usage(`$0 security-txt get
|
|
6
|
-
|
|
7
|
-
Retrieves the current security.txt file configuration for a zone, used for security vulnerability reporting.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get`,describe:`Retrieves security.txt`,builder:f,handler:async o=>a({command:`security-txt get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf security-txt get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await e(o),s=await t({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s;let c=await i(`Loading`,async()=>a.securityTxt.get({zone_id:s}));n(c,{successLabel:`Loaded`})})};function m(e){return e.usage(`$0 security-txt update
|
|
8
|
-
|
|
9
|
-
Updates the security.txt file configuration for a zone, which provides security researchers with vulnerability reporting information.`).option(`acknowledgments`,{type:`string`,array:!0,description:`The acknowledgments field`}).option(`canonical`,{type:`string`,array:!0,description:`The canonical field`}).option(`contact`,{type:`string`,array:!0,description:`The contact field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`encryption`,{type:`string`,array:!0,description:`The encryption field`}).option(`expires`,{type:`string`,description:`The expires field`}).option(`hiring`,{type:`string`,array:!0,description:`The hiring field`}).option(`policy`,{type:`string`,array:!0,description:`The policy field`}).option(`preferred-languages`,{type:`string`,description:`The preferred_languages field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`update`,describe:`Updates security.txt`,builder:m,handler:async l=>a({command:`security-txt update`,classification:{safeFlags:[`enabled`,`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf security-txt update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/security-center/securitytxt`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({acknowledgments:l.acknowledgments,canonical:l.canonical,contact:l.contact,enabled:l.enabled,encryption:l.encryption,expires:c(l.expires,`expires`,`text`),hiring:l.hiring,policy:l.policy,preferred_languages:c(l[`preferred-languages`],`preferred-languages`,`text`)}):o(l.body)});return}let a=await e(l),u=await t({zone:l.zone},a,{quiet:l.quiet});if(l.zoneId=u,l.body){let e=o(l.body),t=await i(`Updating`,async()=>a.securityTxt.update({body:e,zone_id:u}));n(t,{successLabel:`Updated`});return}let d=s({acknowledgments:l.acknowledgments,canonical:l.canonical,contact:l.contact,enabled:l.enabled,encryption:l.encryption,expires:c(l.expires,`expires`,`text`),hiring:l.hiring,policy:l.policy,preferred_languages:c(l[`preferred-languages`],`preferred-languages`,`text`)}),f=await i(`Updating`,async()=>a.securityTxt.update({body:d,zone_id:u}));n(f,{successLabel:`Updated`})})},g={command:`security-txt`,describe:`Manage the /.well-known/security.txt file that tells security researchers how to report vulnerabilities`,builder:e=>e.command(d).command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./theme-CQ_TYifs.mjs";import{o as t}from"./chunk-NDZDTP46-Bjx_wtJe.mjs";import{t as n}from"./banner-D03JEqRs.mjs";let r=!1,i=!1,a=!1;function o(e,t={}){if(!(r||i)){if(t.quiet||!process.stderr.isTTY){i=!0;return}process.stderr.write(`${n(e,t.update)}\n`),r=!0}}function s(n){!r||i||a||n==="default"||t({allowGlobalAuthKey:!1})!==void 0||(process.stderr.write(`${e.muted(`Active profile:`)} ${e.info(n)}\n`),a=!0)}export{s as n,o as t};
|
package/dist/shared-BPjcpXuA.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./theme-CQ_TYifs.mjs";import{r as t}from"./dotenv-DpXaxfho.mjs";import{G as n,nt as r,q as i}from"./dist-BHEmAAHr.mjs";import"./ui-YmjF66Ct.mjs";import{n as a}from"./dist-uRuGmkMB.mjs";import{t as o}from"./context-q7UaYK69.mjs";import{_ as s,d as c,f as l,t as u}from"./deploy-context-Dr6bxNcB.mjs";import{t as d}from"./auth-token-pNQrX_9O.mjs";import{c as f,i as p,l as m,t as h}from"./containers-DeoZyeQe.mjs";import{a as g,i as _,n as v,o as y,r as b}from"./build-HmSXqjGn.mjs";import{i as x,n as S,t as C}from"./deploy-input-Cc0_2QlW.mjs";import{readBuildOutput as w}from"@cloudflare/build-output-utils";function T(e){return e.option(`prebuilt`,{type:`boolean`,description:`Deploy existing Build Output Specification files without building`,default:!1}).option(`tag`,{type:`string`,description:`A tag to associate with this Worker Version`,requiresArg:!0}).option(`message`,{type:`string`,description:`A message to associate with this Worker Version`,requiresArg:!0}).option(`secrets-file`,{type:`string`,description:`Path to a file containing secrets to upload with the version (JSON or .env format)`,requiresArg:!0}).option(`dry-run`,{describe:`Build a project and run checks without actually uploading the Worker`,type:`boolean`,default:!1}).option(`worker`,b)}async function E(e,n){if(!e.prebuilt){if(await v(e.mode,{worker:e.worker,dryRun:e[`dry-run`]})===`setup-needed`){a.success(`--dry-run: exiting now.`);return}a.message(``,{spacing:0})}return t(e,()=>D(e,n))}async function D(t,v){let{workers:b,rootConfig:T,containers:E}=await w(process.cwd());if(T.buildContext.isPreview){let e=[`cf previews deploy`,...t.prebuilt?[`--prebuilt`]:[],...T.buildContext.mode===void 0?[]:[`--mode`,T.buildContext.mode]].join(` `);throw Error(`This build output is for a Preview. Run ${e} instead.`)}y(t.mode,T.buildContext.mode);let D=g(b,t.worker),{wranglerConfig:O,builtConfig:k}=_(D,T),A=C(D,k),j=t[`dry-run`]?``:await d(),M=t[`dry-run`]?void 0:T.accountId??await o({skipProjectSettings:!0,complianceRegion:i(O)}),N=u(j);m(N),s({logger:N.logger,fetchResult:N.fetchResult,fetchPagedListResult:N.fetchPagedListResult}),M!==void 0&&E.length>0&&l(M,j,n(O));let P=h(E,O,{accountId:M,containersRollout:t[`containers-rollout`]}),F;if(v.command===`Deploy`){let n=S(D,O,M,t,P);a.message(e.bold(`Deploy`),{symbol:e.muted(`├`),spacing:0}),{versionId:F}=await p(n,O,A,{syncWorkersSite:void 0,analyseBundle:void 0})}else{let n=x(D,O,M,t,P);a.message(e.bold(`Upload`),{symbol:e.muted(`├`),spacing:0}),{versionId:F}=await f(n,O,A,{analyseBundle:void 0})}F!==null&&!t[`dry-run`]&&(v.command!==`Deploy`||t[`containers-rollout`]!==`none`)&&await c([...v.command===`Deploy`?P.standard.builtImages:[],...P.durableObjects.builtImages],r()),t[`dry-run`]||a.success(`${v.command} complete`)}export{T as n,E as t};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./auth-CGLsxbc6.mjs";import{i as t}from"./context-q7UaYK69.mjs";import{t as n}from"./output-BOe-3AQG.mjs";import{t as r}from"./dry-run-DRj2_uV3.mjs";import{t as i}from"./progress-BtkTVcHI.mjs";import{t as a}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as o,r as s,t as c}from"./body-parser-DkHKPkJ7.mjs";import{n as l}from"./input-validation-D7z60HJH.mjs";import{a as u,n as d}from"./prompt-RlgRrmbm.mjs";function f(e){return e.usage(`$0 smart-shield cache-reserve-clear clear
|
|
3
|
-
|
|
4
|
-
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`clear`,describe:`Start Cache Reserve Clear`,builder:f,handler:async o=>a({command:`smart-shield cache-reserve-clear clear`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf smart-shield cache-reserve-clear clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await e(o),s=await t({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await d({force:!!o.force,message:`This operation permanently clears Cache Reserve for this zone and cannot be undone.`})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}let c=await i(`Deleting`,async()=>a.smartShield.cacheReserveClear.clear({zone_id:s}));n(c,{successLabel:`Deleted`})})};function m(e){return e.usage(`$0 smart-shield cache-reserve-clear status
|
|
6
|
-
|
|
7
|
-
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`status`,describe:`Get Cache Reserve Clear`,builder:m,handler:async o=>a({command:`smart-shield cache-reserve-clear status`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf smart-shield cache-reserve-clear status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/smart_shield/cache_reserve_clear`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await e(o),s=await t({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s;let c=await i(`Loading`,async()=>a.smartShield.cacheReserveClear.status({zone_id:s}));n(c,{successLabel:`Loaded`})})},g={command:`cache-reserve-clear`,describe:`Cache Reserve Clear operations`,builder:e=>e.command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.usage(`$0 smart-shield get
|
|
8
|
-
|
|
9
|
-
Retrieve Smart Shield Settings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Get Smart Shield Settings`,builder:_,handler:async o=>a({command:`smart-shield get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf smart-shield get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/smart_shield`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await e(o),s=await t({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s;let c=await i(`Loading`,async()=>a.smartShield.get({zone_id:s}));n(c,{successLabel:`Loaded`})})};function y(e){return e.usage(`$0 smart-shield health-checks create
|
|
10
|
-
|
|
11
|
-
Create a new health check.`).option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`,default:1}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`,default:1}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`,default:60}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`,default:!1}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`,default:`HTTP`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create`,describe:`Create Health Check`,builder:y,handler:async s=>a({command:`smart-shield health-checks create`,classification:{safeFlags:[`http-config-allow-insecure`,`http-config-follow-redirects`,`http-config-method`,`suspended`,`tcp-config-method`,`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf smart-shield health-checks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/smart_shield/healthchecks`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?c({address:l(s.address,`address`,`text`),check_regions:s[`check-regions`],consecutive_fails:s[`consecutive-fails`],consecutive_successes:s[`consecutive-successes`],description:l(s.description,`description`,`text`),http_config:{allow_insecure:s[`http-config-allow-insecure`],expected_body:l(s[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:s[`http-config-expected-codes`],follow_redirects:s[`http-config-follow-redirects`],method:l(s[`http-config-method`],`http-config-method`,`text`),path:l(s[`http-config-path`],`http-config-path`,`text`),port:s[`http-config-port`]},interval:s.interval,name:l(s.name,`name`,`text`),retries:s.retries,suspended:s.suspended,tcp_config:{method:l(s[`tcp-config-method`],`tcp-config-method`,`text`),port:s[`tcp-config-port`]},timeout:s.timeout,type:l(s.type,`type`,`text`)}):o(s.body)});return}let a=await e(s),d=await t({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=d,s.body){let e=o(s.body),t=await i(`Creating`,async()=>a.smartShield.healthChecks.create({body:e,zone_id:d}));n(t,{successLabel:`Created`});return}s.address===void 0&&(s.address=await u(`address`,`The hostname or IP address of the origin server to run health checks on.`)),s.name===void 0&&(s.name=await u(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=c({address:l(s.address,`address`,`text`),check_regions:s[`check-regions`],consecutive_fails:s[`consecutive-fails`],consecutive_successes:s[`consecutive-successes`],description:l(s.description,`description`,`text`),http_config:{allow_insecure:s[`http-config-allow-insecure`],expected_body:l(s[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:s[`http-config-expected-codes`],follow_redirects:s[`http-config-follow-redirects`],method:l(s[`http-config-method`],`http-config-method`,`text`),path:l(s[`http-config-path`],`http-config-path`,`text`),port:s[`http-config-port`]},interval:s.interval,name:l(s.name,`name`,`text`),retries:s.retries,suspended:s.suspended,tcp_config:{method:l(s[`tcp-config-method`],`tcp-config-method`,`text`),port:s[`tcp-config-port`]},timeout:s.timeout,type:l(s.type,`type`,`text`)}),p=await i(`Creating`,async()=>a.smartShield.healthChecks.create({body:f,zone_id:d}));n(p,{successLabel:`Created`})})};function x(e){return e.usage(`$0 smart-shield health-checks delete <healthcheck-id>
|
|
12
|
-
|
|
13
|
-
Delete a health check.`).positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <healthcheck-id>`,describe:`Delete Health Check`,builder:x,handler:async o=>a({command:`smart-shield health-checks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf smart-shield health-checks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/smart_shield/healthchecks/${o[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(o[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(o[`healthcheck-id`]??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await e(o),s=await t({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await d({force:!!o.force})){process.stderr.write(`Aborted.
|
|
14
|
-
`);return}let c=await i(`Deleting`,async()=>a.smartShield.healthChecks.delete({zone_id:s,healthcheck_id:o[`healthcheck-id`]}));n(c,{successLabel:`Deleted`})})};function C(e){return e.usage(`$0 smart-shield health-checks edit <healthcheck-id>
|
|
15
|
-
|
|
16
|
-
Patch a configured health check.`).positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`}).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 w={command:`edit <healthcheck-id>`,describe:`Patch Health Check`,builder:C,handler:async s=>a({command:`smart-shield health-checks edit`,classification:{safeFlags:[`http-config-allow-insecure`,`http-config-follow-redirects`,`http-config-method`,`suspended`,`tcp-config-method`,`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf smart-shield health-checks edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/smart_shield/healthchecks/${s[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(s[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(s[`healthcheck-id`]??``),"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?c({address:l(s.address,`address`,`text`),check_regions:s[`check-regions`],consecutive_fails:s[`consecutive-fails`],consecutive_successes:s[`consecutive-successes`],description:l(s.description,`description`,`text`),http_config:{allow_insecure:s[`http-config-allow-insecure`],expected_body:l(s[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:s[`http-config-expected-codes`],follow_redirects:s[`http-config-follow-redirects`],method:l(s[`http-config-method`],`http-config-method`,`text`),path:l(s[`http-config-path`],`http-config-path`,`text`),port:s[`http-config-port`]},interval:s.interval,name:l(s.name,`name`,`text`),retries:s.retries,suspended:s.suspended,tcp_config:{method:l(s[`tcp-config-method`],`tcp-config-method`,`text`),port:s[`tcp-config-port`]},timeout:s.timeout,type:l(s.type,`type`,`text`)}):o(s.body)});return}let a=await e(s),d=await t({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=d,s.body){let e=o(s.body),t=await i(`Updating`,async()=>a.smartShield.healthChecks.edit({body:e,zone_id:d,healthcheck_id:s[`healthcheck-id`]}));n(t,{successLabel:`Updated`});return}s.address===void 0&&(s.address=await u(`address`,`The hostname or IP address of the origin server to run health checks on.`)),s.name===void 0&&(s.name=await u(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=c({address:l(s.address,`address`,`text`),check_regions:s[`check-regions`],consecutive_fails:s[`consecutive-fails`],consecutive_successes:s[`consecutive-successes`],description:l(s.description,`description`,`text`),http_config:{allow_insecure:s[`http-config-allow-insecure`],expected_body:l(s[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:s[`http-config-expected-codes`],follow_redirects:s[`http-config-follow-redirects`],method:l(s[`http-config-method`],`http-config-method`,`text`),path:l(s[`http-config-path`],`http-config-path`,`text`),port:s[`http-config-port`]},interval:s.interval,name:l(s.name,`name`,`text`),retries:s.retries,suspended:s.suspended,tcp_config:{method:l(s[`tcp-config-method`],`tcp-config-method`,`text`),port:s[`tcp-config-port`]},timeout:s.timeout,type:l(s.type,`type`,`text`)}),p=await i(`Updating`,async()=>a.smartShield.healthChecks.edit({body:f,zone_id:d,healthcheck_id:s[`healthcheck-id`]}));n(p,{successLabel:`Updated`})})};function T(e){return e.usage(`$0 smart-shield health-checks get <healthcheck-id>
|
|
17
|
-
|
|
18
|
-
Fetch a single configured health check.`).positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <healthcheck-id>`,describe:`Health Check Details`,builder:T,handler:async o=>a({command:`smart-shield health-checks get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf smart-shield health-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/smart_shield/healthchecks/${o[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(o[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(o[`healthcheck-id`]??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await e(o),s=await t({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s;let c=await i(`Loading`,async()=>a.smartShield.healthChecks.get({zone_id:s,healthcheck_id:o[`healthcheck-id`]}));n(c,{successLabel:`Loaded`})})};function D(e){return e.usage(`$0 smart-shield health-checks list
|
|
19
|
-
|
|
20
|
-
List configured health checks.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page. Must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`List Health Checks`,builder:D,handler:async o=>a({command:`smart-shield health-checks list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{let a={page:o.page,per_page:o[`per-page`]};if(o.dryRun){r({command:`cf smart-shield health-checks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/smart_shield/healthchecks`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},query:a,bodyKind:`none`});return}let s=await e(o),c=await t({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c;let l=await i(`Loading`,async()=>s.smartShield.healthChecks.list({zone_id:c,...a}));n(l,{successLabel:`Loaded`})})};function k(e){return e.usage(`$0 smart-shield health-checks update <healthcheck-id>
|
|
21
|
-
|
|
22
|
-
Update a configured health check.`).positional(`healthcheck-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`errors`,{type:`string`,description:`The errors field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`result-address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`result-check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`result-consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`}).option(`result-consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`}).option(`result-description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`result-http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`result-http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`result-http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`result-http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`result-http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`result-http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`result-http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`result-interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`}).option(`result-name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`result-retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`}).option(`result-suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`}).option(`result-tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`result-tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`result-timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).option(`result-type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`}).option(`success`,{type:`boolean`,description:`Whether the API call was successful.`}).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 A={command:`update <healthcheck-id>`,describe:`Update Health Check`,builder:k,handler:async u=>a({command:`smart-shield health-checks update`,classification:{safeFlags:[`result-http-config-allow-insecure`,`result-http-config-follow-redirects`,`result-http-config-method`,`result-suspended`,`result-tcp-config-method`,`success`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf smart-shield health-checks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/smart_shield/healthchecks/${u[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(u[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(u[`healthcheck-id`]??``),"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({errors:s(u.errors,`errors`),messages:s(u.messages,`messages`),result:{address:l(u[`result-address`],`result-address`,`text`),check_regions:u[`result-check-regions`],consecutive_fails:u[`result-consecutive-fails`],consecutive_successes:u[`result-consecutive-successes`],description:l(u[`result-description`],`result-description`,`text`),http_config:{allow_insecure:u[`result-http-config-allow-insecure`],expected_body:l(u[`result-http-config-expected-body`],`result-http-config-expected-body`,`text`),expected_codes:u[`result-http-config-expected-codes`],follow_redirects:u[`result-http-config-follow-redirects`],method:l(u[`result-http-config-method`],`result-http-config-method`,`text`),path:l(u[`result-http-config-path`],`result-http-config-path`,`text`),port:u[`result-http-config-port`]},interval:u[`result-interval`],name:l(u[`result-name`],`result-name`,`text`),retries:u[`result-retries`],suspended:u[`result-suspended`],tcp_config:{method:l(u[`result-tcp-config-method`],`result-tcp-config-method`,`text`),port:u[`result-tcp-config-port`]},timeout:u[`result-timeout`],type:l(u[`result-type`],`result-type`,`text`)},success:u.success}):o(u.body)});return}let a=await e(u),d=await t({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body),t=await i(`Updating`,async()=>a.smartShield.healthChecks.update({...e,zone_id:d,healthcheck_id:u[`healthcheck-id`]}));n(t,{successLabel:`Updated`});return}if(u.errors===void 0)throw Error(`--errors is required (or pass --body with this field set).`);if(u.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);if(u.success===void 0)throw Error(`--success is required (or pass --body with this field set).`);let f=c({errors:s(u.errors,`errors`),messages:s(u.messages,`messages`),result:{address:l(u[`result-address`],`result-address`,`text`),check_regions:u[`result-check-regions`],consecutive_fails:u[`result-consecutive-fails`],consecutive_successes:u[`result-consecutive-successes`],description:l(u[`result-description`],`result-description`,`text`),http_config:{allow_insecure:u[`result-http-config-allow-insecure`],expected_body:l(u[`result-http-config-expected-body`],`result-http-config-expected-body`,`text`),expected_codes:u[`result-http-config-expected-codes`],follow_redirects:u[`result-http-config-follow-redirects`],method:l(u[`result-http-config-method`],`result-http-config-method`,`text`),path:l(u[`result-http-config-path`],`result-http-config-path`,`text`),port:u[`result-http-config-port`]},interval:u[`result-interval`],name:l(u[`result-name`],`result-name`,`text`),retries:u[`result-retries`],suspended:u[`result-suspended`],tcp_config:{method:l(u[`result-tcp-config-method`],`result-tcp-config-method`,`text`),port:u[`result-tcp-config-port`]},timeout:u[`result-timeout`],type:l(u[`result-type`],`result-type`,`text`)},success:u.success}),p=await i(`Updating`,async()=>a.smartShield.healthChecks.update({...f,zone_id:d,healthcheck_id:u[`healthcheck-id`]}));n(p,{successLabel:`Updated`})})},j={command:`health-checks`,describe:`Health checks operations`,builder:e=>e.command(b).command(S).command(w).command(E).command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.usage(`$0 smart-shield update
|
|
23
|
-
|
|
24
|
-
Set Smart Shield Settings.`).option(`cache-reserve-value`,{type:`string`,description:`Specifies the enablement value of Cache Reserve.`,choices:[`on`,`off`]}).option(`regional-tiered-cache-value`,{type:`string`,description:`Specifies the enablement value of Regional Tiered Cache.`,choices:[`on`,`off`]}).option(`smart-routing-value`,{type:`string`,description:`Specifies the enablement value of Smart Routing.`,choices:[`on`,`off`]}).option(`smart-tiered-cache-value`,{type:`string`,description:`Specifies the enablement value of Smart Tiered Cache.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The patch body for Smart Shield.`})}const N={command:`update`,describe:`Patch Smart Shield Settings`,builder:M,handler:async s=>a({command:`smart-shield update`,classification:{safeFlags:[`cache-reserve-value`,`regional-tiered-cache-value`,`smart-routing-value`,`smart-tiered-cache-value`,`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf smart-shield update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/smart_shield`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?c({cache_reserve:{value:l(s[`cache-reserve-value`],`cache-reserve-value`,`text`)},regional_tiered_cache:{value:l(s[`regional-tiered-cache-value`],`regional-tiered-cache-value`,`text`)},smart_routing:{value:l(s[`smart-routing-value`],`smart-routing-value`,`text`)},smart_tiered_cache:{value:l(s[`smart-tiered-cache-value`],`smart-tiered-cache-value`,`text`)}}):o(s.body)});return}let a=await e(s),u=await t({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=u,s.body){let e=o(s.body),t=await i(`Updating`,async()=>a.smartShield.update({...e,zone_id:u}));n(t,{successLabel:`Updated`});return}let d=c({cache_reserve:{value:l(s[`cache-reserve-value`],`cache-reserve-value`,`text`)},regional_tiered_cache:{value:l(s[`regional-tiered-cache-value`],`regional-tiered-cache-value`,`text`)},smart_routing:{value:l(s[`smart-routing-value`],`smart-routing-value`,`text`)},smart_tiered_cache:{value:l(s[`smart-tiered-cache-value`],`smart-tiered-cache-value`,`text`)}}),f=await i(`Updating`,async()=>a.smartShield.update({...d,zone_id:u}));n(f,{successLabel:`Updated`})})},P={command:`smart-shield`,describe:`Smart Shield settings, health checks, and cache reserve management`,builder:e=>e.command(v).command(N).command(g).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
|