cf 1.0.0-beta.11 → 1.0.0-beta.13
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/bin/cf +1 -1
- package/dist/_meta/commands.json +3119 -2067
- package/dist/_meta/hand-written-commands.json +14 -1
- package/dist/_meta/schemas.json +1856 -1132
- package/dist/abuse-reports-BjU1s8cf.mjs +24 -0
- package/dist/{access-DuHs0Mii.mjs → access-C_G2MZnA.mjs} +1 -1
- package/dist/account-tags-CaXDDeZ4.mjs +15 -0
- package/dist/accounts-BALwxDQY.mjs +131 -0
- package/dist/{acm-BgSr3Ig4.mjs → acm-CP9EaXQN.mjs} +7 -7
- package/dist/addressing-DRlaxqrI.mjs +93 -0
- package/dist/agent-context-DFEgYjEQ.mjs +2 -0
- package/dist/agent-memory-vGhlfZBx.mjs +34 -0
- package/dist/ai-CJtbWfB9.mjs +31 -0
- package/dist/{ai-audit-Bn_BfMFS.mjs → ai-audit-C0BJNqZZ.mjs} +3 -3
- package/dist/ai-gateway-BQtv3U3x.mjs +80 -0
- package/dist/ai-search-DGU1Y5By.mjs +79 -0
- package/dist/ai-security-CFTaYk_X.mjs +10 -0
- package/dist/alerting-1hun27JC.mjs +56 -0
- package/dist/analytics-DXUSjvzT.mjs +17 -0
- package/dist/analytics_engine-CQsnL09C.mjs +4 -0
- package/dist/ansi-styles-kSC6bEIq.mjs +2 -0
- package/dist/{api-security-gB1FHrHq.mjs → api-security-BXhrfR6-.mjs} +57 -57
- package/dist/argo-LPUCTnee.mjs +14 -0
- package/dist/artifacts-Dt6easua.mjs +43 -0
- package/dist/{audit-logs-CpPUjMUP.mjs → audit-logs-CVznAM2Z.mjs} +2 -2
- package/dist/auth-CGLsxbc6.mjs +2 -0
- package/dist/auth-CrmVwfpJ.mjs +2 -0
- package/dist/{auth-7Fk7PVIC.mjs → auth-eQr-kQCH.mjs} +1 -1
- package/dist/{auth-token-DeG33BMQ.mjs → auth-token-pNQrX_9O.mjs} +1 -1
- package/dist/autoconfig-sD7Frryg.mjs +532 -0
- package/dist/{banner-Xk4xBN8U.mjs → banner-D03JEqRs.mjs} +1 -1
- package/dist/basin-catalog-ZQICw-zF.mjs +46 -0
- package/dist/billing-Dy1-dV_B.mjs +23 -0
- package/dist/bot-management-DTgPwL7O.mjs +9 -0
- package/dist/botnet-feed-xb98Cj3Y.mjs +11 -0
- package/dist/brand-protection-Ck3okE2k.mjs +27 -0
- package/dist/browser-run-DJGJSzFX.mjs +42 -0
- package/dist/build-B1L6xrgC.mjs +2 -0
- package/dist/build-HmSXqjGn.mjs +2 -0
- package/dist/builds-CYxcZtkG.mjs +71 -0
- package/dist/cache-D9tSfovH.mjs +45 -0
- package/dist/{certificate-authorities-NUQzCDK8.mjs → certificate-authorities-CpiveTFC.mjs} +3 -3
- package/dist/cf-BxsXrVeh.mjs +18 -0
- package/dist/chunk-DSGVRFIS-C1_SEtRK.mjs +2 -0
- package/dist/chunk-NDZDTP46-Bjx_wtJe.mjs +361 -0
- package/dist/chunk-TAK63GWY-DdMktrgc.mjs +319 -0
- package/dist/chunk-U6NEESU5-DqqRCaWH.mjs +2 -0
- package/dist/chunk-WMOON6TZ-C0dmPHpM.mjs +2 -0
- package/dist/{cli-aChy8ou_.mjs → cli-DeJc9U8z.mjs} +1 -1
- package/dist/cli-exit-CstFZ1eJ.mjs +2 -0
- package/dist/{client-certificates-qgLpBn8t.mjs → client-certificates-CF6YZyvP.mjs} +6 -6
- package/dist/{client-side-security-DZO6Xw14.mjs → client-side-security-BLoe9kS5.mjs} +14 -14
- package/dist/{cloud-connector-C7vGDCzX.mjs → cloud-connector-DXRUHsjt.mjs} +3 -3
- package/dist/cloudflared--1Ws1RJy.mjs +2 -0
- package/dist/cloudforce-one-CBLxXi6v.mjs +447 -0
- package/dist/{command-07vhr56i.mjs → command-83uVfXh9.mjs} +1 -1
- package/dist/{command-Cdx___59.mjs → command-BDe67N_n.mjs} +1 -1
- package/dist/command-BlIb6RR2.mjs +2 -0
- package/dist/{command-dAYWrB5y.mjs → command-Bpzp8Mz2.mjs} +1 -1
- package/dist/{command-eM48o0J6.mjs → command-BvfKhMl7.mjs} +1 -1
- package/dist/command-CG6RvZs0.mjs +2 -0
- package/dist/{command-D0MKPucK.mjs → command-CcuLC6CJ.mjs} +1 -1
- package/dist/{command-Ds5OVat3.mjs → command-Cu7dcaHT.mjs} +1 -1
- package/dist/{command-BsmF3J_l.mjs → command-D3fyhdy-.mjs} +1 -1
- package/dist/{command-Dv6YavZa.mjs → command-DUhX8Dcr.mjs} +1 -1
- package/dist/{command-maDJWJgu.mjs → command-Dh7RmjFu.mjs} +1 -1
- package/dist/{command-C2pNxAeL.mjs → command-DwXiDOeH.mjs} +1 -1
- package/dist/{command-CrtDkZNs.mjs → command-UiHLJ8Ji.mjs} +1 -1
- package/dist/command-_rqD0hXF.mjs +2 -0
- package/dist/{command-B6TpINoN.mjs → command-oNVwyjGB.mjs} +1 -1
- package/dist/{completions-D0280hul.mjs → completions-D06AO7A8.mjs} +12 -12
- package/dist/connector-interrupts-DelTmNyw.mjs +6 -0
- package/dist/connector-telemetry-events-BwxR3G8d.mjs +6 -0
- package/dist/connector-telemetry-snapshots-Bqq-hrpJ.mjs +6 -0
- package/dist/connectors-D-m3rEpk.mjs +15 -0
- package/dist/containers-CVNfEjJs.mjs +78 -0
- package/dist/containers-DeoZyeQe.mjs +375 -0
- package/dist/{content-scan-BCtWBCqd.mjs → content-scan-W0BNzbQp.mjs} +7 -7
- package/dist/{context-CquYYyS3.mjs → context-q7UaYK69.mjs} +2 -2
- package/dist/{cps-C8BbnbuD.mjs → cps-BZ6hqRb5.mjs} +3 -3
- package/dist/{csamScanner-CsJ9H2fA.mjs → csamScanner-Bo1t3CLh.mjs} +3 -3
- package/dist/ct-alerting-E03faC7p.mjs +5 -0
- package/dist/{custom-certificates-CA8HqolM.mjs → custom-certificates-CUySSPzi.mjs} +7 -7
- package/dist/{custom-csrs-D0P2vWJE.mjs → custom-csrs-gNpWkJPQ.mjs} +5 -5
- package/dist/{custom-hostnames-CzYMChbh.mjs → custom-hostnames-abGBAbx7.mjs} +12 -12
- package/dist/{custom-nameservers-Cet3oF56.mjs → custom-nameservers-BgNXol1P.mjs} +5 -5
- package/dist/{custom-pages-DUkHIaTP.mjs → custom-pages-DMKX3aoD.mjs} +10 -10
- package/dist/d1-CE08YqYk.mjs +93 -0
- package/dist/{dcv-delegation-BkdRVEAH.mjs → dcv-delegation-B5YUEWu0.mjs} +2 -2
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-CWNm1-5v.mjs +2 -0
- package/dist/deploy-context-Dr6bxNcB.mjs +56 -0
- package/dist/deploy-input-Cc0_2QlW.mjs +2 -0
- package/dist/{dev-BHkVwAea.mjs → dev-ZA8itQE7.mjs} +2 -2
- package/dist/diagnostics-UMbG6m4n.mjs +15 -0
- package/dist/dialog-D4Y9ocuF.mjs +2 -0
- package/dist/discover-DIDEGKo3.mjs +2 -0
- package/dist/discover-P20XeGBF.mjs +2 -0
- package/dist/dist-BHEmAAHr.mjs +487 -0
- package/dist/dist-uRuGmkMB.mjs +60 -0
- package/dist/dls-DIl16mLp.mjs +17 -0
- package/dist/{dns-BLNa0GrP.mjs → dns-QUpgljRG.mjs} +63 -63
- package/dist/{dns-firewall-ChCvC5rT.mjs → dns-firewall-BZwJXHLj.mjs} +9 -9
- package/dist/dot-prop-IITUZ2XW-BnPfnQkb.mjs +2 -0
- package/dist/dotenv-DpXaxfho.mjs +4 -0
- package/dist/dry-run-DRj2_uV3.mjs +2 -0
- package/dist/durable-objects-BCj4ykpU.mjs +6 -0
- package/dist/{email-auth-C28s03aI.mjs → email-auth-DlHIYhCk.mjs} +3 -3
- package/dist/{email-routing-Ci-xjXIN.mjs → email-routing-UKVS4DYy.mjs} +22 -22
- package/dist/email-security-CZjfRIg0.mjs +158 -0
- package/dist/{email-sending-kTVAlVKO.mjs → email-sending-Dquc880C.mjs} +22 -22
- package/dist/error-sanitization-DE_zSrXw.mjs +2 -0
- package/dist/error-sanitization-DOCQ9Ykh.mjs +2 -0
- package/dist/fieldExtractors-BbwDRquU.mjs +9 -0
- package/dist/{firewall-BND3qSY2.mjs → firewall--mTfDnCJ.mjs} +17 -17
- package/dist/flagship-cfoSwwM9.mjs +28 -0
- package/dist/{fraud-DgyYv_CC.mjs → fraud-Dcsq3EYK.mjs} +3 -3
- package/dist/{generate-VxmGG8BF.mjs → generate-CeeWW3eX.mjs} +1 -1
- package/dist/generate-D80-1GnZ.mjs +2 -0
- package/dist/{google-tag-gateway-v3p7murv.mjs → google-tag-gateway-DPKSkZQi.mjs} +3 -3
- package/dist/gt-3bcLGJ7V.mjs +3 -0
- package/dist/{healthchecks-CByb4qYA.mjs → healthchecks-D78hIIBC.mjs} +10 -10
- package/dist/{hostnames-3CqeMF5g.mjs → hostnames-sF999-6H.mjs} +5 -5
- package/dist/{hyperdrive-CmyYTE-K.mjs → hyperdrive-qWACKfA4.mjs} +10 -10
- package/dist/iam-Bvg_PayW.mjs +52 -0
- package/dist/images-DI_lEZ4L.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/init-1w_mcgk3.mjs +43 -0
- package/dist/intel-BxElBUMP.mjs +76 -0
- package/dist/interactive-BW9T1D1q.mjs +48 -0
- package/dist/interactive-DGUWZ2Gk.mjs +2 -0
- package/dist/{ips-WWvPwSBc.mjs → ips-DWoaKxi7.mjs} +2 -2
- package/dist/k2-tFjaftl-.mjs +11 -0
- package/dist/{keyless-certificates-DqILy3t9.mjs → keyless-certificates-BrvxHU4J.mjs} +6 -6
- package/dist/keys-DcwTYKRf.mjs +4 -0
- package/dist/kv-htXS-7uP.mjs +15 -0
- package/dist/{lazy-command--5YpWUVY.mjs → lazy-command-BDiIwpss.mjs} +1 -1
- package/dist/{leaked-credential-checks-C0U1oYM5.mjs → leaked-credential-checks-bvGrLOmQ.mjs} +8 -8
- package/dist/lifecycle-oud60haK.mjs +2 -0
- package/dist/{load-balancers-BJKI9lm7.mjs → load-balancers-BNTUt4yG.mjs} +40 -40
- package/dist/local-DlDumOSC.mjs +2 -0
- package/dist/{local-rYpzEQb-.mjs → local-DlT72Xpn.mjs} +1 -1
- package/dist/{local-runtime-DZTTIe6x.mjs → local-runtime-CokO6qaX.mjs} +1 -1
- package/dist/{login-bnylLTit.mjs → login-BGF_I_LT.mjs} +1 -1
- package/dist/login-Ccw-mYwT.mjs +2 -0
- package/dist/logo-matches-tE8LTKgg.mjs +6 -0
- package/dist/logos-Bj845Mcw.mjs +7 -0
- package/dist/logpush-Cs8JdvKi.mjs +46 -0
- package/dist/{logs-c3b3USyS.mjs → logs-C92XZvNu.mjs} +11 -11
- package/dist/magic-cloud-networking-hNp5MMw-.mjs +71 -0
- package/dist/magic-network-monitoring-68GuWAnv.mjs +36 -0
- package/dist/magic-transit-DNd7gu4j.mjs +383 -0
- package/dist/managed-defense-B_wCAuFD.mjs +18 -0
- package/dist/{managed-transforms-DcYAvqTe.mjs → managed-transforms-DZdxHPOh.mjs} +4 -4
- package/dist/{matches-hnU16rSJ.mjs → matches-B65CkflD.mjs} +3 -3
- package/dist/mcp-DrJW5ayK.mjs +32 -0
- package/dist/mesh-DfVzYTn1.mjs +26 -0
- package/dist/metadata-Df5kCWJv.mjs +2 -0
- package/dist/{migrate-BNvUWrjy.mjs → migrate-CZNq63Uj.mjs} +1 -1
- package/dist/{monetization-Dsqj9DCA.mjs → monetization-BGaI8CMO.mjs} +9 -9
- package/dist/mtls-certificates-BsU2emDD.mjs +13 -0
- package/dist/network-BEMD8P0U.mjs +50 -0
- package/dist/network-interconnects-DMu_fcbo.mjs +68 -0
- package/dist/o11y-C1a4gDGF.mjs +93 -0
- package/dist/{oauth-CeZ3d_dB.mjs → oauth-Bj5Ne1o8.mjs} +1 -1
- package/dist/oauth-clients-p4Etdqy_.mjs +16 -0
- package/dist/{oauth-w0fWmrwU.mjs → oauth-mspHHU5U.mjs} +1 -1
- package/dist/{oauth-scopes-CxpRD6d7.mjs → oauth-scopes-B2IabFza.mjs} +2 -2
- package/dist/open-PCXX3ZDZ-D55O2jpQ.mjs +4 -0
- package/dist/{organization-DNieJ1xJ.mjs → organization-CdXt7AVZ.mjs} +16 -16
- package/dist/{organizations-BIXPmTy5.mjs → organizations-5S6xEp7T.mjs} +2 -2
- package/dist/{origin-ca-certificates-dVJvSIH8.mjs → origin-ca-certificates-_VJAoK1D.mjs} +5 -5
- package/dist/{origin-post-quantum-encryption-CO6tDW1t.mjs → origin-post-quantum-encryption-GcldDsT2.mjs} +3 -3
- package/dist/{origin-tls-client-auth-DeTY8aN2.mjs → origin-tls-client-auth-DZHld9fA.mjs} +14 -14
- package/dist/output-BOe-3AQG.mjs +2 -0
- package/dist/{page-rules-DA552Ra4.mjs → page-rules-o1tAMMsD.mjs} +7 -7
- package/dist/pages-CmiOhjSl.mjs +54 -0
- package/dist/pay-per-crawl-BsnOxGYU.mjs +38 -0
- package/dist/pay-per-use-BXWMCSyE.mjs +33 -0
- package/dist/pipelines-DWLQC0F6.mjs +44 -0
- package/dist/precursor-B6DjBib6.mjs +4 -0
- package/dist/previews-dUKEBGSM.mjs +4 -0
- package/dist/process-2wmDCy17.mjs +2 -0
- package/dist/{progress-TLUEIYE6.mjs → progress-BtkTVcHI.mjs} +1 -1
- package/dist/prompt-RlgRrmbm.mjs +3 -0
- package/dist/queries-yLwoJRHV.mjs +9 -0
- package/dist/queues-CnJRaE1o.mjs +57 -0
- package/dist/r2-CuC6-zQX.mjs +128 -0
- package/dist/{radar-Bez6k9Dw.mjs → radar-DrQLcbkq.mjs} +150 -150
- package/dist/{raw-fetch-DNxNCoeP.mjs → raw-fetch-B4NvWuZD.mjs} +1 -1
- package/dist/realtime-CjsnzHxD.mjs +172 -0
- package/dist/registrar-BgOsxTnX.mjs +43 -0
- package/dist/registrar-sandbox-3ikBD9fB.mjs +56 -0
- package/dist/{registry-CsSLAAOE.mjs → registry-CHowrQsZ.mjs} +1 -1
- package/dist/reporting-hE127s5r.mjs +14 -0
- package/dist/request-headers-DiJeDAn1.mjs +2 -0
- package/dist/request-tracers-BCwLxmPN.mjs +4 -0
- package/dist/resolve-CaTBV-c6.mjs +2 -0
- package/dist/resolve-DCGSzUDQ.mjs +2 -0
- package/dist/resource-sharing-2qvWUuMa.mjs +40 -0
- package/dist/resource-tagging-Dwx7iL3v.mjs +4 -0
- package/dist/rules-DxVQ6jIg.mjs +18 -0
- package/dist/rulesets-Cdh8YjI9.mjs +37 -0
- package/dist/rum-a4CMq4Qu.mjs +30 -0
- package/dist/run-BvHwWWUX.mjs +2 -0
- package/dist/run-CkbrPJPx.mjs +2 -0
- package/dist/schema-elj12WOx.mjs +2 -0
- package/dist/schema-flags-BzoBGPWk.mjs +5 -0
- package/dist/scim-B8XlXl8v.mjs +18 -0
- package/dist/secrets-store-Cqhedh_i.mjs +24 -0
- package/dist/{security-insights-DVAqroY5.mjs → security-insights-le2-DteL.mjs} +20 -20
- package/dist/{security-txt-rfrrdiZV.mjs → security-txt-cCArWXur.mjs} +4 -4
- package/dist/{session-B6mFkaVZ.mjs → session-C1BhT1ZJ.mjs} +1 -1
- package/dist/shared-BPjcpXuA.mjs +2 -0
- package/dist/{smart-shield-_HA814Im.mjs → smart-shield-Csyh8hwB.mjs} +11 -11
- package/dist/{snippets-mRelEw0p.mjs → snippets-DUWx25q6.mjs} +8 -8
- package/dist/source-mXUcrTVw.mjs +6 -0
- package/dist/spawn-IysxuTNW.mjs +10 -0
- package/dist/{spectrum-BwtOiaDw.mjs → spectrum-Da3UYSOR.mjs} +11 -11
- package/dist/{speed-DmqsZtiJ.mjs → speed-NxlMnB2e.mjs} +11 -11
- package/dist/sql-CNdHAlQ8.mjs +4 -0
- package/dist/src-JfLDUxFr.mjs +125 -0
- package/dist/{ssl-DCvfveJB.mjs → ssl-BtaX2WEJ.mjs} +16 -16
- package/dist/startup-profile-B2l0ChVu.mjs +2 -0
- package/dist/startup-profile-CdJWgNjd.mjs +29 -0
- package/dist/{state-BPwdiNO_.mjs → state-BDSvdSdP.mjs} +1 -1
- package/dist/state-JB4_BU1o.mjs +2 -0
- package/dist/stream-C1Ijjzn4.mjs +102 -0
- package/dist/submit-MdkuU_Pt.mjs +4 -0
- package/dist/{tags-Djw0e-4j.mjs → tags-CA1xMM96.mjs} +2 -2
- package/dist/telemetry-BsYO3nxG.mjs +2 -0
- package/dist/{telemetry-DrFNujdx.mjs → telemetry-Cm39QJ-M.mjs} +1 -1
- package/dist/{tenant-tc1wb_ym.mjs → tenant-BB6Oszcl.mjs} +5 -5
- package/dist/{tenant-custom-nameservers-XCbXryBZ.mjs → tenant-custom-nameservers-BsbgYAEo.mjs} +4 -4
- package/dist/{theme-BIWQFmZ0.mjs → theme-CQ_TYifs.mjs} +2 -2
- package/dist/{tools-CB4NleeJ.mjs → tools-CSc5DmFi.mjs} +1 -1
- package/dist/tunnels-CRFtyHWz.mjs +29 -0
- package/dist/turnstile-DBXWo_Xe.mjs +33 -0
- package/dist/{ui-D1hhIDIs.mjs → ui-YmjF66Ct.mjs} +1 -1
- package/dist/update-check-C2oVEbXx.mjs +2 -0
- package/dist/update-check-CMXSdres.mjs +2 -0
- package/dist/update-check-worker.mjs +1 -1
- package/dist/url-info-t-XAs0Mk.mjs +4 -0
- package/dist/{url-normalization-Dbypc9wz.mjs → url-normalization-Cs4F8e0a.mjs} +4 -4
- package/dist/url-scanner-CBIoDbTx.mjs +16 -0
- package/dist/{user-3uwLMH78.mjs → user-CevdOMoa.mjs} +52 -52
- package/dist/values-CjNlkbIh.mjs +4 -0
- package/dist/vectorize-9d9tPmg5.mjs +32 -0
- package/dist/version-BdVUXLnK.mjs +2 -0
- package/dist/waiting-rooms--5WmrWb3.mjs +53 -0
- package/dist/{web-assets-BfEprX1S.mjs → web-assets-BHot_MU8.mjs} +30 -30
- package/dist/{web3-DNbp5sZw.mjs → web3-CYfWAF6b.mjs} +13 -13
- package/dist/workers-S17M0n3h.mjs +40 -0
- package/dist/workers-builds-Dw7ho3So.mjs +14 -0
- package/dist/workers-for-platforms-A3yjyLh3.mjs +40 -0
- package/dist/{workers-vpc-LVfayM2-.mjs → workers-vpc-BZ2xXtC3.mjs} +7 -7
- package/dist/workflows-BgGrVpSR.mjs +43 -0
- package/dist/{wrangler-migration-B0mKHqGd.mjs → wrangler-migration-C6FKHER1.mjs} +1 -1
- package/dist/{zaraz-BY60ZUQ4.mjs → zaraz-BsD2dMI3.mjs} +11 -11
- package/dist/zero-trust-CA3iGQbG.mjs +837 -0
- package/dist/{zone-BVDW2UGd.mjs → zone-D2M4EZD0.mjs} +2 -2
- package/dist/{zones-CcZL0YQp.mjs → zones-BoOC_JzC.mjs} +43 -43
- package/package.json +33 -35
- package/dist/abuse-reports-DX5xgeka.mjs +0 -24
- package/dist/account-tags-CiKwgOWd.mjs +0 -15
- package/dist/accounts-DfXSHrkF.mjs +0 -138
- package/dist/addressing-B70NFnrX.mjs +0 -93
- package/dist/agent-context-GRiQ4zRU.mjs +0 -2
- package/dist/agent-memory-DJRquHeq.mjs +0 -34
- package/dist/ai-CP2oIS-I.mjs +0 -29
- package/dist/ai-gateway-CrrEtzUP.mjs +0 -82
- package/dist/ai-search-C4YWVTCa.mjs +0 -79
- package/dist/ai-security-Bt_fG65f.mjs +0 -10
- package/dist/alerting-CRr88fVR.mjs +0 -56
- package/dist/analytics-XqS9OP5B.mjs +0 -20
- package/dist/analytics_engine-CzmYem4f.mjs +0 -4
- package/dist/ansi-styles-eKEZXVwN.mjs +0 -2
- package/dist/argo-wFCAsYx7.mjs +0 -10
- package/dist/artifacts-qFjlNRqb.mjs +0 -43
- package/dist/auth-BmJ946bE.mjs +0 -2
- package/dist/auth-Br-t8vL_.mjs +0 -2
- package/dist/autoconfig-D-copdZG.mjs +0 -511
- package/dist/basin-catalog-CshcpsAH.mjs +0 -46
- package/dist/billing-B-xNxxiP.mjs +0 -23
- package/dist/bot-management-DhafeA2J.mjs +0 -9
- package/dist/botnet-feed-D6uCLE_D.mjs +0 -11
- package/dist/brand-protection-c3WiHbYn.mjs +0 -27
- package/dist/browser-run-D9_cwaSD.mjs +0 -46
- package/dist/build-9ihDp-Gy.mjs +0 -2
- package/dist/build-DrG6TqMw.mjs +0 -2
- package/dist/builds-Dl8if-2k.mjs +0 -71
- package/dist/cache-CIZokBjd.mjs +0 -45
- package/dist/cf-DfQfIu3q.mjs +0 -18
- package/dist/chunk-FT2NMTJB-BFqlGcem.mjs +0 -97
- package/dist/chunk-KKDV4JPS-B_t8sDTz.mjs +0 -2
- package/dist/chunk-U6NEESU5-BhF4rnpx.mjs +0 -2
- package/dist/chunk-WMOON6TZ-B8xCqjB1.mjs +0 -2
- package/dist/cli-exit-Dqoo6Jgb.mjs +0 -2
- package/dist/cloudflared-CEfZhSQH.mjs +0 -2
- package/dist/cloudforce-one-CE7y5UkF.mjs +0 -447
- package/dist/command-BWC9CbE7.mjs +0 -2
- package/dist/command-C65Ed0o9.mjs +0 -2
- package/dist/command-DHdWKtqx.mjs +0 -2
- package/dist/connector-interrupts-CVjFhU-C.mjs +0 -6
- package/dist/connector-telemetry-events-Bu3LKP6T.mjs +0 -6
- package/dist/connector-telemetry-snapshots-BbDTIc06.mjs +0 -6
- package/dist/connectors-DGtx-rPI.mjs +0 -15
- package/dist/containers-CzNbBrYE.mjs +0 -239
- package/dist/containers-DEFrbNgO.mjs +0 -78
- package/dist/ct-alerting-CYsQZO2H.mjs +0 -5
- package/dist/d1-B2duXfH2.mjs +0 -41
- package/dist/deploy-BdWBEbLj.mjs +0 -2
- package/dist/deploy-input-LmLfj6kI.mjs +0 -2
- package/dist/diagnostics-9Wj5UWBL.mjs +0 -15
- package/dist/dialog-Dpi-UVbz.mjs +0 -2
- package/dist/discover-BYkHr5Ja.mjs +0 -2
- package/dist/discover-t6E9lpf3.mjs +0 -2
- package/dist/dist-Cpb7_h4N.mjs +0 -57
- package/dist/dist-D1iG7guo.mjs +0 -366
- package/dist/dist-zep5OXGt.mjs +0 -48
- package/dist/dls-Caya7FZc.mjs +0 -17
- package/dist/dot-prop-IITUZ2XW-BsZYdILY.mjs +0 -2
- package/dist/dotenv-CcQjGlV0.mjs +0 -4
- package/dist/dry-run-p9Q7nMZ5.mjs +0 -2
- package/dist/durable-objects-DuRbdp7N.mjs +0 -6
- package/dist/email-security-DPU6xvI9.mjs +0 -158
- package/dist/error-sanitization-BbEw--0B.mjs +0 -2
- package/dist/error-sanitization-p5rmb53x.mjs +0 -2
- package/dist/fieldExtractors-ceaXu4zD.mjs +0 -9
- package/dist/flagship-DfxbNzgx.mjs +0 -28
- package/dist/generate-9P8Q_RiO.mjs +0 -2
- package/dist/gt-KlYHH-UC.mjs +0 -2
- package/dist/iam-CV_M681j.mjs +0 -52
- package/dist/images-DaLPjskW.mjs +0 -71
- package/dist/init-CBKifk5L.mjs +0 -39
- package/dist/intel-MpftjuPB.mjs +0 -76
- package/dist/interactive-D80kbTap.mjs +0 -32
- package/dist/interactive-mJQ_IrGd.mjs +0 -2
- package/dist/k2-D0QYUFqT.mjs +0 -13
- package/dist/keys-DhX4AcqF.mjs +0 -4
- package/dist/kv-DLUfUL0_.mjs +0 -15
- package/dist/lifecycle-Cyc3fmyN.mjs +0 -2
- package/dist/local-DkYQiSQQ.mjs +0 -2
- package/dist/login-CnE2Ii_F.mjs +0 -2
- package/dist/logo-matches-DFZybI0C.mjs +0 -6
- package/dist/logos-Da2YtqSN.mjs +0 -7
- package/dist/logpush-Q7WIEHS1.mjs +0 -46
- package/dist/magic-cloud-networking-BoyDmFq3.mjs +0 -71
- package/dist/magic-network-monitoring-BkUbpMUp.mjs +0 -36
- package/dist/magic-transit-4-THD45G.mjs +0 -383
- package/dist/managed-defense-CTMqSp6z.mjs +0 -18
- package/dist/mcp-kZX4irfN.mjs +0 -32
- package/dist/mesh-Dxzvvso6.mjs +0 -26
- package/dist/metadata-C33s4rc-.mjs +0 -2
- package/dist/mtls-certificates-BSbMwIna.mjs +0 -13
- package/dist/network-interconnects-osO_vAPu.mjs +0 -73
- package/dist/network-mEnXTEiG.mjs +0 -50
- package/dist/oauth-clients-CWPHi-Yn.mjs +0 -16
- package/dist/observability-BxL2RqWZ.mjs +0 -80
- package/dist/open-PCXX3ZDZ-C7gpxSsl.mjs +0 -4
- package/dist/output-ClYel9WX.mjs +0 -2
- package/dist/pages-B0x7tidm.mjs +0 -54
- package/dist/pay-per-crawl-DoTg9VP7.mjs +0 -65
- package/dist/pay-per-use-yRO2QBfe.mjs +0 -6
- package/dist/pipelines-CQxrm9ao.mjs +0 -44
- package/dist/precursor-FiGYDRV9.mjs +0 -4
- package/dist/previews-BthBa50j.mjs +0 -4
- package/dist/prompt-Ck_1PCHm.mjs +0 -3
- package/dist/queries-C0RRdol7.mjs +0 -9
- package/dist/queues-sLgvjsRP.mjs +0 -57
- package/dist/r2-C2PllL6i.mjs +0 -125
- package/dist/realtime-D-HSXznX.mjs +0 -172
- package/dist/registrar-DwHrG9QR.mjs +0 -43
- package/dist/registrar-sandbox-jNukmzQP.mjs +0 -56
- package/dist/reporting-DolhAb10.mjs +0 -14
- package/dist/request-headers-Lhj314mk.mjs +0 -2
- package/dist/request-tracers-w72hKc33.mjs +0 -4
- package/dist/resolve-CGKqk7q8.mjs +0 -2
- package/dist/resolve-Djf2xgBx.mjs +0 -2
- package/dist/resource-sharing-DTrSkqI4.mjs +0 -40
- package/dist/resource-tagging-aURR4fIJ.mjs +0 -4
- package/dist/rules-C8a7cV-W.mjs +0 -18
- package/dist/rulesets-RJ6yBefy.mjs +0 -37
- package/dist/rum-Bk1dPW4p.mjs +0 -30
- package/dist/run-BJOAPmsz.mjs +0 -2
- package/dist/run-iFM5TxtQ.mjs +0 -2
- package/dist/schema-flags-PagOq-G2.mjs +0 -5
- package/dist/schema-v7mOxMdx.mjs +0 -2
- package/dist/scim-C0FmjkkV.mjs +0 -18
- package/dist/secrets-store-cG_5RMzK.mjs +0 -24
- package/dist/shared-BqsWoApw.mjs +0 -2
- package/dist/source-38bULAR8.mjs +0 -6
- package/dist/spawn-BzPhcLJI.mjs +0 -10
- package/dist/src--KDGqL5N.mjs +0 -109
- package/dist/startup-profile-BCe9k9sR.mjs +0 -17
- package/dist/startup-profile-WrwRyMwH.mjs +0 -2
- package/dist/state-a1tTOGjm.mjs +0 -2
- package/dist/stream-aroClJeD.mjs +0 -102
- package/dist/submit-BBKhoKT8.mjs +0 -4
- package/dist/telemetry-DoBQOGRk.mjs +0 -2
- package/dist/tunnels-C2FTswb6.mjs +0 -29
- package/dist/turnstile-BV4Mdd-j.mjs +0 -33
- package/dist/update-check-CFt6cMOi.mjs +0 -2
- package/dist/update-check-Dtj9fzNe.mjs +0 -2
- package/dist/url-info-CeegsDK7.mjs +0 -4
- package/dist/url-scanner-BFXMrpJF.mjs +0 -16
- package/dist/values-BTncDc3U.mjs +0 -4
- package/dist/vectorize-CtMAtx8r.mjs +0 -32
- package/dist/version-oN1bmOgM.mjs +0 -2
- package/dist/waiting-rooms-1xDvjF13.mjs +0 -53
- package/dist/workers-DK_JgS4Y.mjs +0 -38
- package/dist/workers-builds-CdhwmmsQ.mjs +0 -14
- package/dist/workers-for-platforms-CP6IqxrK.mjs +0 -42
- package/dist/workflows-CA5K8FFb.mjs +0 -43
- package/dist/zero-trust-CQNohO7_.mjs +0 -821
- /package/dist/{Page-DAgOEX17.mjs → Page-BShsqCXr.mjs} +0 -0
- /package/dist/{alerts-D3iKtzoN.mjs → alerts-BSON-vFh.mjs} +0 -0
- /package/dist/{args-CXgkQKK7.mjs → args-CfbYkeXd.mjs} +0 -0
- /package/dist/{autorag-pvRfDwne.mjs → autorag-kNrLiqDX.mjs} +0 -0
- /package/dist/{body-parser-NjzJZMOV.mjs → body-parser-DkHKPkJ7.mjs} +0 -0
- /package/dist/{brands-DP5Ndir1.mjs → brands-bBJgbbOH.mjs} +0 -0
- /package/dist/{browser-extension-Dee2Y1qn.mjs → browser-extension-C1_fcw7h.mjs} +0 -0
- /package/dist/{clear-qLKPlJqb.mjs → clear-BW9vLgI3.mjs} +0 -0
- /package/dist/{cli-types-_Kmwfpnp.mjs → cli-types-9oYmRTHJ.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-_aCmWeZx.mjs → connector-telemetry-events-latest-BQdOvbWh.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-CffEplpV.mjs → connector-telemetry-snapshots-latest-CtdN_dGu.mjs} +0 -0
- /package/dist/{delegate-CCGgla7X.mjs → delegate-Tgfxa-MZ.mjs} +0 -0
- /package/dist/{domain-info-BQh9XapD.mjs → domain-info-BkcBcyfF.mjs} +0 -0
- /package/dist/{errors-cuuW88wR.mjs → errors-_sob7Ihu.mjs} +0 -0
- /package/dist/{health--10IShMi.mjs → health-CTaCeVyC.mjs} +0 -0
- /package/dist/{input-validation-0CeePPHp.mjs → input-validation-D7z60HJH.mjs} +0 -0
- /package/dist/{internal-BUs583vv.mjs → internal-BYS7hO8c.mjs} +0 -0
- /package/dist/{live-VCSxA0N9.mjs → live-BJE_YWE1.mjs} +0 -0
- /package/dist/{project-settings-Bf6rReo1.mjs → project-settings-nBMEx1f-.mjs} +0 -0
- /package/dist/{r2-data-catalog-Bg7zq1IB.mjs → r2-data-catalog-BRo-Rx2I.mjs} +0 -0
- /package/dist/{rate-limit-analytics-D3q0mGv2.mjs → rate-limit-analytics-BiRyU0Xd.mjs} +0 -0
- /package/dist/{rate-limits-BIxlBuMn.mjs → rate-limits-Cr2zpncO.mjs} +0 -0
- /package/dist/{ready-CAgelFmC.mjs → ready-B3pLxnjc.mjs} +0 -0
- /package/dist/{recent-submissions-B3TOjNmk.mjs → recent-submissions-JLOvuZq-.mjs} +0 -0
- /package/dist/{refute-BZNkFpBB.mjs → refute-Dp3VodMn.mjs} +0 -0
- /package/dist/{scan-logo-StecHiaf.mjs → scan-logo-3Zr6CDJB.mjs} +0 -0
- /package/dist/{scan-page-B4adr-vD.mjs → scan-page-CxeudOzj.mjs} +0 -0
- /package/dist/{search-Devngw4M.mjs → search-B_P5ZTQj.mjs} +0 -0
- /package/dist/{signed-url-ChR5eXXd.mjs → signed-url-D5RwvrQq.mjs} +0 -0
- /package/dist/{submission-info-BGb81HZN.mjs → submission-info-_t78q2OE.mjs} +0 -0
- /package/dist/{total-queries-_wa6KxEl.mjs → total-queries-CPrKEciQ.mjs} +0 -0
- /package/dist/{tracked-domains-BesKGqfI.mjs → tracked-domains-CTRItgFT.mjs} +0 -0
- /package/dist/{verify-CYM5GlPu.mjs → verify-5KcvRk-q.mjs} +0 -0
|
@@ -0,0 +1,837 @@
|
|
|
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,i,t as a}from"./context-q7UaYK69.mjs";import{t as o}from"./output-BOe-3AQG.mjs";import{t as s}from"./dry-run-DRj2_uV3.mjs";import{t as c}from"./progress-BtkTVcHI.mjs";import{t as l}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-DkHKPkJ7.mjs";import{n as m,t as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v}from"./prompt-RlgRrmbm.mjs";import{t as y}from"./cli-types-9oYmRTHJ.mjs";import{n as ee,t as te}from"./raw-fetch-B4NvWuZD.mjs";function b(e){return e.usage(`$0 zero-trust access applications create
|
|
3
|
+
|
|
4
|
+
Adds a new application to Access.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Add an Access application`,builder:b,handler:async t=>l({command:`zero-trust access applications create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Creating`,async()=>l.zeroTrust.access.applications.create({body:e,account_or_zone:u,account_or_zone_id:f}));o(n,{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function S(e){return e.usage(`$0 zero-trust access applications delete <app-id>
|
|
5
|
+
|
|
6
|
+
Deletes an application from Access.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <app-id>`,describe:`Delete an Access application`,builder:S,handler:async t=>l({command:`zero-trust access applications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}`,pathParams:{"account-or-zone":String(n),"app-id":String(t[`app-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=d:t.accountId=d,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}let f=await c(`Deleting`,async()=>l.zeroTrust.access.applications.delete({account_or_zone:u,account_or_zone_id:d,app_id:t[`app-id`]}));o(f,{successLabel:`Deleted`})})};function w(e){return e.usage(`$0 zero-trust access applications get <app-id>
|
|
8
|
+
|
|
9
|
+
Fetches information about an Access application.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <app-id>`,describe:`Get an Access application`,builder:w,handler:async t=>l({command:`zero-trust access applications get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}`,pathParams:{"account-or-zone":String(n),"app-id":String(t[`app-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();u===`zones`?t.zoneId=d:t.accountId=d;let f=await c(`Loading`,async()=>l.zeroTrust.access.applications.get({account_or_zone:u,account_or_zone_id:d,app_id:t[`app-id`]}));o(f,{successLabel:`Loaded`})})};function E(e){return e.usage(`$0 zero-trust access applications list
|
|
10
|
+
|
|
11
|
+
Lists all Access applications in an account or zone.`).option(`name`,{type:`string`,description:`The name of the app.`}).option(`domain`,{type:`string`,description:`The domain of the app.`}).option(`aud`,{type:`string`,description:`The aud of the app.`}).option(`target-attributes`,{type:`string`,description:`Target Criteria attributes in key=value format.`}).option(`exact`,{type:`boolean`,description:`True for only exact string matches against passed name/domain query parameters.`}).option(`search`,{type:`string`,description:`Search for apps by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`List Access applications`,builder:E,handler:async t=>l({command:`zero-trust access applications list`,classification:{safeFlags:[`exact`,`dry-run`]}},t,async()=>{let l={name:t.name,domain:t.domain,aud:t.aud,target_attributes:t[`target-attributes`],exact:t.exact,search:t.search,page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},query:l,bodyKind:`none`});return}let u=await n(t),d=t.zone===void 0?`accounts`:`zones`,f=d===`zones`?await i({zone:t.zone},u,{quiet:t.quiet}):t.local?e:await a();d===`zones`?t.zoneId=f:t.accountId=f;let p=await c(`Loading`,async()=>u.zeroTrust.access.applications.list({account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})};function O(e){return e.usage(`$0 zero-trust access applications policies make-reusable <policy-id>
|
|
12
|
+
|
|
13
|
+
Converts an application-scoped policy to a reusable policy. The policy will no longer be exclusively scoped to the application. Further updates to the policy should go through the /accounts/{account_id}/policies/{uid} endpoint.`).positional(`policy-id`,{type:`string`,description:`The policy ID.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`make-reusable <policy-id>`,describe:`Convert an Access application policy to a reusable policy`,builder:O,handler:async t=>l({command:`zero-trust access applications policies make-reusable`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access applications policies make-reusable`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/policies/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}/make_reusable`,pathParams:{"app-id":String(t[`app-id`]??``),"policy-id":String(t[`policy-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Updating`,async()=>i.zeroTrust.access.applications.policies.makeReusable({account_id:l,app_id:t[`app-id`],policy_id:t[`policy-id`]}));o(u,{successLabel:`Updated`})})},A={command:`policies`,describe:`Operations for access.applications.policies`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.usage(`$0 zero-trust access applications policy-tests create
|
|
14
|
+
|
|
15
|
+
Starts an Access policy test.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Start Access policy test`,builder:j,handler:async t=>l({command:`zero-trust access applications policy-tests create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access applications policy-tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/policy-tests`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.applications.policyTests.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}let u=await c(`Creating`,async()=>i.zeroTrust.access.applications.policyTests.create({account_id:l}));o(u,{successLabel:`Created`})})};function N(e){return e.usage(`$0 zero-trust access applications policy-tests get <policy-test-id>
|
|
16
|
+
|
|
17
|
+
Fetches the current status of a given Access policy test.`).positional(`policy-test-id`,{type:`string`,description:`The UUID of the policy test.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <policy-test-id>`,describe:`Get the current status of a given Access policy test`,builder:N,handler:async t=>l({command:`zero-trust access applications policy-tests get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access applications policy-tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/policy-tests/${t[`policy-test-id`]==null?`<policy-test-id>`:encodeURIComponent(String(t[`policy-test-id`]))}`,pathParams:{"policy-test-id":String(t[`policy-test-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.applications.policyTests.get({account_id:l,policy_test_id:t[`policy-test-id`]}));o(u,{successLabel:`Loaded`})})};function F(e){return e.usage(`$0 zero-trust access applications policy-tests users list
|
|
18
|
+
|
|
19
|
+
Fetches a single page of user results from an Access policy test.`).option(`policy-test-id`,{type:`string`,description:`The UUID of the policy test.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`status`,{type:`string`,description:`Filter users by their policy evaluation status.`,choices:[`success`,`fail`,`error`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Get an Access policy test users page`,builder:y(F),handler:async t=>l({command:`zero-trust access applications policy-tests users list`,classification:{safeFlags:[`status`,`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],status:t.status};if(t.dryRun){let e=await r();s({command:`cf zero-trust access applications policy-tests users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/policy-tests/${t[`policy-test-id`]==null?`<policy-test-id>`:encodeURIComponent(String(t[`policy-test-id`]))}/users`,pathParams:{"policy-test-id":String(t[`policy-test-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.applications.policyTests.users.list({account_id:u,policy_test_id:t[`policy-test-id`],...i}));o(d,{successLabel:`Loaded`})})},L={command:`users`,describe:`Operations for access.applications.policy-tests.users`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`policy-tests`,describe:`Operations for access.applications.policy-tests`,builder:e=>e.command(M).command(P).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage(`$0 zero-trust access applications revoke-tokens <app-id>
|
|
20
|
+
|
|
21
|
+
Revokes all tokens issued for an application.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const B={command:`revoke-tokens <app-id>`,describe:`Revoke application tokens`,builder:z,handler:async t=>l({command:`zero-trust access applications revoke-tokens`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications revoke-tokens`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/revoke_tokens`,pathParams:{"account-or-zone":String(n),"app-id":String(t[`app-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=d:t.accountId=d,!await v({force:!!t.force,message:`This operation invalidates every service token for the app.`})){process.stderr.write(`Aborted.
|
|
22
|
+
`);return}let f=await c(`Deleting`,async()=>l.zeroTrust.access.applications.revokeTokens({account_or_zone:u,account_or_zone_id:d,app_id:t[`app-id`]}));o(f,{successLabel:`Deleted`})})};function V(e){return e.usage(`$0 zero-trust access applications settings update <app-id>
|
|
23
|
+
|
|
24
|
+
Updates Access application settings.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`allow-iframe`,{type:`boolean`,description:`Enables loading application content in an iFrame.`}).option(`skip-interstitial`,{type:`boolean`,description:`Enables automatic authentication through cloudflared.`}).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 <app-id>`,describe:`Update Access application settings`,builder:V,handler:async t=>l({command:`zero-trust access applications settings update`,classification:{safeFlags:[`allow-iframe`,`skip-interstitial`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/settings`,pathParams:{"account-or-zone":String(n),"app-id":String(t[`app-id`]??``),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({allow_iframe:t[`allow-iframe`],skip_interstitial:t[`skip-interstitial`]}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Updating`,async()=>l.zeroTrust.access.applications.settings.update({...e,account_or_zone:u,account_or_zone_id:f,app_id:t[`app-id`]}));o(n,{successLabel:`Updated`});return}let m=p({allow_iframe:t[`allow-iframe`],skip_interstitial:t[`skip-interstitial`]}),h=await c(`Updating`,async()=>l.zeroTrust.access.applications.settings.update({...m,account_or_zone:u,account_or_zone_id:f,app_id:t[`app-id`]}));o(h,{successLabel:`Updated`})})},U={command:`settings`,describe:`Operations for access.applications.settings`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 zero-trust access applications short-lived-certificates create <app-id>
|
|
25
|
+
|
|
26
|
+
Generates a new short-lived certificate CA and public key.`).positional(`app-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`create <app-id>`,describe:`Create a short-lived certificate CA`,builder:W,handler:async t=>l({command:`zero-trust access applications short-lived-certificates create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications short-lived-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(n),"app-id":String(t[`app-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();u===`zones`?t.zoneId=d:t.accountId=d;let f=await c(`Creating`,async()=>l.zeroTrust.access.applications.shortLivedCertificates.create({account_or_zone:u,account_or_zone_id:d,app_id:t[`app-id`]}));o(f,{successLabel:`Created`})})};function K(e){return e.usage(`$0 zero-trust access applications short-lived-certificates delete <app-id>
|
|
27
|
+
|
|
28
|
+
Deletes a short-lived certificate CA.`).positional(`app-id`,{type:`string`,description:`UUID.`,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 q={command:`delete <app-id>`,describe:`Delete a short-lived certificate CA`,builder:K,handler:async t=>l({command:`zero-trust access applications short-lived-certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications short-lived-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(n),"app-id":String(t[`app-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=d:t.accountId=d,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
29
|
+
`);return}let f=await c(`Deleting`,async()=>l.zeroTrust.access.applications.shortLivedCertificates.delete({account_or_zone:u,account_or_zone_id:d,app_id:t[`app-id`]}));o(f,{successLabel:`Deleted`})})};function J(e){return e.usage(`$0 zero-trust access applications short-lived-certificates get <app-id>
|
|
30
|
+
|
|
31
|
+
Fetches a short-lived certificate CA and its public key.`).positional(`app-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get <app-id>`,describe:`Get a short-lived certificate CA`,builder:J,handler:async t=>l({command:`zero-trust access applications short-lived-certificates get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications short-lived-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(n),"app-id":String(t[`app-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();u===`zones`?t.zoneId=d:t.accountId=d;let f=await c(`Loading`,async()=>l.zeroTrust.access.applications.shortLivedCertificates.get({account_or_zone:u,account_or_zone_id:d,app_id:t[`app-id`]}));o(f,{successLabel:`Loaded`})})};function X(e){return e.usage(`$0 zero-trust access applications short-lived-certificates list
|
|
32
|
+
|
|
33
|
+
Lists short-lived certificate CAs and their public keys.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`list`,describe:`List short-lived certificate CAs`,builder:X,handler:async t=>l({command:`zero-trust access applications short-lived-certificates list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let l={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications short-lived-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps/ca`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},query:l,bodyKind:`none`});return}let u=await n(t),d=t.zone===void 0?`accounts`:`zones`,f=d===`zones`?await i({zone:t.zone},u,{quiet:t.quiet}):t.local?e:await a();d===`zones`?t.zoneId=f:t.accountId=f;let p=await c(`Loading`,async()=>u.zeroTrust.access.applications.shortLivedCertificates.list({account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})},Q={command:`short-lived-certificates`,describe:`Operations for access.applications.short-lived-certificates`,builder:e=>e.command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.usage(`$0 zero-trust access applications update <app-id>
|
|
34
|
+
|
|
35
|
+
Updates an Access application.`).positional(`app-id`,{type:`string`,description:`App ID`,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 re={command:`update <app-id>`,describe:`Update an Access application`,builder:ne,handler:async t=>l({command:`zero-trust access applications update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}`,pathParams:{"account-or-zone":String(n),"app-id":String(t[`app-id`]??``),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Updating`,async()=>l.zeroTrust.access.applications.update({body:e,account_or_zone:u,account_or_zone_id:f,app_id:t[`app-id`]}));o(n,{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function ie(e){return e.usage(`$0 zero-trust access applications user-policy-checks list
|
|
36
|
+
|
|
37
|
+
Tests if a specific user has permission to access an application.`).option(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Test Access policies`,builder:ie,handler:async t=>l({command:`zero-trust access applications user-policy-checks list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access applications user-policy-checks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/apps/${t[`app-id`]==null?`<app-id>`:encodeURIComponent(String(t[`app-id`]))}/user_policy_checks`,pathParams:{"account-or-zone":String(n),"app-id":String(t[`app-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();u===`zones`?t.zoneId=d:t.accountId=d;let f=await c(`Loading`,async()=>l.zeroTrust.access.applications.userPolicyChecks.list({account_or_zone:u,account_or_zone_id:d,app_id:t[`app-id`]}));o(f,{successLabel:`Loaded`})})},oe={command:`user-policy-checks`,describe:`Operations for access.applications.user-policy-checks`,builder:e=>e.command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},se={command:`applications`,describe:`Operations for access.applications`,builder:e=>e.command(x).command(C).command(T).command(D).command(B).command(re).command(A).command(R).command(U).command(Q).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.usage(`$0 zero-trust access custom-pages create
|
|
38
|
+
|
|
39
|
+
Create a custom page`).option(`app-count`,{type:`number`,description:`Number of apps the custom page is assigned to.`}).option(`contract-version`,{type:`number`,description:`Contract version of the page's Liquid template. Present (>= 1) marks a sanitized template; absent or 0 marks a legacy page served verbatim.`}).option(`custom-html`,{type:`string`,description:`Custom page HTML.`}).option(`name`,{type:`string`,description:`Custom page name.`}).option(`type`,{type:`string`,description:`Custom page type.`,choices:[`identity_denied`,`forbidden`,`login`,`interstitial`]}).option(`uid`,{type:`string`,description:`UUID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const le={command:`create`,describe:`Create a custom page`,builder:ce,handler:async t=>l({command:`zero-trust access custom-pages create`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access custom-pages create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/custom_pages`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({app_count:t[`app-count`],contract_version:t[`contract-version`],custom_html:m(t[`custom-html`],`custom-html`,`text`),name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`),uid:m(t.uid,`uid`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.customPages.create({body:e,account_id:l}));o(n,{successLabel:`Created`});return}t[`custom-html`]===void 0&&(t[`custom-html`]=await g(`custom-html`,`Custom page HTML.`)),t.name===void 0&&(t.name=await g(`name`,`Custom page name.`)),t.type===void 0&&(t.type=await _(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=p({app_count:t[`app-count`],contract_version:t[`contract-version`],custom_html:m(t[`custom-html`],`custom-html`,`text`),name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`),uid:m(t.uid,`uid`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.access.customPages.create({body:u,account_id:l}));o(f,{successLabel:`Created`})})};function ue(e){return e.usage(`$0 zero-trust access custom-pages delete <custom-page-id>
|
|
40
|
+
|
|
41
|
+
Delete a custom page`).positional(`custom-page-id`,{type:`string`,description:`UUID.`,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 de={command:`delete <custom-page-id>`,describe:`Delete a custom page`,builder:ue,handler:async t=>l({command:`zero-trust access custom-pages delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access custom-pages delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/custom_pages/${t[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(t[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(t[`custom-page-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
42
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.access.customPages.delete({account_id:l,custom_page_id:t[`custom-page-id`]}));o(u,{successLabel:`Deleted`})})};function fe(e){return e.usage(`$0 zero-trust access custom-pages get <custom-page-id>
|
|
43
|
+
|
|
44
|
+
Fetches a custom page and also returns its HTML.`).positional(`custom-page-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`get <custom-page-id>`,describe:`Get a custom page`,builder:fe,handler:async t=>l({command:`zero-trust access custom-pages get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/custom_pages/${t[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(t[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(t[`custom-page-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.customPages.get({account_id:l,custom_page_id:t[`custom-page-id`]}));o(u,{successLabel:`Loaded`})})};function me(e){return e.usage(`$0 zero-trust access custom-pages list
|
|
45
|
+
|
|
46
|
+
List custom pages`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`list`,describe:`List custom pages`,builder:me,handler:async t=>l({command:`zero-trust access custom-pages list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust access custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/custom_pages`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.customPages.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function ge(e){return e.usage(`$0 zero-trust access custom-pages update <custom-page-id>
|
|
47
|
+
|
|
48
|
+
Update a custom page`).positional(`custom-page-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`app-count`,{type:`number`,description:`Number of apps the custom page is assigned to.`}).option(`contract-version`,{type:`number`,description:`Contract version of the page's Liquid template. Present (>= 1) marks a sanitized template; absent or 0 marks a legacy page served verbatim.`}).option(`custom-html`,{type:`string`,description:`Custom page HTML.`}).option(`name`,{type:`string`,description:`Custom page name.`}).option(`type`,{type:`string`,description:`Custom page type.`,choices:[`identity_denied`,`forbidden`,`login`,`interstitial`]}).option(`uid`,{type:`string`,description:`UUID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`update <custom-page-id>`,describe:`Update a custom page`,builder:ge,handler:async t=>l({command:`zero-trust access custom-pages update`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/custom_pages/${t[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(t[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(t[`custom-page-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({app_count:t[`app-count`],contract_version:t[`contract-version`],custom_html:m(t[`custom-html`],`custom-html`,`text`),name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`),uid:m(t.uid,`uid`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.access.customPages.update({body:e,account_id:l,custom_page_id:t[`custom-page-id`]}));o(n,{successLabel:`Updated`});return}t[`custom-html`]===void 0&&(t[`custom-html`]=await g(`custom-html`,`Custom page HTML.`)),t.name===void 0&&(t.name=await g(`name`,`Custom page name.`)),t.type===void 0&&(t.type=await _(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=p({app_count:t[`app-count`],contract_version:t[`contract-version`],custom_html:m(t[`custom-html`],`custom-html`,`text`),name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`),uid:m(t.uid,`uid`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.access.customPages.update({body:u,account_id:l,custom_page_id:t[`custom-page-id`]}));o(f,{successLabel:`Updated`})})};function ve(e){return e.usage(`$0 zero-trust access custom-pages validate
|
|
49
|
+
|
|
50
|
+
Validate a Liquid template and return its errors and warnings without persisting it.`).option(`template`,{type:`string`,description:`The Liquid template to validate.`}).option(`type`,{type:`string`,description:`Custom page type.`,choices:[`identity_denied`,`forbidden`,`login`,`interstitial`]}).option(`contract-version`,{type:`number`,description:`Contract version to validate against; omit for the latest.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A template to validate without persisting it.`})}const ye={command:`validate`,describe:`Validate a custom page template`,builder:ve,handler:async t=>l({command:`zero-trust access custom-pages validate`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access custom-pages validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/custom_pages/validate`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({template:m(t.template,`template`,`text`),type:m(t.type,`type`,`text`),version:t[`contract-version`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.customPages.validate({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.template===void 0&&(t.template=await g(`template`,`The Liquid template to validate.`)),t.type===void 0&&(t.type=await _(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=p({template:m(t.template,`template`,`text`),type:m(t.type,`type`,`text`),version:t[`contract-version`]}),f=await c(`Creating`,async()=>i.zeroTrust.access.customPages.validate({...u,account_id:l}));o(f,{successLabel:`Created`})})},be={command:`custom-pages`,describe:`Operations for access.custom-pages`,builder:e=>e.command(le).command(de).command(pe).command(he).command(_e).command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.usage(`$0 zero-trust access infrastructure audit-ssh-settings get
|
|
51
|
+
|
|
52
|
+
Retrieve all Zero Trust Audit SSH and SSH with Access for Infrastructure settings for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get`,describe:`Get Zero Trust SSH settings`,builder:xe,handler:async t=>l({command:`zero-trust access infrastructure audit-ssh-settings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access infrastructure audit-ssh-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/audit_ssh_settings`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.infrastructure.auditSshSettings.get({account_id:l}));o(u,{successLabel:`Loaded`})})};function Ce(e){return e.usage(`$0 zero-trust access infrastructure audit-ssh-settings rotate-seed
|
|
53
|
+
|
|
54
|
+
Rotate the SSH account seed that generates the host key identity when connecting through the Cloudflare SSH Proxy.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`rotate-seed`,describe:`Rotate Zero Trust SSH account seed`,builder:Ce,handler:async t=>l({command:`zero-trust access infrastructure audit-ssh-settings rotate-seed`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access infrastructure audit-ssh-settings rotate-seed`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/audit_ssh_settings/rotate_seed`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.access.infrastructure.auditSshSettings.rotateSeed({account_id:l}));o(u,{successLabel:`Created`})})};function Te(e){return e.usage(`$0 zero-trust access infrastructure audit-ssh-settings update
|
|
55
|
+
|
|
56
|
+
Update Zero Trust Audit SSH and SSH with Access for Infrastructure settings for an account.`).option(`public-key`,{type:`string`,description:`Provide the Base64-encoded HPKE public key that encrypts SSH session logs. See https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#enable-ssh-command-logging.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`update`,describe:`Update Zero Trust SSH settings`,builder:Te,handler:async t=>l({command:`zero-trust access infrastructure audit-ssh-settings update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access infrastructure audit-ssh-settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/audit_ssh_settings`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({public_key:m(t[`public-key`],`public-key`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.access.infrastructure.auditSshSettings.update({...e,account_id:l}));o(n,{successLabel:`Updated`});return}t[`public-key`]===void 0&&(t[`public-key`]=await g(`public-key`,`Provide the Base64-encoded HPKE public key that encrypts SSH session logs. See https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#enable-ssh-command-logging.`));let u=p({public_key:m(t[`public-key`],`public-key`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.access.infrastructure.auditSshSettings.update({...u,account_id:l}));o(f,{successLabel:`Updated`})})},De={command:`audit-ssh-settings`,describe:`Operations for access.infrastructure.audit-ssh-settings`,builder:e=>e.command(Se).command(we).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.usage(`$0 zero-trust access infrastructure ssh-ca create
|
|
57
|
+
|
|
58
|
+
Adds a new SSH Certificate Authority (CA).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`create`,describe:`Add a new SSH Certificate Authority (CA)`,builder:Oe,handler:async t=>l({command:`zero-trust access infrastructure ssh-ca create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access infrastructure ssh-ca create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/gateway_ca`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.access.infrastructure.sshCa.create({account_id:l}));o(u,{successLabel:`Created`})})};function Ae(e){return e.usage(`$0 zero-trust access infrastructure ssh-ca delete <certificate-id>
|
|
59
|
+
|
|
60
|
+
Deletes an SSH Certificate Authority.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,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 je={command:`delete <certificate-id>`,describe:`Delete an SSH Certificate Authority (CA)`,builder:Ae,handler:async t=>l({command:`zero-trust access infrastructure ssh-ca delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access infrastructure ssh-ca delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/gateway_ca/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
61
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.access.infrastructure.sshCa.delete({account_id:l,certificate_id:t[`certificate-id`]}));o(u,{successLabel:`Deleted`})})};function Me(e){return e.usage(`$0 zero-trust access infrastructure ssh-ca list
|
|
62
|
+
|
|
63
|
+
Lists SSH Certificate Authorities (CA).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`list`,describe:`List SSH Certificate Authorities (CA)`,builder:Me,handler:async t=>l({command:`zero-trust access infrastructure ssh-ca list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access infrastructure ssh-ca list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/gateway_ca`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.infrastructure.sshCa.list({account_id:l}));o(u,{successLabel:`Loaded`})})},Pe={command:`ssh-ca`,describe:`Operations for access.infrastructure.ssh-ca`,builder:e=>e.command(ke).command(je).command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fe={command:`infrastructure`,describe:`Operations for access.infrastructure`,builder:e=>e.command(De).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(e){return e.usage(`$0 zero-trust access logs access-requests list
|
|
64
|
+
|
|
65
|
+
Gets a list of Access authentication audit logs for an account.`).option(`limit`,{type:`number`,description:`The maximum number of log entries to retrieve.`}).option(`direction`,{type:`string`,description:`The chronological sorting order for the logs.`,choices:[`desc`,`asc`]}).option(`since`,{type:`string`,description:`The earliest event timestamp to query.`}).option(`until`,{type:`string`,description:`The latest event timestamp to query.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`email`,{type:`string`,description:"Filter by user email. Match mode is controlled by `emailOp` (preferred) or the legacy `email_exact` flag.\n- Default (no `emailOp`, `email_exact=false` or unset): substring match — `email=@example.com` returns all events with that domain.\n- Exact match: set `emailOp=eq` (preferred) or `email_exact=true` — e.g. `email=user@example.com&email_exact=true` returns only that user.\n- Explicit substring match: set `emailOp=contains` (without `email_exact=true`). When both are set, `email_exact=true` takes precedence and the match is exact.\n- Exclusion: set `emailOp=neq`. With `email_exact=true` this is an exact-value exclusion; without it, a fuzzy substring exclusion."}).option(`email-exact`,{type:`boolean`,description:"When true, `email` is matched exactly instead of substring matching."}).option(`user-id`,{type:`string`,description:"Deprecated. Accepted for backward compatibility but no longer applied\nas a filter. Use `email` instead."}).option(`allowed-op`,{type:`string`,description:"Operator for the `allowed` filter.",choices:[`eq`,`neq`]}).option(`country-code-op`,{type:`string`,description:"Operator for the `country_code` filter.",choices:[`eq`,`neq`]}).option(`app-type-op`,{type:`string`,description:"Operator for the `app_type` filter.",choices:[`eq`,`neq`]}).option(`app-uid-op`,{type:`string`,description:"Operator for the `app_uid` filter.",choices:[`eq`,`neq`]}).option(`ray-id-op`,{type:`string`,description:"Operator for the `ray_id` filter.",choices:[`eq`,`neq`]}).option(`email-op`,{type:`string`,description:"Operator for the `email` filter.\n`contains` performs a substring (case-sensitive) match. When `email_exact=true`\nis also set, `email_exact` takes precedence and `contains` is ignored.",choices:[`eq`,`neq`,`contains`]}).option(`idp-op`,{type:`string`,description:"Operator for the `idp` filter.",choices:[`eq`,`neq`]}).option(`non-identity-op`,{type:`string`,description:"Operator for the `non_identity` filter.",choices:[`eq`,`neq`]}).option(`user-id-op`,{type:`string`,description:"Deprecated. Accepted for backward compatibility but no longer applied\nas a filter (the `user_id` parameter is itself deprecated).",choices:[`eq`,`neq`]}).option(`fields`,{type:`string`,description:`Comma-separated list of fields to include in the response.
|
|
66
|
+
When omitted, all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`list`,describe:`Get Access authentication logs`,builder:y(Ie),handler:async t=>l({command:`zero-trust access logs access-requests list`,classification:{safeFlags:[`direction`,`email-exact`,`allowed-op`,`country-code-op`,`app-type-op`,`app-uid-op`,`ray-id-op`,`email-op`,`idp-op`,`non-identity-op`,`user-id-op`,`dry-run`]}},t,async()=>{let i={limit:t.limit,direction:t.direction,since:t.since,until:t.until,page:t.page,per_page:t[`per-page`],email:t.email,email_exact:t[`email-exact`],user_id:t[`user-id`],allowedOp:t[`allowed-op`],country_codeOp:t[`country-code-op`],app_typeOp:t[`app-type-op`],app_uidOp:t[`app-uid-op`],ray_idOp:t[`ray-id-op`],emailOp:t[`email-op`],idpOp:t[`idp-op`],non_identityOp:t[`non-identity-op`],user_idOp:t[`user-id-op`],fields:t.fields};if(t.dryRun){let e=await r();s({command:`cf zero-trust access logs access-requests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/logs/access_requests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.logs.accessRequests.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},Re={command:`access-requests`,describe:`Operations for access.logs.access-requests`,builder:e=>e.command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ze(e){return e.usage(`$0 zero-trust access logs jit-requests get <knock-request-id>
|
|
67
|
+
|
|
68
|
+
Gets an account-scoped Access JIT request summary and its lifecycle events in chronological order.`).positional(`knock-request-id`,{type:`string`,description:`Knock request ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`get <knock-request-id>`,describe:`Get an Access JIT request log`,builder:ze,handler:async t=>l({command:`zero-trust access logs jit-requests get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access logs jit-requests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/logs/jit_requests/${t[`knock-request-id`]==null?`<knock-request-id>`:encodeURIComponent(String(t[`knock-request-id`]))}`,pathParams:{"knock-request-id":String(t[`knock-request-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.logs.jitRequests.get({account_id:l,knock_request_id:t[`knock-request-id`]}));o(u,{successLabel:`Loaded`})})};function Ve(e){return e.usage(`$0 zero-trust access logs jit-requests list
|
|
69
|
+
|
|
70
|
+
Lists account-wide Access JIT request logs reconstructed from request lifecycle events.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`status`,{type:`string`,description:"JIT request status. `SPENT` is deprecated and interpreted as `APPROVED`.",choices:[`PENDING`,`APPROVED`,`DENIED`,`CANCELED`,`SPENT`]}).option(`search`,{type:`string`,description:`Case-insensitive search over request ID, requester email, application audience, and application hostname.`}).option(`since`,{type:`string`,description:`The earliest request timestamp to query. Defaults to 366 days before the current time.`}).option(`until`,{type:`string`,description:`The latest request timestamp to query. Defaults to the current time.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const He={command:`list`,describe:`List Access JIT request logs`,builder:y(Ve),handler:async t=>l({command:`zero-trust access logs jit-requests list`,classification:{safeFlags:[`status`,`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],status:t.status,search:t.search,since:t.since,until:t.until};if(t.dryRun){let e=await r();s({command:`cf zero-trust access logs jit-requests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/logs/jit_requests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.logs.jitRequests.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},Ue={command:`jit-requests`,describe:`Operations for access.logs.jit-requests`,builder:e=>e.command(Be).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function We(e){return e.usage(`$0 zero-trust access logs scim updates list
|
|
71
|
+
|
|
72
|
+
Lists Access SCIM update logs that maintain a record of updates made to User and Group resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).option(`limit`,{type:`number`,description:`The maximum number of update logs to retrieve.`}).option(`direction`,{type:`string`,description:`The chronological order used to sort the logs.`,choices:[`desc`,`asc`]}).option(`since`,{type:`string`,description:`the timestamp of the earliest update log.`}).option(`until`,{type:`string`,description:`the timestamp of the most-recent update log.`}).option(`idp-id`,{type:`string`,description:`The unique Id of the IdP that has SCIM enabled.`,demandOption:!0}).option(`status`,{type:`string`,description:`The status of the SCIM request.`}).option(`resource-type`,{type:`string`,description:`The resource type of the SCIM request.`}).option(`request-method`,{type:`string`,description:`The request method of the SCIM request.`}).option(`resource-user-email`,{type:`string`,description:"The email address of the SCIM User resource. Pass once for a single\nlookup (`?resource_user_email=A`) or repeat the parameter\n(`?resource_user_email=A&resource_user_email=B`) to filter by multiple\nemails in one request."}).option(`resource-group-name`,{type:`string`,description:"The display name of the SCIM Group resource. Pass once for a single\nlookup (`?resource_group_name=A`) or repeat the parameter\n(`?resource_group_name=A&resource_group_name=B`) to filter by multiple\ngroup names in one request."}).option(`cf-resource-id`,{type:`string`,description:"The unique Cloudflare-generated Id of the SCIM resource. Pass once for\na single lookup (`?cf_resource_id=A`) or repeat the parameter\n(`?cf_resource_id=A&cf_resource_id=B`) to filter by multiple resources\nin one request."}).option(`idp-resource-id`,{type:`string`,description:"The IdP-generated Id of the SCIM resource. Pass once for a single\nlookup (`?idp_resource_id=A`) or repeat the parameter\n(`?idp_resource_id=A&idp_resource_id=B`) to filter by multiple\nresources in one request."}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ge={command:`list`,describe:`List Access SCIM update logs`,builder:y(We),handler:async t=>l({command:`zero-trust access logs scim updates list`,classification:{safeFlags:[`direction`,`dry-run`]}},t,async()=>{let i={limit:t.limit,direction:t.direction,since:t.since,until:t.until,idp_id:t[`idp-id`],status:t.status,resource_type:t[`resource-type`],request_method:t[`request-method`],resource_user_email:t[`resource-user-email`],resource_group_name:t[`resource-group-name`],cf_resource_id:t[`cf-resource-id`],idp_resource_id:t[`idp-resource-id`],page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust access logs scim updates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/logs/scim/updates`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.logs.scim.updates.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},Ke={command:`updates`,describe:`Operations for access.logs.scim.updates`,builder:e=>e.command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},qe={command:`scim`,describe:`Operations for access.logs.scim`,builder:e=>e.command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Je={command:`logs`,describe:`Operations for access.logs`,builder:e=>e.command(Re).command(Ue).command(qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ye(e){return e.usage(`$0 zero-trust access mfa authenticator-catalog list
|
|
73
|
+
|
|
74
|
+
Returns a list of Authenticator Device AAGUIDs for MFA configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xe={command:`list`,describe:`List authenticator device AAGUIDs`,builder:Ye,handler:async t=>l({command:`zero-trust access mfa authenticator-catalog list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access mfa authenticator-catalog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/authenticator_device_aaguids`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.mfa.authenticatorCatalog.list({account_id:l}));o(u,{successLabel:`Loaded`})})},Ze={command:`authenticator-catalog`,describe:`Operations for access.mfa.authenticator-catalog`,builder:e=>e.command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Qe={command:`mfa`,describe:`Operations for access.mfa`,builder:e=>e.command(Ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $e(e){return e.usage(`$0 zero-trust access mtls-certificates create
|
|
75
|
+
|
|
76
|
+
Adds a new mTLS root certificate to Access.`).option(`associated-hostnames`,{type:`string`,array:!0,description:`The hostnames of the applications that will use this certificate.`}).option(`certificate`,{type:`string`,description:`The certificate content.`}).option(`name`,{type:`string`,description:`The name of the certificate.`}).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 et={command:`create`,describe:`Add an mTLS certificate`,builder:$e,handler:async t=>l({command:`zero-trust access mtls-certificates create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/certificates`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({associated_hostnames:t[`associated-hostnames`],certificate:m(t.certificate,`certificate`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Creating`,async()=>l.zeroTrust.access.mtlsCertificates.create({...e,account_or_zone:u,account_or_zone_id:f}));o(n,{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await g(`certificate`,`The certificate content.`)),t.name===void 0&&(t.name=await g(`name`,`The name of the certificate.`));let h=p({associated_hostnames:t[`associated-hostnames`],certificate:m(t.certificate,`certificate`,`text`),name:m(t.name,`name`,`text`)}),_=await c(`Creating`,async()=>l.zeroTrust.access.mtlsCertificates.create({...h,account_or_zone:u,account_or_zone_id:f}));o(_,{successLabel:`Created`})})};function tt(e){return e.usage(`$0 zero-trust access mtls-certificates delete <certificate-id>
|
|
77
|
+
|
|
78
|
+
Deletes an mTLS certificate.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,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 nt={command:`delete <certificate-id>`,describe:`Delete an mTLS certificate`,builder:tt,handler:async t=>l({command:`zero-trust access mtls-certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"account-or-zone":String(n),"certificate-id":String(t[`certificate-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=d:t.accountId=d,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
79
|
+
`);return}let f=await c(`Deleting`,async()=>l.zeroTrust.access.mtlsCertificates.delete({account_or_zone:u,account_or_zone_id:d,certificate_id:t[`certificate-id`]}));o(f,{successLabel:`Deleted`})})};function rt(e){return e.usage(`$0 zero-trust access mtls-certificates get <certificate-id>
|
|
80
|
+
|
|
81
|
+
Fetches a single mTLS certificate.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const it={command:`get <certificate-id>`,describe:`Get an mTLS certificate`,builder:rt,handler:async t=>l({command:`zero-trust access mtls-certificates get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access mtls-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"account-or-zone":String(n),"certificate-id":String(t[`certificate-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();u===`zones`?t.zoneId=d:t.accountId=d;let f=await c(`Loading`,async()=>l.zeroTrust.access.mtlsCertificates.get({account_or_zone:u,account_or_zone_id:d,certificate_id:t[`certificate-id`]}));o(f,{successLabel:`Loaded`})})};function at(e){return e.usage(`$0 zero-trust access mtls-certificates list
|
|
82
|
+
|
|
83
|
+
Lists all mTLS root certificates.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`list`,describe:`List mTLS certificates`,builder:at,handler:async t=>l({command:`zero-trust access mtls-certificates list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let l={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access mtls-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/certificates`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},query:l,bodyKind:`none`});return}let u=await n(t),d=t.zone===void 0?`accounts`:`zones`,f=d===`zones`?await i({zone:t.zone},u,{quiet:t.quiet}):t.local?e:await a();d===`zones`?t.zoneId=f:t.accountId=f;let p=await c(`Loading`,async()=>u.zeroTrust.access.mtlsCertificates.list({account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})};function st(e){return e.usage(`$0 zero-trust access mtls-certificates settings get
|
|
84
|
+
|
|
85
|
+
List all mTLS hostname settings for this account or zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ct={command:`get`,describe:`List all mTLS hostname settings`,builder:st,handler:async t=>l({command:`zero-trust access mtls-certificates settings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access mtls-certificates settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/certificates/settings`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();u===`zones`?t.zoneId=d:t.accountId=d;let f=await c(`Loading`,async()=>l.zeroTrust.access.mtlsCertificates.settings.get({account_or_zone:u,account_or_zone_id:d}));o(f,{successLabel:`Loaded`})})};function lt(e){return e.usage(`$0 zero-trust access mtls-certificates settings update
|
|
86
|
+
|
|
87
|
+
Updates an mTLS certificate's hostname settings.`).option(`settings`,{type:`string`,description:`The settings field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ut={command:`update`,describe:`Update an mTLS certificate's hostname settings`,builder:lt,handler:async t=>l({command:`zero-trust access mtls-certificates settings update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access mtls-certificates settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/certificates/settings`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({settings:f(t.settings,`settings`)}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,m=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=m:t.accountId=m,t.body){let e=d(t.body),n=await c(`Updating`,async()=>l.zeroTrust.access.mtlsCertificates.settings.update({...e,account_or_zone:u,account_or_zone_id:m}));o(n,{successLabel:`Updated`});return}if(t.settings===void 0)throw Error(`--settings is required (or pass --body with this field set).`);let h=p({settings:f(t.settings,`settings`)}),g=await c(`Updating`,async()=>l.zeroTrust.access.mtlsCertificates.settings.update({...h,account_or_zone:u,account_or_zone_id:m}));o(g,{successLabel:`Updated`})})},dt={command:`settings`,describe:`Operations for access.mtls-certificates.settings`,builder:e=>e.command(ct).command(ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ft(e){return e.usage(`$0 zero-trust access mtls-certificates update <certificate-id>
|
|
88
|
+
|
|
89
|
+
Updates a configured mTLS certificate.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`associated-hostnames`,{type:`string`,array:!0,description:`The hostnames of the applications that will use this certificate.`}).option(`name`,{type:`string`,description:`The name of the certificate.`}).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 pt={command:`update <certificate-id>`,describe:`Update an mTLS certificate`,builder:ft,handler:async t=>l({command:`zero-trust access mtls-certificates update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access mtls-certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"account-or-zone":String(n),"certificate-id":String(t[`certificate-id`]??``),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({associated_hostnames:t[`associated-hostnames`],name:m(t.name,`name`,`text`)}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Updating`,async()=>l.zeroTrust.access.mtlsCertificates.update({...e,account_or_zone:u,account_or_zone_id:f,certificate_id:t[`certificate-id`]}));o(n,{successLabel:`Updated`});return}if(t[`associated-hostnames`]===void 0)throw Error(`--associated-hostnames is required (or pass --body with this field set).`);let h=p({associated_hostnames:t[`associated-hostnames`],name:m(t.name,`name`,`text`)}),g=await c(`Updating`,async()=>l.zeroTrust.access.mtlsCertificates.update({...h,account_or_zone:u,account_or_zone_id:f,certificate_id:t[`certificate-id`]}));o(g,{successLabel:`Updated`})})},mt={command:`mtls-certificates`,describe:`Operations for access.mtls-certificates`,builder:e=>e.command(et).command(nt).command(it).command(ot).command(pt).command(dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ht(e){return e.usage(`$0 zero-trust access policies create
|
|
90
|
+
|
|
91
|
+
Creates a new Access reusable policy.`).option(`decision`,{type:`string`,description:`The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.`,choices:[`allow`,`deny`,`non_identity`,`bypass`]}).option(`exclude`,{type:`string`,description:`Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`include`,{type:`string`,description:`Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name of the Access policy.`}).option(`require`,{type:`string`,description:`Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. 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 gt={command:`create`,describe:`Create an Access reusable policy`,builder:ht,handler:async t=>l({command:`zero-trust access policies create`,classification:{safeFlags:[`decision`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/policies`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({decision:m(t.decision,`decision`,`text`),exclude:f(t.exclude,`exclude`),include:f(t.include,`include`),name:m(t.name,`name`,`text`),require:f(t.require,`require`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.policies.create({body:e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.decision===void 0&&(t.decision=await _(`decision`,`The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.`,[`allow`,`deny`,`non_identity`,`bypass`])),t.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await g(`name`,`The name of the Access policy.`));let u=p({decision:m(t.decision,`decision`,`text`),exclude:f(t.exclude,`exclude`),include:f(t.include,`include`),name:m(t.name,`name`,`text`),require:f(t.require,`require`)}),h=await c(`Creating`,async()=>i.zeroTrust.access.policies.create({body:u,account_id:l}));o(h,{successLabel:`Created`})})};function _t(e){return e.usage(`$0 zero-trust access policies delete <policy-id>
|
|
92
|
+
|
|
93
|
+
Deletes an Access reusable policy.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy`,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 vt={command:`delete <policy-id>`,describe:`Delete an Access reusable policy`,builder:_t,handler:async t=>l({command:`zero-trust access policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/policies/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
94
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.access.policies.delete({account_id:l,policy_id:t[`policy-id`]}));o(u,{successLabel:`Deleted`})})};function yt(e){return e.usage(`$0 zero-trust access policies get <policy-id>
|
|
95
|
+
|
|
96
|
+
Fetches a single Access reusable policy.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bt={command:`get <policy-id>`,describe:`Get an Access reusable policy`,builder:yt,handler:async t=>l({command:`zero-trust access policies get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/policies/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.policies.get({account_id:l,policy_id:t[`policy-id`]}));o(u,{successLabel:`Loaded`})})};function xt(e){return e.usage(`$0 zero-trust access policies list
|
|
97
|
+
|
|
98
|
+
Lists Access reusable policies.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`list`,describe:`List Access reusable policies`,builder:xt,handler:async t=>l({command:`zero-trust access policies list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust access policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/policies`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.policies.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function Ct(e){return e.usage(`$0 zero-trust access policies update <policy-id>
|
|
99
|
+
|
|
100
|
+
Updates a Access reusable policy.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy`,demandOption:!0}).option(`decision`,{type:`string`,description:`The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.`,choices:[`allow`,`deny`,`non_identity`,`bypass`]}).option(`exclude`,{type:`string`,description:`Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`include`,{type:`string`,description:`Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name of the Access policy.`}).option(`require`,{type:`string`,description:`Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. 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 wt={command:`update <policy-id>`,describe:`Update an Access reusable policy`,builder:Ct,handler:async t=>l({command:`zero-trust access policies update`,classification:{safeFlags:[`decision`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/policies/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({decision:m(t.decision,`decision`,`text`),exclude:f(t.exclude,`exclude`),include:f(t.include,`include`),name:m(t.name,`name`,`text`),require:f(t.require,`require`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.access.policies.update({body:e,account_id:l,policy_id:t[`policy-id`]}));o(n,{successLabel:`Updated`});return}if(t.decision===void 0&&(t.decision=await _(`decision`,`The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.`,[`allow`,`deny`,`non_identity`,`bypass`])),t.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await g(`name`,`The name of the Access policy.`));let u=p({decision:m(t.decision,`decision`,`text`),exclude:f(t.exclude,`exclude`),include:f(t.include,`include`),name:m(t.name,`name`,`text`),require:f(t.require,`require`)}),h=await c(`Updating`,async()=>i.zeroTrust.access.policies.update({body:u,account_id:l,policy_id:t[`policy-id`]}));o(h,{successLabel:`Updated`})})},Tt={command:`policies`,describe:`Operations for access.policies`,builder:e=>e.command(gt).command(vt).command(bt).command(St).command(wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Et(e){return e.usage(`$0 zero-trust access rule-groups create
|
|
101
|
+
|
|
102
|
+
Creates a new Access group.`).option(`exclude`,{type:`string`,description:`Rules evaluated with a NOT logical operator. To match a policy, a user cannot meet any of the Exclude rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`include`,{type:`string`,description:`Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`is-default`,{type:`boolean`,description:`Whether this is the default group`}).option(`name`,{type:`string`,description:`The name of the Access group.`}).option(`require`,{type:`string`,description:`Rules evaluated with an AND logical operator. To match a policy, a user must meet all of the Require rules. 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 Dt={command:`create`,describe:`Create an Access group`,builder:Et,handler:async t=>l({command:`zero-trust access rule-groups create`,classification:{safeFlags:[`is-default`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access rule-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/groups`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({exclude:f(t.exclude,`exclude`),include:f(t.include,`include`),is_default:t[`is-default`],name:m(t.name,`name`,`text`),require:f(t.require,`require`)}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,h=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=h:t.accountId=h,t.body){let e=d(t.body),n=await c(`Creating`,async()=>l.zeroTrust.access.ruleGroups.create({...e,account_or_zone:u,account_or_zone_id:h}));o(n,{successLabel:`Created`});return}if(t.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await g(`name`,`The name of the Access group.`));let _=p({exclude:f(t.exclude,`exclude`),include:f(t.include,`include`),is_default:t[`is-default`],name:m(t.name,`name`,`text`),require:f(t.require,`require`)}),v=await c(`Creating`,async()=>l.zeroTrust.access.ruleGroups.create({..._,account_or_zone:u,account_or_zone_id:h}));o(v,{successLabel:`Created`})})};function Ot(e){return e.usage(`$0 zero-trust access rule-groups delete <group-id>
|
|
103
|
+
|
|
104
|
+
Deletes an Access group.`).positional(`group-id`,{type:`string`,description:`UUID.`,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 kt={command:`delete <group-id>`,describe:`Delete an Access group`,builder:Ot,handler:async t=>l({command:`zero-trust access rule-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access rule-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"account-or-zone":String(n),"group-id":String(t[`group-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=d:t.accountId=d,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
105
|
+
`);return}let f=await c(`Deleting`,async()=>l.zeroTrust.access.ruleGroups.delete({account_or_zone:u,account_or_zone_id:d,group_id:t[`group-id`]}));o(f,{successLabel:`Deleted`})})};function At(e){return e.usage(`$0 zero-trust access rule-groups get <group-id>
|
|
106
|
+
|
|
107
|
+
Fetches a single Access group.`).positional(`group-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jt={command:`get <group-id>`,describe:`Get an Access group`,builder:At,handler:async t=>l({command:`zero-trust access rule-groups get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access rule-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"account-or-zone":String(n),"group-id":String(t[`group-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();u===`zones`?t.zoneId=d:t.accountId=d;let f=await c(`Loading`,async()=>l.zeroTrust.access.ruleGroups.get({account_or_zone:u,account_or_zone_id:d,group_id:t[`group-id`]}));o(f,{successLabel:`Loaded`})})};function Mt(e){return e.usage(`$0 zero-trust access rule-groups list
|
|
108
|
+
|
|
109
|
+
Lists all Access groups.`).option(`name`,{type:`string`,description:`The name of the group.`}).option(`search`,{type:`string`,description:`Search for groups by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Nt={command:`list`,describe:`List Access groups`,builder:Mt,handler:async t=>l({command:`zero-trust access rule-groups list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let l={name:t.name,search:t.search,page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access rule-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/groups`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},query:l,bodyKind:`none`});return}let u=await n(t),d=t.zone===void 0?`accounts`:`zones`,f=d===`zones`?await i({zone:t.zone},u,{quiet:t.quiet}):t.local?e:await a();d===`zones`?t.zoneId=f:t.accountId=f;let p=await c(`Loading`,async()=>u.zeroTrust.access.ruleGroups.list({account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})};function Pt(e){return e.usage(`$0 zero-trust access rule-groups update <group-id>
|
|
110
|
+
|
|
111
|
+
Updates a configured Access group.`).positional(`group-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`exclude`,{type:`string`,description:`Rules evaluated with a NOT logical operator. To match a policy, a user cannot meet any of the Exclude rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`include`,{type:`string`,description:`Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`is-default`,{type:`boolean`,description:`Whether this is the default group`}).option(`name`,{type:`string`,description:`The name of the Access group.`}).option(`require`,{type:`string`,description:`Rules evaluated with an AND logical operator. To match a policy, a user must meet all of the Require rules. 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 Ft={command:`update <group-id>`,describe:`Update an Access group`,builder:Pt,handler:async t=>l({command:`zero-trust access rule-groups update`,classification:{safeFlags:[`is-default`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access rule-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"account-or-zone":String(n),"group-id":String(t[`group-id`]??``),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({exclude:f(t.exclude,`exclude`),include:f(t.include,`include`),is_default:t[`is-default`],name:m(t.name,`name`,`text`),require:f(t.require,`require`)}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,h=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=h:t.accountId=h,t.body){let e=d(t.body),n=await c(`Updating`,async()=>l.zeroTrust.access.ruleGroups.update({...e,account_or_zone:u,account_or_zone_id:h,group_id:t[`group-id`]}));o(n,{successLabel:`Updated`});return}if(t.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await g(`name`,`The name of the Access group.`));let _=p({exclude:f(t.exclude,`exclude`),include:f(t.include,`include`),is_default:t[`is-default`],name:m(t.name,`name`,`text`),require:f(t.require,`require`)}),v=await c(`Updating`,async()=>l.zeroTrust.access.ruleGroups.update({..._,account_or_zone:u,account_or_zone_id:h,group_id:t[`group-id`]}));o(v,{successLabel:`Updated`})})},It={command:`rule-groups`,describe:`Operations for access.rule-groups`,builder:e=>e.command(Dt).command(kt).command(jt).command(Nt).command(Ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Lt(e){return e.usage(`$0 zero-trust access saml-encryption-certificates get-pem <saml-cert-set-id>
|
|
112
|
+
|
|
113
|
+
Downloads the current SAML encryption certificate's public key in PEM format for the specified certificate set. This endpoint is useful for providing the certificate to Identity Providers for SAML assertion encryption configuration.`).positional(`saml-cert-set-id`,{type:`string`,description:`UID of the SAML certificate set.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rt={command:`get-pem <saml-cert-set-id>`,describe:`Download current certificate in PEM format`,builder:Lt,handler:async t=>l({command:`zero-trust access saml-encryption-certificates get-pem`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access saml-encryption-certificates get-pem`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/saml_certificates/${t[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(t[`saml-cert-set-id`]))}/pem`,pathParams:{"saml-cert-set-id":String(t[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.samlEncryptionCertificates.getPem({account_id:l,saml_cert_set_id:t[`saml-cert-set-id`]}));o(u,{successLabel:`Loaded`})})};function zt(e){return e.usage(`$0 zero-trust access saml-encryption-certificates get <saml-cert-set-id>
|
|
114
|
+
|
|
115
|
+
Retrieves a specific SAML encryption certificate set by its UID, including both current and previous certificates if available.`).positional(`saml-cert-set-id`,{type:`string`,description:`UID of the SAML certificate set.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bt={command:`get <saml-cert-set-id>`,describe:`Get SAML certificate set`,builder:zt,handler:async t=>l({command:`zero-trust access saml-encryption-certificates get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access saml-encryption-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/saml_certificates/${t[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(t[`saml-cert-set-id`]))}`,pathParams:{"saml-cert-set-id":String(t[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.samlEncryptionCertificates.get({account_id:l,saml_cert_set_id:t[`saml-cert-set-id`]}));o(u,{successLabel:`Loaded`})})};function Vt(e){return e.usage(`$0 zero-trust access saml-encryption-certificates list
|
|
116
|
+
|
|
117
|
+
Returns a paginated list of the organization's SAML encryption certificate sets. Each certificate set includes the current and (if present) previous certificates.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`id`,{type:`string`,description:`Filter by SAML certificate set UID. Accepts a comma-separated list of UIDs.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ht={command:`list`,describe:`List SAML certificate sets`,builder:Vt,handler:async t=>l({command:`zero-trust access saml-encryption-certificates list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],id:t.id};if(t.dryRun){let e=await r();s({command:`cf zero-trust access saml-encryption-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/saml_certificates`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.samlEncryptionCertificates.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function Ut(e){return e.usage(`$0 zero-trust access saml-encryption-certificates rotate <saml-cert-set-id>
|
|
118
|
+
|
|
119
|
+
Rotates the SAML encryption certificates within the specified certificate set. This generates a new certificate and moves the current certificate to the previous slot. If a previous certificate exists, it will be deactivated and removed. This endpoint ensures zero-downtime rotation by maintaining both current and previous certificates during the transition period, allowing IdPs time to update their configurations. Automated rotation happens 30 days before a current certificate's expiration.`).positional(`saml-cert-set-id`,{type:`string`,description:`UID of the SAML certificate set to rotate.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wt={command:`rotate <saml-cert-set-id>`,describe:`Rotate SAML certificate`,builder:Ut,handler:async t=>l({command:`zero-trust access saml-encryption-certificates rotate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access saml-encryption-certificates rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/saml_certificates/${t[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(t[`saml-cert-set-id`]))}/rotate`,pathParams:{"saml-cert-set-id":String(t[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.access.samlEncryptionCertificates.rotate({account_id:l,saml_cert_set_id:t[`saml-cert-set-id`]}));o(u,{successLabel:`Created`})})},Gt={command:`saml-encryption-certificates`,describe:`Operations for access.saml-encryption-certificates`,builder:e=>e.command(Bt).command(Rt).command(Ht).command(Wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Kt(e){return e.usage(`$0 zero-trust access service-tokens create
|
|
120
|
+
|
|
121
|
+
Generates a new service token. **Note:** This is the only time you can get the Client Secret. If you lose the Client Secret, you will have to rotate the Client Secret or create a new service token.`).option(`client-secret-version`,{type:`number`,description:"A version number identifying the current `client_secret` associated with the service token. Incrementing it triggers a rotation; the previous secret will still be accepted until the time indicated by `previous_client_secret_expires_at`.",default:1}).option(`duration`,{type:`string`,description:"The duration for how long the service token will be valid. Must be in the format `300ms` or `2h45m`, or the special value `forever` for non-expiring tokens. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).",default:`8760h`}).option(`enabled`,{type:`boolean`,description:"Whether the service token is enabled. A disabled service token cannot be used to authenticate; both its current and previous `client_secret` stop being accepted, but the token itself is preserved and can be re-enabled at any time. Defaults to enabled when omitted on create."}).option(`name`,{type:`string`,description:`The name of the service token.`}).option(`previous-client-secret-expires-at`,{type:`string`,description:"The expiration of the previous `client_secret`. This can be modified at any point after a rotation. For example, you may extend it further into the future if you need more time to update services with the new secret; or move it into the past to immediately invalidate the previous token in case of compromise."}).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 qt={command:`create`,describe:`Create a service token`,builder:Kt,handler:async t=>l({command:`zero-trust access service-tokens create`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/service_tokens`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({client_secret_version:t[`client-secret-version`],duration:m(t.duration,`duration`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),previous_client_secret_expires_at:m(t[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Creating`,async()=>l.zeroTrust.access.serviceTokens.create({...e,account_or_zone:u,account_or_zone_id:f}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`The name of the service token.`));let h=p({client_secret_version:t[`client-secret-version`],duration:m(t.duration,`duration`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),previous_client_secret_expires_at:m(t[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}),_=await c(`Creating`,async()=>l.zeroTrust.access.serviceTokens.create({...h,account_or_zone:u,account_or_zone_id:f}));o(_,{successLabel:`Created`})})};function Jt(e){return e.usage(`$0 zero-trust access service-tokens delete <service-token-id>
|
|
122
|
+
|
|
123
|
+
Deletes a service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,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 Yt={command:`delete <service-token-id>`,describe:`Delete a service token`,builder:Jt,handler:async t=>l({command:`zero-trust access service-tokens delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/service_tokens/${t[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(t[`service-token-id`]))}`,pathParams:{"account-or-zone":String(n),"service-token-id":String(t[`service-token-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=d:t.accountId=d,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
124
|
+
`);return}let f=await c(`Deleting`,async()=>l.zeroTrust.access.serviceTokens.delete({account_or_zone:u,account_or_zone_id:d,service_token_id:t[`service-token-id`]}));o(f,{successLabel:`Deleted`})})};function Xt(e){return e.usage(`$0 zero-trust access service-tokens get <service-token-id>
|
|
125
|
+
|
|
126
|
+
Fetches a single service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Zt={command:`get <service-token-id>`,describe:`Get a service token`,builder:Xt,handler:async t=>l({command:`zero-trust access service-tokens get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/service_tokens/${t[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(t[`service-token-id`]))}`,pathParams:{"account-or-zone":String(n),"service-token-id":String(t[`service-token-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();u===`zones`?t.zoneId=d:t.accountId=d;let f=await c(`Loading`,async()=>l.zeroTrust.access.serviceTokens.get({account_or_zone:u,account_or_zone_id:d,service_token_id:t[`service-token-id`]}));o(f,{successLabel:`Loaded`})})};function Qt(e){return e.usage(`$0 zero-trust access service-tokens list
|
|
127
|
+
|
|
128
|
+
Lists all service tokens.`).option(`name`,{type:`string`,description:`The name of the service token.`}).option(`search`,{type:`string`,description:`Search for service tokens by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $t={command:`list`,describe:`List service tokens`,builder:Qt,handler:async t=>l({command:`zero-trust access service-tokens list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let l={name:t.name,search:t.search,page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/service_tokens`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},query:l,bodyKind:`none`});return}let u=await n(t),d=t.zone===void 0?`accounts`:`zones`,f=d===`zones`?await i({zone:t.zone},u,{quiet:t.quiet}):t.local?e:await a();d===`zones`?t.zoneId=f:t.accountId=f;let p=await c(`Loading`,async()=>u.zeroTrust.access.serviceTokens.list({account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})};function en(e){return e.usage(`$0 zero-trust access service-tokens refresh <service-token-id>
|
|
129
|
+
|
|
130
|
+
Refreshes the expiration of a service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tn={command:`refresh <service-token-id>`,describe:`Refresh a service token`,builder:en,handler:async t=>l({command:`zero-trust access service-tokens refresh`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access service-tokens refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/service_tokens/${t[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(t[`service-token-id`]))}/refresh`,pathParams:{"service-token-id":String(t[`service-token-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.refresh({account_id:l,service_token_id:t[`service-token-id`]}));o(u,{successLabel:`Created`})})};function nn(e){return e.usage(`$0 zero-trust access service-tokens rotate <service-token-id>
|
|
131
|
+
|
|
132
|
+
Generates a new Client Secret for a service token and revokes the old one.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`previous-client-secret-expires-at`,{type:`string`,description:"The expiration of the previous `client_secret`. If not provided, it defaults to the current timestamp in order to immediately expire the previous 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 rn={command:`rotate <service-token-id>`,describe:`Rotate a service token`,builder:nn,handler:async t=>l({command:`zero-trust access service-tokens rotate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access service-tokens rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/service_tokens/${t[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(t[`service-token-id`]))}/rotate`,pathParams:{"service-token-id":String(t[`service-token-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({previous_client_secret_expires_at:m(t[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.rotate({...e,account_id:l,service_token_id:t[`service-token-id`]}));o(n,{successLabel:`Created`});return}let u=p({previous_client_secret_expires_at:m(t[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.rotate({...u,account_id:l,service_token_id:t[`service-token-id`]}));o(f,{successLabel:`Created`})})};function an(e){return e.usage(`$0 zero-trust access service-tokens update <service-token-id>
|
|
133
|
+
|
|
134
|
+
Updates a configured service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`client-secret-version`,{type:`number`,description:"A version number identifying the current `client_secret` associated with the service token. Incrementing it triggers a rotation; the previous secret will still be accepted until the time indicated by `previous_client_secret_expires_at`."}).option(`duration`,{type:`string`,description:"The duration for how long the service token will be valid. Must be in the format `300ms` or `2h45m`, or the special value `forever` for non-expiring tokens. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h)."}).option(`enabled`,{type:`boolean`,description:"Whether the service token is enabled. A disabled service token cannot be used to authenticate; both its current and previous `client_secret` stop being accepted, but the token itself is preserved and can be re-enabled at any time. Defaults to enabled when omitted on create."}).option(`name`,{type:`string`,description:`The name of the service token.`}).option(`previous-client-secret-expires-at`,{type:`string`,description:"The expiration of the previous `client_secret`. This can be modified at any point after a rotation. For example, you may extend it further into the future if you need more time to update services with the new secret; or move it into the past to immediately invalidate the previous token in case of compromise."}).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 on={command:`update <service-token-id>`,describe:`Update a service token`,builder:an,handler:async t=>l({command:`zero-trust access service-tokens update`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/service_tokens/${t[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(t[`service-token-id`]))}`,pathParams:{"account-or-zone":String(n),"service-token-id":String(t[`service-token-id`]??``),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({client_secret_version:t[`client-secret-version`],duration:m(t.duration,`duration`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),previous_client_secret_expires_at:m(t[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Updating`,async()=>l.zeroTrust.access.serviceTokens.update({...e,account_or_zone:u,account_or_zone_id:f,service_token_id:t[`service-token-id`]}));o(n,{successLabel:`Updated`});return}let h=p({client_secret_version:t[`client-secret-version`],duration:m(t.duration,`duration`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),previous_client_secret_expires_at:m(t[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}),g=await c(`Updating`,async()=>l.zeroTrust.access.serviceTokens.update({...h,account_or_zone:u,account_or_zone_id:f,service_token_id:t[`service-token-id`]}));o(g,{successLabel:`Updated`})})},sn={command:`service-tokens`,describe:`Operations for access.service-tokens`,builder:e=>e.command(qt).command(Yt).command(Zt).command($t).command(tn).command(rn).command(on).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function cn(e){return e.usage(`$0 zero-trust access signing-keys get
|
|
135
|
+
|
|
136
|
+
Gets the Access key rotation settings for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ln={command:`get`,describe:`Get the Access key configuration`,builder:cn,handler:async t=>l({command:`zero-trust access signing-keys get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access signing-keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/keys`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.signingKeys.get({account_id:l}));o(u,{successLabel:`Loaded`})})};function un(e){return e.usage(`$0 zero-trust access signing-keys rotate
|
|
137
|
+
|
|
138
|
+
Perfoms a key rotation for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const dn={command:`rotate`,describe:`Rotate Access keys`,builder:un,handler:async t=>l({command:`zero-trust access signing-keys rotate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access signing-keys rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/keys/rotate`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.access.signingKeys.rotate({account_id:l}));o(u,{successLabel:`Created`})})};function fn(e){return e.usage(`$0 zero-trust access signing-keys update
|
|
139
|
+
|
|
140
|
+
Updates the Access key rotation settings for an account.`).option(`key-rotation-interval-days`,{type:`number`,description:`The number of days between key rotations.`}).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 pn={command:`update`,describe:`Update the Access key configuration`,builder:fn,handler:async t=>l({command:`zero-trust access signing-keys update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access signing-keys update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/keys`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({key_rotation_interval_days:t[`key-rotation-interval-days`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.access.signingKeys.update({...e,account_id:l}));o(n,{successLabel:`Updated`});return}if(t[`key-rotation-interval-days`]===void 0)throw Error(`--key-rotation-interval-days is required (or pass --body with this field set).`);let u=p({key_rotation_interval_days:t[`key-rotation-interval-days`]}),f=await c(`Updating`,async()=>i.zeroTrust.access.signingKeys.update({...u,account_id:l}));o(f,{successLabel:`Updated`})})},mn={command:`signing-keys`,describe:`Operations for access.signing-keys`,builder:e=>e.command(ln).command(dn).command(pn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function hn(e){return e.usage(`$0 zero-trust access tags create
|
|
141
|
+
|
|
142
|
+
Create a tag`).option(`name`,{type:`string`,description:`The name of the tag`}).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 gn={command:`create`,describe:`Create a tag`,builder:hn,handler:async t=>l({command:`zero-trust access tags create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/tags`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.tags.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}let u=p({name:m(t.name,`name`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.access.tags.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function _n(e){return e.usage(`$0 zero-trust access tags delete <tag-name>
|
|
143
|
+
|
|
144
|
+
Delete a tag`).positional(`tag-name`,{type:`string`,description:`The name of the 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 vn={command:`delete <tag-name>`,describe:`Delete a tag`,builder:_n,handler:async t=>l({command:`zero-trust access tags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/tags/${t[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(t[`tag-name`]))}`,pathParams:{"tag-name":String(t[`tag-name`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
145
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.access.tags.delete({account_id:l,tag_name:t[`tag-name`]}));o(u,{successLabel:`Deleted`})})};function yn(e){return e.usage(`$0 zero-trust access tags get <tag-name>
|
|
146
|
+
|
|
147
|
+
Get a tag`).positional(`tag-name`,{type:`string`,description:`The name of the tag`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bn={command:`get <tag-name>`,describe:`Get a tag`,builder:yn,handler:async t=>l({command:`zero-trust access tags get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/tags/${t[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(t[`tag-name`]))}`,pathParams:{"tag-name":String(t[`tag-name`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.tags.get({account_id:l,tag_name:t[`tag-name`]}));o(u,{successLabel:`Loaded`})})};function xn(e){return e.usage(`$0 zero-trust access tags list
|
|
148
|
+
|
|
149
|
+
List tags`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Sn={command:`list`,describe:`List tags`,builder:xn,handler:async t=>l({command:`zero-trust access tags list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust access tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/tags`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.tags.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function Cn(e){return e.usage(`$0 zero-trust access tags update <tag-name>
|
|
150
|
+
|
|
151
|
+
Update a tag`).positional(`tag-name`,{type:`string`,description:`The name of the tag`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the tag`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A tag`})}const wn={command:`update <tag-name>`,describe:`Update a tag`,builder:Cn,handler:async t=>l({command:`zero-trust access tags update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/tags/${t[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(t[`tag-name`]))}`,pathParams:{"tag-name":String(t[`tag-name`]??``)},bodyKind:`json`,body:t.body===void 0?p({name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.access.tags.update({...e,account_id:l,tag_name:t[`tag-name`]}));o(n,{successLabel:`Updated`});return}t.name===void 0&&(t.name=await g(`name`,`The name of the tag`));let u=p({name:m(t.name,`name`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.access.tags.update({...u,account_id:l,tag_name:t[`tag-name`]}));o(f,{successLabel:`Updated`})})},Tn={command:`tags`,describe:`Operations for access.tags`,builder:e=>e.command(gn).command(vn).command(bn).command(Sn).command(wn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function En(e){return e.usage(`$0 zero-trust access targets bulk delete
|
|
152
|
+
|
|
153
|
+
Removes one or more targets.`).option(`target-ids`,{type:`string`,array:!0,description:`List of target IDs to bulk delete`}).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 Dn={command:`delete`,describe:`Delete targets`,builder:En,handler:async t=>l({command:`zero-trust access targets bulk delete`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access targets bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/infrastructure/targets/batch_delete`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({target_ids:t[`target-ids`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.targets.bulk.delete({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`target-ids`]===void 0)throw Error(`--target-ids is required (or pass --body with this field set).`);let u=p({target_ids:t[`target-ids`]}),f=await c(`Creating`,async()=>i.zeroTrust.access.targets.bulk.delete({...u,account_id:l}));o(f,{successLabel:`Created`})})};function On(e){return e.usage(`$0 zero-trust access targets bulk replace-tags
|
|
154
|
+
|
|
155
|
+
Replaces tags for one or more existing infrastructure access targets.`).option(`items`,{type:`string`,description:`The items field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const kn={command:`replace-tags`,describe:`Replace tags on existing targets`,builder:On,handler:async t=>l({command:`zero-trust access targets bulk replace-tags`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access targets bulk replace-tags`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/infrastructure/targets/batch_tags`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({items:f(t.items,`items`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.targets.bulk.replaceTags({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.items===void 0)throw Error(`--items is required (or pass --body with this field set).`);let u=p({items:f(t.items,`items`)}),m=await c(`Creating`,async()=>i.zeroTrust.access.targets.bulk.replaceTags({...u,account_id:l}));o(m,{successLabel:`Created`})})};function An(e){return e.usage(`$0 zero-trust access targets bulk update
|
|
156
|
+
|
|
157
|
+
Adds one or more targets.`).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 jn={command:`update`,describe:`Create new targets`,builder:An,handler:async t=>l({command:`zero-trust access targets bulk update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access targets bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/infrastructure/targets/batch`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.access.targets.bulk.update({body:e,account_id:l}));o(n,{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Mn={command:`bulk`,describe:`Operations for access.targets.bulk`,builder:e=>e.command(Dn).command(kn).command(jn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Nn(e){return e.usage(`$0 zero-trust access targets create
|
|
158
|
+
|
|
159
|
+
Creates a new infrastructure access target in the account.`).option(`hostname`,{type:`string`,description:`A non-unique field that refers to a target. Case insensitive, maximum
|
|
160
|
+
length of 255 characters, supports the use of special characters dash
|
|
161
|
+
and period, does not support spaces, and must start and end with an
|
|
162
|
+
alphanumeric character.`}).option(`ip-ipv4-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv4-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`ip-ipv6-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv6-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).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 Pn={command:`create`,describe:`Create new target`,builder:Nn,handler:async t=>l({command:`zero-trust access targets create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access targets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/infrastructure/targets`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({hostname:m(t.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:m(t[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:m(t[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:m(t[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:m(t[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.targets.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.hostname===void 0&&(t.hostname=await g(`hostname`,`A non-unique field that refers to a target. Case insensitive, maximum length of 255 characters, supports the use of special characters dash and period, does not support spaces, and must start and end with an alphanumeric character.`));let u=p({hostname:m(t.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:m(t[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:m(t[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:m(t[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:m(t[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}),f=await c(`Creating`,async()=>i.zeroTrust.access.targets.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Fn(e){return e.usage(`$0 zero-trust access targets delete <target-id>
|
|
163
|
+
|
|
164
|
+
Removes a single infrastructure access target by its ID.`).positional(`target-id`,{type:`string`,description:`Target 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 In={command:`delete <target-id>`,describe:`Delete target`,builder:Fn,handler:async t=>l({command:`zero-trust access targets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access targets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/infrastructure/targets/${t[`target-id`]==null?`<target-id>`:encodeURIComponent(String(t[`target-id`]))}`,pathParams:{"target-id":String(t[`target-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
165
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.access.targets.delete({account_id:l,target_id:t[`target-id`]}));o(u,{successLabel:`Deleted`})})};function Ln(e){return e.usage(`$0 zero-trust access targets get <target-id>
|
|
166
|
+
|
|
167
|
+
Fetches a single infrastructure access target by its ID.`).positional(`target-id`,{type:`string`,description:`Target identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rn={command:`get <target-id>`,describe:`Get target`,builder:Ln,handler:async t=>l({command:`zero-trust access targets get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access targets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/infrastructure/targets/${t[`target-id`]==null?`<target-id>`:encodeURIComponent(String(t[`target-id`]))}`,pathParams:{"target-id":String(t[`target-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.targets.get({account_id:l,target_id:t[`target-id`]}));o(u,{successLabel:`Loaded`})})};function zn(e){return e.usage(`$0 zero-trust access targets list
|
|
168
|
+
|
|
169
|
+
Lists and sorts an account's targets. Filters are optional and are ANDed together.`).option(`hostname`,{type:`string`,description:`Hostname of a target`}).option(`hostname-contains`,{type:`string`,description:`Partial match to the hostname of a target`}).option(`virtual-network-id`,{type:`string`,description:`Private virtual network identifier of the target`}).option(`ip-v4`,{type:`string`,description:`IPv4 address of the target`}).option(`ip-v6`,{type:`string`,description:`IPv6 address of the target`}).option(`created-before`,{type:`string`,description:`Date and time at which the target was created before (inclusive)`}).option(`created-after`,{type:`string`,description:`Date and time at which the target was created after (inclusive)`}).option(`modified-before`,{type:`string`,description:`Date and time at which the target was modified before (inclusive)`}).option(`modified-after`,{type:`string`,description:`Date and time at which the target was modified after (inclusive)`}).option(`ips`,{type:`string`,description:"Filters for targets that have any of the following IP addresses. Specify\n`ips` multiple times in query parameter to build list of candidates."}).option(`target-ids`,{type:`string`,description:`Filters for targets that have any of the following UUIDs. Specify
|
|
170
|
+
\`target_ids\` multiple times in query parameter to build list of
|
|
171
|
+
candidates.`}).option(`ip-like`,{type:`string`,description:"Filters for targets whose IP addresses look like the specified string.\nSupports `*` as a wildcard character"}).option(`ipv4-start`,{type:`string`,description:"Defines an IPv4 filter range's starting value (inclusive). Requires\n`ipv4_end` to be specified as well."}).option(`ipv4-end`,{type:`string`,description:"Defines an IPv4 filter range's ending value (inclusive). Requires\n`ipv4_start` to be specified as well."}).option(`ipv6-start`,{type:`string`,description:"Defines an IPv6 filter range's starting value (inclusive). Requires\n`ipv6_end` to be specified as well."}).option(`ipv6-end`,{type:`string`,description:"Defines an IPv6 filter range's ending value (inclusive). Requires\n`ipv6_start` to be specified as well."}).option(`tag`,{type:`string`,description:"Filter by tag key:value pairs. Multiple `tag` params are AND'd.\nFormat: `tag=key:value` (e.g., `tag=environment:production`).\nKey and value must both be non-empty; `tag=:value` and `tag=key:` return 400."}).option(`page`,{type:`number`,description:`Current page in the response`}).option(`per-page`,{type:`number`,description:`Max amount of entries returned per page`}).option(`order`,{type:`string`,description:`The field to sort by.`,choices:[`hostname`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bn={command:`list`,describe:`List all targets`,builder:y(zn),handler:async t=>l({command:`zero-trust access targets list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},t,async()=>{let i={hostname:t.hostname,hostname_contains:t[`hostname-contains`],virtual_network_id:t[`virtual-network-id`],ip_v4:t[`ip-v4`],ip_v6:t[`ip-v6`],created_before:t[`created-before`],created_after:t[`created-after`],modified_before:t[`modified-before`],modified_after:t[`modified-after`],ips:t.ips,target_ids:t[`target-ids`],ip_like:t[`ip-like`],ipv4_start:t[`ipv4-start`],ipv4_end:t[`ipv4-end`],ipv6_start:t[`ipv6-start`],ipv6_end:t[`ipv6-end`],tag:t.tag,page:t.page,per_page:t[`per-page`],order:t.order,direction:t.direction};if(t.dryRun){let e=await r();s({command:`cf zero-trust access targets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/infrastructure/targets`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.targets.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function Vn(e){return e.usage(`$0 zero-trust access targets update <target-id>
|
|
172
|
+
|
|
173
|
+
Updates an existing infrastructure access target by its ID.`).positional(`target-id`,{type:`string`,description:`Target identifier`,demandOption:!0}).option(`hostname`,{type:`string`,description:`A non-unique field that refers to a target. Case insensitive, maximum
|
|
174
|
+
length of 255 characters, supports the use of special characters dash
|
|
175
|
+
and period, does not support spaces, and must start and end with an
|
|
176
|
+
alphanumeric character.`}).option(`ip-ipv4-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv4-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`ip-ipv6-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv6-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).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 Hn={command:`update <target-id>`,describe:`Update target`,builder:Vn,handler:async t=>l({command:`zero-trust access targets update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access targets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/infrastructure/targets/${t[`target-id`]==null?`<target-id>`:encodeURIComponent(String(t[`target-id`]))}`,pathParams:{"target-id":String(t[`target-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({hostname:m(t.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:m(t[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:m(t[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:m(t[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:m(t[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.access.targets.update({...e,account_id:l,target_id:t[`target-id`]}));o(n,{successLabel:`Updated`});return}t.hostname===void 0&&(t.hostname=await g(`hostname`,`A non-unique field that refers to a target. Case insensitive, maximum length of 255 characters, supports the use of special characters dash and period, does not support spaces, and must start and end with an alphanumeric character.`));let u=p({hostname:m(t.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:m(t[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:m(t[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:m(t[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:m(t[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}),f=await c(`Updating`,async()=>i.zeroTrust.access.targets.update({...u,account_id:l,target_id:t[`target-id`]}));o(f,{successLabel:`Updated`})})},Un={command:`targets`,describe:`Operations for access.targets`,builder:e=>e.command(Pn).command(In).command(Rn).command(Bn).command(Hn).command(Mn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Wn(e){return e.usage(`$0 zero-trust access user-populations create
|
|
177
|
+
|
|
178
|
+
Creates a user population in an account.`).option(`name`,{type:`string`,description:`The name of the user population. Leading and trailing whitespace is trimmed before validation. After trimming, the name must contain at least one non-whitespace character and must not exceed 128 UTF-8 bytes.
|
|
179
|
+
`}).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 Gn={command:`create`,describe:`Create a user population`,builder:Wn,handler:async t=>l({command:`zero-trust access user-populations create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access user-populations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/user_populations`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.userPopulations.create({body:e,account_id:l}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`The name of the user population. Leading and trailing whitespace is trimmed before validation. After trimming, the name must contain at least one non-whitespace character and must not exceed 128 UTF-8 bytes. `));let u=p({name:m(t.name,`name`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.access.userPopulations.create({body:u,account_id:l}));o(f,{successLabel:`Created`})})};function Kn(e){return e.usage(`$0 zero-trust access user-populations delete <user-population-id>
|
|
180
|
+
|
|
181
|
+
Deletes a user population that is not attached to an application.`).positional(`user-population-id`,{type:`string`,description:`UUID.`,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 qn={command:`delete <user-population-id>`,describe:`Delete a user population`,builder:Kn,handler:async t=>l({command:`zero-trust access user-populations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access user-populations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/user_populations/${t[`user-population-id`]==null?`<user-population-id>`:encodeURIComponent(String(t[`user-population-id`]))}`,pathParams:{"user-population-id":String(t[`user-population-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
182
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.access.userPopulations.delete({account_id:l,user_population_id:t[`user-population-id`]}));o(u,{successLabel:`Deleted`})})};function Jn(e){return e.usage(`$0 zero-trust access user-populations get <user-population-id>
|
|
183
|
+
|
|
184
|
+
Fetches a user population.`).positional(`user-population-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Yn={command:`get <user-population-id>`,describe:`Get a user population`,builder:Jn,handler:async t=>l({command:`zero-trust access user-populations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access user-populations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/user_populations/${t[`user-population-id`]==null?`<user-population-id>`:encodeURIComponent(String(t[`user-population-id`]))}`,pathParams:{"user-population-id":String(t[`user-population-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.userPopulations.get({account_id:l,user_population_id:t[`user-population-id`]}));o(u,{successLabel:`Loaded`})})};function Xn(e){return e.usage(`$0 zero-trust access user-populations list
|
|
185
|
+
|
|
186
|
+
Lists the user populations in an account.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Zn={command:`list`,describe:`List user populations`,builder:Xn,handler:async t=>l({command:`zero-trust access user-populations list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust access user-populations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/user_populations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.userPopulations.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function Qn(e){return e.usage(`$0 zero-trust access user-populations update <user-population-id>
|
|
187
|
+
|
|
188
|
+
Updates a user population's name.`).positional(`user-population-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the user population. Leading and trailing whitespace is trimmed before validation. After trimming, the name must contain at least one non-whitespace character and must not exceed 128 UTF-8 bytes.
|
|
189
|
+
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $n={command:`update <user-population-id>`,describe:`Update a user population`,builder:Qn,handler:async t=>l({command:`zero-trust access user-populations update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access user-populations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/user_populations/${t[`user-population-id`]==null?`<user-population-id>`:encodeURIComponent(String(t[`user-population-id`]))}`,pathParams:{"user-population-id":String(t[`user-population-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.access.userPopulations.update({body:e,account_id:l,user_population_id:t[`user-population-id`]}));o(n,{successLabel:`Updated`});return}t.name===void 0&&(t.name=await g(`name`,`The name of the user population. Leading and trailing whitespace is trimmed before validation. After trimming, the name must contain at least one non-whitespace character and must not exceed 128 UTF-8 bytes. `));let u=p({name:m(t.name,`name`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.access.userPopulations.update({body:u,account_id:l,user_population_id:t[`user-population-id`]}));o(f,{successLabel:`Updated`})})},er={command:`user-populations`,describe:`Operations for access.user-populations`,builder:e=>e.command(Gn).command(qn).command(Yn).command(Zn).command($n).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tr(e){return e.usage(`$0 zero-trust access users active-sessions get <nonce>
|
|
190
|
+
|
|
191
|
+
Get an active session for a single user.`).positional(`nonce`,{type:`string`,description:`Nonce`,demandOption:!0}).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const nr={command:`get <nonce>`,describe:`Get single active session`,builder:tr,handler:async t=>l({command:`zero-trust access users active-sessions get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access users active-sessions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}/active_sessions/${t.nonce==null?`<nonce>`:encodeURIComponent(String(t.nonce))}`,pathParams:{"user-id":String(t[`user-id`]??``),nonce:String(t.nonce??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.users.activeSessions.get({account_id:l,user_id:t[`user-id`],nonce:t.nonce}));o(u,{successLabel:`Loaded`})})};function rr(e){return e.usage(`$0 zero-trust access users active-sessions list
|
|
192
|
+
|
|
193
|
+
Get active sessions for a single user.`).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ir={command:`list`,describe:`Get active sessions`,builder:rr,handler:async t=>l({command:`zero-trust access users active-sessions list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access users active-sessions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}/active_sessions`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.users.activeSessions.list({account_id:l,user_id:t[`user-id`]}));o(u,{successLabel:`Loaded`})})},ar={command:`active-sessions`,describe:`Operations for access.users.active-sessions`,builder:e=>e.command(nr).command(ir).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function or(e){return e.usage(`$0 zero-trust access users create
|
|
194
|
+
|
|
195
|
+
Creates a new user.`).option(`email`,{type:`string`,description:`The email of the user.`}).option(`name`,{type:`string`,description:`The name of the user.`}).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 sr={command:`create`,describe:`Create a user`,builder:or,handler:async t=>l({command:`zero-trust access users create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({email:m(t.email,`email`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.access.users.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.email===void 0&&(t.email=await g(`email`,`The email of the user.`));let u=p({email:m(t.email,`email`,`text`),name:m(t.name,`name`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.access.users.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function cr(e){return e.usage(`$0 zero-trust access users delete <user-id>
|
|
196
|
+
|
|
197
|
+
Deletes a specific user for an account. This will also revoke any active seats and tokens for the user.`).positional(`user-id`,{type:`string`,description:`UUID.`,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 lr={command:`delete <user-id>`,describe:`Delete a user`,builder:cr,handler:async t=>l({command:`zero-trust access users delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
198
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.access.users.delete({account_id:l,user_id:t[`user-id`]}));o(u,{successLabel:`Deleted`})})};function ur(e){return e.usage(`$0 zero-trust access users failed-logins list
|
|
199
|
+
|
|
200
|
+
Get all failed login attempts for a single user.`).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const dr={command:`list`,describe:`Get failed logins`,builder:ur,handler:async t=>l({command:`zero-trust access users failed-logins list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access users failed-logins list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}/failed_logins`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.users.failedLogins.list({account_id:l,user_id:t[`user-id`]}));o(u,{successLabel:`Loaded`})})},fr={command:`failed-logins`,describe:`Operations for access.users.failed-logins`,builder:e=>e.command(dr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pr(e){return e.usage(`$0 zero-trust access users get <user-id>
|
|
201
|
+
|
|
202
|
+
Gets a specific user for an account.`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mr={command:`get <user-id>`,describe:`Get a user`,builder:pr,handler:async t=>l({command:`zero-trust access users get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.users.get({account_id:l,user_id:t[`user-id`]}));o(u,{successLabel:`Loaded`})})};function hr(e){return e.usage(`$0 zero-trust access users last-seen-identity get <user-id>
|
|
203
|
+
|
|
204
|
+
Get last seen identity for a single user.`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gr={command:`get <user-id>`,describe:`Get last seen identity`,builder:hr,handler:async t=>l({command:`zero-trust access users last-seen-identity get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access users last-seen-identity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}/last_seen_identity`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.access.users.lastSeenIdentity.get({account_id:l,user_id:t[`user-id`]}));o(u,{successLabel:`Loaded`})})},_r={command:`last-seen-identity`,describe:`Operations for access.users.last-seen-identity`,builder:e=>e.command(gr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vr(e){return e.usage(`$0 zero-trust access users list
|
|
205
|
+
|
|
206
|
+
Gets a list of users for an account.`).option(`name`,{type:`string`,description:`The name of the user.`}).option(`email`,{type:`string`,description:`The email of the user.`}).option(`search`,{type:`string`,description:`Search for users by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yr={command:`list`,describe:`Get users`,builder:vr,handler:async t=>l({command:`zero-trust access users list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={name:t.name,email:t.email,search:t.search,page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust access users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.access.users.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function br(e){return e.usage(`$0 zero-trust access users revoke
|
|
207
|
+
|
|
208
|
+
Revokes a user's access across all applications.`).option(`devices`,{type:`boolean`,description:"When set to `true`, all devices associated with the user will be revoked."}).option(`email`,{type:`string`,description:`The email of the user to revoke.`}).option(`user-uid`,{type:`string`,description:`The uuid of the user to revoke.`}).option(`warp-session-reauth`,{type:`boolean`,description:"When set to `true`, the user will be required to re-authenticate to WARP for all Gateway policies that enforce a WARP client session duration. When `false`, the user’s WARP session will remain active"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xr={command:`revoke`,describe:`Revoke all Access tokens for a user`,builder:br,handler:async t=>l({command:`zero-trust access users revoke`,classification:{safeFlags:[`devices`,`warp-session-reauth`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust access users revoke`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/organizations/revoke_user`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({devices:t.devices,email:m(t.email,`email`,`text`),user_uid:m(t[`user-uid`],`user-uid`,`text`),warp_session_reauth:t[`warp-session-reauth`]}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,!await v({force:!!t.force,message:`This operation revokes all access tokens for a user destructively.`})){process.stderr.write(`Aborted.
|
|
209
|
+
`);return}if(t.body){let e=d(t.body),n=await c(`Deleting`,async()=>l.zeroTrust.access.users.revoke({...e,account_or_zone:u,account_or_zone_id:f}));o(n,{successLabel:`Deleted`});return}t.email===void 0&&(t.email=await g(`email`,`The email of the user to revoke.`));let h=p({devices:t.devices,email:m(t.email,`email`,`text`),user_uid:m(t[`user-uid`],`user-uid`,`text`),warp_session_reauth:t[`warp-session-reauth`]}),_=await c(`Deleting`,async()=>l.zeroTrust.access.users.revoke({...h,account_or_zone:u,account_or_zone_id:f}));o(_,{successLabel:`Deleted`})})};function Sr(e){return e.usage(`$0 zero-trust access users update <user-id>
|
|
210
|
+
|
|
211
|
+
Updates a specific user's name for an account. Requires the user's current email as confirmation (email cannot be changed).`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`email`,{type:`string`,description:`The email of the user.`}).option(`name`,{type:`string`,description:`The name of the user.`}).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 Cr={command:`update <user-id>`,describe:`Update a user`,builder:Sr,handler:async t=>l({command:`zero-trust access users update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust access users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({email:m(t.email,`email`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.access.users.update({...e,account_id:l,user_id:t[`user-id`]}));o(n,{successLabel:`Updated`});return}t.email===void 0&&(t.email=await g(`email`,`The email of the user.`)),t.name===void 0&&(t.name=await g(`name`,`The name of the user.`));let u=p({email:m(t.email,`email`,`text`),name:m(t.name,`name`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.access.users.update({...u,account_id:l,user_id:t[`user-id`]}));o(f,{successLabel:`Updated`})})},wr={command:`users`,describe:`Operations for access.users`,builder:e=>e.command(sr).command(lr).command(mr).command(yr).command(xr).command(Cr).command(ar).command(fr).command(_r).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Tr={command:`access`,describe:`Operations for access`,builder:e=>e.command(se).command(be).command(Fe).command(Je).command(Qe).command(mt).command(Tt).command(It).command(Gt).command(sn).command(mn).command(Tn).command(Un).command(er).command(wr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Er(e){return e.usage(`$0 zero-trust apps review status list
|
|
212
|
+
|
|
213
|
+
Retrieve the statuses of your applications.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Dr={command:`list`,describe:`List applications review statuses`,builder:Er,handler:async t=>l({command:`zero-trust apps review status list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust apps review status list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/apps/review_status`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.apps.review.status.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function Or(e){return e.usage(`$0 zero-trust apps review status update
|
|
214
|
+
|
|
215
|
+
Update the statuses of your applications.`).option(`approved-apps`,{type:`string`,array:!0,description:`Contains the ids of the approved applications.`}).option(`in-review-apps`,{type:`string`,array:!0,description:`Contains the ids of the applications in review.`}).option(`unapproved-apps`,{type:`string`,array:!0,description:`Contains the ids of the unapproved applications.`}).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 kr={command:`update`,describe:`Update applications review statuses`,builder:Or,handler:async t=>l({command:`zero-trust apps review status update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust apps review status update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/apps/review_status`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({approved_apps:t[`approved-apps`],in_review_apps:t[`in-review-apps`],unapproved_apps:t[`unapproved-apps`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.apps.review.status.update({...e,account_id:l}));o(n,{successLabel:`Updated`});return}if(t[`approved-apps`]===void 0)throw Error(`--approved-apps is required (or pass --body with this field set).`);if(t[`in-review-apps`]===void 0)throw Error(`--in-review-apps is required (or pass --body with this field set).`);if(t[`unapproved-apps`]===void 0)throw Error(`--unapproved-apps is required (or pass --body with this field set).`);let u=p({approved_apps:t[`approved-apps`],in_review_apps:t[`in-review-apps`],unapproved_apps:t[`unapproved-apps`]}),f=await c(`Updating`,async()=>i.zeroTrust.apps.review.status.update({...u,account_id:l}));o(f,{successLabel:`Updated`})})},Ar={command:`status`,describe:`Operations for apps.review.status`,builder:e=>e.command(Dr).command(kr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},jr={command:`review`,describe:`Operations for apps.review`,builder:e=>e.command(Ar).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Mr={command:`apps`,describe:`Operations for apps`,builder:e=>e.command(jr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Nr(e){return e.usage(`$0 zero-trust casb applications auth-methods list
|
|
216
|
+
|
|
217
|
+
Returns available auth methods for the specified vendor, including credential schema, instructions, and example payloads. Use this to understand what credentials are required before calling POST /v2/integrations.`).option(`application-id`,{type:`string`,description:`Application/vendor identifier.`,demandOption:!0}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`page-size`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pr={command:`list`,describe:`Get auth methods`,builder:y(Nr),handler:async t=>l({command:`zero-trust casb applications auth-methods list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,page_size:t[`page-size`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb applications auth-methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/applications/${t[`application-id`]==null?`<application-id>`:encodeURIComponent(String(t[`application-id`]))}/auth-methods`,pathParams:{"application-id":String(t[`application-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.applications.authMethods.list({account_id:u,application_id:t[`application-id`],...i}));o(d,{successLabel:`Loaded`})})},Fr={command:`auth-methods`,describe:`Operations for casb.applications.auth-methods`,builder:e=>e.command(Pr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ir(e){return e.usage(`$0 zero-trust casb applications get <application-id>
|
|
218
|
+
|
|
219
|
+
Returns full application details including auth methods, use cases, and permissions.`).positional(`application-id`,{type:`string`,description:`Application/vendor identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Lr={command:`get <application-id>`,describe:`Get application details`,builder:y(Ir),handler:async t=>l({command:`zero-trust casb applications get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/applications/${t[`application-id`]==null?`<application-id>`:encodeURIComponent(String(t[`application-id`]))}`,pathParams:{"application-id":String(t[`application-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.casb.applications.get({account_id:l,application_id:t[`application-id`]}));o(u,{successLabel:`Loaded`})})};function Rr(e){return e.usage(`$0 zero-trust casb applications list
|
|
220
|
+
|
|
221
|
+
Returns a list of available applications with use cases and permissions.`).option(`environment`,{type:`string`,description:`Filter by supported environment (standard, fedramp).`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`page-size`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const zr={command:`list`,describe:`List applications`,builder:Rr,handler:async t=>l({command:`zero-trust casb applications list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={environment:t.environment,page:t.page,page_size:t[`page-size`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/applications`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.applications.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},Br={command:`applications`,describe:`Operations for casb.applications`,builder:e=>e.command(Lr).command(zr).command(Fr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Vr(e){return e.usage(`$0 zero-trust casb content export
|
|
222
|
+
|
|
223
|
+
Creates a CSV export for content and accepts optional filters in the payload.`).option(`dlp-profile-id`,{type:`string`,array:!0,description:`Filter by DLP profile IDs.`}).option(`dlp-profile-information`,{type:`string`,description:`DLP profile metadata for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view content flagged on or before this date.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view content flagged on or after this date.`}).option(`orders`,{type:`string`,description:`Ordering specifications for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`Search term to filter content.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating content exports.`})}const Hr={command:`export`,describe:`Create a content export`,builder:Vr,handler:async t=>l({command:`zero-trust casb content export`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb content export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/content/export`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({dlp_profile_id:t[`dlp-profile-id`],dlp_profile_information:f(t[`dlp-profile-information`],`dlp-profile-information`),integration_id:t[`integration-id`],max_affliction_date:m(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:m(t[`min-affliction-date`],`min-affliction-date`,`text`),orders:f(t.orders,`orders`),search:m(t.search,`search`,`text`),vendors:t.vendors}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Loading`,async()=>i.zeroTrust.casb.content.export({...e,account_id:l}));o(n,{successLabel:`Loaded`});return}if(t[`dlp-profile-information`]===void 0)throw Error(`--dlp-profile-information is required (or pass --body with this field set).`);let u=p({dlp_profile_id:t[`dlp-profile-id`],dlp_profile_information:f(t[`dlp-profile-information`],`dlp-profile-information`),integration_id:t[`integration-id`],max_affliction_date:m(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:m(t[`min-affliction-date`],`min-affliction-date`,`text`),orders:f(t.orders,`orders`),search:m(t.search,`search`,`text`),vendors:t.vendors}),h=await c(`Loading`,async()=>i.zeroTrust.casb.content.export({...u,account_id:l}));o(h,{successLabel:`Loaded`})})};function Ur(e){return e.usage(`$0 zero-trust casb content list
|
|
224
|
+
|
|
225
|
+
List DLP content findings`).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dlp-profile-id`,{type:`string`,description:`Filter by an DLP profile ID`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`order`,{type:`string`,description:`Which field to use when ordering content assets.`,choices:[`asset_name`,`dlp_profile_count`,`integration_name`,`latest_affliction_date`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`vendor`,{type:`string`,description:`Filter by vendor`,choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`,`ZOOM`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wr={command:`list`,describe:`List DLP content findings`,builder:y(Ur),handler:async t=>l({command:`zero-trust casb content list`,classification:{safeFlags:[`direction`,`order`,`vendor`,`dry-run`]}},t,async()=>{let i={direction:t.direction,dlp_profile_id:t[`dlp-profile-id`],integration_id:t[`integration-id`],max_affliction_date:t[`max-affliction-date`],min_affliction_date:t[`min-affliction-date`],order:t.order,page:t.page,per_page:t[`per-page`],search:t.search,vendor:t.vendor};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb content list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/content`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.content.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},Gr={command:`content`,describe:`Operations for casb.content`,builder:e=>e.command(Hr).command(Wr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Kr(e){return e.usage(`$0 zero-trust casb exports get <id>
|
|
226
|
+
|
|
227
|
+
Retrieves a single export job by its unique identifier`).positional(`id`,{type:`string`,description:`Unique identifier for the export job`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qr={command:`get <id>`,describe:`Get a single export job`,builder:Kr,handler:async t=>l({command:`zero-trust casb exports get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb exports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/exports/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.casb.exports.get({account_id:l,id:t.id}));o(u,{successLabel:`Loaded`})})};function Jr(e){return e.usage(`$0 zero-trust casb exports list
|
|
228
|
+
|
|
229
|
+
List all export jobs for a given requestor's organization`).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`status`,{type:`string`,description:`Filter on export job's status`,choices:[`Pending`,`Success`,`Failure`,`Rescheduled`,`In-Progress`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Yr={command:`list`,describe:`List all export jobs`,builder:y(Jr),handler:async t=>l({command:`zero-trust casb exports list`,classification:{safeFlags:[`status`,`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],status:t.status};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb exports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/exports`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.exports.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},Xr={command:`exports`,describe:`Operations for casb.exports`,builder:e=>e.command(qr).command(Yr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Zr(e){return e.usage(`$0 zero-trust casb finding-types get <finding-type-id>
|
|
230
|
+
|
|
231
|
+
Retrieve a specific finding type by its unique identifier.`).positional(`finding-type-id`,{type:`string`,description:`A UUID string identifying the finding type.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Qr={command:`get <finding-type-id>`,describe:`Get finding by ID`,builder:Zr,handler:async t=>l({command:`zero-trust casb finding-types get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb finding-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/finding_types/${t[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(t[`finding-type-id`]))}`,pathParams:{"finding-type-id":String(t[`finding-type-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.casb.findingTypes.get({account_id:l,finding_type_id:t[`finding-type-id`]}));o(u,{successLabel:`Loaded`})})};function $r(e){return e.usage(`$0 zero-trust casb finding-types list
|
|
232
|
+
|
|
233
|
+
List all available finding types with pagination support.`).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`vendors`,{type:`string`,description:`Filter finding types by vendor. Supports multiple comma-separated values. Each value may be either the vendor enum (GOOGLE_WORKSPACE) or the friendly name returned by the read routes (Google Workspace).`}).option(`search`,{type:`string`,description:`Filter finding types by name or ID (case-insensitive substring match).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ei={command:`list`,describe:`List all finding types`,builder:y($r),handler:async t=>l({command:`zero-trust casb finding-types list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],vendors:t.vendors,search:t.search};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb finding-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/finding_types`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.findingTypes.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function ti(e){return e.usage("$0 zero-trust casb finding-types remediation-types list\n\nList all remediation types for a given finding type. This endpoint supports both cursor and offset pagination. Note that `cursor` and `page` are mutually exclusive.").option(`finding-type-id`,{type:`string`,description:`A UUID string identifying the finding type.`,demandOption:!0}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`cursor`,{type:`string`,description:`A cursor for pagination.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ni={command:`list`,describe:`List remediation types for a finding type`,builder:ti,handler:async t=>l({command:`zero-trust casb finding-types remediation-types list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={integration_id:t[`integration-id`],cursor:t.cursor,page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb finding-types remediation-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/finding_types/${t[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(t[`finding-type-id`]))}/remediation_types`,pathParams:{"finding-type-id":String(t[`finding-type-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.findingTypes.remediationTypes.list({account_id:u,finding_type_id:t[`finding-type-id`],...i}));o(d,{successLabel:`Loaded`})})},ri={command:`remediation-types`,describe:`Operations for casb.finding-types.remediation-types`,builder:e=>e.command(ni).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ii={command:`finding-types`,describe:`Operations for casb.finding-types`,builder:e=>e.command(Qr).command(ei).command(ri).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ai(e){return e.usage(`$0 zero-trust casb findings export
|
|
234
|
+
|
|
235
|
+
Creates a CSV export for findings and accepts optional filters in the payload.`).option(`ignored`,{type:`boolean`,description:`Filter for only the ignored findings. Set to false to only see active items.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`orders`,{type:`string`,description:`Which fields to use when ordering the findings. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`severities`,{type:`string`,array:!0,description:`Filter by severity levels.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for findings export jobs.`})}const oi={command:`export`,describe:`Create new findings export request`,builder:ai,handler:async t=>l({command:`zero-trust casb findings export`,classification:{safeFlags:[`ignored`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/export`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({ignored:t.ignored,integration_id:t[`integration-id`],max_affliction_date:m(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:m(t[`min-affliction-date`],`min-affliction-date`,`text`),orders:f(t.orders,`orders`),search:m(t.search,`search`,`text`),severities:t.severities,vendors:t.vendors}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Loading`,async()=>i.zeroTrust.casb.findings.export({...e,account_id:l}));o(n,{successLabel:`Loaded`});return}let u=p({ignored:t.ignored,integration_id:t[`integration-id`],max_affliction_date:m(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:m(t[`min-affliction-date`],`min-affliction-date`,`text`),orders:f(t.orders,`orders`),search:m(t.search,`search`,`text`),severities:t.severities,vendors:t.vendors}),h=await c(`Loading`,async()=>i.zeroTrust.casb.findings.export({...u,account_id:l}));o(h,{successLabel:`Loaded`})})};function si(e){return e.usage(`$0 zero-trust casb findings get <finding-id>
|
|
236
|
+
|
|
237
|
+
Gets a security Finding that has been identified as being problematic.`).positional(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response. It is a base64-encoded identifier.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ci={command:`get <finding-id>`,describe:`Get a posture finding`,builder:si,handler:async t=>l({command:`zero-trust casb findings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}`,pathParams:{"finding-id":String(t[`finding-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.casb.findings.get({account_id:l,finding_id:t[`finding-id`]}));o(u,{successLabel:`Loaded`})})};function li(e){return e.usage(`$0 zero-trust casb findings ignore
|
|
238
|
+
|
|
239
|
+
Given a list of findings, mark as ignored. Does nothing if Finding is already ignored.`).option(`checks`,{type:`string`,array:!0,description:`A list of finding IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on findings.`})}const ui={command:`ignore`,describe:`Mark a finding as ignored`,builder:li,handler:async t=>l({command:`zero-trust casb findings ignore`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings ignore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/ignore`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({checks:t.checks}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.casb.findings.ignore({body:e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let u=p({checks:t.checks}),f=await c(`Creating`,async()=>i.zeroTrust.casb.findings.ignore({body:u,account_id:l}));o(f,{successLabel:`Created`})})};function di(e){return e.usage(`$0 zero-trust casb findings instances archive <finding-id>
|
|
240
|
+
|
|
241
|
+
Archive one or more finding instances.`).positional(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response. It is a base64-encoded identifier.",demandOption:!0}).option(`check-instances`,{type:`string`,array:!0,description:`A list of finding instance IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on finding instances.`})}const fi={command:`archive <finding-id>`,describe:`Archive a finding`,builder:di,handler:async t=>l({command:`zero-trust casb findings instances archive`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings instances archive`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/instances/archive`,pathParams:{"finding-id":String(t[`finding-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({check_instances:t[`check-instances`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.casb.findings.instances.archive({body:e,account_id:l,finding_id:t[`finding-id`]}));o(n,{successLabel:`Created`});return}if(t[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let u=p({check_instances:t[`check-instances`]}),f=await c(`Creating`,async()=>i.zeroTrust.casb.findings.instances.archive({body:u,account_id:l,finding_id:t[`finding-id`]}));o(f,{successLabel:`Created`})})};function pi(e){return e.usage("$0 zero-trust casb findings instances export <finding-namespace-id>\n\nCreates a CSV export for Finding instances and accepts optional filters in the payload. Identify the finding as `<integration_id>-<finding_type_id>`: join the `integration.id` and `finding.id` of the finding (from the List posture findings response) with a hyphen.").positional(`finding-namespace-id`,{type:`string`,description:"Identifies the finding whose instances to export, in the form `<integration_id>-<finding_type_id>`. Take `integration.id` and `finding.id` from the finding in the List posture findings response and join them with a hyphen.",demandOption:!0}).option(`archived`,{type:`boolean`,description:`Filter for archived status.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`orders`,{type:`string`,description:`Ordering specifications for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for finding instance exports.`})}const mi={command:`export <finding-namespace-id>`,describe:`Create a finding instances export`,builder:pi,handler:async t=>l({command:`zero-trust casb findings instances export`,classification:{safeFlags:[`archived`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings instances export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/${t[`finding-namespace-id`]==null?`<finding-namespace-id>`:encodeURIComponent(String(t[`finding-namespace-id`]))}/instances/export`,pathParams:{"finding-namespace-id":String(t[`finding-namespace-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({archived:t.archived,max_affliction_date:m(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:m(t[`min-affliction-date`],`min-affliction-date`,`text`),orders:f(t.orders,`orders`),search:m(t.search,`search`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Loading`,async()=>i.zeroTrust.casb.findings.instances.export({...e,account_id:l,"finding-namespace-id":t[`finding-namespace-id`]}));o(n,{successLabel:`Loaded`});return}let u=p({archived:t.archived,max_affliction_date:m(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:m(t[`min-affliction-date`],`min-affliction-date`,`text`),orders:f(t.orders,`orders`),search:m(t.search,`search`,`text`)}),h=await c(`Loading`,async()=>i.zeroTrust.casb.findings.instances.export({...u,account_id:l,"finding-namespace-id":t[`finding-namespace-id`]}));o(h,{successLabel:`Loaded`})})};function hi(e){return e.usage(`$0 zero-trust casb findings instances get <instance-id>
|
|
242
|
+
|
|
243
|
+
Gets a security Finding instance by id.`).positional(`instance-id`,{type:`string`,description:`A uuid ID identifying this Finding instance.`,demandOption:!0}).option(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response.\nIt is a base64-encoded identifier.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gi={command:`get <instance-id>`,describe:`Get a finding instance using an instance ID`,builder:hi,handler:async t=>l({command:`zero-trust casb findings instances get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings instances get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/instances/${t[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(t[`instance-id`]))}`,pathParams:{"finding-id":String(t[`finding-id`]??``),"instance-id":String(t[`instance-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.casb.findings.instances.get({account_id:l,finding_id:t[`finding-id`],instance_id:t[`instance-id`]}));o(u,{successLabel:`Loaded`})})};function _i(e){return e.usage(`$0 zero-trust casb findings instances list
|
|
244
|
+
|
|
245
|
+
Lists all security finding instances for a given security finding.`).option(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response.\nIt is a base64-encoded identifier.",demandOption:!0}).option(`archived`,{type:`boolean`,description:`Archived`}).option(`cursor`,{type:`string`,description:"A cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`order`,{type:`string`,description:`Which field to use when ordering the Finding's instances.
|
|
246
|
+
When ordering by 'remediation.status', only the most recent non-stale remediation job is considered. Stale jobs (created before the instance's affliction_date) are treated as having no status for ordering purposes.`,choices:[`affliction_date`,`asset.name`,`remediation.status`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`remediation-statuses`,{type:`string`,description:`Filter finding instances by most recent remediation job status. Supports multiple comma-separated values.
|
|
247
|
+
Use 'none' to filter instances with no remediation jobs or instances where the most recent job is stale.
|
|
248
|
+
Note: Stale jobs (created before the instance's affliction_date) are ignored for filtering purposes, but are still included in the 'remediations' array with stale=true.`}).option(`finding-instance-ids`,{type:`string`,description:`Filter finding instances by an array of finding instance IDs. Supports multiple comma-separated values.`}).option(`asset-ids`,{type:`string`,description:`Filter finding instances by an array of asset IDs. Supports multiple comma-separated values.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vi={command:`list`,describe:`List instances of a finding`,builder:y(_i),handler:async t=>l({command:`zero-trust casb findings instances list`,classification:{safeFlags:[`archived`,`direction`,`order`,`dry-run`]}},t,async()=>{let i={archived:t.archived,cursor:t.cursor,direction:t.direction,max_affliction_date:t[`max-affliction-date`],min_affliction_date:t[`min-affliction-date`],order:t.order,page:t.page,per_page:t[`per-page`],search:t.search,remediation_statuses:t[`remediation-statuses`],finding_instance_ids:t[`finding-instance-ids`],asset_ids:t[`asset-ids`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings instances list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/instances`,pathParams:{"finding-id":String(t[`finding-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.findings.instances.list({account_id:u,finding_id:t[`finding-id`],...i}));o(d,{successLabel:`Loaded`})})};function yi(e){return e.usage(`$0 zero-trust casb findings instances unarchive <finding-id>
|
|
249
|
+
|
|
250
|
+
Remove the archive marking from one or more finding instances.`).positional(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response. It is a base64-encoded identifier.",demandOption:!0}).option(`check-instances`,{type:`string`,array:!0,description:`A list of finding instance IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on finding instances.`})}const bi={command:`unarchive <finding-id>`,describe:`Remove the archive marking from a finding instance`,builder:yi,handler:async t=>l({command:`zero-trust casb findings instances unarchive`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings instances unarchive`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/instances/unarchive`,pathParams:{"finding-id":String(t[`finding-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({check_instances:t[`check-instances`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.casb.findings.instances.unarchive({body:e,account_id:l,finding_id:t[`finding-id`]}));o(n,{successLabel:`Created`});return}if(t[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let u=p({check_instances:t[`check-instances`]}),f=await c(`Creating`,async()=>i.zeroTrust.casb.findings.instances.unarchive({body:u,account_id:l,finding_id:t[`finding-id`]}));o(f,{successLabel:`Created`})})},xi={command:`instances`,describe:`Operations for casb.findings.instances`,builder:e=>e.command(fi).command(mi).command(gi).command(vi).command(bi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Si(e){return e.usage(`$0 zero-trust casb findings list
|
|
251
|
+
|
|
252
|
+
List all security findings that have been identified as being problematic. This will return a list of findings regardless if they have been ignored or not.`).option(`cursor`,{type:`string`,description:"A cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`ignored`,{type:`boolean`,description:`Filter for only the ignored findings. Set to false to only see "active" items`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`observation`,{type:`string`,description:`Filter by observation type of the finding`,choices:[`Activity`,`Insight`,`Issue`]}).option(`order`,{type:`string`,description:`Which field to use when ordering the findings.`,choices:[`finding.name`,`instance_count`,`integration.name`,`latest_affliction_date`,`severity`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`product`,{type:`string`,description:`Filter by product category of the finding`,choices:[`Cloud`,`Saas`]}).option(`search`,{type:`string`,description:`A search term.`}).option(`severity`,{type:`string`,description:`Filter by severity`,choices:[`Critical`,`High`,`Medium`,`Low`]}).option(`type`,{type:`string`,description:`Filter by type of the finding`,choices:[`Content`,`Posture`]}).option(`vendor`,{type:`string`,description:`Filter by vendor`,choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`,`ZOOM`]}).option(`finding-type-ids`,{type:`string`,description:`A comma separated list of UUIDs identifying the finding type(s).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ci={command:`list`,describe:`List posture findings`,builder:y(Si),handler:async t=>l({command:`zero-trust casb findings list`,classification:{safeFlags:[`direction`,`ignored`,`observation`,`order`,`product`,`severity`,`type`,`vendor`,`dry-run`]}},t,async()=>{let i={cursor:t.cursor,direction:t.direction,ignored:t.ignored,integration_id:t[`integration-id`],max_affliction_date:t[`max-affliction-date`],min_affliction_date:t[`min-affliction-date`],observation:t.observation,order:t.order,page:t.page,per_page:t[`per-page`],product:t.product,search:t.search,severity:t.severity,type:t.type,vendor:t.vendor,finding_type_ids:t[`finding-type-ids`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.findings.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function wi(e){return e.usage(`$0 zero-trust casb findings reset-severity <finding-id>
|
|
253
|
+
|
|
254
|
+
If a Finding's severity has been changed, reset it back to default value. Does nothing if no override exists.`).positional(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response. It is a base64-encoded identifier.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ti={command:`reset-severity <finding-id>`,describe:`Reset severity for a finding back to the default`,builder:wi,handler:async t=>l({command:`zero-trust casb findings reset-severity`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings reset-severity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/reset_finding_severity`,pathParams:{"finding-id":String(t[`finding-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.casb.findings.resetSeverity({account_id:l,finding_id:t[`finding-id`]}));o(u,{successLabel:`Created`})})};function Ei(e){return e.usage(`$0 zero-trust casb findings tune-severity <finding-id>
|
|
255
|
+
|
|
256
|
+
Update the severity of a Finding. This will update the \`severity_override\` field on the Finding payload with the new severity value.`).positional(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response. It is a base64-encoded identifier.",demandOption:!0}).option(`new-severity`,{type:`number`,description:`The numeric severity value to apply to the finding.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating a finding's severity.`})}const Di={command:`tune-severity <finding-id>`,describe:`Update the severity for a finding`,builder:Ei,handler:async t=>l({command:`zero-trust casb findings tune-severity`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings tune-severity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/tune_finding_severity`,pathParams:{"finding-id":String(t[`finding-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({new_severity:t[`new-severity`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.casb.findings.tuneSeverity({...e,account_id:l,finding_id:t[`finding-id`]}));o(n,{successLabel:`Created`});return}if(t[`new-severity`]===void 0)throw Error(`--new-severity is required (or pass --body with this field set).`);let u=p({new_severity:t[`new-severity`]}),f=await c(`Creating`,async()=>i.zeroTrust.casb.findings.tuneSeverity({...u,account_id:l,finding_id:t[`finding-id`]}));o(f,{successLabel:`Created`})})};function Oi(e){return e.usage(`$0 zero-trust casb findings unignore
|
|
257
|
+
|
|
258
|
+
Ability to un-ignore a Finding if it's previously been ignored. Does nothing if the Finding is not ignored.`).option(`checks`,{type:`string`,array:!0,description:`A list of finding IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on findings.`})}const ki={command:`unignore`,describe:`Remove ignore marker from a finding`,builder:Oi,handler:async t=>l({command:`zero-trust casb findings unignore`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb findings unignore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings/unignore`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({checks:t.checks}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.casb.findings.unignore({body:e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let u=p({checks:t.checks}),f=await c(`Creating`,async()=>i.zeroTrust.casb.findings.unignore({body:u,account_id:l}));o(f,{successLabel:`Created`})})},Ai={command:`findings`,describe:`Operations for casb.findings`,builder:e=>e.command(oi).command(ci).command(ui).command(Ci).command(Ti).command(Di).command(ki).command(xi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ji(e){return e.usage(`$0 zero-trust casb integrations create
|
|
259
|
+
|
|
260
|
+
Creates a new integration for the specified application. Integration creation with OAuth is not supported by API at the moment. For other auth methods, use \`GET /v2/applications/{application_id}/credential-guide\` to see the required credential structure and example payloads for each vendor.`).option(`application`,{type:`string`,description:"Vendor/application slug (e.g., GOOGLE_WORKSPACE).\n\n* `ANTHROPIC` - ANTHROPIC\n* `AWS` - AWS\n* `BITBUCKET` - BITBUCKET\n* `BOX` - BOX\n* `CONFLUENCE` - CONFLUENCE\n* `DROPBOX` - DROPBOX\n* `GITHUB` - GITHUB\n* `GOOGLE_CLOUD_PLATFORM` - GOOGLE_CLOUD_PLATFORM\n* `GOOGLE_WORKSPACE` - GOOGLE_WORKSPACE\n* `JIRA` - JIRA\n* `MICROSOFT_INTERNAL` - MICROSOFT_INTERNAL\n* `OPENAI` - OPENAI\n* `SALESFORCE` - SALESFORCE\n* `SERVICENOW` - SERVICENOW\n* `SLACK` - SLACK",choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`]}).option(`auth-method`,{type:`string`,description:`Authentication method slug (uses default if omitted).`}).option(`dlp-profiles`,{type:`string`,array:!0,description:`List of DLP profile IDs to associate.`}).option(`name`,{type:`string`,description:`Name of the integration.`}).option(`permissions`,{type:`string`,array:!0,description:`List of permission scopes (uses policy defaults if empty).`}).option(`use-cases`,{type:`string`,array:!0,description:`List of use case or feature slugs to enroll (e.g., ['casb', 'ces', 'auto_remediation']).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Serializer for v2 integration create requests.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Mi={command:`create`,describe:`Create integration`,builder:ji,handler:async i=>l({command:`zero-trust casb integrations create`,classification:{safeFlags:[`application`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=await r();s({command:`cf zero-trust casb integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/integrations`,pathParams:{},bodyKind:i.file===void 0?`json`:`octet-stream`,body:i.file===void 0?i.body===void 0?p({application:m(i.application,`application`,`text`),auth_method:m(i[`auth-method`],`auth-method`,`text`),dlp_profiles:i[`dlp-profiles`],name:m(i.name,`name`,`text`),permissions:i.permissions,use_cases:i[`use-cases`]}):d(i.body):{file:i.file}});return}let l=await n(i),f=i.local?e:await a();if(i.accountId=f,i.file){let e=h(i.file),n=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${f}/one/integrations`,{body:e,headers:{"Content-Type":`text/plain;charset=UTF-8`}}));o(n,{successLabel:`Created`});return}if(i.body){let e=d(i.body),n=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${f}/one/integrations`,{body:e}));o(n,{successLabel:`Created`});return}i.application===void 0&&(i.application=await _(`application`,"Vendor/application slug (e.g., GOOGLE_WORKSPACE). * `ANTHROPIC` - ANTHROPIC * `AWS` - AWS * `BITBUCKET` - BITBUCKET * `BOX` - BOX * `CONFLUENCE` - CONFLUENCE * `DROPBOX` - DROPBOX * `GITHUB` - GITHUB * `GOOGLE_CLOUD_PLATFORM` - GOOGLE_CLOUD_PLATFORM * `GOOGLE_WORKSPACE` - GOOGLE_WORKSPACE * `JIRA` - JIRA * `MICROSOFT_INTERNAL` - MICROSOFT_INTERNAL * `OPENAI` - OPENAI * `SALESFORCE` - SALESFORCE * `SERVICENOW` - SERVICENOW * `SLACK` - SLACK",[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`])),i.name===void 0&&(i.name=await g(`name`,`Name of the integration.`));let v={};i.application!==void 0&&u(v,[`application`],m(i.application,`application`,`text`)),i[`auth-method`]!==void 0&&u(v,[`auth_method`],m(i[`auth-method`],`auth-method`,`text`)),i[`dlp-profiles`]!==void 0&&u(v,[`dlp_profiles`],i[`dlp-profiles`]),i.name!==void 0&&u(v,[`name`],m(i.name,`name`,`text`)),i.permissions!==void 0&&u(v,[`permissions`],i.permissions),i[`use-cases`]!==void 0&&u(v,[`use_cases`],i[`use-cases`]);let y=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${f}/one/integrations`,{body:Object.keys(v).length>0?v:void 0}));o(y,{successLabel:`Created`})})};function Ni(e){return e.usage(`$0 zero-trust casb integrations delete <id>
|
|
261
|
+
|
|
262
|
+
Delete an integration by soft-deleting it.`).positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Pi={command:`delete <id>`,describe:`Delete integration`,builder:Ni,handler:async t=>l({command:`zero-trust casb integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
263
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.casb.integrations.delete({account_id:l,id:t.id}));o(u,{successLabel:`Deleted`})})};function Fi(e){return e.usage(`$0 zero-trust casb integrations get <id>
|
|
264
|
+
|
|
265
|
+
Returns full integration details including use cases and permissions.`).positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ii={command:`get <id>`,describe:`Get integration details`,builder:Fi,handler:async t=>l({command:`zero-trust casb integrations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.casb.integrations.get({account_id:l,id:t.id}));o(u,{successLabel:`Loaded`})})};function Li(e){return e.usage(`$0 zero-trust casb integrations list
|
|
266
|
+
|
|
267
|
+
Returns a paginated list of integrations for the account.`).option(`application`,{type:`string`,description:`Filter by application/vendor (e.g., GOOGLE_WORKSPACE, MICROSOFT_INTERNAL).`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dlp-enabled`,{type:`boolean`,description:`Filter by DLP enabled status (true/false).`}).option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`application`,`created`,`name`,`status`]}).option(`page`,{type:`number`,description:`Page number within the paginated result set.`}).option(`page-size`,{type:`number`,description:`Number of results per page.`}).option(`search`,{type:`string`,description:`Search integrations by name or application.`}).option(`status`,{type:`string`,description:`Filter by integration status.`,choices:[`Healthy`,`Initializing`,`Offline`,`Unhealthy`]}).option(`use-cases`,{type:`string`,description:`Filter by enabled use cases (e.g., casb, ces). Matches integrations enrolled in any of the specified values. Can be specified multiple times.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ri={command:`list`,describe:`List integrations`,builder:y(Li),handler:async t=>l({command:`zero-trust casb integrations list`,classification:{safeFlags:[`direction`,`dlp-enabled`,`order`,`status`,`dry-run`]}},t,async()=>{let i={application:t.application,direction:t.direction,dlp_enabled:t[`dlp-enabled`],order:t.order,page:t.page,page_size:t[`page-size`],search:t.search,status:t.status,use_cases:t[`use-cases`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/integrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.integrations.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function zi(e){return e.usage(`$0 zero-trust casb integrations pause <id>
|
|
268
|
+
|
|
269
|
+
Pauses an integration, stopping all crawlers.`).positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bi={command:`pause <id>`,describe:`Pause integration`,builder:zi,handler:async t=>l({command:`zero-trust casb integrations pause`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb integrations pause`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/pause`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.casb.integrations.pause({account_id:l,id:t.id}));o(u,{successLabel:`Created`})})};function Vi(e){return e.usage(`$0 zero-trust casb integrations resume <id>
|
|
270
|
+
|
|
271
|
+
Resumes a paused integration, restarting crawlers.`).positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Hi={command:`resume <id>`,describe:`Resume integration`,builder:Vi,handler:async t=>l({command:`zero-trust casb integrations resume`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb integrations resume`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/resume`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.casb.integrations.resume({account_id:l,id:t.id}));o(u,{successLabel:`Created`})})};function Ui(e){return e.usage(`$0 zero-trust casb integrations update <id>
|
|
272
|
+
|
|
273
|
+
Updates an integration's name, permissions, DLP profiles, use cases, or credentials.`).positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dlp-profiles`,{type:`string`,array:!0,description:`List of DLP profile IDs to associate with the integration.`}).option(`name`,{type:`string`,description:`Name of the integration.`}).option(`permissions`,{type:`string`,array:!0,description:`List of permission scopes granted to the integration.`}).option(`use-cases`,{type:`string`,array:!0,description:`List of use case or feature slugs to enroll (e.g., ['casb', 'ces', 'auto_remediation']).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Serializer for v2 integration PATCH requests.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Wi={command:`update <id>`,describe:`Update integration`,builder:Ui,handler:async i=>l({command:`zero-trust casb integrations update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=await r();s({command:`cf zero-trust casb integrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/integrations/${i.id==null?`<id>`:encodeURIComponent(String(i.id))}`,pathParams:{id:String(i.id??``)},bodyKind:i.file===void 0?`json`:`octet-stream`,body:i.file===void 0?i.body===void 0?p({dlp_profiles:i[`dlp-profiles`],name:m(i.name,`name`,`text`),permissions:i.permissions,use_cases:i[`use-cases`]}):d(i.body):{file:i.file}});return}let l=await n(i),f=i.local?e:await a();if(i.accountId=f,i.file){let e=h(i.file),n=await c(`Updating`,async()=>t(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(i.id))}`,{body:e,headers:{"Content-Type":`text/plain;charset=UTF-8`}}));o(n,{successLabel:`Updated`});return}if(i.body){let e=d(i.body),n=await c(`Updating`,async()=>t(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(i.id))}`,{body:e}));o(n,{successLabel:`Updated`});return}let g={};i[`dlp-profiles`]!==void 0&&u(g,[`dlp_profiles`],i[`dlp-profiles`]),i.name!==void 0&&u(g,[`name`],m(i.name,`name`,`text`)),i.permissions!==void 0&&u(g,[`permissions`],i.permissions),i[`use-cases`]!==void 0&&u(g,[`use_cases`],i[`use-cases`]);let _=await c(`Updating`,async()=>t(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(i.id))}`,{body:Object.keys(g).length>0?g:void 0}));o(_,{successLabel:`Updated`})})},Gi={command:`integrations`,describe:`Operations for casb.integrations`,builder:e=>e.command(Mi).command(Pi).command(Ii).command(Ri).command(Bi).command(Hi).command(Wi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ki(e){return e.usage(`$0 zero-trust casb policies create
|
|
274
|
+
|
|
275
|
+
Creates a new policy configuration that defines automated actions to be executed when security findings are detected. A policy can include multiple remediation and/or webhook actions that will be triggered automatically.`).option(`applies-to-all-integrations`,{type:`boolean`,description:`When true, the policy applies to all integrations for the account. When false, integration_ids must be provided.`}).option(`description`,{type:`string`,description:`Optional description of what this policy does.`}).option(`display-name`,{type:`string`,description:`Display name for the policy configuration.`}).option(`enabled`,{type:`boolean`,description:`Boolean specifying if the policy is enabled or disabled.`}).option(`finding-type-id`,{type:`string`,description:`The finding type this policy is associated with. All remediation actions must match this finding type.`}).option(`integration-ids`,{type:`string`,array:!0,description:`The integrations this policy applies to. Required when applies_to_all_integrations is false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a new policy configuration.`})}const qi={command:`create`,describe:`Create a new policy configuration`,builder:Ki,handler:async t=>l({command:`zero-trust casb policies create`,classification:{safeFlags:[`applies-to-all-integrations`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/policies`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({applies_to_all_integrations:t[`applies-to-all-integrations`],description:m(t.description,`description`,`text`),display_name:m(t[`display-name`],`display-name`,`text`),enabled:t.enabled,finding_type_id:m(t[`finding-type-id`],`finding-type-id`,`text`),integration_ids:t[`integration-ids`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.casb.policies.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(t[`display-name`]===void 0&&(t[`display-name`]=await g(`display-name`,`Display name for the policy configuration.`)),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t[`finding-type-id`]===void 0&&(t[`finding-type-id`]=await g(`finding-type-id`,`The finding type this policy is associated with. All remediation actions must match this finding type.`));let u=p({applies_to_all_integrations:t[`applies-to-all-integrations`],description:m(t.description,`description`,`text`),display_name:m(t[`display-name`],`display-name`,`text`),enabled:t.enabled,finding_type_id:m(t[`finding-type-id`],`finding-type-id`,`text`),integration_ids:t[`integration-ids`]}),f=await c(`Creating`,async()=>i.zeroTrust.casb.policies.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Ji(e){return e.usage(`$0 zero-trust casb policies delete <policy-id>
|
|
276
|
+
|
|
277
|
+
Deletes a policy configuration.`).positional(`policy-id`,{type:`string`,description:`A UUID identifying the policy.`,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 Yi={command:`delete <policy-id>`,describe:`Delete a policy configuration`,builder:Ji,handler:async t=>l({command:`zero-trust casb policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/policies/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
278
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.casb.policies.delete({account_id:l,policy_id:t[`policy-id`]}));o(u,{successLabel:`Deleted`})})};function Xi(e){return e.usage(`$0 zero-trust casb policies get <policy-id>
|
|
279
|
+
|
|
280
|
+
Retrieves the details of a specific policy configuration, including its associated remediation and webhook actions.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy configuration to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Zi={command:`get <policy-id>`,describe:`Get a policy configuration by ID`,builder:Xi,handler:async t=>l({command:`zero-trust casb policies get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/policies/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.casb.policies.get({account_id:l,policy_id:t[`policy-id`]}));o(u,{successLabel:`Loaded`})})};function Qi(e){return e.usage(`$0 zero-trust casb policies list
|
|
281
|
+
|
|
282
|
+
Returns a list of integration-scoped policy configurations for the given account. This endpoint supports cursor based pagination. By default, results are returned in sorted order based on created_at.`).option(`cursor`,{type:`string`,description:"Cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $i={command:`list`,describe:`List policy configurations`,builder:Qi,handler:async t=>l({command:`zero-trust casb policies list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={cursor:t.cursor};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/policies`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.policies.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function ea(e){return e.usage(`$0 zero-trust casb policies update <policy-id>
|
|
283
|
+
|
|
284
|
+
Updates an existing policy configuration and replaces its actions.`).positional(`policy-id`,{type:`string`,description:`Policy configuration ID`,demandOption:!0}).option(`applies-to-all-integrations`,{type:`boolean`,description:`When true, the policy applies to all integrations for the account. When false, integration_ids must be provided.`}).option(`description`,{type:`string`,description:`Optional description of what this policy does.`}).option(`display-name`,{type:`string`,description:`Display name for the policy configuration.`}).option(`enabled`,{type:`boolean`,description:`Boolean specifying if the policy is enabled or disabled.`}).option(`integration-ids`,{type:`string`,array:!0,description:`The integrations this policy applies to. Required when applies_to_all_integrations is false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating an existing policy configuration.`})}const ta={command:`update <policy-id>`,describe:`Update a policy configuration`,builder:ea,handler:async t=>l({command:`zero-trust casb policies update`,classification:{safeFlags:[`applies-to-all-integrations`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/policies/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({applies_to_all_integrations:t[`applies-to-all-integrations`],description:m(t.description,`description`,`text`),display_name:m(t[`display-name`],`display-name`,`text`),enabled:t.enabled,integration_ids:t[`integration-ids`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.casb.policies.update({...e,account_id:l,policy_id:t[`policy-id`]}));o(n,{successLabel:`Updated`});return}if(t[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(t[`display-name`]===void 0&&(t[`display-name`]=await g(`display-name`,`Display name for the policy configuration.`)),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({applies_to_all_integrations:t[`applies-to-all-integrations`],description:m(t.description,`description`,`text`),display_name:m(t[`display-name`],`display-name`,`text`),enabled:t.enabled,integration_ids:t[`integration-ids`]}),f=await c(`Updating`,async()=>i.zeroTrust.casb.policies.update({...u,account_id:l,policy_id:t[`policy-id`]}));o(f,{successLabel:`Updated`})})},na={command:`policies`,describe:`Operations for casb.policies`,builder:e=>e.command(qi).command(Yi).command(Zi).command($i).command(ta).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ra(e){return e.usage(`$0 zero-trust casb remediations jobs create
|
|
285
|
+
|
|
286
|
+
Create one or more remediation jobs tied to a specific Cloudflare Account.`).option(`finding-instance-ids`,{type:`string`,array:!0,description:`UUIDs identifying Finding Instances.`}).option(`remediation-type-id`,{type:`string`,description:`A UUID identifying this Remediation Type.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating remediation jobs.`})}const ia={command:`create`,describe:`Creates remediation jobs`,builder:ra,handler:async t=>l({command:`zero-trust casb remediations jobs create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb remediations jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({finding_instance_ids:t[`finding-instance-ids`],remediation_type_id:m(t[`remediation-type-id`],`remediation-type-id`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.casb.remediations.jobs.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);t[`remediation-type-id`]===void 0&&(t[`remediation-type-id`]=await g(`remediation-type-id`,`A UUID identifying this Remediation Type.`));let u=p({finding_instance_ids:t[`finding-instance-ids`],remediation_type_id:m(t[`remediation-type-id`],`remediation-type-id`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.casb.remediations.jobs.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function aa(e){return e.usage(`$0 zero-trust casb remediations jobs export
|
|
287
|
+
|
|
288
|
+
Creates a CSV export for remediation jobs and accepts optional filters in the payload.`).option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or before this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or after this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`orders`,{type:`string`,description:`Ordering specifications for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`status`,{type:`string`,array:!0,description:`Filter by remediation job status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for remediation jobs export.`})}const oa={command:`export`,describe:`Create a remediation jobs export`,builder:aa,handler:async t=>l({command:`zero-trust casb remediations jobs export`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb remediations jobs export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/remediations/jobs/export`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({integration_id:t[`integration-id`],max_updated_at:m(t[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:m(t[`min-updated-at`],`min-updated-at`,`text`),orders:f(t.orders,`orders`),search:m(t.search,`search`,`text`),status:t.status}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Loading`,async()=>i.zeroTrust.casb.remediations.jobs.export({...e,account_id:l}));o(n,{successLabel:`Loaded`});return}let u=p({integration_id:t[`integration-id`],max_updated_at:m(t[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:m(t[`min-updated-at`],`min-updated-at`,`text`),orders:f(t.orders,`orders`),search:m(t.search,`search`,`text`),status:t.status}),h=await c(`Loading`,async()=>i.zeroTrust.casb.remediations.jobs.export({...u,account_id:l}));o(h,{successLabel:`Loaded`})})};function sa(e){return e.usage("$0 zero-trust casb remediations jobs list\n\nList all remediation jobs tied to a specific Cloudflare Account. Note that `cursor` and `page` are mutually exclusive.").option(`cursor`,{type:`string`,description:`A cursor for pagination.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`min-updated-at`,{type:`string`,description:`Filter to view remediations updated on or after the min updated datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`max-updated-at`,{type:`string`,description:`Filter to view remediations updated on or before the max updated datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`status`,{type:`string`,description:`Filter to view remediations with the given status.`,choices:[`pending`,`processing`,`completed`,`failed`,`validating`]}).option(`triggered-by-actor`,{type:`string`,description:`Filter remediations by what kind of actor triggered them. Supports multiple comma-separated values.`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`order`,{type:`string`,description:`An optional param to sort the results by the given field.`,choices:[`created_at`,`affliction_date`,`integration_name`,`status`,`last_updated_at`,`asset_name`,`finding_type_name`]}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ca={command:`list`,describe:`List remediation jobs`,builder:y(sa),handler:async t=>l({command:`zero-trust casb remediations jobs list`,classification:{safeFlags:[`status`,`order`,`direction`,`dry-run`]}},t,async()=>{let i={cursor:t.cursor,page:t.page,per_page:t[`per-page`],search:t.search,min_updated_at:t[`min-updated-at`],max_updated_at:t[`max-updated-at`],status:t.status,triggered_by_actor:t[`triggered-by-actor`],integration_id:t[`integration-id`],order:t.order,direction:t.direction};if(t.dryRun){let e=await r();s({command:`cf zero-trust casb remediations jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.casb.remediations.jobs.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},la={command:`jobs`,describe:`Operations for casb.remediations.jobs`,builder:e=>e.command(ia).command(oa).command(ca).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ua={command:`remediations`,describe:`Operations for casb.remediations`,builder:e=>e.command(la).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function da(e){return e.usage(`$0 zero-trust casb webhooks create
|
|
289
|
+
|
|
290
|
+
Creates a new webhook configuration for sending finding notifications to external endpoints.`).option(`authentication-type`,{type:`string`,description:`Type of authentication used for the webhook.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL for the webhook configuration. Where resulting data will be sent.`}).option(`headers`,{type:`string`,description:`List of custom headers to include in webhook requests. Provide as a JSON array of objects or @path/to/file.json.`}).option(`label`,{type:`string`,description:`Account-specified display label for the webhook configuration.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`status`,{type:`string`,description:`Status of the webhook configuration. Defaults to enabled when omitted.`,choices:[`enabled`,`disabled`],default:`enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a new webhook configuration.`})}const fa={command:`create`,describe:`Create a new webhook configuration`,builder:da,handler:async t=>l({command:`zero-trust casb webhooks create`,classification:{safeFlags:[`authentication-type`,`status`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb webhooks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({authentication_type:m(t[`authentication-type`],`authentication-type`,`text`),destination_url:m(t[`destination-url`],`destination-url`,`text`),headers:f(t.headers,`headers`),label:m(t.label,`label`,`text`),signing_secret:m(t[`signing-secret`],`signing-secret`,`text`),status:m(t.status,`status`,`text`)}):d(t.body),sensitiveBodyPaths:[[`signing_secret`]]});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.casb.webhooks.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t[`authentication-type`]===void 0&&(t[`authentication-type`]=await _(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),t[`destination-url`]===void 0&&(t[`destination-url`]=await g(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),t.label===void 0&&(t.label=await g(`label`,`Account-specified display label for the webhook configuration.`));let u=p({authentication_type:m(t[`authentication-type`],`authentication-type`,`text`),destination_url:m(t[`destination-url`],`destination-url`,`text`),headers:f(t.headers,`headers`),label:m(t.label,`label`,`text`),signing_secret:m(t[`signing-secret`],`signing-secret`,`text`),status:m(t.status,`status`,`text`)}),h=await c(`Creating`,async()=>i.zeroTrust.casb.webhooks.create({...u,account_id:l}));o(h,{successLabel:`Created`})})};function pa(e){return e.usage(`$0 zero-trust casb webhooks delete <webhook-id>
|
|
291
|
+
|
|
292
|
+
Soft deletes a webhook configuration by its unique identifier. The webhook will be marked as deleted and will no longer be available for use.`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,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 ma={command:`delete <webhook-id>`,describe:`Delete a webhook configuration`,builder:pa,handler:async t=>l({command:`zero-trust casb webhooks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb webhooks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/webhooks/${t[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(t[`webhook-id`]))}`,pathParams:{"webhook-id":String(t[`webhook-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
293
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.casb.webhooks.delete({account_id:l,webhook_id:t[`webhook-id`]}));o(u,{successLabel:`Deleted`})})};function ha(e){return e.usage(`$0 zero-trust casb webhooks evaluate-existing <webhook-id>
|
|
294
|
+
|
|
295
|
+
Sends a test webhook event using an existing webhook configuration. This allows customers to verify their webhook endpoint is still reachable and properly configured after creating the webhook resource. The test payload includes: - event_type: "webhook.test" - timestamp: Current UTC timestamp - message: Test message indicating this is from Cloudflare CASB - data: Object with test: true`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ga={command:`evaluate-existing <webhook-id>`,describe:`Test an existing webhook configuration`,builder:ha,handler:async t=>l({command:`zero-trust casb webhooks evaluate-existing`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb webhooks evaluate-existing`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/webhooks/${t[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(t[`webhook-id`]))}/evaluate`,pathParams:{"webhook-id":String(t[`webhook-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.casb.webhooks.evaluateExisting({account_id:l,webhook_id:t[`webhook-id`]}));o(u,{successLabel:`Created`})})};function _a(e){return e.usage(`$0 zero-trust casb webhooks evaluate
|
|
296
|
+
|
|
297
|
+
Sends a test webhook event to the specified destination URL to verify the webhook endpoint is reachable and properly configured. This allows customers to validate their webhook configuration before creating the actual webhook resource. The test payload includes: - event_type: "webhook.test" - timestamp: Current UTC timestamp - message: Test message indicating this is from Cloudflare CASB - data: Object with test: true`).option(`authentication-type`,{type:`string`,description:`Type of authentication to use for the test webhook request.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL to send the test webhook event to.`}).option(`headers`,{type:`string`,description:`List of custom headers to include in the test webhook request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for testing a webhook configuration before creating it.`})}const va={command:`evaluate`,describe:`Test a webhook configuration before creating it`,builder:_a,handler:async t=>l({command:`zero-trust casb webhooks evaluate`,classification:{safeFlags:[`authentication-type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb webhooks evaluate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/webhooks/evaluate`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({authentication_type:m(t[`authentication-type`],`authentication-type`,`text`),destination_url:m(t[`destination-url`],`destination-url`,`text`),headers:f(t.headers,`headers`),signing_secret:m(t[`signing-secret`],`signing-secret`,`text`)}):d(t.body),sensitiveBodyPaths:[[`signing_secret`]]});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.casb.webhooks.evaluate({...e,account_id:l}));o(n,{successLabel:`Created`});return}t[`authentication-type`]===void 0&&(t[`authentication-type`]=await _(`authentication-type`,`Type of authentication to use for the test webhook request.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),t[`destination-url`]===void 0&&(t[`destination-url`]=await g(`destination-url`,`Target URL to send the test webhook event to.`));let u=p({authentication_type:m(t[`authentication-type`],`authentication-type`,`text`),destination_url:m(t[`destination-url`],`destination-url`,`text`),headers:f(t.headers,`headers`),signing_secret:m(t[`signing-secret`],`signing-secret`,`text`)}),h=await c(`Creating`,async()=>i.zeroTrust.casb.webhooks.evaluate({...u,account_id:l}));o(h,{successLabel:`Created`})})};function ya(e){return e.usage(`$0 zero-trust casb webhooks get <webhook-id>
|
|
298
|
+
|
|
299
|
+
Retrieves a specific webhook configuration by its unique identifier.`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ba={command:`get <webhook-id>`,describe:`Get webhook configuration by ID`,builder:ya,handler:async t=>l({command:`zero-trust casb webhooks get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb webhooks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/webhooks/${t[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(t[`webhook-id`]))}`,pathParams:{"webhook-id":String(t[`webhook-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.casb.webhooks.get({account_id:l,webhook_id:t[`webhook-id`]}));o(u,{successLabel:`Loaded`})})};function xa(e){return e.usage(`$0 zero-trust casb webhooks jobs create
|
|
300
|
+
|
|
301
|
+
Creates webhook jobs to send a finding instance to one or more configured webhooks.`).option(`finding-instance-ids`,{type:`string`,array:!0,description:`Array of finding instance IDs to send to the webhooks.`}).option(`webhook-ids`,{type:`string`,array:!0,description:`Array of webhook IDs to trigger jobs for.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating up to 100 webhook jobs. The number of jobs is the product of webhook_ids and finding_instance_ids.`})}const Sa={command:`create`,describe:`Create webhook jobs`,builder:xa,handler:async t=>l({command:`zero-trust casb webhooks jobs create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb webhooks jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/webhooks/jobs`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({finding_instance_ids:t[`finding-instance-ids`],webhook_ids:t[`webhook-ids`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.casb.webhooks.jobs.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);if(t[`webhook-ids`]===void 0)throw Error(`--webhook-ids is required (or pass --body with this field set).`);let u=p({finding_instance_ids:t[`finding-instance-ids`],webhook_ids:t[`webhook-ids`]}),f=await c(`Creating`,async()=>i.zeroTrust.casb.webhooks.jobs.create({...u,account_id:l}));o(f,{successLabel:`Created`})})},Ca={command:`jobs`,describe:`Operations for casb.webhooks.jobs`,builder:e=>e.command(Sa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function wa(e){return e.usage(`$0 zero-trust casb webhooks list
|
|
302
|
+
|
|
303
|
+
Retrieves all webhook configurations for the authenticated account. Returns an array of webhook configurations that can be used to send finding notifications.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ta={command:`list`,describe:`List webhook configurations`,builder:wa,handler:async t=>l({command:`zero-trust casb webhooks list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb webhooks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.casb.webhooks.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function Ea(e){return e.usage(`$0 zero-trust casb webhooks update <webhook-id>
|
|
304
|
+
|
|
305
|
+
Updates an existing webhook configuration with new settings.`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`authentication-type`,{type:`string`,description:`Type of authentication used for the webhook.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL for the webhook configuration. Where resulting data will be sent.`}).option(`headers`,{type:`string`,description:`List of custom headers to include in webhook requests. Provide as a JSON array of objects or @path/to/file.json.`}).option(`label`,{type:`string`,description:`Account-specified display label for the webhook configuration.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`status`,{type:`string`,description:`Status of the webhook configuration.`,choices:[`enabled`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating an existing webhook configuration.`})}const Da={command:`update <webhook-id>`,describe:`Update an existing webhook configuration`,builder:Ea,handler:async t=>l({command:`zero-trust casb webhooks update`,classification:{safeFlags:[`authentication-type`,`status`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust casb webhooks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/webhooks/${t[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(t[`webhook-id`]))}`,pathParams:{"webhook-id":String(t[`webhook-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({authentication_type:m(t[`authentication-type`],`authentication-type`,`text`),destination_url:m(t[`destination-url`],`destination-url`,`text`),headers:f(t.headers,`headers`),label:m(t.label,`label`,`text`),signing_secret:m(t[`signing-secret`],`signing-secret`,`text`),status:m(t.status,`status`,`text`)}):d(t.body),sensitiveBodyPaths:[[`signing_secret`]]});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.casb.webhooks.update({...e,account_id:l,webhook_id:t[`webhook-id`]}));o(n,{successLabel:`Updated`});return}t[`authentication-type`]===void 0&&(t[`authentication-type`]=await _(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),t[`destination-url`]===void 0&&(t[`destination-url`]=await g(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),t.label===void 0&&(t.label=await g(`label`,`Account-specified display label for the webhook configuration.`)),t.status===void 0&&(t.status=await _(`status`,`Status of the webhook configuration.`,[`enabled`,`disabled`]));let u=p({authentication_type:m(t[`authentication-type`],`authentication-type`,`text`),destination_url:m(t[`destination-url`],`destination-url`,`text`),headers:f(t.headers,`headers`),label:m(t.label,`label`,`text`),signing_secret:m(t[`signing-secret`],`signing-secret`,`text`),status:m(t.status,`status`,`text`)}),h=await c(`Updating`,async()=>i.zeroTrust.casb.webhooks.update({...u,account_id:l,webhook_id:t[`webhook-id`]}));o(h,{successLabel:`Updated`})})},Oa={command:`webhooks`,describe:`Operations for casb.webhooks`,builder:e=>e.command(fa).command(ma).command(va).command(ga).command(ba).command(Ta).command(Da).command(Ca).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ka={command:`casb`,describe:`Operations for casb`,builder:e=>e.command(Br).command(Gr).command(Xr).command(ii).command(Ai).command(Gi).command(na).command(ua).command(Oa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Aa(e){return e.usage(`$0 zero-trust connectivity-settings edit
|
|
306
|
+
|
|
307
|
+
Updates the Zero Trust Connectivity Settings for the given account.`).option(`icmp-proxy-enabled`,{type:`boolean`,description:`A flag to enable the ICMP proxy for the account network.`}).option(`offramp-warp-enabled`,{type:`boolean`,description:`A flag to enable WARP to WARP traffic.`}).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 ja={command:`edit`,describe:`Updates the Zero Trust Connectivity Settings`,builder:Aa,handler:async t=>l({command:`zero-trust connectivity-settings edit`,classification:{safeFlags:[`icmp-proxy-enabled`,`offramp-warp-enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust connectivity-settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zerotrust/connectivity_settings`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({icmp_proxy_enabled:t[`icmp-proxy-enabled`],offramp_warp_enabled:t[`offramp-warp-enabled`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.connectivitySettings.edit({...e,account_id:l}));o(n,{successLabel:`Updated`});return}let u=p({icmp_proxy_enabled:t[`icmp-proxy-enabled`],offramp_warp_enabled:t[`offramp-warp-enabled`]}),f=await c(`Updating`,async()=>i.zeroTrust.connectivitySettings.edit({...u,account_id:l}));o(f,{successLabel:`Updated`})})};function Ma(e){return e.usage(`$0 zero-trust connectivity-settings get
|
|
308
|
+
|
|
309
|
+
Gets the Zero Trust Connectivity Settings for the given account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Na={command:`get`,describe:`Get Zero Trust Connectivity Settings`,builder:Ma,handler:async t=>l({command:`zero-trust connectivity-settings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust connectivity-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zerotrust/connectivity_settings`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.connectivitySettings.get({account_id:l}));o(u,{successLabel:`Loaded`})})},Pa={command:`connectivity-settings`,describe:`Operations for connectivity-settings`,builder:e=>e.command(ja).command(Na).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fa(e){return e.usage(`$0 zero-trust devices client-versions list
|
|
310
|
+
|
|
311
|
+
Lists available WARP client versions for a specific target environment and release track. This endpoint is in Beta.`).option(`target-environment`,{type:`string`,description:`The target environment for the client version (e.g., windows, macos).`,demandOption:!0}).option(`release-track`,{type:`string`,description:`The release track (ga for General Availability, beta for Beta releases).`,choices:[`ga`,`beta`],demandOption:!0}).option(`page`,{type:`number`,description:`The page number to return.`}).option(`per-page`,{type:`number`,description:`The maximum number of versions to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ia={command:`list`,describe:`List client versions`,builder:y(Fa),handler:async t=>l({command:`zero-trust devices client-versions list`,classification:{safeFlags:[`release-track`,`dry-run`]}},t,async()=>{let i={target_environment:t[`target-environment`],release_track:t[`release-track`],page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust devices client-versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/client-versions`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.devices.clientVersions.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function La(e){return e.usage(`$0 zero-trust devices client-versions target-environments list
|
|
312
|
+
|
|
313
|
+
Retrieves a list of all available target environments with their display names. This endpoint is in Beta.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ra={command:`list`,describe:`List available target environments`,builder:La,handler:async t=>l({command:`zero-trust devices client-versions target-environments list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices client-versions target-environments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/client-versions/target-environments`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.clientVersions.targetEnvironments.list({account_id:l}));o(u,{successLabel:`Loaded`})})},za={command:`target-environments`,describe:`Operations for devices.client-versions.target-environments`,builder:e=>e.command(Ra).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ba={command:`client-versions`,describe:`Operations for devices.client-versions`,builder:e=>e.command(Ia).command(za).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Va(e){return e.usage(`$0 zero-trust devices delete <device-id>
|
|
314
|
+
|
|
315
|
+
Deletes a WARP device.`).positional(`device-id`,{type:`string`,description:`Device ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ha={command:`delete <device-id>`,describe:`Delete device`,builder:Va,handler:async t=>l({command:`zero-trust devices delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/physical-devices/${t[`device-id`]==null?`<device-id>`:encodeURIComponent(String(t[`device-id`]))}`,pathParams:{"device-id":String(t[`device-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
316
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.devices.delete({account_id:l,device_id:t[`device-id`]}));o(u,{successLabel:`Deleted`})})};function Ua(e){return e.usage(`$0 zero-trust devices deployment-groups create
|
|
317
|
+
|
|
318
|
+
Creates a new deployment group. Policy IDs must be unique across all deployment groups. This endpoint is in Beta.`).option(`name`,{type:`string`,description:`A user-friendly name for the deployment group.`}).option(`policy-ids`,{type:`string`,array:!0,description:`Contains an optional list of policy IDs assigned to a group.`}).option(`version-config`,{type:`string`,description:`Contains at least one version configuration. 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 Wa={command:`create`,describe:`Create deployment group`,builder:Ua,handler:async t=>l({command:`zero-trust devices deployment-groups create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices deployment-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/deployment-groups`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({name:m(t.name,`name`,`text`),policy_ids:t[`policy-ids`],version_config:f(t[`version-config`],`version-config`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.devices.deploymentGroups.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.name===void 0&&(t.name=await g(`name`,`A user-friendly name for the deployment group.`)),t[`version-config`]===void 0)throw Error(`--version-config is required (or pass --body with this field set).`);let u=p({name:m(t.name,`name`,`text`),policy_ids:t[`policy-ids`],version_config:f(t[`version-config`],`version-config`)}),h=await c(`Creating`,async()=>i.zeroTrust.devices.deploymentGroups.create({...u,account_id:l}));o(h,{successLabel:`Created`})})};function Ga(e){return e.usage(`$0 zero-trust devices deployment-groups delete <group-id>
|
|
319
|
+
|
|
320
|
+
Deletes a deployment group. Associated policies no longer apply and devices stop receiving version targets. This endpoint is in Beta.`).positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ka={command:`delete <group-id>`,describe:`Delete deployment group`,builder:Ga,handler:async t=>l({command:`zero-trust devices deployment-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices deployment-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/deployment-groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
321
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.devices.deploymentGroups.delete({account_id:l,group_id:t[`group-id`]}));o(u,{successLabel:`Deleted`})})};function qa(e){return e.usage(`$0 zero-trust devices deployment-groups get <group-id>
|
|
322
|
+
|
|
323
|
+
Fetches a single deployment group by its ID. This endpoint is in Beta.`).positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ja={command:`get <group-id>`,describe:`Get deployment group`,builder:qa,handler:async t=>l({command:`zero-trust devices deployment-groups get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices deployment-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/deployment-groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.deploymentGroups.get({account_id:l,group_id:t[`group-id`]}));o(u,{successLabel:`Loaded`})})};function Ya(e){return e.usage(`$0 zero-trust devices deployment-groups list
|
|
324
|
+
|
|
325
|
+
Lists all deployment groups for an account. Use deployment groups to assign target WARP client versions to specific devices. This endpoint is in Beta.`).option(`page`,{type:`number`,description:`The page number to return.`}).option(`per-page`,{type:`number`,description:`The maximum number of deployment groups to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xa={command:`list`,describe:`List deployment groups`,builder:Ya,handler:async t=>l({command:`zero-trust devices deployment-groups list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust devices deployment-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/deployment-groups`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.devices.deploymentGroups.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function Za(e){return e.usage(`$0 zero-trust devices deployment-groups update <group-id>
|
|
326
|
+
|
|
327
|
+
Updates a deployment group. Returns 409 if any newly added policy IDs already belong to another deployment group. This endpoint is in Beta.`).positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`name`,{type:`string`,description:`A user-friendly name for the deployment group.`}).option(`policy-ids`,{type:`string`,array:!0,description:`Replaces the entire list of policy IDs.`}).option(`version-config`,{type:`string`,description:`Replaces the entire version_config array. 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 Qa={command:`update <group-id>`,describe:`Update deployment group`,builder:Za,handler:async t=>l({command:`zero-trust devices deployment-groups update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices deployment-groups update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/deployment-groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({name:m(t.name,`name`,`text`),policy_ids:t[`policy-ids`],version_config:f(t[`version-config`],`version-config`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.devices.deploymentGroups.update({...e,account_id:l,group_id:t[`group-id`]}));o(n,{successLabel:`Updated`});return}let u=p({name:m(t.name,`name`,`text`),policy_ids:t[`policy-ids`],version_config:f(t[`version-config`],`version-config`)}),h=await c(`Updating`,async()=>i.zeroTrust.devices.deploymentGroups.update({...u,account_id:l,group_id:t[`group-id`]}));o(h,{successLabel:`Updated`})})},$a={command:`deployment-groups`,describe:`Operations for devices.deployment-groups`,builder:e=>e.command(Wa).command(Ka).command(Ja).command(Xa).command(Qa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function eo(e){return e.usage(`$0 zero-trust devices emergency-disconnect get
|
|
328
|
+
|
|
329
|
+
Fetch the Global WARP disconnect state.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const to={command:`get`,describe:`Get Global Disconnect`,builder:eo,handler:async t=>l({command:`zero-trust devices emergency-disconnect get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices emergency-disconnect get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/resilience/disconnect`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.emergencyDisconnect.get({account_id:l}));o(u,{successLabel:`Loaded`})})};function no(e){return e.usage(`$0 zero-trust devices emergency-disconnect set
|
|
330
|
+
|
|
331
|
+
Sets the Global WARP disconnect state.`).option(`disconnect`,{type:`boolean`,description:`Disconnects all devices on the account using Global WARP override.`}).option(`justification`,{type:`string`,description:`Reasoning for setting the Global WARP override state. This will be surfaced in the audit log.`}).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 ro={command:`set`,describe:`Set Global Disconnect`,builder:no,handler:async t=>l({command:`zero-trust devices emergency-disconnect set`,classification:{safeFlags:[`disconnect`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices emergency-disconnect set`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/resilience/disconnect`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({disconnect:t.disconnect,justification:m(t.justification,`justification`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.devices.emergencyDisconnect.set({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.disconnect===void 0)throw Error(`--disconnect is required (or pass --body with this field set).`);let u=p({disconnect:t.disconnect,justification:m(t.justification,`justification`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.devices.emergencyDisconnect.set({...u,account_id:l}));o(f,{successLabel:`Created`})})},io={command:`emergency-disconnect`,describe:`Operations for devices.emergency-disconnect`,builder:e=>e.command(to).command(ro).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ao(e){return e.usage(`$0 zero-trust devices get <device-id>
|
|
332
|
+
|
|
333
|
+
Fetches a single WARP device.`).positional(`device-id`,{type:`string`,description:`Device ID`,demandOption:!0}).option(`include`,{type:`string`,description:`Comma-separated list of additional information that should be included in the device response. Supported values are: "last_seen_registration.policy".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oo={command:`get <device-id>`,describe:`Get device`,builder:ao,handler:async t=>l({command:`zero-trust devices get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={include:t.include};if(t.dryRun){let e=await r();s({command:`cf zero-trust devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/physical-devices/${t[`device-id`]==null?`<device-id>`:encodeURIComponent(String(t[`device-id`]))}`,pathParams:{"device-id":String(t[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.devices.get({account_id:u,device_id:t[`device-id`],...i}));o(d,{successLabel:`Loaded`})})};function so(e){return e.usage(`$0 zero-trust devices ip-profiles create
|
|
334
|
+
|
|
335
|
+
Creates a WARP Device IP profile. Currently, only IPv4 Device subnets can be associated.`).option(`description`,{type:`string`,description:`An optional description of the Device IP profile.`}).option(`enabled`,{type:`boolean`,description:`Whether the Device IP profile will be applied to matching devices.`,default:!0}).option(`match`,{type:`string`,description:`The wirefilter expression to match registrations. Available values: "identity.name", "identity.email", "identity.groups.id", "identity.groups.name", "identity.groups.email", "identity.saml_attributes".`}).option(`name`,{type:`string`,description:`A user-friendly name for the Device IP profile.`}).option(`precedence`,{type:`number`,description:`The precedence of the Device IP profile. Lower values indicate higher precedence. Device IP profile will be evaluated in ascending order of this field.`}).option(`subnet-id`,{type:`string`,description:`The ID of the Subnet.`}).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 co={command:`create`,describe:`Create IP profile`,builder:so,handler:async t=>l({command:`zero-trust devices ip-profiles create`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices ip-profiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/ip-profiles`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),enabled:t.enabled,match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,subnet_id:m(t[`subnet-id`],`subnet-id`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.devices.ipProfiles.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.match===void 0&&(t.match=await g(`match`,`The wirefilter expression to match registrations. Available values: "identity.name", "identity.email", "identity.groups.id", "identity.groups.name", "identity.groups.email", "identity.saml_attributes".`)),t.name===void 0&&(t.name=await g(`name`,`A user-friendly name for the Device IP profile.`)),t.precedence===void 0)throw Error(`--precedence is required (or pass --body with this field set).`);t[`subnet-id`]===void 0&&(t[`subnet-id`]=await g(`subnet-id`,`The ID of the Subnet.`));let u=p({description:m(t.description,`description`,`text`),enabled:t.enabled,match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,subnet_id:m(t[`subnet-id`],`subnet-id`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.devices.ipProfiles.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function lo(e){return e.usage(`$0 zero-trust devices ip-profiles delete <profile-id>
|
|
336
|
+
|
|
337
|
+
Delete a WARP Device IP profile.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const uo={command:`delete <profile-id>`,describe:`Delete IP profile`,builder:lo,handler:async t=>l({command:`zero-trust devices ip-profiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices ip-profiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/ip-profiles/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
338
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.devices.ipProfiles.delete({account_id:l,profile_id:t[`profile-id`]}));o(u,{successLabel:`Deleted`})})};function fo(e){return e.usage(`$0 zero-trust devices ip-profiles get <profile-id>
|
|
339
|
+
|
|
340
|
+
Fetches a single WARP Device IP profile.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const po={command:`get <profile-id>`,describe:`Get IP profile`,builder:fo,handler:async t=>l({command:`zero-trust devices ip-profiles get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices ip-profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/ip-profiles/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.ipProfiles.get({account_id:l,profile_id:t[`profile-id`]}));o(u,{successLabel:`Loaded`})})};function mo(e){return e.usage(`$0 zero-trust devices ip-profiles list
|
|
341
|
+
|
|
342
|
+
Lists WARP Device IP profiles.`).option(`page`,{type:`number`,description:`The page number to return.`}).option(`per-page`,{type:`number`,description:`The number of IP profiles to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ho={command:`list`,describe:`List IP profiles`,builder:mo,handler:async t=>l({command:`zero-trust devices ip-profiles list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust devices ip-profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/ip-profiles`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.devices.ipProfiles.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function go(e){return e.usage(`$0 zero-trust devices ip-profiles update <profile-id>
|
|
343
|
+
|
|
344
|
+
Updates a WARP Device IP profile. Currently, only IPv4 Device subnets can be associated.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`description`,{type:`string`,description:`An optional description of the Device IP profile.`}).option(`enabled`,{type:`boolean`,description:`Whether the Device IP profile is enabled.`}).option(`match`,{type:`string`,description:`The wirefilter expression to match registrations. Available values: "identity.name", "identity.email", "identity.groups.id", "identity.groups.name", "identity.groups.email", "identity.saml_attributes".`}).option(`name`,{type:`string`,description:`A user-friendly name for the Device IP profile.`}).option(`precedence`,{type:`number`,description:`The precedence of the Device IP profile. Lower values indicate higher precedence. Device IP profile will be evaluated in ascending order of this field.`}).option(`subnet-id`,{type:`string`,description:`The ID of the Subnet.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _o={command:`update <profile-id>`,describe:`Update IP profile`,builder:go,handler:async t=>l({command:`zero-trust devices ip-profiles update`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices ip-profiles update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/ip-profiles/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),enabled:t.enabled,match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,subnet_id:m(t[`subnet-id`],`subnet-id`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.devices.ipProfiles.update({...e,account_id:l,profile_id:t[`profile-id`]}));o(n,{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),enabled:t.enabled,match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,subnet_id:m(t[`subnet-id`],`subnet-id`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.devices.ipProfiles.update({...u,account_id:l,profile_id:t[`profile-id`]}));o(f,{successLabel:`Updated`})})},vo={command:`ip-profiles`,describe:`Operations for devices.ip-profiles`,builder:e=>e.command(co).command(uo).command(po).command(ho).command(_o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function yo(e){return e.usage(`$0 zero-trust devices list
|
|
345
|
+
|
|
346
|
+
Lists WARP devices.`).option(`cursor`,{type:`string`,description:`Opaque token indicating the starting position when requesting the next set of records. A cursor value can be obtained from the result_info.cursor field in the response.`}).option(`sort-by`,{type:`string`,description:`The device field to order results by.`,choices:[`name`,`id`,`client_version`,`last_seen_user.email`,`last_seen_at`,`active_registrations`,`created_at`]}).option(`sort-order`,{type:`string`,description:`Sort direction.`,choices:[`asc`,`desc`]}).option(`last-seen-user-email`,{type:`string`,description:`Filter by the last seen user's email.`}).option(`seen-after`,{type:`string`,description:`Filter by the last_seen timestamp - returns only devices last seen after this timestamp.`}).option(`seen-before`,{type:`string`,description:`Filter by the last_seen timestamp - returns only devices last seen before this timestamp.`}).option(`per-page`,{type:`number`,description:`The maximum number of devices to return in a single response.`}).option(`search`,{type:`string`,description:`Search by device details.`}).option(`active-registrations`,{type:`string`,description:`Include or exclude devices with active registrations. The default is "only" - return only devices with active registrations.`,choices:[`include`,`only`,`exclude`]}).option(`has-registration-type`,{type:`string`,description:`Filter by the type of active registration associated with the device.`,choices:[`warp`,`browser_extension`]}).option(`id`,{type:`string`,description:`Filter by a one or more device IDs.`}).option(`tag`,{type:`string`,description:`Filter by one or more device tags in key:value format. Devices must match all provided tags.`}).option(`last-seen-registration-policy-id`,{type:`string`,description:`Filter by the ID of the device settings profile assigned to the device registration.`}).option(`include`,{type:`string`,description:`Comma-separated list of additional information that should be included in the device response. Supported values are: "last_seen_registration.policy".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bo={command:`list`,describe:`List devices`,builder:y(yo),handler:async t=>l({command:`zero-trust devices list`,classification:{safeFlags:[`sort-by`,`sort-order`,`active-registrations`,`has-registration-type`,`dry-run`]}},t,async()=>{let i={cursor:t.cursor,sort_by:t[`sort-by`],sort_order:t[`sort-order`],"last_seen_user.email":t[`last-seen-user-email`],seen_after:t[`seen-after`],seen_before:t[`seen-before`],per_page:t[`per-page`],search:t.search,active_registrations:t[`active-registrations`],has_registration_type:t[`has-registration-type`],id:t.id,tag:t.tag,"last_seen_registration.policy.id":t[`last-seen-registration-policy-id`],include:t.include};if(t.dryRun){let e=await r();s({command:`cf zero-trust devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/physical-devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.devices.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function xo(e){return e.usage(`$0 zero-trust devices networks create
|
|
347
|
+
|
|
348
|
+
Creates a new device managed network.`).option(`config-sha256`,{type:`string`,description:`The SHA-256 hash of the TLS certificate presented by the host found at tls_sockaddr. If absent, regular certificate verification (trusted roots, valid timestamp, etc) will be used to validate the certificate.`}).option(`config-tls-sockaddr`,{type:`string`,description:`A network address of the form "host:port" that the WARP client will use to detect the presence of a TLS host.`}).option(`name`,{type:`string`,description:`The name of the device managed network. This name must be unique.`}).option(`type`,{type:`string`,description:`The type of device managed network.`,choices:[`tls`]}).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 So={command:`create`,describe:`Create a device managed network`,builder:xo,handler:async t=>l({command:`zero-trust devices networks create`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices networks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/networks`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({config:{sha256:m(t[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:m(t[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.devices.networks.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t[`config-tls-sockaddr`]===void 0&&(t[`config-tls-sockaddr`]=await g(`config-tls-sockaddr`,`A network address of the form "host:port" that the WARP client will use to detect the presence of a TLS host.`)),t.name===void 0&&(t.name=await g(`name`,`The name of the device managed network. This name must be unique.`)),t.type===void 0&&(t.type=await _(`type`,`The type of device managed network.`,[`tls`]));let u=p({config:{sha256:m(t[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:m(t[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.devices.networks.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Co(e){return e.usage(`$0 zero-trust devices networks delete <network-id>
|
|
349
|
+
|
|
350
|
+
Deletes a device managed network and fetches a list of the remaining device managed networks for an account.`).positional(`network-id`,{type:`string`,description:`API UUID.`,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 wo={command:`delete <network-id>`,describe:`Delete a device managed network`,builder:Co,handler:async t=>l({command:`zero-trust devices networks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices networks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/networks/${t[`network-id`]==null?`<network-id>`:encodeURIComponent(String(t[`network-id`]))}`,pathParams:{"network-id":String(t[`network-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
351
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.devices.networks.delete({account_id:l,network_id:t[`network-id`]}));o(u,{successLabel:`Deleted`})})};function To(e){return e.usage(`$0 zero-trust devices networks get <network-id>
|
|
352
|
+
|
|
353
|
+
Fetches details for a single managed network.`).positional(`network-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Eo={command:`get <network-id>`,describe:`Get device managed network details`,builder:To,handler:async t=>l({command:`zero-trust devices networks get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices networks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/networks/${t[`network-id`]==null?`<network-id>`:encodeURIComponent(String(t[`network-id`]))}`,pathParams:{"network-id":String(t[`network-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.networks.get({account_id:l,network_id:t[`network-id`]}));o(u,{successLabel:`Loaded`})})};function Do(e){return e.usage(`$0 zero-trust devices networks list
|
|
354
|
+
|
|
355
|
+
Fetches a list of managed networks for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oo={command:`list`,describe:`List your device managed networks`,builder:Do,handler:async t=>l({command:`zero-trust devices networks list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices networks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/networks`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.networks.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function ko(e){return e.usage(`$0 zero-trust devices networks update <network-id>
|
|
356
|
+
|
|
357
|
+
Updates a configured device managed network.`).positional(`network-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`config-sha256`,{type:`string`,description:`The SHA-256 hash of the TLS certificate presented by the host found at tls_sockaddr. If absent, regular certificate verification (trusted roots, valid timestamp, etc) will be used to validate the certificate.`}).option(`config-tls-sockaddr`,{type:`string`,description:`A network address of the form "host:port" that the WARP client will use to detect the presence of a TLS host.`}).option(`name`,{type:`string`,description:`The name of the device managed network. This name must be unique.`}).option(`type`,{type:`string`,description:`The type of device managed network.`,choices:[`tls`]}).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)`}).check(e=>{if([`config-sha256`,`config-tls-sockaddr`].some(t=>e[t]!==void 0)){let t=[`config-tls-sockaddr`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --config-* flag is set`)}return!0})}const Ao={command:`update <network-id>`,describe:`Update a device managed network`,builder:ko,handler:async t=>l({command:`zero-trust devices networks update`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices networks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/networks/${t[`network-id`]==null?`<network-id>`:encodeURIComponent(String(t[`network-id`]))}`,pathParams:{"network-id":String(t[`network-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({config:{sha256:m(t[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:m(t[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.devices.networks.update({...e,account_id:l,network_id:t[`network-id`]}));o(n,{successLabel:`Updated`});return}let u=p({config:{sha256:m(t[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:m(t[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.devices.networks.update({...u,account_id:l,network_id:t[`network-id`]}));o(f,{successLabel:`Updated`})})},jo={command:`networks`,describe:`Operations for devices.networks`,builder:e=>e.command(So).command(wo).command(Eo).command(Oo).command(Ao).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Mo(e){return e.usage(`$0 zero-trust devices override-codes create
|
|
358
|
+
|
|
359
|
+
Generates an account-wide or device-specific uninstall protection override code.`).option(`device-id`,{type:`string`,description:`Physical device ID. Required when scope is device and forbidden when scope is account.`}).option(`duration-hours`,{type:`number`,description:`Number of hours for which the override code should remain valid.`}).option(`scope`,{type:`string`,description:`Whether the code applies to every device in the account or one physical device.`,choices:[`account`,`device`]}).option(`type`,{type:`string`,description:`The feature that the override code applies to.`,choices:[`uninstall_protection`]}).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 No={command:`create`,describe:`Generate an uninstall protection override code`,builder:Mo,handler:async t=>l({command:`zero-trust devices override-codes create`,classification:{safeFlags:[`scope`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices override-codes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/override_codes`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({device_id:m(t[`device-id`],`device-id`,`text`),duration_hours:t[`duration-hours`],scope:m(t.scope,`scope`,`text`),type:m(t.type,`type`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.devices.overrideCodes.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`duration-hours`]===void 0)throw Error(`--duration-hours is required (or pass --body with this field set).`);t.scope===void 0&&(t.scope=await _(`scope`,`Whether the code applies to every device in the account or one physical device.`,[`account`,`device`])),t.type===void 0&&(t.type=await _(`type`,`The feature that the override code applies to.`,[`uninstall_protection`]));let u=p({device_id:m(t[`device-id`],`device-id`,`text`),duration_hours:t[`duration-hours`],scope:m(t.scope,`scope`,`text`),type:m(t.type,`type`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.devices.overrideCodes.create({...u,account_id:l}));o(f,{successLabel:`Created`})})},Po={command:`override-codes`,describe:`Operations for devices.override-codes`,builder:e=>e.command(No).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fo(e){return e.usage(`$0 zero-trust devices posture integrations create
|
|
360
|
+
|
|
361
|
+
Create a new device posture integration.`).option(`config-api-url`,{type:`string`,description:`The Workspace One API URL provided in the Workspace One Admin Dashboard.`}).option(`config-auth-url`,{type:`string`,description:`The Workspace One Authorization URL depending on your region.`}).option(`config-client-id`,{type:`string`,description:`The Workspace One client ID provided in the Workspace One Admin Dashboard.`}).option(`config-client-secret`,{type:`string`,description:`The Workspace One client secret provided in the Workspace One Admin Dashboard.`}).option(`config-customer-id`,{type:`string`,description:`The Crowdstrike customer ID.`}).option(`config-client-key`,{type:`string`,description:`The Uptycs client secret.`}).option(`config-access-client-id`,{type:`string`,description:"If present, this id will be passed in the `CF-Access-Client-ID` header when hitting the `api_url`."}).option(`config-access-client-secret`,{type:`string`,description:"If present, this secret will be passed in the `CF-Access-Client-Secret` header when hitting the `api_url`."}).option(`interval`,{type:`string`,description:"The interval between each posture check with the third-party API. Use `m` for minutes (e.g. `5m`) and `h` for hours (e.g. `12h`)."}).option(`name`,{type:`string`,description:`The name of the device posture integration.`}).option(`type`,{type:`string`,description:`The type of device posture integration.`,choices:[`workspace_one`,`crowdstrike_s2s`,`uptycs`,`intune`,`kolide`,`tanium_s2s`,`sentinelone_s2s`,`custom_s2s`]}).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(`config-api-url`,[`config-customer-id`,`config-client-id`,`config-client-secret`]).conflicts(`config-auth-url`,[`config-customer-id`,`config-client-key`,`config-access-client-id`,`config-access-client-secret`]).implies(`config-auth-url`,[`config-api-url`,`config-client-id`,`config-client-secret`]).conflicts(`config-client-id`,[`config-client-key`,`config-customer-id`,`config-access-client-id`,`config-access-client-secret`,`config-api-url`]).conflicts(`config-client-secret`,[`config-access-client-id`,`config-access-client-secret`,`config-api-url`]).conflicts(`config-customer-id`,[`config-auth-url`,`config-client-id`,`config-api-url`,`config-access-client-id`,`config-access-client-secret`]).conflicts(`config-client-key`,[`config-auth-url`,`config-client-id`,`config-access-client-id`,`config-access-client-secret`]).implies(`config-client-key`,[`config-api-url`,`config-customer-id`,`config-client-secret`]).conflicts(`config-access-client-id`,[`config-auth-url`,`config-client-id`,`config-client-secret`,`config-customer-id`,`config-client-key`]).implies(`config-access-client-id`,[`config-api-url`,`config-access-client-secret`]).conflicts(`config-access-client-secret`,[`config-auth-url`,`config-client-id`,`config-client-secret`,`config-customer-id`,`config-client-key`]).implies(`config-access-client-secret`,[`config-api-url`,`config-access-client-id`])}const Io={command:`create`,describe:`Create posture integration`,builder:Fo,handler:async t=>l({command:`zero-trust devices posture integrations create`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices posture integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture/integration`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({config:{api_url:m(t[`config-api-url`],`config-api-url`,`text`),auth_url:m(t[`config-auth-url`],`config-auth-url`,`text`),client_id:m(t[`config-client-id`],`config-client-id`,`text`),client_secret:m(t[`config-client-secret`],`config-client-secret`,`text`),customer_id:m(t[`config-customer-id`],`config-customer-id`,`text`),client_key:m(t[`config-client-key`],`config-client-key`,`text`),access_client_id:m(t[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:m(t[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:m(t.interval,`interval`,`text`),name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`)}):d(t.body),sensitiveBodyPaths:[[`config`,`client_secret`],[`config`,`client_key`],[`config`,`access_client_secret`]]});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.devices.posture.integrations.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.interval===void 0&&(t.interval=await g(`interval`,"The interval between each posture check with the third-party API. Use `m` for minutes (e.g. `5m`) and `h` for hours (e.g. `12h`).")),t.name===void 0&&(t.name=await g(`name`,`The name of the device posture integration.`)),t.type===void 0&&(t.type=await _(`type`,`The type of device posture integration.`,[`workspace_one`,`crowdstrike_s2s`,`uptycs`,`intune`,`kolide`,`tanium_s2s`,`sentinelone_s2s`,`custom_s2s`]));let u=p({config:{api_url:m(t[`config-api-url`],`config-api-url`,`text`),auth_url:m(t[`config-auth-url`],`config-auth-url`,`text`),client_id:m(t[`config-client-id`],`config-client-id`,`text`),client_secret:m(t[`config-client-secret`],`config-client-secret`,`text`),customer_id:m(t[`config-customer-id`],`config-customer-id`,`text`),client_key:m(t[`config-client-key`],`config-client-key`,`text`),access_client_id:m(t[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:m(t[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:m(t.interval,`interval`,`text`),name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.devices.posture.integrations.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Lo(e){return e.usage(`$0 zero-trust devices posture integrations delete <integration-id>
|
|
362
|
+
|
|
363
|
+
Delete a configured device posture integration.`).positional(`integration-id`,{type:`string`,description:`API UUID.`,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 Ro={command:`delete <integration-id>`,describe:`Delete posture integration`,builder:Lo,handler:async t=>l({command:`zero-trust devices posture integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices posture integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture/integration/${t[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(t[`integration-id`]))}`,pathParams:{"integration-id":String(t[`integration-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
364
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.devices.posture.integrations.delete({account_id:l,integration_id:t[`integration-id`]}));o(u,{successLabel:`Deleted`})})};function zo(e){return e.usage(`$0 zero-trust devices posture integrations get <integration-id>
|
|
365
|
+
|
|
366
|
+
Fetches details for a single device posture integration.`).positional(`integration-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bo={command:`get <integration-id>`,describe:`Get posture integration`,builder:zo,handler:async t=>l({command:`zero-trust devices posture integrations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices posture integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture/integration/${t[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(t[`integration-id`]))}`,pathParams:{"integration-id":String(t[`integration-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.posture.integrations.get({account_id:l,integration_id:t[`integration-id`]}));o(u,{successLabel:`Loaded`})})};function Vo(e){return e.usage(`$0 zero-trust devices posture integrations list
|
|
367
|
+
|
|
368
|
+
Fetches the list of device posture integrations for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ho={command:`list`,describe:`List posture integrations`,builder:Vo,handler:async t=>l({command:`zero-trust devices posture integrations list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices posture integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture/integration`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.posture.integrations.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function Uo(e){return e.usage(`$0 zero-trust devices posture integrations update <integration-id>
|
|
369
|
+
|
|
370
|
+
Updates a configured device posture integration.`).positional(`integration-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`config-api-url`,{type:`string`,description:`The Workspace One API URL provided in the Workspace One Admin Dashboard.`}).option(`config-auth-url`,{type:`string`,description:`The Workspace One Authorization URL depending on your region.`}).option(`config-client-id`,{type:`string`,description:`The Workspace One client ID provided in the Workspace One Admin Dashboard.`}).option(`config-client-secret`,{type:`string`,description:`The Workspace One client secret provided in the Workspace One Admin Dashboard.`}).option(`config-customer-id`,{type:`string`,description:`The Crowdstrike customer ID.`}).option(`config-client-key`,{type:`string`,description:`The Uptycs client secret.`}).option(`config-access-client-id`,{type:`string`,description:"If present, this id will be passed in the `CF-Access-Client-ID` header when hitting the `api_url`."}).option(`config-access-client-secret`,{type:`string`,description:"If present, this secret will be passed in the `CF-Access-Client-Secret` header when hitting the `api_url`."}).option(`interval`,{type:`string`,description:"The interval between each posture check with the third-party API. Use `m` for minutes (e.g. `5m`) and `h` for hours (e.g. `12h`)."}).option(`name`,{type:`string`,description:`The name of the device posture integration.`}).option(`type`,{type:`string`,description:`The type of device posture integration.`,choices:[`workspace_one`,`crowdstrike_s2s`,`uptycs`,`intune`,`kolide`,`tanium_s2s`,`sentinelone_s2s`,`custom_s2s`]}).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(`config-api-url`,[`config-customer-id`,`config-client-id`,`config-client-secret`]).conflicts(`config-auth-url`,[`config-customer-id`,`config-client-key`,`config-access-client-id`,`config-access-client-secret`]).implies(`config-auth-url`,[`config-api-url`,`config-client-id`,`config-client-secret`]).conflicts(`config-client-id`,[`config-client-key`,`config-customer-id`,`config-access-client-id`,`config-access-client-secret`,`config-api-url`]).conflicts(`config-client-secret`,[`config-access-client-id`,`config-access-client-secret`,`config-api-url`]).conflicts(`config-customer-id`,[`config-auth-url`,`config-client-id`,`config-api-url`,`config-access-client-id`,`config-access-client-secret`]).conflicts(`config-client-key`,[`config-auth-url`,`config-client-id`,`config-access-client-id`,`config-access-client-secret`]).implies(`config-client-key`,[`config-api-url`,`config-customer-id`,`config-client-secret`]).conflicts(`config-access-client-id`,[`config-auth-url`,`config-client-id`,`config-client-secret`,`config-customer-id`,`config-client-key`]).implies(`config-access-client-id`,[`config-api-url`,`config-access-client-secret`]).conflicts(`config-access-client-secret`,[`config-auth-url`,`config-client-id`,`config-client-secret`,`config-customer-id`,`config-client-key`]).implies(`config-access-client-secret`,[`config-api-url`,`config-access-client-id`])}const Wo={command:`update <integration-id>`,describe:`Update posture integration`,builder:Uo,handler:async t=>l({command:`zero-trust devices posture integrations update`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices posture integrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture/integration/${t[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(t[`integration-id`]))}`,pathParams:{"integration-id":String(t[`integration-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({config:{api_url:m(t[`config-api-url`],`config-api-url`,`text`),auth_url:m(t[`config-auth-url`],`config-auth-url`,`text`),client_id:m(t[`config-client-id`],`config-client-id`,`text`),client_secret:m(t[`config-client-secret`],`config-client-secret`,`text`),customer_id:m(t[`config-customer-id`],`config-customer-id`,`text`),client_key:m(t[`config-client-key`],`config-client-key`,`text`),access_client_id:m(t[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:m(t[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:m(t.interval,`interval`,`text`),name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`)}):d(t.body),sensitiveBodyPaths:[[`config`,`client_secret`],[`config`,`client_key`],[`config`,`access_client_secret`]]});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.devices.posture.integrations.update({...e,account_id:l,integration_id:t[`integration-id`]}));o(n,{successLabel:`Updated`});return}let u=p({config:{api_url:m(t[`config-api-url`],`config-api-url`,`text`),auth_url:m(t[`config-auth-url`],`config-auth-url`,`text`),client_id:m(t[`config-client-id`],`config-client-id`,`text`),client_secret:m(t[`config-client-secret`],`config-client-secret`,`text`),customer_id:m(t[`config-customer-id`],`config-customer-id`,`text`),client_key:m(t[`config-client-key`],`config-client-key`,`text`),access_client_id:m(t[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:m(t[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:m(t.interval,`interval`,`text`),name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.devices.posture.integrations.update({...u,account_id:l,integration_id:t[`integration-id`]}));o(f,{successLabel:`Updated`})})},Go={command:`integrations`,describe:`Operations for devices.posture.integrations`,builder:e=>e.command(Io).command(Ro).command(Bo).command(Ho).command(Wo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ko(e){return e.usage(`$0 zero-trust devices posture rules create
|
|
371
|
+
|
|
372
|
+
Creates a new device posture rule.`).option(`description`,{type:`string`,description:`The description of the device posture rule.`}).option(`expiration`,{type:`string`,description:`Sets the expiration time for a posture check result. If empty, the result remains valid until it is overwritten by new data from the WARP client.`}).option(`input-exists`,{type:`boolean`,description:`Whether or not file exists.`}).option(`input-operating-system`,{type:`string`,description:`Operating system.`,choices:[`windows`,`linux`,`mac`,`android`,`ios`,`chromeos`]}).option(`input-path`,{type:`string`,description:`File path.`}).option(`input-sha256`,{type:`string`,description:`SHA-256.`}).option(`input-thumbprint`,{type:`string`,description:`Signing certificate thumbprint.`}).option(`input-id`,{type:`string`,description:`List ID.`}).option(`input-domain`,{type:`string`,description:`Domain.`}).option(`input-operator`,{type:`string`,description:`Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).option(`input-os-distro-name`,{type:`string`,description:`Operating System Distribution Name (linux only).`}).option(`input-os-distro-revision`,{type:`string`,description:`Version of OS Distribution (linux only).`}).option(`input-os-version-extra`,{type:`string`,description:`Additional operating system version details. For Windows, the UBR (Update Build Revision). For Mac or iOS, the Product Version Extra. For Linux, the distribution name and version.`}).option(`input-version`,{type:`string`,description:`Version of OS.`}).option(`input-enabled`,{type:`boolean`,description:`Enabled.`}).option(`input-check-disks`,{type:`string`,array:!0,description:`List of volume names to be checked for encryption.`}).option(`input-require-all`,{type:`boolean`,description:`Whether to check all disks for encryption.`}).option(`input-certificate-id`,{type:`string`,description:`UUID of Cloudflare managed certificate.`}).option(`input-cn`,{type:`string`,description:`Common Name that is protected by the certificate.`}).option(`input-check-private-key`,{type:`boolean`,description:`Confirm the certificate was not imported from another device. We recommend keeping this enabled unless the certificate was deployed without a private key.`}).option(`input-extended-key-usage`,{type:`string`,array:!0,description:`List of values indicating purposes for which the certificate public key can be used.`}).option(`input-locations-paths`,{type:`string`,array:!0,description:`List of paths to check for client certificate on linux.`}).option(`input-locations-trust-stores`,{type:`string`,array:!0,description:`List of trust stores to check for client certificate.`}).option(`input-subject-alternative-names`,{type:`string`,array:!0,description:`List of certificate Subject Alternative Names.`}).option(`input-update-window-days`,{type:`number`,description:`Number of days that the antivirus should be updated within.`}).option(`input-compliance-status`,{type:`string`,description:`Compliance Status.`,choices:[`compliant`,`noncompliant`,`unknown`,`notapplicable`,`ingraceperiod`,`error`]}).option(`input-connection-id`,{type:`string`,description:`Posture Integration ID.`}).option(`input-last-seen`,{type:`string`,description:`For more details on last seen, please refer to the Crowdstrike documentation.`}).option(`input-os`,{type:`string`,description:`Os Version.`}).option(`input-overall`,{type:`string`,description:`Overall.`}).option(`input-sensor-config`,{type:`string`,description:`SensorConfig.`}).option(`input-state`,{type:`string`,description:`For more details on state, please refer to the Crowdstrike documentation.`,choices:[`online`,`offline`,`unknown`]}).option(`input-version-operator`,{type:`string`,description:`Version Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).option(`input-auth-state`,{type:`string`,array:!0,description:`The set of Kolide device authentication states that pass the posture check. Device must match one of the specified states.`}).option(`input-count-operator`,{type:`string`,description:`Count Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).option(`input-issue-count`,{type:`string`,description:`The Number of Issues.`}).option(`input-eid-last-seen`,{type:`string`,description:`For more details on eid last seen, refer to the Tanium documentation.`}).option(`input-risk-level`,{type:`string`,description:`For more details on risk level, refer to the Tanium documentation.`,choices:[`low`,`medium`,`high`,`critical`]}).option(`input-score-operator`,{type:`string`,description:`Score Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).option(`input-total-score`,{type:`number`,description:`For more details on total score, refer to the Tanium documentation.`}).option(`input-active-threats`,{type:`number`,description:`The Number of active threats.`}).option(`input-infected`,{type:`boolean`,description:`Whether device is infected.`}).option(`input-is-active`,{type:`boolean`,description:`Whether device is active.`}).option(`input-network-status`,{type:`string`,description:`Network status of device.`,choices:[`connected`,`disconnected`,`disconnecting`,`connecting`]}).option(`input-operational-state`,{type:`string`,description:`Agent operational state.`,choices:[`na`,`partially_disabled`,`auto_fully_disabled`,`fully_disabled`,`auto_partially_disabled`,`disabled_error`,`db_corruption`]}).option(`input-score`,{type:`number`,description:`A value between 0-100 assigned to devices set by the 3rd party posture provider.`}).option(`match`,{type:`string`,description:`The conditions that the client must match to run the rule. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name of the device posture rule.`}).option(`schedule`,{type:`string`,description:"Polling frequency for the WARP client posture check. Default: `5m` (poll every five minutes). Minimum: `1m`."}).option(`type`,{type:`string`,description:`The type of device posture rule.`,choices:[`file`,`application`,`tanium`,`gateway`,`warp`,`disk_encryption`,`serial_number`,`sentinelone`,`carbonblack`,`firewall`,`os_version`,`domain_joined`,`client_certificate`,`client_certificate_v2`,`antivirus`,`unique_client_id`,`kolide`,`tanium_s2s`,`crowdstrike_s2s`,`intune`,`workspace_one`,`sentinelone_s2s`,`custom_s2s`]}).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(`input-exists`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-operating-system`,/* @__PURE__ */ `input-id.input-check-disks.input-require-all.input-certificate-id.input-cn.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-operator.input-os.input-overall.input-sensor-config.input-state.input-version.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-path`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-sha256`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-thumbprint`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-id`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-operating-system.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-domain`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-operator`,[`input-exists`,`input-path`,`input-sha256`,`input-thumbprint`,`input-operating-system`,`input-id`,`input-domain`,`input-enabled`,`input-check-disks`,`input-require-all`,`input-certificate-id`,`input-cn`,`input-check-private-key`,`input-extended-key-usage`,`input-locations-paths`,`input-locations-trust-stores`,`input-subject-alternative-names`,`input-update-window-days`,`input-compliance-status`,`input-connection-id`,`input-auth-state`,`input-count-operator`,`input-issue-count`]).conflicts(`input-os-distro-name`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os-distro-revision`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os-version-extra`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-version`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-operating-system.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-version`,[`input-operating-system`,`input-operator`]).conflicts(`input-enabled`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-enabled`,[`input-operating-system`]).conflicts(`input-check-disks`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-require-all`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-certificate-id`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-cn`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-cn`,[`input-certificate-id`]).conflicts(`input-check-private-key`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-check-private-key`,[`input-certificate-id`,`input-operating-system`]).conflicts(`input-extended-key-usage`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-locations-paths`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-locations-trust-stores`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-subject-alternative-names`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-update-window-days`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-compliance-status`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-connection-id`,[`input-exists`,`input-operating-system`,`input-path`,`input-sha256`,`input-thumbprint`,`input-id`,`input-domain`,`input-operator`,`input-os-distro-name`,`input-os-distro-revision`,`input-os-version-extra`,`input-version`,`input-enabled`,`input-check-disks`,`input-require-all`,`input-certificate-id`,`input-cn`,`input-check-private-key`,`input-extended-key-usage`,`input-locations-paths`,`input-locations-trust-stores`,`input-subject-alternative-names`,`input-update-window-days`]).conflicts(`input-last-seen`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-overall`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-sensor-config`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-version-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-auth-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-count-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-issue-count`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-eid-last-seen`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-risk-level`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-score-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-total-score`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-active-threats`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-infected`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-is-active`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-network-status`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-operational-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-score`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state`.split(`.`)).implies(`input-score`,[`input-connection-id`,`input-operator`])}const qo={command:`create`,describe:`Create posture rule`,builder:Ko,handler:async t=>l({command:`zero-trust devices posture rules create`,classification:{safeFlags:[`input-exists`,`input-operating-system`,`input-operator`,`input-enabled`,`input-require-all`,`input-check-private-key`,`input-compliance-status`,`input-state`,`input-version-operator`,`input-count-operator`,`input-risk-level`,`input-score-operator`,`input-infected`,`input-is-active`,`input-network-status`,`input-operational-state`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices posture rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),expiration:m(t.expiration,`expiration`,`text`),input:{exists:t[`input-exists`],operating_system:m(t[`input-operating-system`],`input-operating-system`,`text`),path:m(t[`input-path`],`input-path`,`text`),sha256:m(t[`input-sha256`],`input-sha256`,`text`),thumbprint:m(t[`input-thumbprint`],`input-thumbprint`,`text`),id:m(t[`input-id`],`input-id`,`text`),domain:m(t[`input-domain`],`input-domain`,`text`),operator:m(t[`input-operator`],`input-operator`,`text`),os_distro_name:m(t[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:m(t[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:m(t[`input-os-version-extra`],`input-os-version-extra`,`text`),version:m(t[`input-version`],`input-version`,`text`),enabled:t[`input-enabled`],checkDisks:t[`input-check-disks`],requireAll:t[`input-require-all`],certificate_id:m(t[`input-certificate-id`],`input-certificate-id`,`text`),cn:m(t[`input-cn`],`input-cn`,`text`),check_private_key:t[`input-check-private-key`],extended_key_usage:t[`input-extended-key-usage`],locations:{paths:t[`input-locations-paths`],trust_stores:t[`input-locations-trust-stores`]},subject_alternative_names:t[`input-subject-alternative-names`],update_window_days:t[`input-update-window-days`],compliance_status:m(t[`input-compliance-status`],`input-compliance-status`,`text`),connection_id:m(t[`input-connection-id`],`input-connection-id`,`text`),last_seen:m(t[`input-last-seen`],`input-last-seen`,`text`),os:m(t[`input-os`],`input-os`,`text`),overall:m(t[`input-overall`],`input-overall`,`text`),sensor_config:m(t[`input-sensor-config`],`input-sensor-config`,`text`),state:m(t[`input-state`],`input-state`,`text`),versionOperator:m(t[`input-version-operator`],`input-version-operator`,`text`),auth_state:t[`input-auth-state`],countOperator:m(t[`input-count-operator`],`input-count-operator`,`text`),issue_count:m(t[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:m(t[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:m(t[`input-risk-level`],`input-risk-level`,`text`),scoreOperator:m(t[`input-score-operator`],`input-score-operator`,`text`),total_score:t[`input-total-score`],active_threats:t[`input-active-threats`],infected:t[`input-infected`],is_active:t[`input-is-active`],network_status:m(t[`input-network-status`],`input-network-status`,`text`),operational_state:m(t[`input-operational-state`],`input-operational-state`,`text`),score:t[`input-score`]},match:f(t.match,`match`),name:m(t.name,`name`,`text`),schedule:m(t.schedule,`schedule`,`text`),type:m(t.type,`type`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.devices.posture.rules.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`The name of the device posture rule.`)),t.type===void 0&&(t.type=await _(`type`,`The type of device posture rule.`,[`file`,`application`,`tanium`,`gateway`,`warp`,`disk_encryption`,`serial_number`,`sentinelone`,`carbonblack`,`firewall`,`os_version`,`domain_joined`,`client_certificate`,`client_certificate_v2`,`antivirus`,`unique_client_id`,`kolide`,`tanium_s2s`,`crowdstrike_s2s`,`intune`,`workspace_one`,`sentinelone_s2s`,`custom_s2s`]));let u=p({description:m(t.description,`description`,`text`),expiration:m(t.expiration,`expiration`,`text`),input:{exists:t[`input-exists`],operating_system:m(t[`input-operating-system`],`input-operating-system`,`text`),path:m(t[`input-path`],`input-path`,`text`),sha256:m(t[`input-sha256`],`input-sha256`,`text`),thumbprint:m(t[`input-thumbprint`],`input-thumbprint`,`text`),id:m(t[`input-id`],`input-id`,`text`),domain:m(t[`input-domain`],`input-domain`,`text`),operator:m(t[`input-operator`],`input-operator`,`text`),os_distro_name:m(t[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:m(t[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:m(t[`input-os-version-extra`],`input-os-version-extra`,`text`),version:m(t[`input-version`],`input-version`,`text`),enabled:t[`input-enabled`],checkDisks:t[`input-check-disks`],requireAll:t[`input-require-all`],certificate_id:m(t[`input-certificate-id`],`input-certificate-id`,`text`),cn:m(t[`input-cn`],`input-cn`,`text`),check_private_key:t[`input-check-private-key`],extended_key_usage:t[`input-extended-key-usage`],locations:{paths:t[`input-locations-paths`],trust_stores:t[`input-locations-trust-stores`]},subject_alternative_names:t[`input-subject-alternative-names`],update_window_days:t[`input-update-window-days`],compliance_status:m(t[`input-compliance-status`],`input-compliance-status`,`text`),connection_id:m(t[`input-connection-id`],`input-connection-id`,`text`),last_seen:m(t[`input-last-seen`],`input-last-seen`,`text`),os:m(t[`input-os`],`input-os`,`text`),overall:m(t[`input-overall`],`input-overall`,`text`),sensor_config:m(t[`input-sensor-config`],`input-sensor-config`,`text`),state:m(t[`input-state`],`input-state`,`text`),versionOperator:m(t[`input-version-operator`],`input-version-operator`,`text`),auth_state:t[`input-auth-state`],countOperator:m(t[`input-count-operator`],`input-count-operator`,`text`),issue_count:m(t[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:m(t[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:m(t[`input-risk-level`],`input-risk-level`,`text`),scoreOperator:m(t[`input-score-operator`],`input-score-operator`,`text`),total_score:t[`input-total-score`],active_threats:t[`input-active-threats`],infected:t[`input-infected`],is_active:t[`input-is-active`],network_status:m(t[`input-network-status`],`input-network-status`,`text`),operational_state:m(t[`input-operational-state`],`input-operational-state`,`text`),score:t[`input-score`]},match:f(t.match,`match`),name:m(t.name,`name`,`text`),schedule:m(t.schedule,`schedule`,`text`),type:m(t.type,`type`,`text`)}),h=await c(`Creating`,async()=>i.zeroTrust.devices.posture.rules.create({...u,account_id:l}));o(h,{successLabel:`Created`})})};function Jo(e){return e.usage(`$0 zero-trust devices posture rules delete <rule-id>
|
|
373
|
+
|
|
374
|
+
Deletes a device posture rule.`).positional(`rule-id`,{type:`string`,description:`API UUID.`,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 Yo={command:`delete <rule-id>`,describe:`Delete posture rule`,builder:Jo,handler:async t=>l({command:`zero-trust devices posture rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices posture rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
375
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.devices.posture.rules.delete({account_id:l,rule_id:t[`rule-id`]}));o(u,{successLabel:`Deleted`})})};function Xo(e){return e.usage(`$0 zero-trust devices posture rules get <rule-id>
|
|
376
|
+
|
|
377
|
+
Fetches a single device posture rule.`).positional(`rule-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Zo={command:`get <rule-id>`,describe:`Get posture rule`,builder:Xo,handler:async t=>l({command:`zero-trust devices posture rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices posture rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.posture.rules.get({account_id:l,rule_id:t[`rule-id`]}));o(u,{successLabel:`Loaded`})})};function Qo(e){return e.usage(`$0 zero-trust devices posture rules list
|
|
378
|
+
|
|
379
|
+
Fetches device posture rules for a Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $o={command:`list`,describe:`List posture rules`,builder:Qo,handler:async t=>l({command:`zero-trust devices posture rules list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices posture rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.posture.rules.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function es(e){return e.usage(`$0 zero-trust devices posture rules update <rule-id>
|
|
380
|
+
|
|
381
|
+
Updates a device posture rule.`).positional(`rule-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`description`,{type:`string`,description:`The description of the device posture rule.`}).option(`expiration`,{type:`string`,description:`Sets the expiration time for a posture check result. If empty, the result remains valid until it is overwritten by new data from the WARP client.`}).option(`input-exists`,{type:`boolean`,description:`Whether or not file exists.`}).option(`input-operating-system`,{type:`string`,description:`Operating system.`,choices:[`windows`,`linux`,`mac`,`android`,`ios`,`chromeos`]}).option(`input-path`,{type:`string`,description:`File path.`}).option(`input-sha256`,{type:`string`,description:`SHA-256.`}).option(`input-thumbprint`,{type:`string`,description:`Signing certificate thumbprint.`}).option(`input-id`,{type:`string`,description:`List ID.`}).option(`input-domain`,{type:`string`,description:`Domain.`}).option(`input-operator`,{type:`string`,description:`Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).option(`input-os-distro-name`,{type:`string`,description:`Operating System Distribution Name (linux only).`}).option(`input-os-distro-revision`,{type:`string`,description:`Version of OS Distribution (linux only).`}).option(`input-os-version-extra`,{type:`string`,description:`Additional operating system version details. For Windows, the UBR (Update Build Revision). For Mac or iOS, the Product Version Extra. For Linux, the distribution name and version.`}).option(`input-version`,{type:`string`,description:`Version of OS.`}).option(`input-enabled`,{type:`boolean`,description:`Enabled.`}).option(`input-check-disks`,{type:`string`,array:!0,description:`List of volume names to be checked for encryption.`}).option(`input-require-all`,{type:`boolean`,description:`Whether to check all disks for encryption.`}).option(`input-certificate-id`,{type:`string`,description:`UUID of Cloudflare managed certificate.`}).option(`input-cn`,{type:`string`,description:`Common Name that is protected by the certificate.`}).option(`input-check-private-key`,{type:`boolean`,description:`Confirm the certificate was not imported from another device. We recommend keeping this enabled unless the certificate was deployed without a private key.`}).option(`input-extended-key-usage`,{type:`string`,array:!0,description:`List of values indicating purposes for which the certificate public key can be used.`}).option(`input-locations-paths`,{type:`string`,array:!0,description:`List of paths to check for client certificate on linux.`}).option(`input-locations-trust-stores`,{type:`string`,array:!0,description:`List of trust stores to check for client certificate.`}).option(`input-subject-alternative-names`,{type:`string`,array:!0,description:`List of certificate Subject Alternative Names.`}).option(`input-update-window-days`,{type:`number`,description:`Number of days that the antivirus should be updated within.`}).option(`input-compliance-status`,{type:`string`,description:`Compliance Status.`,choices:[`compliant`,`noncompliant`,`unknown`,`notapplicable`,`ingraceperiod`,`error`]}).option(`input-connection-id`,{type:`string`,description:`Posture Integration ID.`}).option(`input-last-seen`,{type:`string`,description:`For more details on last seen, please refer to the Crowdstrike documentation.`}).option(`input-os`,{type:`string`,description:`Os Version.`}).option(`input-overall`,{type:`string`,description:`Overall.`}).option(`input-sensor-config`,{type:`string`,description:`SensorConfig.`}).option(`input-state`,{type:`string`,description:`For more details on state, please refer to the Crowdstrike documentation.`,choices:[`online`,`offline`,`unknown`]}).option(`input-version-operator`,{type:`string`,description:`Version Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).option(`input-auth-state`,{type:`string`,array:!0,description:`The set of Kolide device authentication states that pass the posture check. Device must match one of the specified states.`}).option(`input-count-operator`,{type:`string`,description:`Count Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).option(`input-issue-count`,{type:`string`,description:`The Number of Issues.`}).option(`input-eid-last-seen`,{type:`string`,description:`For more details on eid last seen, refer to the Tanium documentation.`}).option(`input-risk-level`,{type:`string`,description:`For more details on risk level, refer to the Tanium documentation.`,choices:[`low`,`medium`,`high`,`critical`]}).option(`input-score-operator`,{type:`string`,description:`Score Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).option(`input-total-score`,{type:`number`,description:`For more details on total score, refer to the Tanium documentation.`}).option(`input-active-threats`,{type:`number`,description:`The Number of active threats.`}).option(`input-infected`,{type:`boolean`,description:`Whether device is infected.`}).option(`input-is-active`,{type:`boolean`,description:`Whether device is active.`}).option(`input-network-status`,{type:`string`,description:`Network status of device.`,choices:[`connected`,`disconnected`,`disconnecting`,`connecting`]}).option(`input-operational-state`,{type:`string`,description:`Agent operational state.`,choices:[`na`,`partially_disabled`,`auto_fully_disabled`,`fully_disabled`,`auto_partially_disabled`,`disabled_error`,`db_corruption`]}).option(`input-score`,{type:`number`,description:`A value between 0-100 assigned to devices set by the 3rd party posture provider.`}).option(`match`,{type:`string`,description:`The conditions that the client must match to run the rule. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name of the device posture rule.`}).option(`schedule`,{type:`string`,description:"Polling frequency for the WARP client posture check. Default: `5m` (poll every five minutes). Minimum: `1m`."}).option(`type`,{type:`string`,description:`The type of device posture rule.`,choices:[`file`,`application`,`tanium`,`gateway`,`warp`,`disk_encryption`,`serial_number`,`sentinelone`,`carbonblack`,`firewall`,`os_version`,`domain_joined`,`client_certificate`,`client_certificate_v2`,`antivirus`,`unique_client_id`,`kolide`,`tanium_s2s`,`crowdstrike_s2s`,`intune`,`workspace_one`,`sentinelone_s2s`,`custom_s2s`]}).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(`input-exists`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-operating-system`,/* @__PURE__ */ `input-id.input-check-disks.input-require-all.input-certificate-id.input-cn.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-operator.input-os.input-overall.input-sensor-config.input-state.input-version.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-path`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-sha256`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-thumbprint`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-id`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-operating-system.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-domain`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-operator`,[`input-exists`,`input-path`,`input-sha256`,`input-thumbprint`,`input-operating-system`,`input-id`,`input-domain`,`input-enabled`,`input-check-disks`,`input-require-all`,`input-certificate-id`,`input-cn`,`input-check-private-key`,`input-extended-key-usage`,`input-locations-paths`,`input-locations-trust-stores`,`input-subject-alternative-names`,`input-update-window-days`,`input-compliance-status`,`input-connection-id`,`input-auth-state`,`input-count-operator`,`input-issue-count`]).conflicts(`input-os-distro-name`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os-distro-revision`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os-version-extra`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-version`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-operating-system.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-version`,[`input-operating-system`,`input-operator`]).conflicts(`input-enabled`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-enabled`,[`input-operating-system`]).conflicts(`input-check-disks`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-require-all`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-certificate-id`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-cn`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-cn`,[`input-certificate-id`]).conflicts(`input-check-private-key`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-check-private-key`,[`input-certificate-id`,`input-operating-system`]).conflicts(`input-extended-key-usage`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-locations-paths`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-locations-trust-stores`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-subject-alternative-names`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-update-window-days`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-compliance-status`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-connection-id`,[`input-exists`,`input-operating-system`,`input-path`,`input-sha256`,`input-thumbprint`,`input-id`,`input-domain`,`input-operator`,`input-os-distro-name`,`input-os-distro-revision`,`input-os-version-extra`,`input-version`,`input-enabled`,`input-check-disks`,`input-require-all`,`input-certificate-id`,`input-cn`,`input-check-private-key`,`input-extended-key-usage`,`input-locations-paths`,`input-locations-trust-stores`,`input-subject-alternative-names`,`input-update-window-days`]).conflicts(`input-last-seen`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-overall`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-sensor-config`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-version-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-auth-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-count-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-issue-count`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-eid-last-seen`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-risk-level`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-score-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-total-score`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-active-threats`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-infected`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-is-active`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-network-status`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-operational-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-score`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state`.split(`.`)).implies(`input-score`,[`input-connection-id`,`input-operator`])}const ts={command:`update <rule-id>`,describe:`Update posture rule`,builder:es,handler:async t=>l({command:`zero-trust devices posture rules update`,classification:{safeFlags:[`input-exists`,`input-operating-system`,`input-operator`,`input-enabled`,`input-require-all`,`input-check-private-key`,`input-compliance-status`,`input-state`,`input-version-operator`,`input-count-operator`,`input-risk-level`,`input-score-operator`,`input-infected`,`input-is-active`,`input-network-status`,`input-operational-state`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices posture rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),expiration:m(t.expiration,`expiration`,`text`),input:{exists:t[`input-exists`],operating_system:m(t[`input-operating-system`],`input-operating-system`,`text`),path:m(t[`input-path`],`input-path`,`text`),sha256:m(t[`input-sha256`],`input-sha256`,`text`),thumbprint:m(t[`input-thumbprint`],`input-thumbprint`,`text`),id:m(t[`input-id`],`input-id`,`text`),domain:m(t[`input-domain`],`input-domain`,`text`),operator:m(t[`input-operator`],`input-operator`,`text`),os_distro_name:m(t[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:m(t[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:m(t[`input-os-version-extra`],`input-os-version-extra`,`text`),version:m(t[`input-version`],`input-version`,`text`),enabled:t[`input-enabled`],checkDisks:t[`input-check-disks`],requireAll:t[`input-require-all`],certificate_id:m(t[`input-certificate-id`],`input-certificate-id`,`text`),cn:m(t[`input-cn`],`input-cn`,`text`),check_private_key:t[`input-check-private-key`],extended_key_usage:t[`input-extended-key-usage`],locations:{paths:t[`input-locations-paths`],trust_stores:t[`input-locations-trust-stores`]},subject_alternative_names:t[`input-subject-alternative-names`],update_window_days:t[`input-update-window-days`],compliance_status:m(t[`input-compliance-status`],`input-compliance-status`,`text`),connection_id:m(t[`input-connection-id`],`input-connection-id`,`text`),last_seen:m(t[`input-last-seen`],`input-last-seen`,`text`),os:m(t[`input-os`],`input-os`,`text`),overall:m(t[`input-overall`],`input-overall`,`text`),sensor_config:m(t[`input-sensor-config`],`input-sensor-config`,`text`),state:m(t[`input-state`],`input-state`,`text`),versionOperator:m(t[`input-version-operator`],`input-version-operator`,`text`),auth_state:t[`input-auth-state`],countOperator:m(t[`input-count-operator`],`input-count-operator`,`text`),issue_count:m(t[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:m(t[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:m(t[`input-risk-level`],`input-risk-level`,`text`),scoreOperator:m(t[`input-score-operator`],`input-score-operator`,`text`),total_score:t[`input-total-score`],active_threats:t[`input-active-threats`],infected:t[`input-infected`],is_active:t[`input-is-active`],network_status:m(t[`input-network-status`],`input-network-status`,`text`),operational_state:m(t[`input-operational-state`],`input-operational-state`,`text`),score:t[`input-score`]},match:f(t.match,`match`),name:m(t.name,`name`,`text`),schedule:m(t.schedule,`schedule`,`text`),type:m(t.type,`type`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.devices.posture.rules.update({...e,account_id:l,rule_id:t[`rule-id`]}));o(n,{successLabel:`Updated`});return}t.name===void 0&&(t.name=await g(`name`,`The name of the device posture rule.`)),t.type===void 0&&(t.type=await _(`type`,`The type of device posture rule.`,[`file`,`application`,`tanium`,`gateway`,`warp`,`disk_encryption`,`serial_number`,`sentinelone`,`carbonblack`,`firewall`,`os_version`,`domain_joined`,`client_certificate`,`client_certificate_v2`,`antivirus`,`unique_client_id`,`kolide`,`tanium_s2s`,`crowdstrike_s2s`,`intune`,`workspace_one`,`sentinelone_s2s`,`custom_s2s`]));let u=p({description:m(t.description,`description`,`text`),expiration:m(t.expiration,`expiration`,`text`),input:{exists:t[`input-exists`],operating_system:m(t[`input-operating-system`],`input-operating-system`,`text`),path:m(t[`input-path`],`input-path`,`text`),sha256:m(t[`input-sha256`],`input-sha256`,`text`),thumbprint:m(t[`input-thumbprint`],`input-thumbprint`,`text`),id:m(t[`input-id`],`input-id`,`text`),domain:m(t[`input-domain`],`input-domain`,`text`),operator:m(t[`input-operator`],`input-operator`,`text`),os_distro_name:m(t[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:m(t[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:m(t[`input-os-version-extra`],`input-os-version-extra`,`text`),version:m(t[`input-version`],`input-version`,`text`),enabled:t[`input-enabled`],checkDisks:t[`input-check-disks`],requireAll:t[`input-require-all`],certificate_id:m(t[`input-certificate-id`],`input-certificate-id`,`text`),cn:m(t[`input-cn`],`input-cn`,`text`),check_private_key:t[`input-check-private-key`],extended_key_usage:t[`input-extended-key-usage`],locations:{paths:t[`input-locations-paths`],trust_stores:t[`input-locations-trust-stores`]},subject_alternative_names:t[`input-subject-alternative-names`],update_window_days:t[`input-update-window-days`],compliance_status:m(t[`input-compliance-status`],`input-compliance-status`,`text`),connection_id:m(t[`input-connection-id`],`input-connection-id`,`text`),last_seen:m(t[`input-last-seen`],`input-last-seen`,`text`),os:m(t[`input-os`],`input-os`,`text`),overall:m(t[`input-overall`],`input-overall`,`text`),sensor_config:m(t[`input-sensor-config`],`input-sensor-config`,`text`),state:m(t[`input-state`],`input-state`,`text`),versionOperator:m(t[`input-version-operator`],`input-version-operator`,`text`),auth_state:t[`input-auth-state`],countOperator:m(t[`input-count-operator`],`input-count-operator`,`text`),issue_count:m(t[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:m(t[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:m(t[`input-risk-level`],`input-risk-level`,`text`),scoreOperator:m(t[`input-score-operator`],`input-score-operator`,`text`),total_score:t[`input-total-score`],active_threats:t[`input-active-threats`],infected:t[`input-infected`],is_active:t[`input-is-active`],network_status:m(t[`input-network-status`],`input-network-status`,`text`),operational_state:m(t[`input-operational-state`],`input-operational-state`,`text`),score:t[`input-score`]},match:f(t.match,`match`),name:m(t.name,`name`,`text`),schedule:m(t.schedule,`schedule`,`text`),type:m(t.type,`type`,`text`)}),h=await c(`Updating`,async()=>i.zeroTrust.devices.posture.rules.update({...u,account_id:l,rule_id:t[`rule-id`]}));o(h,{successLabel:`Updated`})})},ns={command:`rules`,describe:`Operations for devices.posture.rules`,builder:e=>e.command(qo).command(Yo).command(Zo).command($o).command(ts).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},rs={command:`posture`,describe:`Operations for devices.posture`,builder:e=>e.command(Go).command(ns).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function is(e){return e.usage(`$0 zero-trust devices profiles custom create
|
|
382
|
+
|
|
383
|
+
Creates a device settings profile to be applied to certain devices matching the criteria.`).option(`allow-mode-switch`,{type:`boolean`,description:`Whether to allow the user to switch WARP between modes.`,default:!1}).option(`allow-updates`,{type:`boolean`,description:`Whether to receive update notifications when a new version of the client is available.`,default:!1}).option(`allowed-to-leave`,{type:`boolean`,description:`Whether to allow devices to leave the organization.`,default:!0}).option(`auto-connect`,{type:`number`,description:`The amount of time in seconds to reconnect after having been disabled.`,default:0}).option(`browser-extension-config-proxy-control`,{type:`string`,description:`Whether the user may disable the browser extension proxy.`,choices:[`unlocked`,`locked`]}).option(`browser-extension-config-proxy-enabled`,{type:`boolean`,description:`Whether the browser extension proxy is active.`}).option(`captive-portal`,{type:`number`,description:`Turn on the captive portal after the specified amount of time.`,default:180}).option(`default`,{type:`boolean`,description:`Whether the policy is the account default. WARP group profiles cannot set this field.`,default:!1}).option(`disable-auto-fallback`,{type:`boolean`,description:"If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`.",default:!1}).option(`dns-search-suffixes`,{type:`string`,description:`List of DNS search suffixes to apply to clients. Suffixes are evaluated in order. Use an empty array to clear. Provide as a JSON array of objects or @path/to/file.json.`}).option(`enabled`,{type:`boolean`,description:`Whether the policy will be applied to matching devices.`,default:!0}).option(`exclude`,{type:`string`,description:`List of routes excluded in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`exclude-office-ips`,{type:`boolean`,description:`Whether to add Microsoft IPs to Split Tunnel exclusions.`,default:!1}).option(`global-acceleration-api-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the API endpoints.`}).option(`global-acceleration-autoswitch`,{type:`boolean`,description:`Automatically switch Global Acceleration regions based on device location. Defaults to false when not provided.`}).option(`global-acceleration-enabled`,{type:`boolean`,description:`Global acceleration settings are used only when "enabled".`}).option(`global-acceleration-masque-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the MASQUE tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`global-acceleration-wireguard-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the WireGuard tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`include`,{type:`string`,description:`List of routes included in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`lan-allow-minutes`,{type:`number`,description:`The amount of time in minutes a user is allowed access to their LAN. A value of 0 will allow LAN access until the next WARP reconnection, such as a reboot or a laptop waking from sleep. Note that this field is omitted from the response if null or unset.`}).option(`lan-allow-subnet-size`,{type:`number`,description:`The size of the subnet for the local access network. Note that this field is omitted from the response if null or unset.`}).option(`match`,{type:`string`,description:`The wirefilter expression to match devices. Available values: "identity.email", "identity.groups.id", "identity.groups.name", "identity.groups.email", "identity.service_token_uuid", "identity.saml_attributes", "network", "os.name", "os.version", "device.tags".`}).option(`name`,{type:`string`,description:`The name of the device settings profile.`}).option(`precedence`,{type:`number`,description:`The precedence of the policy. Lower values indicate higher precedence. Policies will be evaluated in ascending order of this field.`}).option(`profile-type`,{type:`string`,description:`The client type to which the device settings profile applies. This field is set when the profile is created and cannot be changed.`,choices:[`warp`,`browser_extension`],default:`warp`}).option(`register-interface-ip-with-dns`,{type:`boolean`,description:`Determines if the operating system will register WARP's local interface IP with your on-premises DNS server.`,default:!0}).option(`sccm-vpn-boundary-support`,{type:`boolean`,description:`Determines whether the WARP client indicates to SCCM that it is inside a VPN boundary. (Windows only).`,default:!1}).option(`service-mode-v2-mode`,{type:`string`,description:`The mode to run the WARP client under.`}).option(`service-mode-v2-port`,{type:`number`,description:`The port number when used with proxy mode.`}).option(`support-url`,{type:`string`,description:`The URL to launch when the Send Feedback button is clicked.`,default:``}).option(`switch-locked`,{type:`boolean`,description:`Whether to allow the user to turn off the WARP switch and disconnect the client.`,default:!1}).option(`tunnel-protocol`,{type:`string`,description:`Determines which tunnel protocol to use.`,default:``}).option(`uninstall-protection`,{type:`boolean`,description:`Determines whether uninstalling the WARP client requires an override code. (Windows only).`,default:!1}).option(`virtual-networks-allowed`,{type:`string`,array:!0,description:`List of virtual network IDs the device is allowed to access. When virtual_networks is set, at least one entry is required.`}).option(`virtual-networks-default`,{type:`string`,description:"The default virtual network ID. Must be included in the `allowed` list."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`browser-extension-config-proxy-control`,`browser-extension-config-proxy-enabled`].some(t=>e[t]!==void 0)){let t=[`browser-extension-config-proxy-control`,`browser-extension-config-proxy-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --browser_extension_config-* flag is set`)}return!0}).check(e=>{if([`global-acceleration-api-endpoints`,`global-acceleration-autoswitch`,`global-acceleration-enabled`,`global-acceleration-masque-endpoints`,`global-acceleration-wireguard-endpoints`].some(t=>e[t]!==void 0)){let t=[`global-acceleration-api-endpoints`,`global-acceleration-enabled`,`global-acceleration-masque-endpoints`,`global-acceleration-wireguard-endpoints`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --global_acceleration-* flag is set`)}return!0}).check(e=>{if([`virtual-networks-allowed`,`virtual-networks-default`].some(t=>e[t]!==void 0)){let t=[`virtual-networks-allowed`,`virtual-networks-default`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --virtual_networks-* flag is set`)}return!0})}const as={command:`create`,describe:`Create a device settings profile`,builder:is,handler:async t=>l({command:`zero-trust devices profiles custom create`,classification:{safeFlags:[`allow-mode-switch`,`allow-updates`,`allowed-to-leave`,`browser-extension-config-proxy-control`,`browser-extension-config-proxy-enabled`,`default`,`disable-auto-fallback`,`enabled`,`exclude-office-ips`,`global-acceleration-autoswitch`,`global-acceleration-enabled`,`profile-type`,`register-interface-ip-with-dns`,`sccm-vpn-boundary-support`,`switch-locked`,`uninstall-protection`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices profiles custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/policy`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({allow_mode_switch:t[`allow-mode-switch`],allow_updates:t[`allow-updates`],allowed_to_leave:t[`allowed-to-leave`],auto_connect:t[`auto-connect`],browser_extension_config:{proxy_control:m(t[`browser-extension-config-proxy-control`],`browser-extension-config-proxy-control`,`text`),proxy_enabled:t[`browser-extension-config-proxy-enabled`]},captive_portal:t[`captive-portal`],default:t.default,disable_auto_fallback:t[`disable-auto-fallback`],dns_search_suffixes:f(t[`dns-search-suffixes`],`dns-search-suffixes`),enabled:t.enabled,exclude:f(t.exclude,`exclude`),exclude_office_ips:t[`exclude-office-ips`],global_acceleration:{api_endpoints:t[`global-acceleration-api-endpoints`],autoswitch:t[`global-acceleration-autoswitch`],enabled:t[`global-acceleration-enabled`],masque_endpoints:t[`global-acceleration-masque-endpoints`],wireguard_endpoints:t[`global-acceleration-wireguard-endpoints`]},include:f(t.include,`include`),lan_allow_minutes:t[`lan-allow-minutes`],lan_allow_subnet_size:t[`lan-allow-subnet-size`],match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,profile_type:m(t[`profile-type`],`profile-type`,`text`),register_interface_ip_with_dns:t[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:t[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(t[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:t[`service-mode-v2-port`]},support_url:m(t[`support-url`],`support-url`,`text`),switch_locked:t[`switch-locked`],tunnel_protocol:m(t[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:t[`uninstall-protection`],virtual_networks:{allowed:t[`virtual-networks-allowed`],default:m(t[`virtual-networks-default`],`virtual-networks-default`,`text`)}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.devices.profiles.custom.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`The name of the device settings profile.`));let u=p({allow_mode_switch:t[`allow-mode-switch`],allow_updates:t[`allow-updates`],allowed_to_leave:t[`allowed-to-leave`],auto_connect:t[`auto-connect`],browser_extension_config:{proxy_control:m(t[`browser-extension-config-proxy-control`],`browser-extension-config-proxy-control`,`text`),proxy_enabled:t[`browser-extension-config-proxy-enabled`]},captive_portal:t[`captive-portal`],default:t.default,disable_auto_fallback:t[`disable-auto-fallback`],dns_search_suffixes:f(t[`dns-search-suffixes`],`dns-search-suffixes`),enabled:t.enabled,exclude:f(t.exclude,`exclude`),exclude_office_ips:t[`exclude-office-ips`],global_acceleration:{api_endpoints:t[`global-acceleration-api-endpoints`],autoswitch:t[`global-acceleration-autoswitch`],enabled:t[`global-acceleration-enabled`],masque_endpoints:t[`global-acceleration-masque-endpoints`],wireguard_endpoints:t[`global-acceleration-wireguard-endpoints`]},include:f(t.include,`include`),lan_allow_minutes:t[`lan-allow-minutes`],lan_allow_subnet_size:t[`lan-allow-subnet-size`],match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,profile_type:m(t[`profile-type`],`profile-type`,`text`),register_interface_ip_with_dns:t[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:t[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(t[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:t[`service-mode-v2-port`]},support_url:m(t[`support-url`],`support-url`,`text`),switch_locked:t[`switch-locked`],tunnel_protocol:m(t[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:t[`uninstall-protection`],virtual_networks:{allowed:t[`virtual-networks-allowed`],default:m(t[`virtual-networks-default`],`virtual-networks-default`,`text`)}}),h=await c(`Creating`,async()=>i.zeroTrust.devices.profiles.custom.create({...u,account_id:l}));o(h,{successLabel:`Created`})})};function os(e){return e.usage(`$0 zero-trust devices profiles custom delete <policy-id>
|
|
384
|
+
|
|
385
|
+
Deletes a device settings profile and fetches a list of the remaining profiles for an account.`).positional(`policy-id`,{type:`string`,description:`Policy ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ss={command:`delete <policy-id>`,describe:`Delete a device settings profile`,builder:os,handler:async t=>l({command:`zero-trust devices profiles custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices profiles custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/policy/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
386
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.devices.profiles.custom.delete({account_id:l,policy_id:t[`policy-id`]}));o(u,{successLabel:`Deleted`})})};function cs(e){return e.usage(`$0 zero-trust devices profiles custom get <policy-id>
|
|
387
|
+
|
|
388
|
+
Fetches a device settings profile by ID.`).positional(`policy-id`,{type:`string`,description:`Policy ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ls={command:`get <policy-id>`,describe:`Get device settings profile by ID`,builder:cs,handler:async t=>l({command:`zero-trust devices profiles custom get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices profiles custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/policy/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.profiles.custom.get({account_id:l,policy_id:t[`policy-id`]}));o(u,{successLabel:`Loaded`})})};function us(e){return e.usage(`$0 zero-trust devices profiles custom list
|
|
389
|
+
|
|
390
|
+
Fetches a list of the device settings profiles for an account.`).option(`profile-type`,{type:`string`,description:`Filter profiles by client type. When omitted, only WARP profiles are returned.`,choices:[`warp`,`browser_extension`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ds={command:`list`,describe:`List device settings profiles`,builder:y(us),handler:async t=>l({command:`zero-trust devices profiles custom list`,classification:{safeFlags:[`profile-type`,`dry-run`]}},t,async()=>{let i={profile_type:t[`profile-type`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust devices profiles custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/policies`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.devices.profiles.custom.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function fs(e){return e.usage(`$0 zero-trust devices profiles custom update <policy-id>
|
|
391
|
+
|
|
392
|
+
Updates a configured device settings profile.`).positional(`policy-id`,{type:`string`,description:`Policy ID`,demandOption:!0}).option(`allow-mode-switch`,{type:`boolean`,description:`Whether to allow the user to switch WARP between modes.`}).option(`allow-updates`,{type:`boolean`,description:`Whether to receive update notifications when a new version of the client is available.`}).option(`allowed-to-leave`,{type:`boolean`,description:`Whether to allow devices to leave the organization.`}).option(`auto-connect`,{type:`number`,description:`The amount of time in seconds to reconnect after having been disabled.`}).option(`browser-extension-config-proxy-control`,{type:`string`,description:`Whether the user may disable the browser extension proxy.`,choices:[`unlocked`,`locked`]}).option(`browser-extension-config-proxy-enabled`,{type:`boolean`,description:`Whether the browser extension proxy is active.`}).option(`captive-portal`,{type:`number`,description:`Turn on the captive portal after the specified amount of time.`}).option(`default`,{type:`boolean`,description:`Whether the policy is the account default. WARP group profiles cannot set this field.`}).option(`description`,{type:`string`,description:`A description of the policy.`}).option(`disable-auto-fallback`,{type:`boolean`,description:"If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`."}).option(`dns-search-suffixes`,{type:`string`,description:`List of DNS search suffixes to apply to clients. Suffixes are evaluated in order. Use an empty array to clear. Provide as a JSON array of objects or @path/to/file.json.`}).option(`enabled`,{type:`boolean`,description:`Whether the policy will be applied to matching devices.`}).option(`exclude`,{type:`string`,description:`List of routes excluded in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`exclude-office-ips`,{type:`boolean`,description:`Whether to add Microsoft IPs to Split Tunnel exclusions.`}).option(`global-acceleration-api-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the API endpoints.`}).option(`global-acceleration-autoswitch`,{type:`boolean`,description:`Automatically switch Global Acceleration regions based on device location. Defaults to false when not provided.`}).option(`global-acceleration-enabled`,{type:`boolean`,description:`Global acceleration settings are used only when "enabled".`}).option(`global-acceleration-masque-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the MASQUE tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`global-acceleration-wireguard-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the WireGuard tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`include`,{type:`string`,description:`List of routes included in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`lan-allow-minutes`,{type:`number`,description:`The amount of time in minutes a user is allowed access to their LAN. A value of 0 will allow LAN access until the next WARP reconnection, such as a reboot or a laptop waking from sleep. Note that this field is omitted from the response if null or unset.`}).option(`lan-allow-subnet-size`,{type:`number`,description:`The size of the subnet for the local access network. Note that this field is omitted from the response if null or unset.`}).option(`match`,{type:`string`,description:`The wirefilter expression to match devices. Available values: "identity.email", "identity.groups.id", "identity.groups.name", "identity.groups.email", "identity.service_token_uuid", "identity.saml_attributes", "network", "os.name", "os.version", "device.tags".`}).option(`name`,{type:`string`,description:`The name of the device settings profile.`}).option(`precedence`,{type:`number`,description:`The precedence of the policy. Lower values indicate higher precedence. Policies will be evaluated in ascending order of this field.`}).option(`register-interface-ip-with-dns`,{type:`boolean`,description:`Determines if the operating system will register WARP's local interface IP with your on-premises DNS server.`}).option(`sccm-vpn-boundary-support`,{type:`boolean`,description:`Determines whether the WARP client indicates to SCCM that it is inside a VPN boundary. (Windows only).`}).option(`service-mode-v2-mode`,{type:`string`,description:`The mode to run the WARP client under.`}).option(`service-mode-v2-port`,{type:`number`,description:`The port number when used with proxy mode.`}).option(`support-url`,{type:`string`,description:`The URL to launch when the Send Feedback button is clicked.`}).option(`switch-locked`,{type:`boolean`,description:`Whether to allow the user to turn off the WARP switch and disconnect the client.`}).option(`tunnel-protocol`,{type:`string`,description:`Determines which tunnel protocol to use.`}).option(`uninstall-protection`,{type:`boolean`,description:`Determines whether uninstalling the WARP client requires an override code. (Windows only).`}).option(`virtual-networks-allowed`,{type:`string`,array:!0,description:`List of virtual network IDs the device is allowed to access. When virtual_networks is set, at least one entry is required.`}).option(`virtual-networks-default`,{type:`string`,description:"The default virtual network ID. Must be included in the `allowed` list."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`browser-extension-config-proxy-control`,`browser-extension-config-proxy-enabled`].some(t=>e[t]!==void 0)){let t=[`browser-extension-config-proxy-control`,`browser-extension-config-proxy-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --browser_extension_config-* flag is set`)}return!0}).check(e=>{if([`global-acceleration-api-endpoints`,`global-acceleration-autoswitch`,`global-acceleration-enabled`,`global-acceleration-masque-endpoints`,`global-acceleration-wireguard-endpoints`].some(t=>e[t]!==void 0)){let t=[`global-acceleration-api-endpoints`,`global-acceleration-enabled`,`global-acceleration-masque-endpoints`,`global-acceleration-wireguard-endpoints`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --global_acceleration-* flag is set`)}return!0}).check(e=>{if([`virtual-networks-allowed`,`virtual-networks-default`].some(t=>e[t]!==void 0)){let t=[`virtual-networks-allowed`,`virtual-networks-default`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --virtual_networks-* flag is set`)}return!0})}const ps={command:`update <policy-id>`,describe:`Update a device settings profile`,builder:fs,handler:async t=>l({command:`zero-trust devices profiles custom update`,classification:{safeFlags:[`allow-mode-switch`,`allow-updates`,`allowed-to-leave`,`browser-extension-config-proxy-control`,`browser-extension-config-proxy-enabled`,`default`,`disable-auto-fallback`,`enabled`,`exclude-office-ips`,`global-acceleration-autoswitch`,`global-acceleration-enabled`,`register-interface-ip-with-dns`,`sccm-vpn-boundary-support`,`switch-locked`,`uninstall-protection`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices profiles custom update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/policy/${t[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(t[`policy-id`]))}`,pathParams:{"policy-id":String(t[`policy-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({allow_mode_switch:t[`allow-mode-switch`],allow_updates:t[`allow-updates`],allowed_to_leave:t[`allowed-to-leave`],auto_connect:t[`auto-connect`],browser_extension_config:{proxy_control:m(t[`browser-extension-config-proxy-control`],`browser-extension-config-proxy-control`,`text`),proxy_enabled:t[`browser-extension-config-proxy-enabled`]},captive_portal:t[`captive-portal`],default:t.default,description:m(t.description,`description`,`text`),disable_auto_fallback:t[`disable-auto-fallback`],dns_search_suffixes:f(t[`dns-search-suffixes`],`dns-search-suffixes`),enabled:t.enabled,exclude:f(t.exclude,`exclude`),exclude_office_ips:t[`exclude-office-ips`],global_acceleration:{api_endpoints:t[`global-acceleration-api-endpoints`],autoswitch:t[`global-acceleration-autoswitch`],enabled:t[`global-acceleration-enabled`],masque_endpoints:t[`global-acceleration-masque-endpoints`],wireguard_endpoints:t[`global-acceleration-wireguard-endpoints`]},include:f(t.include,`include`),lan_allow_minutes:t[`lan-allow-minutes`],lan_allow_subnet_size:t[`lan-allow-subnet-size`],match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,register_interface_ip_with_dns:t[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:t[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(t[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:t[`service-mode-v2-port`]},support_url:m(t[`support-url`],`support-url`,`text`),switch_locked:t[`switch-locked`],tunnel_protocol:m(t[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:t[`uninstall-protection`],virtual_networks:{allowed:t[`virtual-networks-allowed`],default:m(t[`virtual-networks-default`],`virtual-networks-default`,`text`)}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.devices.profiles.custom.update({...e,account_id:l,policy_id:t[`policy-id`]}));o(n,{successLabel:`Updated`});return}let u=p({allow_mode_switch:t[`allow-mode-switch`],allow_updates:t[`allow-updates`],allowed_to_leave:t[`allowed-to-leave`],auto_connect:t[`auto-connect`],browser_extension_config:{proxy_control:m(t[`browser-extension-config-proxy-control`],`browser-extension-config-proxy-control`,`text`),proxy_enabled:t[`browser-extension-config-proxy-enabled`]},captive_portal:t[`captive-portal`],default:t.default,description:m(t.description,`description`,`text`),disable_auto_fallback:t[`disable-auto-fallback`],dns_search_suffixes:f(t[`dns-search-suffixes`],`dns-search-suffixes`),enabled:t.enabled,exclude:f(t.exclude,`exclude`),exclude_office_ips:t[`exclude-office-ips`],global_acceleration:{api_endpoints:t[`global-acceleration-api-endpoints`],autoswitch:t[`global-acceleration-autoswitch`],enabled:t[`global-acceleration-enabled`],masque_endpoints:t[`global-acceleration-masque-endpoints`],wireguard_endpoints:t[`global-acceleration-wireguard-endpoints`]},include:f(t.include,`include`),lan_allow_minutes:t[`lan-allow-minutes`],lan_allow_subnet_size:t[`lan-allow-subnet-size`],match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,register_interface_ip_with_dns:t[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:t[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(t[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:t[`service-mode-v2-port`]},support_url:m(t[`support-url`],`support-url`,`text`),switch_locked:t[`switch-locked`],tunnel_protocol:m(t[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:t[`uninstall-protection`],virtual_networks:{allowed:t[`virtual-networks-allowed`],default:m(t[`virtual-networks-default`],`virtual-networks-default`,`text`)}}),h=await c(`Updating`,async()=>i.zeroTrust.devices.profiles.custom.update({...u,account_id:l,policy_id:t[`policy-id`]}));o(h,{successLabel:`Updated`})})},ms={command:`custom`,describe:`Operations for devices.profiles.custom`,builder:e=>e.command(as).command(ss).command(ls).command(ds).command(ps).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function hs(e){return e.usage(`$0 zero-trust devices profiles default get
|
|
393
|
+
|
|
394
|
+
Fetches the default device settings profile for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gs={command:`get`,describe:`Get the default device settings profile`,builder:hs,handler:async t=>l({command:`zero-trust devices profiles default get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices profiles default get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/policy`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.profiles.default.get({account_id:l}));o(u,{successLabel:`Loaded`})})};function _s(e){return e.usage(`$0 zero-trust devices profiles default update
|
|
395
|
+
|
|
396
|
+
Updates the default device settings profile for an account.`).option(`allow-mode-switch`,{type:`boolean`,description:`Whether to allow the user to switch WARP between modes.`}).option(`allow-updates`,{type:`boolean`,description:`Whether to receive update notifications when a new version of the client is available.`}).option(`allowed-to-leave`,{type:`boolean`,description:`Whether to allow devices to leave the organization.`}).option(`auto-connect`,{type:`number`,description:`The amount of time in seconds to reconnect after having been disabled.`}).option(`captive-portal`,{type:`number`,description:`Turn on the captive portal after the specified amount of time.`}).option(`disable-auto-fallback`,{type:`boolean`,description:"If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`."}).option(`dns-search-suffixes`,{type:`string`,description:`List of DNS search suffixes to apply to clients. Suffixes are evaluated in order. Use an empty array to clear. Provide as a JSON array of objects or @path/to/file.json.`}).option(`exclude`,{type:`string`,description:`List of routes excluded in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`exclude-office-ips`,{type:`boolean`,description:`Whether to add Microsoft IPs to Split Tunnel exclusions.`}).option(`global-acceleration-api-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the API endpoints.`}).option(`global-acceleration-autoswitch`,{type:`boolean`,description:`Automatically switch Global Acceleration regions based on device location. Defaults to false when not provided.`}).option(`global-acceleration-enabled`,{type:`boolean`,description:`Global acceleration settings are used only when "enabled".`}).option(`global-acceleration-masque-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the MASQUE tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`global-acceleration-wireguard-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the WireGuard tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`include`,{type:`string`,description:`List of routes included in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`lan-allow-minutes`,{type:`number`,description:`The amount of time in minutes a user is allowed access to their LAN. A value of 0 will allow LAN access until the next WARP reconnection, such as a reboot or a laptop waking from sleep. Note that this field is omitted from the response if null or unset.`}).option(`lan-allow-subnet-size`,{type:`number`,description:`The size of the subnet for the local access network. Note that this field is omitted from the response if null or unset.`}).option(`register-interface-ip-with-dns`,{type:`boolean`,description:`Determines if the operating system will register WARP's local interface IP with your on-premises DNS server.`}).option(`sccm-vpn-boundary-support`,{type:`boolean`,description:`Determines whether the WARP client indicates to SCCM that it is inside a VPN boundary. (Windows only).`}).option(`service-mode-v2-mode`,{type:`string`,description:`The mode to run the WARP client under.`}).option(`service-mode-v2-port`,{type:`number`,description:`The port number when used with proxy mode.`}).option(`support-url`,{type:`string`,description:`The URL to launch when the Send Feedback button is clicked.`}).option(`switch-locked`,{type:`boolean`,description:`Whether to allow the user to turn off the WARP switch and disconnect the client.`}).option(`tunnel-protocol`,{type:`string`,description:`Determines which tunnel protocol to use.`}).option(`uninstall-protection`,{type:`boolean`,description:`Determines whether uninstalling the WARP client requires an override code. (Windows only).`}).option(`virtual-networks-allowed`,{type:`string`,array:!0,description:`List of virtual network IDs the device is allowed to access. When virtual_networks is set, at least one entry is required.`}).option(`virtual-networks-default`,{type:`string`,description:"The default virtual network ID. Must be included in the `allowed` list."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`global-acceleration-api-endpoints`,`global-acceleration-autoswitch`,`global-acceleration-enabled`,`global-acceleration-masque-endpoints`,`global-acceleration-wireguard-endpoints`].some(t=>e[t]!==void 0)){let t=[`global-acceleration-api-endpoints`,`global-acceleration-enabled`,`global-acceleration-masque-endpoints`,`global-acceleration-wireguard-endpoints`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --global_acceleration-* flag is set`)}return!0}).check(e=>{if([`virtual-networks-allowed`,`virtual-networks-default`].some(t=>e[t]!==void 0)){let t=[`virtual-networks-allowed`,`virtual-networks-default`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --virtual_networks-* flag is set`)}return!0})}const vs={command:`update`,describe:`Update the default device settings profile`,builder:_s,handler:async t=>l({command:`zero-trust devices profiles default update`,classification:{safeFlags:[`allow-mode-switch`,`allow-updates`,`allowed-to-leave`,`disable-auto-fallback`,`exclude-office-ips`,`global-acceleration-autoswitch`,`global-acceleration-enabled`,`register-interface-ip-with-dns`,`sccm-vpn-boundary-support`,`switch-locked`,`uninstall-protection`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices profiles default update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/policy`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({allow_mode_switch:t[`allow-mode-switch`],allow_updates:t[`allow-updates`],allowed_to_leave:t[`allowed-to-leave`],auto_connect:t[`auto-connect`],captive_portal:t[`captive-portal`],disable_auto_fallback:t[`disable-auto-fallback`],dns_search_suffixes:f(t[`dns-search-suffixes`],`dns-search-suffixes`),exclude:f(t.exclude,`exclude`),exclude_office_ips:t[`exclude-office-ips`],global_acceleration:{api_endpoints:t[`global-acceleration-api-endpoints`],autoswitch:t[`global-acceleration-autoswitch`],enabled:t[`global-acceleration-enabled`],masque_endpoints:t[`global-acceleration-masque-endpoints`],wireguard_endpoints:t[`global-acceleration-wireguard-endpoints`]},include:f(t.include,`include`),lan_allow_minutes:t[`lan-allow-minutes`],lan_allow_subnet_size:t[`lan-allow-subnet-size`],register_interface_ip_with_dns:t[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:t[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(t[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:t[`service-mode-v2-port`]},support_url:m(t[`support-url`],`support-url`,`text`),switch_locked:t[`switch-locked`],tunnel_protocol:m(t[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:t[`uninstall-protection`],virtual_networks:{allowed:t[`virtual-networks-allowed`],default:m(t[`virtual-networks-default`],`virtual-networks-default`,`text`)}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.devices.profiles.default.update({...e,account_id:l}));o(n,{successLabel:`Updated`});return}let u=p({allow_mode_switch:t[`allow-mode-switch`],allow_updates:t[`allow-updates`],allowed_to_leave:t[`allowed-to-leave`],auto_connect:t[`auto-connect`],captive_portal:t[`captive-portal`],disable_auto_fallback:t[`disable-auto-fallback`],dns_search_suffixes:f(t[`dns-search-suffixes`],`dns-search-suffixes`),exclude:f(t.exclude,`exclude`),exclude_office_ips:t[`exclude-office-ips`],global_acceleration:{api_endpoints:t[`global-acceleration-api-endpoints`],autoswitch:t[`global-acceleration-autoswitch`],enabled:t[`global-acceleration-enabled`],masque_endpoints:t[`global-acceleration-masque-endpoints`],wireguard_endpoints:t[`global-acceleration-wireguard-endpoints`]},include:f(t.include,`include`),lan_allow_minutes:t[`lan-allow-minutes`],lan_allow_subnet_size:t[`lan-allow-subnet-size`],register_interface_ip_with_dns:t[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:t[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(t[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:t[`service-mode-v2-port`]},support_url:m(t[`support-url`],`support-url`,`text`),switch_locked:t[`switch-locked`],tunnel_protocol:m(t[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:t[`uninstall-protection`],virtual_networks:{allowed:t[`virtual-networks-allowed`],default:m(t[`virtual-networks-default`],`virtual-networks-default`,`text`)}}),h=await c(`Updating`,async()=>i.zeroTrust.devices.profiles.default.update({...u,account_id:l}));o(h,{successLabel:`Updated`})})},ys={command:`default`,describe:`Operations for devices.profiles.default`,builder:e=>e.command(gs).command(vs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},bs={command:`profiles`,describe:`Operations for devices.profiles`,builder:e=>e.command(ms).command(ys).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xs(e){return e.usage(`$0 zero-trust devices registrations bulk-delete
|
|
397
|
+
|
|
398
|
+
Deletes a list of WARP registrations.`).option(`id`,{type:`string`,description:`A list of registration IDs to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ss={command:`bulk-delete`,describe:`Delete registrations`,builder:xs,handler:async t=>l({command:`zero-trust devices registrations bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{let i={id:t.id};if(t.dryRun){let e=await r();s({command:`cf zero-trust devices registrations bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/registrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();if(t.accountId=u,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
399
|
+
`);return}let d=await c(`Deleting`,async()=>l.zeroTrust.devices.registrations.bulkDelete({account_id:u,...i}));o(d,{successLabel:`Deleted`})})};function Cs(e){return e.usage(`$0 zero-trust devices registrations delete <registration-id>
|
|
400
|
+
|
|
401
|
+
Deletes a WARP registration.`).positional(`registration-id`,{type:`string`,description:`Registration ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ws={command:`delete <registration-id>`,describe:`Delete registration`,builder:Cs,handler:async t=>l({command:`zero-trust devices registrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices registrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/registrations/${t[`registration-id`]==null?`<registration-id>`:encodeURIComponent(String(t[`registration-id`]))}`,pathParams:{"registration-id":String(t[`registration-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
402
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.devices.registrations.delete({account_id:l,registration_id:t[`registration-id`]}));o(u,{successLabel:`Deleted`})})};function Ts(e){return e.usage(`$0 zero-trust devices registrations get <registration-id>
|
|
403
|
+
|
|
404
|
+
Fetches a single WARP registration.`).positional(`registration-id`,{type:`string`,description:`Registration ID`,demandOption:!0}).option(`include`,{type:`string`,description:`Comma-separated list of additional information that should be included in the registration response. Supported values are: "policy".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Es={command:`get <registration-id>`,describe:`Get registration`,builder:Ts,handler:async t=>l({command:`zero-trust devices registrations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={include:t.include};if(t.dryRun){let e=await r();s({command:`cf zero-trust devices registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/registrations/${t[`registration-id`]==null?`<registration-id>`:encodeURIComponent(String(t[`registration-id`]))}`,pathParams:{"registration-id":String(t[`registration-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.devices.registrations.get({account_id:u,registration_id:t[`registration-id`],...i}));o(d,{successLabel:`Loaded`})})};function Ds(e){return e.usage(`$0 zero-trust devices registrations list
|
|
405
|
+
|
|
406
|
+
Lists WARP registrations.`).option(`user-id`,{type:`string`,description:`Filter by user ID.`}).option(`seen-after`,{type:`string`,description:`Filter by the last_seen timestamp - returns only registrations last seen after this timestamp.`}).option(`seen-before`,{type:`string`,description:`Filter by the last_seen timestamp - returns only registrations last seen before this timestamp.`}).option(`status`,{type:`string`,description:`Filter by registration status. Defaults to 'active'.`,choices:[`active`,`all`,`revoked`]}).option(`registration-type`,{type:`string`,description:`Filter by registration client type.`,choices:[`warp`,`browser_extension`]}).option(`per-page`,{type:`number`,description:`The maximum number of devices to return in a single response.`}).option(`search`,{type:`string`,description:`Filter by registration details.`}).option(`sort-by`,{type:`string`,description:`The registration field to order results by.`,choices:[`id`,`user.name`,`user.email`,`last_seen_at`,`created_at`]}).option(`sort-order`,{type:`string`,description:`Sort direction.`,choices:[`asc`,`desc`]}).option(`cursor`,{type:`string`,description:`Opaque token indicating the starting position when requesting the next set of records. A cursor value can be obtained from the result_info.cursor field in the response.`}).option(`id`,{type:`string`,description:`Filter by registration ID.`}).option(`device-id`,{type:`string`,description:`Filter by WARP device ID.`}).option(`policy-id`,{type:`string`,description:`Filter by the ID of the device settings profile assigned to the registration.`}).option(`include`,{type:`string`,description:`Comma-separated list of additional information that should be included in the registration response. Supported values are: "policy".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Os={command:`list`,describe:`List registrations`,builder:y(Ds),handler:async t=>l({command:`zero-trust devices registrations list`,classification:{safeFlags:[`status`,`registration-type`,`sort-by`,`sort-order`,`dry-run`]}},t,async()=>{let i={"user.id":t[`user-id`],seen_after:t[`seen-after`],seen_before:t[`seen-before`],status:t.status,registration_type:t[`registration-type`],per_page:t[`per-page`],search:t.search,sort_by:t[`sort-by`],sort_order:t[`sort-order`],cursor:t.cursor,id:t.id,"device.id":t[`device-id`],"policy.id":t[`policy-id`],include:t.include};if(t.dryRun){let e=await r();s({command:`cf zero-trust devices registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/registrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.devices.registrations.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function ks(e){return e.usage(`$0 zero-trust devices registrations override-codes get <registration-id>
|
|
407
|
+
|
|
408
|
+
Fetches one-time use admin override codes for a registration. This relies on the **Admin Override** setting being enabled in your device configuration.`).positional(`registration-id`,{type:`string`,description:`Registration ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const As={command:`get <registration-id>`,describe:`Get override codes`,builder:ks,handler:async t=>l({command:`zero-trust devices registrations override-codes get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices registrations override-codes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/registrations/${t[`registration-id`]==null?`<registration-id>`:encodeURIComponent(String(t[`registration-id`]))}/override_codes`,pathParams:{"registration-id":String(t[`registration-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.registrations.overrideCodes.get({account_id:l,registration_id:t[`registration-id`]}));o(u,{successLabel:`Loaded`})})},js={command:`override-codes`,describe:`Operations for devices.registrations.override-codes`,builder:e=>e.command(As).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ms={command:`registrations`,describe:`Operations for devices.registrations`,builder:e=>e.command(Ss).command(ws).command(Es).command(Os).command(js).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ns(e){return e.usage(`$0 zero-trust devices settings delete
|
|
409
|
+
|
|
410
|
+
Resets the current device settings for a Zero Trust account.`).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 Ps={command:`delete`,describe:`Reset device settings`,builder:Ns,handler:async t=>l({command:`zero-trust devices settings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
411
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.devices.settings.delete({account_id:l}));o(u,{successLabel:`Deleted`})})};function Fs(e){return e.usage(`$0 zero-trust devices settings get
|
|
412
|
+
|
|
413
|
+
Describes the current device settings for a Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Is={command:`get`,describe:`Get device settings`,builder:Fs,handler:async t=>l({command:`zero-trust devices settings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.devices.settings.get({account_id:l}));o(u,{successLabel:`Loaded`})})};function Ls(e){return e.usage(`$0 zero-trust devices settings update
|
|
414
|
+
|
|
415
|
+
Updates the device settings for a Zero Trust account.`).option(`disable-for-time`,{type:`number`,description:`Sets the time limit, in seconds, that a user can use an override code to bypass WARP.`}).option(`external-emergency-signal-enabled`,{type:`boolean`,description:`Controls whether the external emergency disconnect feature is enabled.`}).option(`external-emergency-signal-fingerprint`,{type:`string`,description:`The SHA256 fingerprint (64 hexadecimal characters) of the HTTPS server certificate for the external_emergency_signal_url. If provided, the WARP client will use this value to verify the server's identity. The device will ignore any response if the server's certificate fingerprint does not exactly match this value.`}).option(`external-emergency-signal-interval`,{type:`string`,description:`The interval at which the WARP client fetches the emergency disconnect signal, formatted as a duration string (e.g., "5m", "2m30s", "1h"). Minimum 30 seconds.`}).option(`external-emergency-signal-url`,{type:`string`,description:`The HTTPS URL from which to fetch the emergency disconnect signal. Must use HTTPS and have an IPv4 or IPv6 address as the host.`}).option(`gateway-proxy-enabled`,{type:`boolean`,description:`Enable gateway proxy filtering on TCP.`}).option(`gateway-udp-proxy-enabled`,{type:`boolean`,description:`Enable gateway proxy filtering on UDP.`}).option(`root-certificate-installation-enabled`,{type:`boolean`,description:`Enable installation of cloudflare managed root certificate.`}).option(`use-zt-virtual-ip`,{type:`boolean`,description:`Enable using CGNAT virtual IPv4.`}).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 Rs={command:`update`,describe:`Update device settings`,builder:Ls,handler:async t=>l({command:`zero-trust devices settings update`,classification:{safeFlags:[`external-emergency-signal-enabled`,`gateway-proxy-enabled`,`gateway-udp-proxy-enabled`,`root-certificate-installation-enabled`,`use-zt-virtual-ip`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices settings update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({disable_for_time:t[`disable-for-time`],external_emergency_signal_enabled:t[`external-emergency-signal-enabled`],external_emergency_signal_fingerprint:m(t[`external-emergency-signal-fingerprint`],`external-emergency-signal-fingerprint`,`text`),external_emergency_signal_interval:m(t[`external-emergency-signal-interval`],`external-emergency-signal-interval`,`text`),external_emergency_signal_url:m(t[`external-emergency-signal-url`],`external-emergency-signal-url`,`text`),gateway_proxy_enabled:t[`gateway-proxy-enabled`],gateway_udp_proxy_enabled:t[`gateway-udp-proxy-enabled`],root_certificate_installation_enabled:t[`root-certificate-installation-enabled`],use_zt_virtual_ip:t[`use-zt-virtual-ip`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.devices.settings.update({body:e,account_id:l}));o(n,{successLabel:`Updated`});return}let u=p({disable_for_time:t[`disable-for-time`],external_emergency_signal_enabled:t[`external-emergency-signal-enabled`],external_emergency_signal_fingerprint:m(t[`external-emergency-signal-fingerprint`],`external-emergency-signal-fingerprint`,`text`),external_emergency_signal_interval:m(t[`external-emergency-signal-interval`],`external-emergency-signal-interval`,`text`),external_emergency_signal_url:m(t[`external-emergency-signal-url`],`external-emergency-signal-url`,`text`),gateway_proxy_enabled:t[`gateway-proxy-enabled`],gateway_udp_proxy_enabled:t[`gateway-udp-proxy-enabled`],root_certificate_installation_enabled:t[`root-certificate-installation-enabled`],use_zt_virtual_ip:t[`use-zt-virtual-ip`]}),f=await c(`Updating`,async()=>i.zeroTrust.devices.settings.update({body:u,account_id:l}));o(f,{successLabel:`Updated`})})},zs={command:`settings`,describe:`Operations for devices.settings`,builder:e=>e.command(Ps).command(Is).command(Rs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Bs(e){return e.usage(`$0 zero-trust devices update <device-id>
|
|
416
|
+
|
|
417
|
+
Updates properties of a WARP device.`).positional(`device-id`,{type:`string`,description:`Device ID`,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 Vs={command:`update <device-id>`,describe:`Update device`,builder:Bs,handler:async t=>l({command:`zero-trust devices update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust devices update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/physical-devices/${t[`device-id`]==null?`<device-id>`:encodeURIComponent(String(t[`device-id`]))}`,pathParams:{"device-id":String(t[`device-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.devices.update({...e,account_id:l,device_id:t[`device-id`]}));o(n,{successLabel:`Updated`});return}let u=await c(`Updating`,async()=>i.zeroTrust.devices.update({account_id:l,device_id:t[`device-id`]}));o(u,{successLabel:`Updated`})})},Hs={command:`devices`,describe:`Operations for devices`,builder:e=>e.command(Ha).command(oo).command(bo).command(Vs).command(Ba).command($a).command(io).command(vo).command(jo).command(Po).command(rs).command(bs).command(Ms).command(zs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Us(e){return e.usage(`$0 zero-trust dex colos list
|
|
418
|
+
|
|
419
|
+
List Cloudflare colos that account's devices were connected to during a time period, sorted by usage starting from the most used colo. Colos without traffic are also returned and sorted alphabetically.`).option(`from`,{type:`string`,description:`Start time for connection period in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for connection period in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`sort-by`,{type:`string`,description:`Type of usage that colos should be sorted by. If unspecified, returns all Cloudflare colos sorted alphabetically.`,choices:[`fleet-status-usage`,`application-tests-usage`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ws={command:`list`,describe:`List Cloudflare colos`,builder:y(Us),handler:async t=>l({command:`zero-trust dex colos list`,classification:{safeFlags:[`sort-by`,`dry-run`]}},t,async()=>{let i={from:t.from,to:t.to,sortBy:t[`sort-by`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex colos list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/colos`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.colos.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},Gs={command:`colos`,describe:`Operations for dex.colos`,builder:e=>e.command(Ws).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ks(e){return e.usage(`$0 zero-trust dex commands create
|
|
420
|
+
|
|
421
|
+
Initiate commands for up to 10 devices per account.`).option(`commands`,{type:`string`,description:`List of device-level commands to execute. 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 qs={command:`create`,describe:`Create account commands`,builder:Ks,handler:async t=>l({command:`zero-trust dex commands create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex commands create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/commands`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({commands:f(t.commands,`commands`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dex.commands.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.commands===void 0)throw Error(`--commands is required (or pass --body with this field set).`);let u=p({commands:f(t.commands,`commands`)}),m=await c(`Creating`,async()=>i.zeroTrust.dex.commands.create({...u,account_id:l}));o(m,{successLabel:`Created`})})};function Js(e){return e.usage(`$0 zero-trust dex commands eligible-devices list
|
|
422
|
+
|
|
423
|
+
List devices with WARP client support for remote captures which have been connected in the last 1 hour.`).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`search`,{type:`string`,description:`Filter devices by name or email.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ys={command:`list`,describe:`List devices eligible for remote captures`,builder:Js,handler:async t=>l({command:`zero-trust dex commands eligible-devices list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],search:t.search};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex commands eligible-devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/commands/devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.commands.eligibleDevices.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},Xs={command:`eligible-devices`,describe:`Operations for dex.commands.eligible-devices`,builder:e=>e.command(Ys).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Zs(e){return e.usage(`$0 zero-trust dex commands list
|
|
424
|
+
|
|
425
|
+
Retrieves a paginated list of commands issued to devices under the specified account, optionally filtered by time range, device, or other parameters`).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start time for the query in ISO (RFC3339 - ISO 8601) format.`}).option(`to`,{type:`string`,description:`End time for the query in ISO (RFC3339 - ISO 8601) format.`}).option(`device-id`,{type:`string`,description:`Unique identifier for a device.`}).option(`user-email`,{type:`string`,description:`Email tied to the device.`}).option(`command-type`,{type:`string`,description:`Optionally filter executed commands by command type.`,choices:[`pcap`,`speed-test`,`warp-diag`]}).option(`status`,{type:`string`,description:`Optionally filter executed commands by status.`,choices:[`PENDING_EXEC`,`PENDING_UPLOAD`,`SUCCESS`,`FAILED`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Qs={command:`list`,describe:`List account commands`,builder:y(Zs),handler:async t=>l({command:`zero-trust dex commands list`,classification:{safeFlags:[`command-type`,`status`,`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],from:t.from,to:t.to,device_id:t[`device-id`],user_email:t[`user-email`],command_type:t[`command-type`],status:t.status};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex commands list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/commands`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.commands.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function $s(e){return e.usage(`$0 zero-trust dex commands quota get
|
|
426
|
+
|
|
427
|
+
Retrieves the current quota usage and limits for device commands within a specific account, including the time when the quota will reset`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ec={command:`get`,describe:`Returns account commands usage, quota, and reset time`,builder:$s,handler:async t=>l({command:`zero-trust dex commands quota get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex commands quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/commands/quota`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dex.commands.quota.get({account_id:l}));o(u,{successLabel:`Loaded`})})},tc={command:`quota`,describe:`Operations for dex.commands.quota`,builder:e=>e.command(ec).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function nc(e){return e.usage(`$0 zero-trust dex commands results get <filename>
|
|
428
|
+
|
|
429
|
+
Downloads artifacts for an executed command. Bulk downloads are not supported`).positional(`filename`,{type:`string`,description:"The name of the file to be downloaded, including the `.zip` extension.",demandOption:!0}).option(`command-id`,{type:`string`,description:`Unique identifier for command.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const rc={command:`get <filename>`,describe:`Download command output file`,builder:nc,handler:async t=>l({command:`zero-trust dex commands results get`,classification:{safeFlags:[`dry-run`,`text`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex commands results get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/commands/${t[`command-id`]==null?`<command-id>`:encodeURIComponent(String(t[`command-id`]))}/downloads/${t.filename==null?`<filename>`:encodeURIComponent(String(t.filename))}`,pathParams:{"command-id":String(t[`command-id`]??``),filename:String(t.filename??``)},bodyKind:`none`});return}await n(t);let i=t.local?e:await a();t.accountId=i;let o=await c(`Loading`,async()=>te(`/accounts/${i}/dex/commands/${encodeURIComponent(String(t[`command-id`]))}/downloads/${encodeURIComponent(String(t.filename))}`,{method:`GET`,local:t.local===!0,persistTo:t.persistTo}));ee(t.text===!0?o.toString(`utf-8`):o)})},ic={command:`results`,describe:`Operations for dex.commands.results`,builder:e=>e.command(rc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ac={command:`commands`,describe:`Operations for dex.commands`,builder:e=>e.command(qs).command(Qs).command(Xs).command(tc).command(ic).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oc(e){return e.usage(`$0 zero-trust dex devices aggregates live get
|
|
430
|
+
|
|
431
|
+
Get details for live (up to 60 minutes) devices using WARP.`).option(`since-minutes`,{type:`number`,description:`Number of minutes before current time.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sc={command:`get`,describe:`Get live aggregate device details by dimension`,builder:oc,handler:async t=>l({command:`zero-trust dex devices aggregates live get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={since_minutes:t[`since-minutes`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex devices aggregates live get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/fleet-status/live`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.devices.aggregates.live.get({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},cc={command:`live`,describe:`Operations for dex.devices.aggregates.live`,builder:e=>e.command(sc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lc(e){return e.usage(`$0 zero-trust dex devices aggregates over-time get
|
|
432
|
+
|
|
433
|
+
Get aggregate details for devices using WARP, up to 7 days.`).option(`to`,{type:`string`,description:`End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`colo`,{type:`string`,description:`Cloudflare colo airport code.`}).option(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const uc={command:`get`,describe:`Get over time aggregate details for devices by dimension`,builder:lc,handler:async t=>l({command:`zero-trust dex devices aggregates over-time get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={to:t.to,from:t.from,colo:t.colo,device_id:t[`device-id`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex devices aggregates over-time get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/fleet-status/over-time`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.devices.aggregates.overTime.get({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},dc={command:`over-time`,describe:`Operations for dex.devices.aggregates.over-time`,builder:e=>e.command(uc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fc={command:`aggregates`,describe:`Operations for dex.devices.aggregates`,builder:e=>e.command(cc).command(dc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pc(e){return e.usage(`$0 zero-trust dex devices get <device-id>
|
|
434
|
+
|
|
435
|
+
Get the latest status of a device given device_id from the device_state table.`).positional(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`,demandOption:!0}).option(`since-minutes`,{type:`number`,description:`Number of minutes before current time.`,demandOption:!0}).option(`time-now`,{type:`string`,description:`Current time in ISO format.`}).option(`colo`,{type:`string`,description:`List of data centers to filter results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mc={command:`get <device-id>`,describe:`Get the latest status of a device.`,builder:pc,handler:async t=>l({command:`zero-trust dex devices get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={since_minutes:t[`since-minutes`],time_now:t[`time-now`],colo:t.colo};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/devices/${t[`device-id`]==null?`<device-id>`:encodeURIComponent(String(t[`device-id`]))}/fleet-status/live`,pathParams:{"device-id":String(t[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.devices.get({account_id:u,device_id:t[`device-id`],...i}));o(d,{successLabel:`Loaded`})})};function hc(e){return e.usage(`$0 zero-trust dex devices list
|
|
436
|
+
|
|
437
|
+
List details of devices using WARP.`).option(`to`,{type:`string`,description:`End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`sort-by`,{type:`string`,description:`Dimension to sort results by.`,choices:[`colo`,`device_id`,`mode`,`platform`,`status`,`timestamp`,`version`]}).option(`colo`,{type:`string`,description:`Cloudflare colo airport code.`}).option(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`}).option(`device-mode`,{type:`string`,description:`The mode under which the WARP client is run.`}).option(`status`,{type:`string`,description:`Network status.`}).option(`platform`,{type:`string`,description:`Operating system.`}).option(`warp-version`,{type:`string`,description:`WARP client version.`}).option(`source`,{type:`string`,description:"Source:\n * `hourly` - device details aggregated hourly, up to 7 days prior\n * `last_seen` - device details, up to 60 minutes prior. Time windows exceeding 60 minutes will be rejected from June 1st, 2026. Please use 'hourly' or 'raw' instead for longer time ranges.\n * `raw` - device details, up to 7 days prior",choices:[`last_seen`,`hourly`,`raw`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gc={command:`list`,describe:`List details of devices using WARP.`,builder:y(hc),handler:async t=>l({command:`zero-trust dex devices list`,classification:{safeFlags:[`sort-by`,`source`,`dry-run`]}},t,async()=>{let i={to:t.to,from:t.from,page:t.page,per_page:t[`per-page`],sort_by:t[`sort-by`],colo:t.colo,device_id:t[`device-id`],mode:t[`device-mode`],status:t.status,platform:t.platform,version:t[`warp-version`],source:t.source};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/fleet-status/devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.devices.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function _c(e){return e.usage(`$0 zero-trust dex devices over-time get <device-id>
|
|
438
|
+
|
|
439
|
+
Get time-bucketed status metrics for a specific device.`).positional(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`to`,{type:`string`,description:`End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`interval`,{type:`string`,description:`Time interval for aggregate time slots.`,choices:[`minute`,`hour`],demandOption:!0}).option(`colo`,{type:`string`,description:`List of data centers to filter results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vc={command:`get <device-id>`,describe:`Get the status over time for a device`,builder:y(_c),handler:async t=>l({command:`zero-trust dex devices over-time get`,classification:{safeFlags:[`interval`,`dry-run`]}},t,async()=>{let i={from:t.from,to:t.to,interval:t.interval,colo:t.colo};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex devices over-time get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/devices/${t[`device-id`]==null?`<device-id>`:encodeURIComponent(String(t[`device-id`]))}/fleet-status/over-time`,pathParams:{"device-id":String(t[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.devices.overTime.get({account_id:u,device_id:t[`device-id`],...i}));o(d,{successLabel:`Loaded`})})},yc={command:`over-time`,describe:`Operations for dex.devices.over-time`,builder:e=>e.command(vc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},bc={command:`devices`,describe:`Operations for dex.devices`,builder:e=>e.command(mc).command(gc).command(fc).command(yc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xc(e){return e.usage(`$0 zero-trust dex isps list
|
|
440
|
+
|
|
441
|
+
List ISP information observed for a specific device during traceroute tests.`).option(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results. Mutually exclusive with cursor.`}).option(`per-page`,{type:`number`,description:`Number of items per page`,demandOption:!0}).option(`cursor`,{type:`string`,description:`Cursor for cursor-based pagination. Mutually exclusive with page.`}).option(`sort-by`,{type:`string`,description:`The field to sort results by.`,choices:[`time_start`]}).option(`sort-order`,{type:`string`,description:`The order to sort results.`,choices:[`ASC`,`DESC`]}).option(`from`,{type:`string`,description:`Start time for the query in ISO 8601 format.`}).option(`to`,{type:`string`,description:`End time for the query in ISO 8601 format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Sc={command:`list`,describe:`List device ISPs`,builder:y(xc),handler:async t=>l({command:`zero-trust dex isps list`,classification:{safeFlags:[`sort-by`,`sort-order`,`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],cursor:t.cursor,sort_by:t[`sort-by`],sort_order:t[`sort-order`],from:t.from,to:t.to};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex isps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/devices/${t[`device-id`]==null?`<device-id>`:encodeURIComponent(String(t[`device-id`]))}/isps`,pathParams:{"device-id":String(t[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.isps.list({account_id:u,device_id:t[`device-id`],...i}));o(d,{successLabel:`Loaded`})})},Cc={command:`isps`,describe:`Operations for dex.isps`,builder:e=>e.command(Sc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function wc(e){return e.usage(`$0 zero-trust dex overview tests list
|
|
442
|
+
|
|
443
|
+
List DEX tests with overview metrics.`).option(`colo`,{type:`string`,description:`Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.`}).option(`test-name`,{type:`string`,description:`Optionally filter results by test name.`}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`registration-id`,{type:`string`,description:`Optionally filter results to a specific device registration. Must be used in combination with a single deviceId.`}).option(`page`,{type:`number`,description:`Page number of paginated results`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`kind`,{type:`string`,description:`Filter by test type.`,choices:[`http`,`traceroute`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Tc={command:`list`,describe:`List DEX test analytics`,builder:y(wc),handler:async t=>l({command:`zero-trust dex overview tests list`,classification:{safeFlags:[`kind`,`dry-run`]}},t,async()=>{let i={colo:t.colo,testName:t[`test-name`],deviceId:t[`device-id`],registration_id:t[`registration-id`],page:t.page,per_page:t[`per-page`],kind:t.kind};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex overview tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/tests/overview`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.overview.tests.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function Ec(e){return e.usage(`$0 zero-trust dex overview tests unique-devices get
|
|
444
|
+
|
|
445
|
+
Returns unique count of devices that have run synthetic application monitoring tests in the past 7 days.`).option(`test-name`,{type:`string`,description:`Optionally filter results by test name.`}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Dc={command:`get`,describe:`Get count of devices targeted`,builder:Ec,handler:async t=>l({command:`zero-trust dex overview tests unique-devices get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={testName:t[`test-name`],deviceId:t[`device-id`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex overview tests unique-devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/tests/unique-devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.overview.tests.uniqueDevices.get({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},Oc={command:`unique-devices`,describe:`Operations for dex.overview.tests.unique-devices`,builder:e=>e.command(Dc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},kc={command:`tests`,describe:`Operations for dex.overview.tests`,builder:e=>e.command(Tc).command(Oc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ac={command:`overview`,describe:`Operations for dex.overview`,builder:e=>e.command(kc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function jc(e){return e.usage(`$0 zero-trust dex rules create
|
|
446
|
+
|
|
447
|
+
Create a DEX Rule.`).option(`description`,{type:`string`,description:`The description field`}).option(`match`,{type:`string`,description:`The wirefilter expression to match.`}).option(`name`,{type:`string`,description:`The name of the Rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Mc={command:`create`,describe:`Create a DEX Rule`,builder:jc,handler:async t=>l({command:`zero-trust dex rules create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/rules`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dex.rules.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.match===void 0&&(t.match=await g(`match`,`The wirefilter expression to match.`)),t.name===void 0&&(t.name=await g(`name`,`The name of the Rule.`));let u=p({description:m(t.description,`description`,`text`),match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.dex.rules.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Nc(e){return e.usage(`$0 zero-trust dex rules delete <rule-id>
|
|
448
|
+
|
|
449
|
+
Delete a DEX Rule.`).positional(`rule-id`,{type:`string`,description:`Unique identifier of the rule.`,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 Pc={command:`delete <rule-id>`,describe:`Delete a DEX Rule`,builder:Nc,handler:async t=>l({command:`zero-trust dex rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
450
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dex.rules.delete({account_id:l,rule_id:t[`rule-id`]}));o(u,{successLabel:`Deleted`})})};function Fc(e){return e.usage(`$0 zero-trust dex rules get <rule-id>
|
|
451
|
+
|
|
452
|
+
Get details for a DEX Rule.`).positional(`rule-id`,{type:`string`,description:`Unique identifier of the rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ic={command:`get <rule-id>`,describe:`Get DEX Rule`,builder:Fc,handler:async t=>l({command:`zero-trust dex rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dex.rules.get({account_id:l,rule_id:t[`rule-id`]}));o(u,{successLabel:`Loaded`})})};function Lc(e){return e.usage(`$0 zero-trust dex rules list
|
|
453
|
+
|
|
454
|
+
List DEX Rules.`).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`sort-order`,{type:`string`,description:`Sort direction for sort_by property.`,choices:[`ASC`,`DESC`]}).option(`sort-by`,{type:`string`,description:`Which property to sort results by.`,choices:[`name`,`created_at`,`updated_at`]}).option(`name`,{type:`string`,description:`Filter results by rule name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rc={command:`list`,describe:`List DEX Rules`,builder:y(Lc),handler:async t=>l({command:`zero-trust dex rules list`,classification:{safeFlags:[`sort-order`,`sort-by`,`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],sort_order:t[`sort-order`],sort_by:t[`sort-by`],name:t.name};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/rules`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.rules.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function zc(e){return e.usage(`$0 zero-trust dex rules update <rule-id>
|
|
455
|
+
|
|
456
|
+
Update a DEX Rule.`).positional(`rule-id`,{type:`string`,description:`Unique identifier of the rule.`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`match`,{type:`string`,description:`The wirefilter expression to match.`}).option(`name`,{type:`string`,description:`The name of the Rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Bc={command:`update <rule-id>`,describe:`Update a DEX Rule`,builder:zc,handler:async t=>l({command:`zero-trust dex rules update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dex.rules.update({...e,account_id:l,rule_id:t[`rule-id`]}));o(n,{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.dex.rules.update({...u,account_id:l,rule_id:t[`rule-id`]}));o(f,{successLabel:`Updated`})})},$={command:`rules`,describe:`Operations for dex.rules`,builder:e=>e.command(Mc).command(Pc).command(Ic).command(Rc).command(Bc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Vc(e){return e.usage(`$0 zero-trust dex test-results http get <test-id>
|
|
457
|
+
|
|
458
|
+
Get test details and aggregate performance metrics for an http test for a given time period between 1 hour and 7 days.`).positional(`test-id`,{type:`string`,description:`Unique identifier for a specific test.`,demandOption:!0}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`from`,{type:`string`,description:`Start time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`interval`,{type:`string`,description:`Time interval for aggregate time slots.`,choices:[`minute`,`hour`],demandOption:!0}).option(`colo`,{type:`string`,description:`Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Hc={command:`get <test-id>`,describe:`Get details and aggregate metrics for an http test`,builder:y(Vc),handler:async t=>l({command:`zero-trust dex test-results http get`,classification:{safeFlags:[`interval`,`dry-run`]}},t,async()=>{let i={deviceId:t[`device-id`],from:t.from,to:t.to,interval:t.interval,colo:t.colo};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex test-results http get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/http-tests/${t[`test-id`]==null?`<test-id>`:encodeURIComponent(String(t[`test-id`]))}`,pathParams:{"test-id":String(t[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.testResults.http.get({account_id:u,test_id:t[`test-id`],...i}));o(d,{successLabel:`Loaded`})})};function Uc(e){return e.usage(`$0 zero-trust dex test-results http percentiles get <test-id>
|
|
459
|
+
|
|
460
|
+
Get percentiles for an http test for a given time period between 1 hour and 7 days.`).positional(`test-id`,{type:`string`,description:`Unique identifier for a specific test.`,demandOption:!0}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`from`,{type:`string`,description:`Start time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`colo`,{type:`string`,description:`Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wc={command:`get <test-id>`,describe:`Get percentiles for an http test`,builder:Uc,handler:async t=>l({command:`zero-trust dex test-results http percentiles get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={deviceId:t[`device-id`],from:t.from,to:t.to,colo:t.colo};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex test-results http percentiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/http-tests/${t[`test-id`]==null?`<test-id>`:encodeURIComponent(String(t[`test-id`]))}/percentiles`,pathParams:{"test-id":String(t[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.testResults.http.percentiles.get({account_id:u,test_id:t[`test-id`],...i}));o(d,{successLabel:`Loaded`})})},Gc={command:`percentiles`,describe:`Operations for dex.test-results.http.percentiles`,builder:e=>e.command(Wc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Kc={command:`http`,describe:`Operations for dex.test-results.http`,builder:e=>e.command(Hc).command(Gc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qc(e){return e.usage(`$0 zero-trust dex test-results traceroute get <test-id>
|
|
461
|
+
|
|
462
|
+
Get test details and aggregate performance metrics for a traceroute test for a given time period between 1 hour and 7 days.`).positional(`test-id`,{type:`string`,description:`Unique identifier for a specific test.`,demandOption:!0}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`from`,{type:`string`,description:`Start time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`interval`,{type:`string`,description:`Time interval for aggregate time slots.`,choices:[`minute`,`hour`],demandOption:!0}).option(`colo`,{type:`string`,description:`Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Jc={command:`get <test-id>`,describe:`Get details and aggregate metrics for a traceroute test`,builder:y(qc),handler:async t=>l({command:`zero-trust dex test-results traceroute get`,classification:{safeFlags:[`interval`,`dry-run`]}},t,async()=>{let i={deviceId:t[`device-id`],from:t.from,to:t.to,interval:t.interval,colo:t.colo};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex test-results traceroute get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/traceroute-tests/${t[`test-id`]==null?`<test-id>`:encodeURIComponent(String(t[`test-id`]))}`,pathParams:{"test-id":String(t[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.testResults.traceroute.get({account_id:u,test_id:t[`test-id`],...i}));o(d,{successLabel:`Loaded`})})};function Yc(e){return e.usage(`$0 zero-trust dex test-results traceroute network-path get <test-result-id>
|
|
463
|
+
|
|
464
|
+
Get a breakdown of hops and performance metrics for a specific traceroute test run`).positional(`test-result-id`,{type:`string`,description:`Unique identifier for a specific traceroute test.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xc={command:`get <test-result-id>`,describe:`Get details for a specific traceroute test run`,builder:Yc,handler:async t=>l({command:`zero-trust dex test-results traceroute network-path get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex test-results traceroute network-path get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/traceroute-test-results/${t[`test-result-id`]==null?`<test-result-id>`:encodeURIComponent(String(t[`test-result-id`]))}/network-path`,pathParams:{"test-result-id":String(t[`test-result-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dex.testResults.traceroute.networkPath.get({account_id:l,test_result_id:t[`test-result-id`]}));o(u,{successLabel:`Loaded`})})},Zc={command:`network-path`,describe:`Operations for dex.test-results.traceroute.network-path`,builder:e=>e.command(Xc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qc(e){return e.usage(`$0 zero-trust dex test-results traceroute percentiles get <test-id>
|
|
465
|
+
|
|
466
|
+
Get percentiles for a traceroute test for a given time period between 1 hour and 7 days.`).positional(`test-id`,{type:`string`,description:`Unique identifier for a specific test.`,demandOption:!0}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`from`,{type:`string`,description:`Start time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`colo`,{type:`string`,description:`Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $c={command:`get <test-id>`,describe:`Get percentiles for a traceroute test`,builder:Qc,handler:async t=>l({command:`zero-trust dex test-results traceroute percentiles get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={deviceId:t[`device-id`],from:t.from,to:t.to,colo:t.colo};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex test-results traceroute percentiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/traceroute-tests/${t[`test-id`]==null?`<test-id>`:encodeURIComponent(String(t[`test-id`]))}/percentiles`,pathParams:{"test-id":String(t[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.testResults.traceroute.percentiles.get({account_id:u,test_id:t[`test-id`],...i}));o(d,{successLabel:`Loaded`})})},el={command:`percentiles`,describe:`Operations for dex.test-results.traceroute.percentiles`,builder:e=>e.command($c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},tl={command:`traceroute`,describe:`Operations for dex.test-results.traceroute`,builder:e=>e.command(Jc).command(Zc).command(el).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},nl={command:`test-results`,describe:`Operations for dex.test-results`,builder:e=>e.command(Kc).command(tl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rl(e){return e.usage(`$0 zero-trust dex tests create
|
|
467
|
+
|
|
468
|
+
Create a DEX test.`).option(`data-host`,{type:`string`,description:`The desired endpoint to test.`}).option(`data-kind`,{type:`string`,description:`The type of test.`,choices:[`http`,`traceroute`]}).option(`data-method`,{type:`string`,description:`The HTTP request method type.`,choices:[`GET`]}).option(`description`,{type:`string`,description:`Additional details about the test.`}).option(`enabled`,{type:`boolean`,description:`Determines whether or not the test is active.`}).option(`interval`,{type:`string`,description:`How often the test will run.`}).option(`name`,{type:`string`,description:`The name of the DEX test. Must be unique.`}).option(`target-policies`,{type:`string`,description:`DEX rules targeted by this test. Provide as a JSON array of objects or @path/to/file.json.`}).option(`targeted`,{type:`boolean`,description:`The targeted 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 il={command:`create`,describe:`Create Device DEX test`,builder:rl,handler:async t=>l({command:`zero-trust dex tests create`,classification:{safeFlags:[`data-kind`,`data-method`,`enabled`,`targeted`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/devices/dex_tests`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({data:{host:m(t[`data-host`],`data-host`,`text`),kind:m(t[`data-kind`],`data-kind`,`text`),method:m(t[`data-method`],`data-method`,`text`)},description:m(t.description,`description`,`text`),enabled:t.enabled,interval:m(t.interval,`interval`,`text`),name:m(t.name,`name`,`text`),target_policies:f(t[`target-policies`],`target-policies`),targeted:t.targeted}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dex.tests.create({body:e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`data-host`]===void 0&&(t[`data-host`]=await g(`data-host`,`The desired endpoint to test.`)),t[`data-kind`]===void 0&&(t[`data-kind`]=await _(`data-kind`,`The type of test.`,[`http`,`traceroute`])),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.interval===void 0&&(t.interval=await g(`interval`,`How often the test will run.`)),t.name===void 0&&(t.name=await g(`name`,`The name of the DEX test. Must be unique.`));let u=p({data:{host:m(t[`data-host`],`data-host`,`text`),kind:m(t[`data-kind`],`data-kind`,`text`),method:m(t[`data-method`],`data-method`,`text`)},description:m(t.description,`description`,`text`),enabled:t.enabled,interval:m(t.interval,`interval`,`text`),name:m(t.name,`name`,`text`),target_policies:f(t[`target-policies`],`target-policies`),targeted:t.targeted}),h=await c(`Creating`,async()=>i.zeroTrust.dex.tests.create({body:u,account_id:l}));o(h,{successLabel:`Created`})})};function al(e){return e.usage(`$0 zero-trust dex tests delete <dex-test-id>
|
|
469
|
+
|
|
470
|
+
Delete a Device DEX test. Returns the remaining device dex tests for the account.`).positional(`dex-test-id`,{type:`string`,description:`Unique identifier for a DEX test.`,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 ol={command:`delete <dex-test-id>`,describe:`Delete Device DEX test`,builder:al,handler:async t=>l({command:`zero-trust dex tests delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex tests delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/devices/dex_tests/${t[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(t[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(t[`dex-test-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
471
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dex.tests.delete({account_id:l,dex_test_id:t[`dex-test-id`]}));o(u,{successLabel:`Deleted`})})};function sl(e){return e.usage(`$0 zero-trust dex tests get <dex-test-id>
|
|
472
|
+
|
|
473
|
+
Fetch a single DEX test.`).positional(`dex-test-id`,{type:`string`,description:`Unique identifier for a DEX test.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const cl={command:`get <dex-test-id>`,describe:`Get Device DEX test`,builder:sl,handler:async t=>l({command:`zero-trust dex tests get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/devices/dex_tests/${t[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(t[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(t[`dex-test-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dex.tests.get({account_id:l,dex_test_id:t[`dex-test-id`]}));o(u,{successLabel:`Loaded`})})};function ll(e){return e.usage(`$0 zero-trust dex tests list
|
|
474
|
+
|
|
475
|
+
Fetch all DEX tests.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`test-name`,{type:`string`,description:`Filter by test name.`}).option(`kind`,{type:`string`,description:`Filter by test type.`,choices:[`http`,`traceroute`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ul={command:`list`,describe:`List Device DEX tests`,builder:y(ll),handler:async t=>l({command:`zero-trust dex tests list`,classification:{safeFlags:[`kind`,`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],testName:t[`test-name`],kind:t.kind};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/devices/dex_tests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.tests.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function dl(e){return e.usage(`$0 zero-trust dex tests network-path get <test-id>
|
|
476
|
+
|
|
477
|
+
Get a breakdown of metrics by hop for individual traceroute test runs.`).positional(`test-id`,{type:`string`,description:`Unique identifier for a specific test.`,demandOption:!0}).option(`device-id`,{type:`string`,description:`Device to filter traceroute result runs to.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`interval`,{type:`string`,description:`Time interval for aggregate time slots.`,choices:[`minute`,`hour`],demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fl={command:`get <test-id>`,describe:`Get network path breakdown for a traceroute test`,builder:y(dl),handler:async t=>l({command:`zero-trust dex tests network-path get`,classification:{safeFlags:[`interval`,`dry-run`]}},t,async()=>{let i={deviceId:t[`device-id`],from:t.from,to:t.to,interval:t.interval};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex tests network-path get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/traceroute-tests/${t[`test-id`]==null?`<test-id>`:encodeURIComponent(String(t[`test-id`]))}/network-path`,pathParams:{"test-id":String(t[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.tests.networkPath.get({account_id:u,test_id:t[`test-id`],...i}));o(d,{successLabel:`Loaded`})})},pl={command:`network-path`,describe:`Operations for dex.tests.network-path`,builder:e=>e.command(fl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ml(e){return e.usage(`$0 zero-trust dex tests update <dex-test-id>
|
|
478
|
+
|
|
479
|
+
Update a DEX test.`).positional(`dex-test-id`,{type:`string`,description:`Unique identifier for a DEX test.`,demandOption:!0}).option(`data-host`,{type:`string`,description:`The desired endpoint to test.`}).option(`data-kind`,{type:`string`,description:`The type of test.`,choices:[`http`,`traceroute`]}).option(`data-method`,{type:`string`,description:`The HTTP request method type.`,choices:[`GET`]}).option(`description`,{type:`string`,description:`Additional details about the test.`}).option(`enabled`,{type:`boolean`,description:`Determines whether or not the test is active.`}).option(`interval`,{type:`string`,description:`How often the test will run.`}).option(`name`,{type:`string`,description:`The name of the DEX test. Must be unique.`}).option(`target-policies`,{type:`string`,description:`DEX rules targeted by this test. Provide as a JSON array of objects or @path/to/file.json.`}).option(`targeted`,{type:`boolean`,description:`The targeted 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 hl={command:`update <dex-test-id>`,describe:`Update Device DEX test`,builder:ml,handler:async t=>l({command:`zero-trust dex tests update`,classification:{safeFlags:[`data-kind`,`data-method`,`enabled`,`targeted`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dex tests update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/devices/dex_tests/${t[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(t[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(t[`dex-test-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({data:{host:m(t[`data-host`],`data-host`,`text`),kind:m(t[`data-kind`],`data-kind`,`text`),method:m(t[`data-method`],`data-method`,`text`)},description:m(t.description,`description`,`text`),enabled:t.enabled,interval:m(t.interval,`interval`,`text`),name:m(t.name,`name`,`text`),target_policies:f(t[`target-policies`],`target-policies`),targeted:t.targeted}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dex.tests.update({body:e,account_id:l,dex_test_id:t[`dex-test-id`]}));o(n,{successLabel:`Updated`});return}if(t[`data-host`]===void 0&&(t[`data-host`]=await g(`data-host`,`The desired endpoint to test.`)),t[`data-kind`]===void 0&&(t[`data-kind`]=await _(`data-kind`,`The type of test.`,[`http`,`traceroute`])),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.interval===void 0&&(t.interval=await g(`interval`,`How often the test will run.`)),t.name===void 0&&(t.name=await g(`name`,`The name of the DEX test. Must be unique.`));let u=p({data:{host:m(t[`data-host`],`data-host`,`text`),kind:m(t[`data-kind`],`data-kind`,`text`),method:m(t[`data-method`],`data-method`,`text`)},description:m(t.description,`description`,`text`),enabled:t.enabled,interval:m(t.interval,`interval`,`text`),name:m(t.name,`name`,`text`),target_policies:f(t[`target-policies`],`target-policies`),targeted:t.targeted}),h=await c(`Updating`,async()=>i.zeroTrust.dex.tests.update({body:u,account_id:l,dex_test_id:t[`dex-test-id`]}));o(h,{successLabel:`Updated`})})},gl={command:`tests`,describe:`Operations for dex.tests`,builder:e=>e.command(il).command(ol).command(cl).command(ul).command(hl).command(pl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _l(e){return e.usage(`$0 zero-trust dex warp-change-events list
|
|
480
|
+
|
|
481
|
+
List WARP configuration and enablement toggle change events by device.`).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`type`,{type:`string`,description:`Filter events by type 'config' or 'toggle'.`,choices:[`config`,`toggle`]}).option(`toggle`,{type:`string`,description:`Filter events by type toggle value. Applicable to type='toggle' events only.`,choices:[`on`,`off`]}).option(`config-name`,{type:`string`,description:`Filter events by WARP configuration name changed from or to. Applicable to type='config' events only.`}).option(`account-name`,{type:`string`,description:`Filter events by account name.`}).option(`sort-order`,{type:`string`,description:`Sort response by event timestamp.`,choices:[`ASC`,`DESC`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vl={command:`list`,describe:`List WARP change events.`,builder:y(_l),handler:async t=>l({command:`zero-trust dex warp-change-events list`,classification:{safeFlags:[`type`,`toggle`,`sort-order`,`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],from:t.from,to:t.to,type:t.type,toggle:t.toggle,config_name:t[`config-name`],account_name:t[`account-name`],sort_order:t[`sort-order`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust dex warp-change-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/warp-change-events`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dex.warpChangeEvents.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},yl={command:`warp-change-events`,describe:`Operations for dex.warp-change-events`,builder:e=>e.command(vl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},bl={command:`dex`,describe:`Digital Experience Monitoring — synthetic tests, fleet-wide device metrics, and network path diagnostics`,builder:e=>e.command(Gs).command(ac).command(bc).command(Cc).command(Ac).command($).command(nl).command(gl).command(yl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xl(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics create
|
|
482
|
+
|
|
483
|
+
Creates a DLP custom prompt topic entry.`).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`profile-id`,{type:`string`,description:`The profile_id field`}).option(`topic`,{type:`string`,description:`The topic field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A new custom prompt topic to create.`})}const Sl={command:`create`,describe:`Create custom prompt topic`,builder:xl,handler:async t=>l({command:`zero-trust dlp custom-prompt-topics create`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp custom-prompt-topics create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/custom_prompt_topics`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),profile_id:m(t[`profile-id`],`profile-id`,`text`),topic:m(t.topic,`topic`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.customPromptTopics.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await g(`name`,`The name field`)),t.topic===void 0&&(t.topic=await g(`topic`,`The topic field`));let u=p({description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),profile_id:m(t[`profile-id`],`profile-id`,`text`),topic:m(t.topic,`topic`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.dlp.customPromptTopics.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Cl(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics delete <entry-id>
|
|
484
|
+
|
|
485
|
+
Deletes a DLP custom prompt topic entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const wl={command:`delete <entry-id>`,describe:`Delete custom prompt topic`,builder:Cl,handler:async t=>l({command:`zero-trust dlp custom-prompt-topics delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp custom-prompt-topics delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/custom_prompt_topics/${t[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(t[`entry-id`]))}`,pathParams:{"entry-id":String(t[`entry-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
486
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.customPromptTopics.delete({account_id:l,entry_id:t[`entry-id`]}));o(u,{successLabel:`Deleted`})})};function Tl(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics get <entry-id>
|
|
487
|
+
|
|
488
|
+
Fetches a DLP custom prompt topic entry by ID.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const El={command:`get <entry-id>`,describe:`Get custom prompt topic`,builder:Tl,handler:async t=>l({command:`zero-trust dlp custom-prompt-topics get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp custom-prompt-topics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/custom_prompt_topics/${t[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(t[`entry-id`]))}`,pathParams:{"entry-id":String(t[`entry-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.customPromptTopics.get({account_id:l,entry_id:t[`entry-id`]}));o(u,{successLabel:`Loaded`})})};function Dl(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics list
|
|
489
|
+
|
|
490
|
+
Lists all DLP custom prompt topic entries in an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ol={command:`list`,describe:`List custom prompt topics`,builder:Dl,handler:async t=>l({command:`zero-trust dlp custom-prompt-topics list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp custom-prompt-topics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/custom_prompt_topics`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.customPromptTopics.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function kl(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics update <entry-id>
|
|
491
|
+
|
|
492
|
+
Updates a DLP custom prompt topic entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`topic`,{type:`string`,description:`The topic field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update to be applied to the custom prompt topic.`})}const Al={command:`update <entry-id>`,describe:`Update custom prompt topic`,builder:kl,handler:async t=>l({command:`zero-trust dlp custom-prompt-topics update`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp custom-prompt-topics update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/custom_prompt_topics/${t[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(t[`entry-id`]))}`,pathParams:{"entry-id":String(t[`entry-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),topic:m(t.topic,`topic`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.customPromptTopics.update({...e,account_id:l,entry_id:t[`entry-id`]}));o(n,{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await g(`name`,`The name field`)),t.topic===void 0&&(t.topic=await g(`topic`,`The topic field`));let u=p({description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),topic:m(t.topic,`topic`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.dlp.customPromptTopics.update({...u,account_id:l,entry_id:t[`entry-id`]}));o(f,{successLabel:`Updated`})})},jl={command:`custom-prompt-topics`,describe:`Data Loss Prevention - manage custom prompt topics for AI-based content detection`,builder:e=>e.command(Sl).command(wl).command(El).command(Ol).command(Al).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ml(e){return e.usage(`$0 zero-trust dlp data-classes create
|
|
493
|
+
|
|
494
|
+
Creates a data class for use in DLP profiles.`).option(`data-tags`,{type:`string`,array:!0,description:`The data_tags field`}).option(`description`,{type:`string`,description:`The description field`}).option(`expression`,{type:`string`,description:`The expression field`}).option(`name`,{type:`string`,description:`The name field`}).option(`sensitivity-levels`,{type:`string`,description:`The sensitivity_levels field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new data class.`})}const Nl={command:`create`,describe:`Creates a new data class`,builder:Ml,handler:async t=>l({command:`zero-trust dlp data-classes create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-classes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_classes`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({data_tags:t[`data-tags`],description:m(t.description,`description`,`text`),expression:m(t.expression,`expression`,`text`),name:m(t.name,`name`,`text`),sensitivity_levels:f(t[`sensitivity-levels`],`sensitivity-levels`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.dataClasses.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`data-tags`]===void 0)throw Error(`--data-tags is required (or pass --body with this field set).`);if(t.expression===void 0&&(t.expression=await g(`expression`,`The expression field`)),t.name===void 0&&(t.name=await g(`name`,`The name field`)),t[`sensitivity-levels`]===void 0)throw Error(`--sensitivity-levels is required (or pass --body with this field set).`);let u=p({data_tags:t[`data-tags`],description:m(t.description,`description`,`text`),expression:m(t.expression,`expression`,`text`),name:m(t.name,`name`,`text`),sensitivity_levels:f(t[`sensitivity-levels`],`sensitivity-levels`)}),h=await c(`Creating`,async()=>i.zeroTrust.dlp.dataClasses.create({...u,account_id:l}));o(h,{successLabel:`Created`})})};function Pl(e){return e.usage(`$0 zero-trust dlp data-classes delete <data-class-id>
|
|
495
|
+
|
|
496
|
+
Deletes a data class from the account.`).positional(`data-class-id`,{type:`string`,description:`Data class ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Fl={command:`delete <data-class-id>`,describe:`Delete a single data class`,builder:Pl,handler:async t=>l({command:`zero-trust dlp data-classes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-classes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_classes/${t[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(t[`data-class-id`]))}`,pathParams:{"data-class-id":String(t[`data-class-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
497
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.dataClasses.delete({account_id:l,data_class_id:t[`data-class-id`]}));o(u,{successLabel:`Deleted`})})};function Il(e){return e.usage(`$0 zero-trust dlp data-classes get <data-class-id>
|
|
498
|
+
|
|
499
|
+
Gets the configuration for a data class.`).positional(`data-class-id`,{type:`string`,description:`Data class ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ll={command:`get <data-class-id>`,describe:`Retrieve a specific data class`,builder:Il,handler:async t=>l({command:`zero-trust dlp data-classes get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-classes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_classes/${t[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(t[`data-class-id`]))}`,pathParams:{"data-class-id":String(t[`data-class-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.dataClasses.get({account_id:l,data_class_id:t[`data-class-id`]}));o(u,{successLabel:`Loaded`})})};function Rl(e){return e.usage(`$0 zero-trust dlp data-classes list
|
|
500
|
+
|
|
501
|
+
Lists data classes configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const zl={command:`list`,describe:`Retrieve all data classes in an account`,builder:Rl,handler:async t=>l({command:`zero-trust dlp data-classes list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-classes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_classes`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.dataClasses.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function Bl(e){return e.usage(`$0 zero-trust dlp data-classes update <data-class-id>
|
|
502
|
+
|
|
503
|
+
Updates the configuration for a data class.`).positional(`data-class-id`,{type:`string`,description:`Data class ID`,demandOption:!0}).option(`data-tags`,{type:`string`,array:!0,description:`The data_tags field`}).option(`description`,{type:`string`,description:`The description field`}).option(`expression`,{type:`string`,description:`The expression field`}).option(`name`,{type:`string`,description:`The name field`}).option(`sensitivity-levels`,{type:`string`,description:`The sensitivity_levels field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the data class to update.`})}const Vl={command:`update <data-class-id>`,describe:`Update the attributes of a single data class`,builder:Bl,handler:async t=>l({command:`zero-trust dlp data-classes update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-classes update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_classes/${t[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(t[`data-class-id`]))}`,pathParams:{"data-class-id":String(t[`data-class-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({data_tags:t[`data-tags`],description:m(t.description,`description`,`text`),expression:m(t.expression,`expression`,`text`),name:m(t.name,`name`,`text`),sensitivity_levels:f(t[`sensitivity-levels`],`sensitivity-levels`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.dataClasses.update({...e,account_id:l,data_class_id:t[`data-class-id`]}));o(n,{successLabel:`Updated`});return}let u=p({data_tags:t[`data-tags`],description:m(t.description,`description`,`text`),expression:m(t.expression,`expression`,`text`),name:m(t.name,`name`,`text`),sensitivity_levels:f(t[`sensitivity-levels`],`sensitivity-levels`)}),h=await c(`Updating`,async()=>i.zeroTrust.dlp.dataClasses.update({...u,account_id:l,data_class_id:t[`data-class-id`]}));o(h,{successLabel:`Updated`})})},Hl={command:`data-classes`,describe:`Data Loss Prevention - manage data classes used to classify sensitive information`,builder:e=>e.command(Nl).command(Fl).command(Ll).command(zl).command(Vl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ul(e){return e.usage(`$0 zero-trust dlp data-tag-categories create
|
|
504
|
+
|
|
505
|
+
Creates a data tag category, optionally from a template.`).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tags`,{type:`string`,description:"Tags to create with the category. Mutually exclusive with `template_id`. Provide as a JSON array of objects or @path/to/file.json."}).option(`template-id`,{type:`string`,description:`The template_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new data tag category.`})}const Wl={command:`create`,describe:`Creates a new data tag category.`,builder:Ul,handler:async t=>l({command:`zero-trust dlp data-tag-categories create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tag-categories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),tags:f(t.tags,`tags`),template_id:m(t[`template-id`],`template-id`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.dataTagCategories.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`The name field`));let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),tags:f(t.tags,`tags`),template_id:m(t[`template-id`],`template-id`,`text`)}),h=await c(`Creating`,async()=>i.zeroTrust.dlp.dataTagCategories.create({...u,account_id:l}));o(h,{successLabel:`Created`})})};function Gl(e){return e.usage(`$0 zero-trust dlp data-tag-categories delete <category-id>
|
|
506
|
+
|
|
507
|
+
Deletes a data tag category and its tags.`).positional(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Kl={command:`delete <category-id>`,describe:`Delete a single data tag category.`,builder:Gl,handler:async t=>l({command:`zero-trust dlp data-tag-categories delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tag-categories delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories/${t[`category-id`]==null?`<category-id>`:encodeURIComponent(String(t[`category-id`]))}`,pathParams:{"category-id":String(t[`category-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
508
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.dataTagCategories.delete({account_id:l,category_id:t[`category-id`]}));o(u,{successLabel:`Deleted`})})};function ql(e){return e.usage(`$0 zero-trust dlp data-tag-categories get <category-id>
|
|
509
|
+
|
|
510
|
+
Gets a data tag category and its tags.`).positional(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Jl={command:`get <category-id>`,describe:`Retrieve a specific data tag category.`,builder:ql,handler:async t=>l({command:`zero-trust dlp data-tag-categories get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tag-categories get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories/${t[`category-id`]==null?`<category-id>`:encodeURIComponent(String(t[`category-id`]))}`,pathParams:{"category-id":String(t[`category-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategories.get({account_id:l,category_id:t[`category-id`]}));o(u,{successLabel:`Loaded`})})};function Yl(e){return e.usage(`$0 zero-trust dlp data-tag-categories list
|
|
511
|
+
|
|
512
|
+
Lists data tag categories configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xl={command:`list`,describe:`Retrieve all data tag categories in an account`,builder:Yl,handler:async t=>l({command:`zero-trust dlp data-tag-categories list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tag-categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategories.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function Zl(e){return e.usage(`$0 zero-trust dlp data-tag-categories update <category-id>
|
|
513
|
+
|
|
514
|
+
Updates a data tag category and its tags.`).positional(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tags`,{type:`string`,description:"The desired final state of tags.\n- `None` (omitted): no tag changes.\n- `Some([])`: delete all tags.\n- `Some([...])`: desired final set + order. 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:`Attributes of the data tag category to update.`})}const Ql={command:`update <category-id>`,describe:`Update the attributes of a single data tag category.`,builder:Zl,handler:async t=>l({command:`zero-trust dlp data-tag-categories update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tag-categories update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories/${t[`category-id`]==null?`<category-id>`:encodeURIComponent(String(t[`category-id`]))}`,pathParams:{"category-id":String(t[`category-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),tags:f(t.tags,`tags`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.dataTagCategories.update({...e,account_id:l,category_id:t[`category-id`]}));o(n,{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),tags:f(t.tags,`tags`)}),h=await c(`Updating`,async()=>i.zeroTrust.dlp.dataTagCategories.update({...u,account_id:l,category_id:t[`category-id`]}));o(h,{successLabel:`Updated`})})},$l={command:`data-tag-categories`,describe:`Data Loss Prevention - manage categories that organize data tags`,builder:e=>e.command(Wl).command(Kl).command(Jl).command(Xl).command(Ql).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function eu(e){return e.usage(`$0 zero-trust dlp data-tag-category-templates get <template-id>
|
|
515
|
+
|
|
516
|
+
Gets an available data tag category template.`).positional(`template-id`,{type:`string`,description:`Template ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tu={command:`get <template-id>`,describe:`Retrieve a specific data tag category template.`,builder:eu,handler:async t=>l({command:`zero-trust dlp data-tag-category-templates get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tag-category-templates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_category_templates/${t[`template-id`]==null?`<template-id>`:encodeURIComponent(String(t[`template-id`]))}`,pathParams:{"template-id":String(t[`template-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategoryTemplates.get({account_id:l,template_id:t[`template-id`]}));o(u,{successLabel:`Loaded`})})};function nu(e){return e.usage(`$0 zero-trust dlp data-tag-category-templates list
|
|
517
|
+
|
|
518
|
+
Lists available data tag category templates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ru={command:`list`,describe:`Retrieve all data tag category templates in an account`,builder:nu,handler:async t=>l({command:`zero-trust dlp data-tag-category-templates list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tag-category-templates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_category_templates`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategoryTemplates.list({account_id:l}));o(u,{successLabel:`Loaded`})})},iu={command:`data-tag-category-templates`,describe:`Data Loss Prevention - browse templates for creating data tag categories`,builder:e=>e.command(tu).command(ru).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function au(e){return e.usage(`$0 zero-trust dlp data-tags create <category-id>
|
|
519
|
+
|
|
520
|
+
Creates a data tag in a category.`).positional(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new data tag.`})}const ou={command:`create <category-id>`,describe:`Creates a new data tag.`,builder:au,handler:async t=>l({command:`zero-trust dlp data-tags create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories/${t[`category-id`]==null?`<category-id>`:encodeURIComponent(String(t[`category-id`]))}/data_tags`,pathParams:{"category-id":String(t[`category-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.dataTags.create({body:e,account_id:l,category_id:t[`category-id`]}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`The name field`));let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.dlp.dataTags.create({body:u,account_id:l,category_id:t[`category-id`]}));o(f,{successLabel:`Created`})})};function su(e){return e.usage(`$0 zero-trust dlp data-tags delete <tag-id>
|
|
521
|
+
|
|
522
|
+
Deletes a data tag from a category.`).positional(`tag-id`,{type:`string`,description:`Tag ID`,demandOption:!0}).option(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const cu={command:`delete <tag-id>`,describe:`Delete a single data tag.`,builder:su,handler:async t=>l({command:`zero-trust dlp data-tags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories/${t[`category-id`]==null?`<category-id>`:encodeURIComponent(String(t[`category-id`]))}/data_tags/${t[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(t[`tag-id`]))}`,pathParams:{"category-id":String(t[`category-id`]??``),"tag-id":String(t[`tag-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
523
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.dataTags.delete({account_id:l,category_id:t[`category-id`],tag_id:t[`tag-id`]}));o(u,{successLabel:`Deleted`})})};function lu(e){return e.usage(`$0 zero-trust dlp data-tags get <tag-id>
|
|
524
|
+
|
|
525
|
+
Gets a data tag from a category.`).positional(`tag-id`,{type:`string`,description:`Tag ID`,demandOption:!0}).option(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const uu={command:`get <tag-id>`,describe:`Retrieve a specific data tag.`,builder:lu,handler:async t=>l({command:`zero-trust dlp data-tags get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories/${t[`category-id`]==null?`<category-id>`:encodeURIComponent(String(t[`category-id`]))}/data_tags/${t[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(t[`tag-id`]))}`,pathParams:{"category-id":String(t[`category-id`]??``),"tag-id":String(t[`tag-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.dataTags.get({account_id:l,category_id:t[`category-id`],tag_id:t[`tag-id`]}));o(u,{successLabel:`Loaded`})})};function du(e){return e.usage(`$0 zero-trust dlp data-tags list
|
|
526
|
+
|
|
527
|
+
Lists data tags in a category.`).option(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fu={command:`list`,describe:`Retrieve all data tags in a data tag category`,builder:du,handler:async t=>l({command:`zero-trust dlp data-tags list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories/${t[`category-id`]==null?`<category-id>`:encodeURIComponent(String(t[`category-id`]))}/data_tags`,pathParams:{"category-id":String(t[`category-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.dataTags.list({account_id:l,category_id:t[`category-id`]}));o(u,{successLabel:`Loaded`})})};function pu(e){return e.usage(`$0 zero-trust dlp data-tags update <tag-id>
|
|
528
|
+
|
|
529
|
+
Updates a data tag in a category.`).positional(`tag-id`,{type:`string`,description:`Tag ID`,demandOption:!0}).option(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the data tag to update.`})}const mu={command:`update <tag-id>`,describe:`Update the attributes of a single data tag.`,builder:pu,handler:async t=>l({command:`zero-trust dlp data-tags update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp data-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories/${t[`category-id`]==null?`<category-id>`:encodeURIComponent(String(t[`category-id`]))}/data_tags/${t[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(t[`tag-id`]))}`,pathParams:{"category-id":String(t[`category-id`]??``),"tag-id":String(t[`tag-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.dataTags.update({...e,account_id:l,category_id:t[`category-id`],tag_id:t[`tag-id`]}));o(n,{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.dlp.dataTags.update({...u,account_id:l,category_id:t[`category-id`],tag_id:t[`tag-id`]}));o(f,{successLabel:`Updated`})})},hu={command:`data-tags`,describe:`Data Loss Prevention - manage tags used to classify and organize sensitive data`,builder:e=>e.command(ou).command(cu).command(uu).command(fu).command(mu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function gu(e){return e.usage(`$0 zero-trust dlp datasets create
|
|
530
|
+
|
|
531
|
+
Creates a new DLP (Data Loss Prevention) dataset for storing custom detection patterns. Datasets can contain exact match data, word lists, or EDM (Exact Data Match) configurations.`).option(`case-sensitive`,{type:`boolean`,description:`Only applies to custom word lists.
|
|
532
|
+
Determines if the words should be matched in a case-sensitive manner
|
|
533
|
+
Cannot be set to false if \`secret\` is true or undefined`}).option(`description`,{type:`string`,description:`The description of the dataset.`}).option(`encoding-version`,{type:`number`,description:`Dataset encoding version
|
|
534
|
+
|
|
535
|
+
Non-secret custom word lists with no header are always version 1.
|
|
536
|
+
Secret EDM lists with no header are version 1.
|
|
537
|
+
Multicolumn CSV with headers are version 2.
|
|
538
|
+
Omitting this field provides the default value 0, which is interpreted
|
|
539
|
+
the same as 1.`}).option(`name`,{type:`string`,description:`The name field`}).option(`secret`,{type:`boolean`,description:`Generate a secret dataset.
|
|
540
|
+
|
|
541
|
+
If true, the response will include a secret to use with the EDM encoder.
|
|
542
|
+
If false, the response has no secret and the dataset is uploaded in plaintext.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Dataset description.`})}const _u={command:`create`,describe:`Create a new dataset`,builder:gu,handler:async t=>l({command:`zero-trust dlp datasets create`,classification:{safeFlags:[`case-sensitive`,`secret`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp datasets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/datasets`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({case_sensitive:t[`case-sensitive`],description:m(t.description,`description`,`text`),encoding_version:t[`encoding-version`],name:m(t.name,`name`,`text`),secret:t.secret}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`The name field`));let u=p({case_sensitive:t[`case-sensitive`],description:m(t.description,`description`,`text`),encoding_version:t[`encoding-version`],name:m(t.name,`name`,`text`),secret:t.secret}),f=await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function vu(e){return e.usage(`$0 zero-trust dlp datasets delete <dataset-id>
|
|
543
|
+
|
|
544
|
+
This deletes all versions of the dataset.`).positional(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const yu={command:`delete <dataset-id>`,describe:`Delete a dataset`,builder:vu,handler:async t=>l({command:`zero-trust dlp datasets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp datasets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}`,pathParams:{"dataset-id":String(t[`dataset-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
545
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.datasets.delete({account_id:l,dataset_id:t[`dataset-id`]}));o(u,{successLabel:`Deleted`})})};function bu(e){return e.usage(`$0 zero-trust dlp datasets get <dataset-id>
|
|
546
|
+
|
|
547
|
+
Gets a dataset and its latest upload status.`).positional(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xu={command:`get <dataset-id>`,describe:`Fetch a specific dataset`,builder:bu,handler:async t=>l({command:`zero-trust dlp datasets get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp datasets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}`,pathParams:{"dataset-id":String(t[`dataset-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.datasets.get({account_id:l,dataset_id:t[`dataset-id`]}));o(u,{successLabel:`Loaded`})})};function Su(e){return e.usage(`$0 zero-trust dlp datasets list
|
|
548
|
+
|
|
549
|
+
Lists all DLP datasets configured for the account, including custom word lists and EDM datasets.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Cu={command:`list`,describe:`Fetch all datasets`,builder:Su,handler:async t=>l({command:`zero-trust dlp datasets list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/datasets`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.datasets.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function wu(e){return e.usage(`$0 zero-trust dlp datasets prepare-upload <dataset-id>
|
|
550
|
+
|
|
551
|
+
Creates a new version of a DLP dataset, allowing you to stage changes before activation. Used for single-column EDM and custom word lists.`).positional(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Tu={command:`prepare-upload <dataset-id>`,describe:`Prepare to upload a new version of a dataset`,builder:wu,handler:async t=>l({command:`zero-trust dlp datasets prepare-upload`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp datasets prepare-upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}/upload`,pathParams:{"dataset-id":String(t[`dataset-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.prepareUpload({account_id:l,dataset_id:t[`dataset-id`]}));o(u,{successLabel:`Created`})})};function Eu(e){return e.usage(`$0 zero-trust dlp datasets update <dataset-id>
|
|
552
|
+
|
|
553
|
+
Updates the configuration of an existing DLP dataset, such as its name, description, or detection settings.`).positional(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`case-sensitive`,{type:`boolean`,description:`Determines if the words should be matched in a case-sensitive manner.
|
|
554
|
+
|
|
555
|
+
Only required for custom word lists.`}).option(`description`,{type:`string`,description:`The description of the dataset.`}).option(`name`,{type:`string`,description:`The name of the dataset, must be unique.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Dataset description.`})}const Du={command:`update <dataset-id>`,describe:`Update details about a dataset`,builder:Eu,handler:async t=>l({command:`zero-trust dlp datasets update`,classification:{safeFlags:[`case-sensitive`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp datasets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}`,pathParams:{"dataset-id":String(t[`dataset-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({case_sensitive:t[`case-sensitive`],description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.datasets.update({...e,account_id:l,dataset_id:t[`dataset-id`]}));o(n,{successLabel:`Updated`});return}let u=p({case_sensitive:t[`case-sensitive`],description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.dlp.datasets.update({...u,account_id:l,dataset_id:t[`dataset-id`]}));o(f,{successLabel:`Updated`})})};function Ou(e){return e.usage(`$0 zero-trust dlp datasets upload <version>
|
|
556
|
+
|
|
557
|
+
This is used for single-column EDMv1 and Custom Word Lists. The EDM format can only be created in the Cloudflare dashboard. For other clients, this operation can only be used for non-secret Custom Word Lists. The body must be a UTF-8 encoded, newline (NL or CRNL) separated list of words to be matched.`).positional(`version`,{type:`string`,description:`Version`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Dataset. For custom wordlists this contains UTF-8 patterns separated by newline characters.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const ku={command:`upload <version>`,describe:`Upload a new version of a dataset`,builder:Ou,handler:async i=>l({command:`zero-trust dlp datasets upload`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=await r();s({command:`cf zero-trust dlp datasets upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/datasets/${i[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(i[`dataset-id`]))}/upload/${i.version==null?`<version>`:encodeURIComponent(String(i.version))}`,pathParams:{"dataset-id":String(i[`dataset-id`]??``),version:String(i.version??``)},bodyKind:`octet-stream`,body:i.body});return}let l=await n(i),u=i.local?e:await a();if(i.accountId=u,i.file){let e=h(i.file),n=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(i[`dataset-id`]))}/upload/${encodeURIComponent(String(i.version))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}}));o(n,{successLabel:`Created`});return}if(i.body){let e=m(i.body,`body`,`binary`),n=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(i[`dataset-id`]))}/upload/${encodeURIComponent(String(i.version))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}}));o(n,{successLabel:`Created`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Au={command:`datasets`,describe:`Data Loss Prevention - manage datasets, versions, and uploads`,builder:e=>e.command(_u).command(yu).command(xu).command(Cu).command(Tu).command(Du).command(ku).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ju(e){return e.usage(`$0 zero-trust dlp document-fingerprints create
|
|
558
|
+
|
|
559
|
+
Creates a new document fingerprint for DLP scanning. Document fingerprints detect documents that are structurally similar to the uploaded sample.`).option(`description`,{type:`string`,description:`The description field`,default:``}).option(`match-percent`,{type:`number`,description:`The match_percent field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new document fingerprint.`})}const Mu={command:`create`,describe:`Creates a new document fingerprint.`,builder:ju,handler:async t=>l({command:`zero-trust dlp document-fingerprints create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp document-fingerprints create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/document_fingerprints`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),match_percent:t[`match-percent`],name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.documentFingerprints.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`match-percent`]===void 0)throw Error(`--match-percent is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await g(`name`,`The name field`));let u=p({description:m(t.description,`description`,`text`),match_percent:t[`match-percent`],name:m(t.name,`name`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.dlp.documentFingerprints.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Nu(e){return e.usage(`$0 zero-trust dlp document-fingerprints delete <document-fingerprint-id>
|
|
560
|
+
|
|
561
|
+
Removes a document fingerprint from DLP configuration. Documents matching this fingerprint will no longer be detected.`).positional(`document-fingerprint-id`,{type:`string`,description:`Document fingerprint ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Pu={command:`delete <document-fingerprint-id>`,describe:`Delete a single document fingerprint.`,builder:Nu,handler:async t=>l({command:`zero-trust dlp document-fingerprints delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp document-fingerprints delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/document_fingerprints/${t[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(t[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(t[`document-fingerprint-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
562
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.documentFingerprints.delete({account_id:l,document_fingerprint_id:t[`document-fingerprint-id`]}));o(u,{successLabel:`Deleted`})})};function Fu(e){return e.usage(`$0 zero-trust dlp document-fingerprints get <document-fingerprint-id>
|
|
563
|
+
|
|
564
|
+
Gets a document fingerprint and its latest upload status.`).positional(`document-fingerprint-id`,{type:`string`,description:`Document fingerprint ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Iu={command:`get <document-fingerprint-id>`,describe:`Retrieve data about a specific document fingerprint.`,builder:Fu,handler:async t=>l({command:`zero-trust dlp document-fingerprints get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp document-fingerprints get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/document_fingerprints/${t[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(t[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(t[`document-fingerprint-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.documentFingerprints.get({account_id:l,document_fingerprint_id:t[`document-fingerprint-id`]}));o(u,{successLabel:`Loaded`})})};function Lu(e){return e.usage(`$0 zero-trust dlp document-fingerprints list
|
|
565
|
+
|
|
566
|
+
Lists all document fingerprints configured for DLP scanning in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ru={command:`list`,describe:`Retrieve data about all document fingerprints.`,builder:Lu,handler:async t=>l({command:`zero-trust dlp document-fingerprints list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp document-fingerprints list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/document_fingerprints`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.documentFingerprints.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function zu(e){return e.usage(`$0 zero-trust dlp document-fingerprints update <document-fingerprint-id>
|
|
567
|
+
|
|
568
|
+
Updates metadata for an existing document fingerprint, such as its name or description.`).positional(`document-fingerprint-id`,{type:`string`,description:`Document fingerprint ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`match-percent`,{type:`number`,description:`The match_percent field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the document fingerprint to update.`})}const Bu={command:`update <document-fingerprint-id>`,describe:`Update the attributes of a single document fingerprint.`,builder:zu,handler:async t=>l({command:`zero-trust dlp document-fingerprints update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp document-fingerprints update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/document_fingerprints/${t[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(t[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(t[`document-fingerprint-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),match_percent:t[`match-percent`],name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.documentFingerprints.update({...e,account_id:l,document_fingerprint_id:t[`document-fingerprint-id`]}));o(n,{successLabel:`Created`});return}let u=p({description:m(t.description,`description`,`text`),match_percent:t[`match-percent`],name:m(t.name,`name`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.dlp.documentFingerprints.update({...u,account_id:l,document_fingerprint_id:t[`document-fingerprint-id`]}));o(f,{successLabel:`Created`})})};function Vu(e){return e.usage(`$0 zero-trust dlp document-fingerprints upload <document-fingerprint-id>
|
|
569
|
+
|
|
570
|
+
Uploads a new document to create or update a fingerprint. The document structure is analyzed to enable detection of similar documents.`).positional(`document-fingerprint-id`,{type:`string`,description:`Document fingerprint ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`File used for document fingerprinting.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Hu={command:`upload <document-fingerprint-id>`,describe:`Uploads a new version for a document fingerprint.`,builder:Vu,handler:async i=>l({command:`zero-trust dlp document-fingerprints upload`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=await r();s({command:`cf zero-trust dlp document-fingerprints upload`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/document_fingerprints/${i[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(i[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(i[`document-fingerprint-id`]??``)},bodyKind:`multipart`,body:{body:i.body,file:i.file}});return}let l=await n(i),u=i.local?e:await a();if(i.accountId=u,i.file!==void 0||i.body!==void 0){let e=new FormData;if(i.file){let t=h(i.file);e.append(`file`,new Blob([t]),i.file.split(/[\\/]/).filter(Boolean).pop())}else i.body!==void 0&&e.append(`file`,i.body);let n=await c(`Updating`,async()=>t(l,`PUT`,`/accounts/${u}/dlp/document_fingerprints/${encodeURIComponent(String(i[`document-fingerprint-id`]))}`,{body:e}));o(n,{successLabel:`Updated`});return}if(i.body){let e=m(i.body,`body`,`binary`),n=await c(`Updating`,async()=>t(l,`PUT`,`/accounts/${u}/dlp/document_fingerprints/${encodeURIComponent(String(i[`document-fingerprint-id`]))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}}));o(n,{successLabel:`Updated`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Uu={command:`document-fingerprints`,describe:`Data Loss Prevention - manage document fingerprints for detecting matching documents`,builder:e=>e.command(Mu).command(Pu).command(Iu).command(Ru).command(Bu).command(Hu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Wu(e){return e.usage(`$0 zero-trust dlp email account-mapping create
|
|
571
|
+
|
|
572
|
+
Creates a mapping between a Cloudflare account and an email provider for DLP email scanning integration.`).option(`auth-requirements-allowed-microsoft-organizations`,{type:`string`,array:!0,description:`The auth_requirements.allowed_microsoft_organizations field`}).option(`auth-requirements-type`,{type:`string`,description:`The auth_requirements.type field`,choices:[`Org`,`NoAuth`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Account mapping.`})}const Gu={command:`create`,describe:`Create mapping`,builder:Wu,handler:async t=>l({command:`zero-trust dlp email account-mapping create`,classification:{safeFlags:[`auth-requirements-type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp email account-mapping create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/email/account_mapping`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({auth_requirements:{allowed_microsoft_organizations:t[`auth-requirements-allowed-microsoft-organizations`],type:m(t[`auth-requirements-type`],`auth-requirements-type`,`text`)}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.email.accountMapping.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t[`auth-requirements-type`]===void 0&&(t[`auth-requirements-type`]=await _(`auth-requirements-type`,`The auth_requirements.type field`,[`Org`,`NoAuth`]));let u=p({auth_requirements:{allowed_microsoft_organizations:t[`auth-requirements-allowed-microsoft-organizations`],type:m(t[`auth-requirements-type`],`auth-requirements-type`,`text`)}}),f=await c(`Creating`,async()=>i.zeroTrust.dlp.email.accountMapping.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Ku(e){return e.usage(`$0 zero-trust dlp email account-mapping get
|
|
573
|
+
|
|
574
|
+
Retrieves the email provider mapping configuration for DLP email scanning.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qu={command:`get`,describe:`Get mapping`,builder:Ku,handler:async t=>l({command:`zero-trust dlp email account-mapping get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp email account-mapping get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/email/account_mapping`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.email.accountMapping.get({account_id:l}));o(u,{successLabel:`Loaded`})})},Ju={command:`account-mapping`,describe:`Data Loss Prevention - configure account mappings for outbound email scanning`,builder:e=>e.command(Gu).command(qu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Yu(e){return e.usage(`$0 zero-trust dlp email rules bulk-edit
|
|
575
|
+
|
|
576
|
+
Reorders DLP email scanning rules by updating their priority values. Higher priority rules are evaluated first.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Rule priorities.`})}const Xu={command:`bulk-edit`,describe:`Update email scanner rule priorities`,builder:Yu,handler:async t=>l({command:`zero-trust dlp email rules bulk-edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp email rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.bulkEdit({...e,account_id:l}));o(n,{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Zu(e){return e.usage(`$0 zero-trust dlp email rules create
|
|
577
|
+
|
|
578
|
+
Creates a new DLP email scanning rule that defines what content patterns to detect in email messages and what actions to take.`).option(`action-action`,{type:`string`,description:`The action.action field`,choices:[`Block`]}).option(`action-message`,{type:`string`,description:`The action.message field`}).option(`conditions`,{type:`string`,description:`Triggered if all conditions match. Provide as a JSON array of objects or @path/to/file.json.`}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Rule description.`})}const Qu={command:`create`,describe:`Create email scanner rule`,builder:Zu,handler:async t=>l({command:`zero-trust dlp email rules create`,classification:{safeFlags:[`action-action`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp email rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({action:{action:m(t[`action-action`],`action-action`,`text`),message:m(t[`action-message`],`action-message`,`text`)},conditions:f(t.conditions,`conditions`),description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.email.rules.create({body:e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`action-action`]===void 0&&(t[`action-action`]=await _(`action-action`,`The action.action field`,[`Block`])),t.conditions===void 0)throw Error(`--conditions is required (or pass --body with this field set).`);if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await g(`name`,`The name field`));let u=p({action:{action:m(t[`action-action`],`action-action`,`text`),message:m(t[`action-message`],`action-message`,`text`)},conditions:f(t.conditions,`conditions`),description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`)}),h=await c(`Creating`,async()=>i.zeroTrust.dlp.email.rules.create({body:u,account_id:l}));o(h,{successLabel:`Created`})})};function $u(e){return e.usage(`$0 zero-trust dlp email rules delete <rule-id>
|
|
579
|
+
|
|
580
|
+
Removes a DLP email scanning rule. The rule will no longer be applied to email messages.`).positional(`rule-id`,{type:`string`,description:`Rule ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ed={command:`delete <rule-id>`,describe:`Delete email scanner rule`,builder:$u,handler:async t=>l({command:`zero-trust dlp email rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp email rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/email/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
581
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.email.rules.delete({account_id:l,rule_id:t[`rule-id`]}));o(u,{successLabel:`Deleted`})})};function td(e){return e.usage(`$0 zero-trust dlp email rules get <rule-id>
|
|
582
|
+
|
|
583
|
+
Gets detailed configuration for a specific DLP email scanning rule, including detection patterns and actions.`).positional(`rule-id`,{type:`string`,description:`Rule ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const nd={command:`get <rule-id>`,describe:`Get an email scanner rule`,builder:td,handler:async t=>l({command:`zero-trust dlp email rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp email rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/email/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.email.rules.get({account_id:l,rule_id:t[`rule-id`]}));o(u,{successLabel:`Loaded`})})};function rd(e){return e.usage(`$0 zero-trust dlp email rules list
|
|
584
|
+
|
|
585
|
+
Lists all email scanner rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const id={command:`list`,describe:`List all email scanner rules`,builder:rd,handler:async t=>l({command:`zero-trust dlp email rules list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp email rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.email.rules.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function ad(e){return e.usage(`$0 zero-trust dlp email rules update <rule-id>
|
|
586
|
+
|
|
587
|
+
Updates a DLP email scanning rule.`).positional(`rule-id`,{type:`string`,description:`Rule ID`,demandOption:!0}).option(`action-action`,{type:`string`,description:`The action.action field`,choices:[`Block`]}).option(`action-message`,{type:`string`,description:`The action.message field`}).option(`conditions`,{type:`string`,description:`Triggered if all conditions match. Provide as a JSON array of objects or @path/to/file.json.`}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Rule description.`})}const od={command:`update <rule-id>`,describe:`Update email scanner rule`,builder:ad,handler:async t=>l({command:`zero-trust dlp email rules update`,classification:{safeFlags:[`action-action`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp email rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/email/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({action:{action:m(t[`action-action`],`action-action`,`text`),message:m(t[`action-message`],`action-message`,`text`)},conditions:f(t.conditions,`conditions`),description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.update({body:e,account_id:l,rule_id:t[`rule-id`]}));o(n,{successLabel:`Updated`});return}if(t[`action-action`]===void 0&&(t[`action-action`]=await _(`action-action`,`The action.action field`,[`Block`])),t.conditions===void 0)throw Error(`--conditions is required (or pass --body with this field set).`);if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await g(`name`,`The name field`));let u=p({action:{action:m(t[`action-action`],`action-action`,`text`),message:m(t[`action-message`],`action-message`,`text`)},conditions:f(t.conditions,`conditions`),description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`)}),h=await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.update({body:u,account_id:l,rule_id:t[`rule-id`]}));o(h,{successLabel:`Updated`})})},sd={command:`rules`,describe:`Data Loss Prevention - manage outbound email scanning rules and their priorities`,builder:e=>e.command(Xu).command(Qu).command(ed).command(nd).command(id).command(od).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},cd={command:`email`,describe:`Operations for dlp.email`,builder:e=>e.command(Ju).command(sd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ld(e){return e.usage(`$0 zero-trust dlp entries create
|
|
588
|
+
|
|
589
|
+
Creates a DLP custom entry.`).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`pattern-regex`,{type:`string`,description:`The pattern.regex field`}).option(`pattern-validation`,{type:`string`,description:`The pattern.validation field`,choices:[`luhn`]}).option(`profile-id`,{type:`string`,description:`The profile_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A new entry to create.`})}const ud={command:`create`,describe:`Create custom entry`,builder:ld,handler:async t=>l({command:`zero-trust dlp entries create`,classification:{safeFlags:[`enabled`,`pattern-validation`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/entries`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),pattern:{regex:m(t[`pattern-regex`],`pattern-regex`,`text`),validation:m(t[`pattern-validation`],`pattern-validation`,`text`)},profile_id:m(t[`profile-id`],`profile-id`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.entries.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await g(`name`,`The name field`)),t[`pattern-regex`]===void 0&&(t[`pattern-regex`]=await g(`pattern-regex`,`The pattern.regex field`));let u=p({description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),pattern:{regex:m(t[`pattern-regex`],`pattern-regex`,`text`),validation:m(t[`pattern-validation`],`pattern-validation`,`text`)},profile_id:m(t[`profile-id`],`profile-id`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.dlp.entries.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function dd(e){return e.usage(`$0 zero-trust dlp entries delete <entry-id>
|
|
590
|
+
|
|
591
|
+
Deletes a DLP custom entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const fd={command:`delete <entry-id>`,describe:`Delete custom entry`,builder:dd,handler:async t=>l({command:`zero-trust dlp entries delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp entries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/entries/${t[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(t[`entry-id`]))}`,pathParams:{"entry-id":String(t[`entry-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
592
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.entries.delete({account_id:l,entry_id:t[`entry-id`]}));o(u,{successLabel:`Deleted`})})};function pd(e){return e.usage(`$0 zero-trust dlp entries get <entry-id>
|
|
593
|
+
|
|
594
|
+
Fetches a DLP entry by ID.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const md={command:`get <entry-id>`,describe:`Get DLP Entry`,builder:pd,handler:async t=>l({command:`zero-trust dlp entries get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp entries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/entries/${t[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(t[`entry-id`]))}`,pathParams:{"entry-id":String(t[`entry-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.entries.get({account_id:l,entry_id:t[`entry-id`]}));o(u,{successLabel:`Loaded`})})};function hd(e){return e.usage(`$0 zero-trust dlp entries list
|
|
595
|
+
|
|
596
|
+
Lists all DLP entries in an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gd={command:`list`,describe:`List all entries`,builder:hd,handler:async t=>l({command:`zero-trust dlp entries list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp entries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/entries`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.entries.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function _d(e){return e.usage(`$0 zero-trust dlp entries update <entry-id>
|
|
597
|
+
|
|
598
|
+
Updates a DLP entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`pattern-regex`,{type:`string`,description:`The pattern.regex field`}).option(`pattern-validation`,{type:`string`,description:`The pattern.validation field`,choices:[`luhn`]}).option(`type`,{type:`string`,description:`The type field`,choices:[`custom`,`predefined`,`integration`]}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update to be applied to the entry.`}).check(e=>{if([`pattern-regex`,`pattern-validation`].some(t=>e[t]!==void 0)){let t=[`pattern-regex`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --pattern-* flag is set`)}return!0})}const vd={command:`update <entry-id>`,describe:`Update entry`,builder:_d,handler:async t=>l({command:`zero-trust dlp entries update`,classification:{safeFlags:[`pattern-validation`,`type`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp entries update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/entries/${t[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(t[`entry-id`]))}`,pathParams:{"entry-id":String(t[`entry-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),pattern:{regex:m(t[`pattern-regex`],`pattern-regex`,`text`),validation:m(t[`pattern-validation`],`pattern-validation`,`text`)},type:m(t.type,`type`,`text`),enabled:t.enabled}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.entries.update({body:e,account_id:l,entry_id:t[`entry-id`]}));o(n,{successLabel:`Updated`});return}if(t.type===void 0&&(t.type=await _(`type`,`The type field`,[`custom`,`predefined`,`integration`])),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),pattern:{regex:m(t[`pattern-regex`],`pattern-regex`,`text`),validation:m(t[`pattern-validation`],`pattern-validation`,`text`)},type:m(t.type,`type`,`text`),enabled:t.enabled}),f=await c(`Updating`,async()=>i.zeroTrust.dlp.entries.update({body:u,account_id:l,entry_id:t[`entry-id`]}));o(f,{successLabel:`Updated`})})},yd={command:`entries`,describe:`Data Loss Prevention - list and manage detection entries`,builder:e=>e.command(ud).command(fd).command(md).command(gd).command(vd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bd(e){return e.usage(`$0 zero-trust dlp limits list
|
|
599
|
+
|
|
600
|
+
Retrieves current DLP usage limits and quotas for the account, including maximum allowed counts and current usage for custom entries, dataset cells, and document fingerprints.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xd={command:`list`,describe:`Fetch limits associated with DLP for account`,builder:bd,handler:async t=>l({command:`zero-trust dlp limits list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp limits list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/limits`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.limits.list({account_id:l}));o(u,{successLabel:`Loaded`})})},Sd={command:`limits`,describe:`Data Loss Prevention - view account limits and resource quotas`,builder:e=>e.command(xd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Cd(e){return e.usage("$0 zero-trust dlp patterns validate\n\nValidates whether this pattern is a valid regular expression. Rejects it if the regular expression is too complex or can match an unbounded-length string. The regex will be rejected if it uses `*` or `+`. Bound the maximum number of characters that can be matched using a range, e.g. `{1,100}`.").option(`max-match-bytes`,{type:`number`,description:"Maximum number of bytes that the regular expression can match.\n\nIf this is `null` then there is no limit on the length. Patterns can use\n`*` and `+`. Otherwise repeats should use a range `{m,n}` to restrict\npatterns to the length. If this field is missing, then a default length\nlimit is used.\n\nNote that the length is specified in bytes. Since regular expressions\nuse UTF-8 the pattern `.` can match up to 4 bytes. Hence `.{1,256}`\nhas a maximum length of 1024 bytes."}).option(`regex`,{type:`string`,description:`The regex field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Validation query.`})}const wd={command:`validate`,describe:`Validate a DLP regex pattern`,builder:Cd,handler:async t=>l({command:`zero-trust dlp patterns validate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp patterns validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/patterns/validate`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({max_match_bytes:t[`max-match-bytes`],regex:m(t.regex,`regex`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.patterns.validate({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.regex===void 0&&(t.regex=await g(`regex`,`The regex field`));let u=p({max_match_bytes:t[`max-match-bytes`],regex:m(t.regex,`regex`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.dlp.patterns.validate({...u,account_id:l}));o(f,{successLabel:`Created`})})},Td={command:`patterns`,describe:`Data Loss Prevention - validate regular expressions used for content detection`,builder:e=>e.command(wd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ed(e){return e.usage(`$0 zero-trust dlp profiles custom create
|
|
601
|
+
|
|
602
|
+
Creates a DLP custom profile.`).option(`ai-context-enabled`,{type:`boolean`,description:`The ai_context_enabled field`,default:!1}).option(`allowed-match-count`,{type:`number`,description:`Related DLP policies will trigger when the match count exceeds the number set.`,default:0}).option(`confidence-threshold`,{type:`string`,description:`The confidence_threshold field`,default:`low`}).option(`context-awareness-enabled`,{type:`boolean`,description:`If true, scan the context of predefined entries to only return matches surrounded by keywords.`}).option(`context-awareness-skip-files`,{type:`boolean`,description:`If the content type is a file, skip context analysis and return all matches.`}).option(`data-classes`,{type:`string`,array:!0,description:`Data class IDs to associate with the profile.`}).option(`data-tags`,{type:`string`,array:!0,description:`Data tag IDs to associate with the profile.`}).option(`description`,{type:`string`,description:`The description of the profile.`}).option(`entries`,{type:`string`,description:`The entries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`ocr-enabled`,{type:`boolean`,description:`The ocr_enabled field`,default:!1}).option(`sensitivity-levels`,{type:`string`,description:`Sensitivity levels to associate with the profile. Provide as a JSON array of objects or @path/to/file.json.`}).option(`shared-entries`,{type:`string`,description:`Entries from other profiles (e.g. pre-defined Cloudflare profiles, or your Microsoft Information Protection profiles). 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:`A new profile to create.`}).check(e=>{if([`context-awareness-enabled`,`context-awareness-skip-files`].some(t=>e[t]!==void 0)){let t=[`context-awareness-enabled`,`context-awareness-skip-files`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --context_awareness-* flag is set`)}return!0})}const Dd={command:`create`,describe:`Create custom profile`,builder:Ed,handler:async t=>l({command:`zero-trust dlp profiles custom create`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp profiles custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/profiles/custom`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({ai_context_enabled:t[`ai-context-enabled`],allowed_match_count:t[`allowed-match-count`],confidence_threshold:m(t[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:t[`context-awareness-enabled`],skip:{files:t[`context-awareness-skip-files`]}},data_classes:t[`data-classes`],data_tags:t[`data-tags`],description:m(t.description,`description`,`text`),entries:f(t.entries,`entries`),name:m(t.name,`name`,`text`),ocr_enabled:t[`ocr-enabled`],sensitivity_levels:f(t[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(t[`shared-entries`],`shared-entries`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.custom.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`The name field`));let u=p({ai_context_enabled:t[`ai-context-enabled`],allowed_match_count:t[`allowed-match-count`],confidence_threshold:m(t[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:t[`context-awareness-enabled`],skip:{files:t[`context-awareness-skip-files`]}},data_classes:t[`data-classes`],data_tags:t[`data-tags`],description:m(t.description,`description`,`text`),entries:f(t.entries,`entries`),name:m(t.name,`name`,`text`),ocr_enabled:t[`ocr-enabled`],sensitivity_levels:f(t[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(t[`shared-entries`],`shared-entries`)}),h=await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.custom.create({...u,account_id:l}));o(h,{successLabel:`Created`})})};function Od(e){return e.usage(`$0 zero-trust dlp profiles custom delete <profile-id>
|
|
603
|
+
|
|
604
|
+
Deletes a DLP custom profile.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const kd={command:`delete <profile-id>`,describe:`Delete custom profile`,builder:Od,handler:async t=>l({command:`zero-trust dlp profiles custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp profiles custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/profiles/custom/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
605
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.profiles.custom.delete({account_id:l,profile_id:t[`profile-id`]}));o(u,{successLabel:`Deleted`})})};function Ad(e){return e.usage(`$0 zero-trust dlp profiles custom update <profile-id>
|
|
606
|
+
|
|
607
|
+
Updates a DLP custom profile.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`ai-context-enabled`,{type:`boolean`,description:`The ai_context_enabled field`}).option(`allowed-match-count`,{type:`number`,description:`The allowed_match_count field`}).option(`confidence-threshold`,{type:`string`,description:`The confidence_threshold field`}).option(`context-awareness-enabled`,{type:`boolean`,description:`If true, scan the context of predefined entries to only return matches surrounded by keywords.`}).option(`context-awareness-skip-files`,{type:`boolean`,description:`If the content type is a file, skip context analysis and return all matches.`}).option(`data-classes`,{type:`string`,array:!0,description:`Data class IDs to associate with the profile. If omitted, existing associations are unchanged.`}).option(`data-tags`,{type:`string`,array:!0,description:`Data tag IDs to associate with the profile. If omitted, existing associations are unchanged.`}).option(`description`,{type:`string`,description:`The description of the profile.`}).option(`entries`,{type:`string`,description:`Custom entries from this profile.
|
|
608
|
+
If this field is omitted, entries owned by this profile will not be changed. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`ocr-enabled`,{type:`boolean`,description:`The ocr_enabled field`}).option(`sensitivity-levels`,{type:`string`,description:`Sensitivity levels to associate with the profile. If omitted, existing associations are unchanged. Provide as a JSON array of objects or @path/to/file.json.`}).option(`shared-entries`,{type:`string`,description:`Other entries, e.g. predefined or integration. 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:`The updated parameters for the profile.`}).check(e=>{if([`context-awareness-enabled`,`context-awareness-skip-files`].some(t=>e[t]!==void 0)){let t=[`context-awareness-enabled`,`context-awareness-skip-files`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --context_awareness-* flag is set`)}return!0})}const jd={command:`update <profile-id>`,describe:`Update custom profile`,builder:Ad,handler:async t=>l({command:`zero-trust dlp profiles custom update`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp profiles custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/profiles/custom/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({ai_context_enabled:t[`ai-context-enabled`],allowed_match_count:t[`allowed-match-count`],confidence_threshold:m(t[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:t[`context-awareness-enabled`],skip:{files:t[`context-awareness-skip-files`]}},data_classes:t[`data-classes`],data_tags:t[`data-tags`],description:m(t.description,`description`,`text`),entries:f(t.entries,`entries`),name:m(t.name,`name`,`text`),ocr_enabled:t[`ocr-enabled`],sensitivity_levels:f(t[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(t[`shared-entries`],`shared-entries`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.custom.update({...e,account_id:l,profile_id:t[`profile-id`]}));o(n,{successLabel:`Updated`});return}t.name===void 0&&(t.name=await g(`name`,`The name field`));let u=p({ai_context_enabled:t[`ai-context-enabled`],allowed_match_count:t[`allowed-match-count`],confidence_threshold:m(t[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:t[`context-awareness-enabled`],skip:{files:t[`context-awareness-skip-files`]}},data_classes:t[`data-classes`],data_tags:t[`data-tags`],description:m(t.description,`description`,`text`),entries:f(t.entries,`entries`),name:m(t.name,`name`,`text`),ocr_enabled:t[`ocr-enabled`],sensitivity_levels:f(t[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(t[`shared-entries`],`shared-entries`)}),h=await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.custom.update({...u,account_id:l,profile_id:t[`profile-id`]}));o(h,{successLabel:`Updated`})})},Md={command:`custom`,describe:`Data Loss Prevention - manage custom profiles`,builder:e=>e.command(Dd).command(kd).command(jd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Nd(e){return e.usage(`$0 zero-trust dlp profiles get <profile-id>
|
|
609
|
+
|
|
610
|
+
Fetches a DLP profile by ID.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pd={command:`get <profile-id>`,describe:`Get DLP Profile`,builder:Nd,handler:async t=>l({command:`zero-trust dlp profiles get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/profiles/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.profiles.get({account_id:l,profile_id:t[`profile-id`]}));o(u,{successLabel:`Loaded`})})};function Fd(e){return e.usage(`$0 zero-trust dlp profiles list
|
|
611
|
+
|
|
612
|
+
Lists all DLP profiles in an account.`).option(`all`,{type:`boolean`,description:`Return all profiles, including those that current account does not have access to.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Id={command:`list`,describe:`List all profiles`,builder:Fd,handler:async t=>l({command:`zero-trust dlp profiles list`,classification:{safeFlags:[`all`,`dry-run`]}},t,async()=>{let i={all:t.all};if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/profiles`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.dlp.profiles.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function Ld(e){return e.usage(`$0 zero-trust dlp profiles predefined update <profile-id>
|
|
613
|
+
|
|
614
|
+
Updates a DLP predefined profile. Only supports enabling/disabling entries.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`ai-context-enabled`,{type:`boolean`,description:`The ai_context_enabled field`}).option(`allowed-match-count`,{type:`number`,description:`The allowed_match_count field`}).option(`confidence-threshold`,{type:`string`,description:`The confidence_threshold field`}).option(`context-awareness-enabled`,{type:`boolean`,description:`If true, scan the context of predefined entries to only return matches surrounded by keywords.`}).option(`context-awareness-skip-files`,{type:`boolean`,description:`If the content type is a file, skip context analysis and return all matches.`}).option(`entries`,{type:`string`,description:`The entries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`ocr-enabled`,{type:`boolean`,description:`The ocr_enabled field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updated parameters for the predefined profile.`}).check(e=>{if([`context-awareness-enabled`,`context-awareness-skip-files`].some(t=>e[t]!==void 0)){let t=[`context-awareness-enabled`,`context-awareness-skip-files`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --context_awareness-* flag is set`)}return!0})}const Rd={command:`update <profile-id>`,describe:`Update predefined profile`,builder:Ld,handler:async t=>l({command:`zero-trust dlp profiles predefined update`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp profiles predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/profiles/predefined/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({ai_context_enabled:t[`ai-context-enabled`],allowed_match_count:t[`allowed-match-count`],confidence_threshold:m(t[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:t[`context-awareness-enabled`],skip:{files:t[`context-awareness-skip-files`]}},entries:f(t.entries,`entries`),ocr_enabled:t[`ocr-enabled`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.predefined.update({...e,account_id:l,profile_id:t[`profile-id`]}));o(n,{successLabel:`Updated`});return}let u=p({ai_context_enabled:t[`ai-context-enabled`],allowed_match_count:t[`allowed-match-count`],confidence_threshold:m(t[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:t[`context-awareness-enabled`],skip:{files:t[`context-awareness-skip-files`]}},entries:f(t.entries,`entries`),ocr_enabled:t[`ocr-enabled`]}),h=await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.predefined.update({...u,account_id:l,profile_id:t[`profile-id`]}));o(h,{successLabel:`Updated`})})},zd={command:`predefined`,describe:`Data Loss Prevention - manage predefined profiles`,builder:e=>e.command(Rd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Bd={command:`profiles`,describe:`Data Loss Prevention - list and retrieve profiles`,builder:e=>e.command(Pd).command(Id).command(Md).command(zd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Vd(e){return e.usage(`$0 zero-trust dlp sensitivity-group-templates get <template-id>
|
|
615
|
+
|
|
616
|
+
Gets an available sensitivity group template.`).positional(`template-id`,{type:`string`,description:`Template ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Hd={command:`get <template-id>`,describe:`Retrieve a specific sensitivity group template.`,builder:Vd,handler:async t=>l({command:`zero-trust dlp sensitivity-group-templates get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-group-templates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/templates/${t[`template-id`]==null?`<template-id>`:encodeURIComponent(String(t[`template-id`]))}`,pathParams:{"template-id":String(t[`template-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroupTemplates.get({account_id:l,template_id:t[`template-id`]}));o(u,{successLabel:`Loaded`})})};function Ud(e){return e.usage(`$0 zero-trust dlp sensitivity-group-templates list
|
|
617
|
+
|
|
618
|
+
Lists available sensitivity group templates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wd={command:`list`,describe:`Retrieve all sensitivity group templates in an account`,builder:Ud,handler:async t=>l({command:`zero-trust dlp sensitivity-group-templates list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-group-templates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/templates`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroupTemplates.list({account_id:l}));o(u,{successLabel:`Loaded`})})},Gd={command:`sensitivity-group-templates`,describe:`Data Loss Prevention - browse templates for creating sensitivity groups`,builder:e=>e.command(Hd).command(Wd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Kd(e){return e.usage(`$0 zero-trust dlp sensitivity-groups create
|
|
619
|
+
|
|
620
|
+
Creates a sensitivity group, optionally from a template.`).option(`description`,{type:`string`,description:`The description field`}).option(`levels`,{type:`string`,description:"Levels to create with the group. Mutually exclusive with `template_id`. Provide as a JSON array of objects or @path/to/file.json."}).option(`name`,{type:`string`,description:`The name field`}).option(`template-id`,{type:`string`,description:`The template_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new sensitivity group.`})}const qd={command:`create`,describe:`Creates a new sensitivity group.`,builder:Kd,handler:async t=>l({command:`zero-trust dlp sensitivity-groups create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),levels:f(t.levels,`levels`),name:m(t.name,`name`,`text`),template_id:m(t[`template-id`],`template-id`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityGroups.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`The name field`));let u=p({description:m(t.description,`description`,`text`),levels:f(t.levels,`levels`),name:m(t.name,`name`,`text`),template_id:m(t[`template-id`],`template-id`,`text`)}),h=await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityGroups.create({...u,account_id:l}));o(h,{successLabel:`Created`})})};function Jd(e){return e.usage(`$0 zero-trust dlp sensitivity-groups delete <sensitivity-group-id>
|
|
621
|
+
|
|
622
|
+
Deletes a sensitivity group and its levels.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Yd={command:`delete <sensitivity-group-id>`,describe:`Delete a single sensitivity group.`,builder:Jd,handler:async t=>l({command:`zero-trust dlp sensitivity-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/${t[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(t[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(t[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
623
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.sensitivityGroups.delete({account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]}));o(u,{successLabel:`Deleted`})})};function Xd(e){return e.usage(`$0 zero-trust dlp sensitivity-groups get-level-order <sensitivity-group-id>
|
|
624
|
+
|
|
625
|
+
Gets the current order of sensitivity levels in a group.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Zd={command:`get-level-order <sensitivity-group-id>`,describe:`Retrieve the ordered list of level IDs for a sensitivity group.`,builder:Xd,handler:async t=>l({command:`zero-trust dlp sensitivity-groups get-level-order`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-groups get-level-order`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/${t[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(t[`sensitivity-group-id`]))}/level_order`,pathParams:{"sensitivity-group-id":String(t[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.getLevelOrder({account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]}));o(u,{successLabel:`Loaded`})})};function Qd(e){return e.usage(`$0 zero-trust dlp sensitivity-groups get <sensitivity-group-id>
|
|
626
|
+
|
|
627
|
+
Gets a sensitivity group and its levels.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $d={command:`get <sensitivity-group-id>`,describe:`Retrieve a specific sensitivity group.`,builder:Qd,handler:async t=>l({command:`zero-trust dlp sensitivity-groups get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/${t[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(t[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(t[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.get({account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]}));o(u,{successLabel:`Loaded`})})};function ef(e){return e.usage(`$0 zero-trust dlp sensitivity-groups list
|
|
628
|
+
|
|
629
|
+
Lists sensitivity groups configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tf={command:`list`,describe:`Retrieve all sensitivity groups in an account`,builder:ef,handler:async t=>l({command:`zero-trust dlp sensitivity-groups list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function nf(e){return e.usage(`$0 zero-trust dlp sensitivity-groups update-level-order <sensitivity-group-id>
|
|
630
|
+
|
|
631
|
+
Updates the order of sensitivity levels in a group.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`level-ids`,{type:`string`,array:!0,description:`The level_ids field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Desired ordered list of level IDs.`})}const rf={command:`update-level-order <sensitivity-group-id>`,describe:`Set the ordering of levels within a sensitivity group.`,builder:nf,handler:async t=>l({command:`zero-trust dlp sensitivity-groups update-level-order`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-groups update-level-order`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/${t[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(t[`sensitivity-group-id`]))}/level_order`,pathParams:{"sensitivity-group-id":String(t[`sensitivity-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({level_ids:t[`level-ids`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.updateLevelOrder({body:e,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]}));o(n,{successLabel:`Updated`});return}if(t[`level-ids`]===void 0)throw Error(`--level-ids is required (or pass --body with this field set).`);let u=p({level_ids:t[`level-ids`]}),f=await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.updateLevelOrder({body:u,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]}));o(f,{successLabel:`Updated`})})};function af(e){return e.usage(`$0 zero-trust dlp sensitivity-groups update <sensitivity-group-id>
|
|
632
|
+
|
|
633
|
+
Updates a sensitivity group and its levels.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`levels`,{type:`string`,description:"The desired final state of levels.\n- `None` (omitted): no level changes.\n- `Some([])`: delete all levels.\n- `Some([...])`: desired final set + order. Provide as a JSON array of objects or @path/to/file.json."}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the sensitivity group to update.`})}const of={command:`update <sensitivity-group-id>`,describe:`Update the attributes of a single sensitivity group.`,builder:af,handler:async t=>l({command:`zero-trust dlp sensitivity-groups update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/${t[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(t[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(t[`sensitivity-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),levels:f(t.levels,`levels`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.update({...e,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]}));o(n,{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),levels:f(t.levels,`levels`),name:m(t.name,`name`,`text`)}),h=await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.update({...u,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]}));o(h,{successLabel:`Updated`})})},sf={command:`sensitivity-groups`,describe:`Data Loss Prevention - manage sensitivity groups and their level ordering`,builder:e=>e.command(qd).command(Yd).command($d).command(Zd).command(tf).command(of).command(rf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function cf(e){return e.usage(`$0 zero-trust dlp sensitivity-levels create <sensitivity-group-id>
|
|
634
|
+
|
|
635
|
+
Creates a sensitivity level in a group.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new sensitivity level.`})}const lf={command:`create <sensitivity-group-id>`,describe:`Creates a new sensitivity level.`,builder:cf,handler:async t=>l({command:`zero-trust dlp sensitivity-levels create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-levels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/${t[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(t[`sensitivity-group-id`]))}/levels`,pathParams:{"sensitivity-group-id":String(t[`sensitivity-group-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityLevels.create({body:e,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`The name field`));let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityLevels.create({body:u,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]}));o(f,{successLabel:`Created`})})};function uf(e){return e.usage(`$0 zero-trust dlp sensitivity-levels delete <sensitivity-level-id>
|
|
636
|
+
|
|
637
|
+
Deletes a sensitivity level from a group.`).positional(`sensitivity-level-id`,{type:`string`,description:`Sensitivity level ID`,demandOption:!0}).option(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const df={command:`delete <sensitivity-level-id>`,describe:`Delete a single sensitivity level.`,builder:uf,handler:async t=>l({command:`zero-trust dlp sensitivity-levels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-levels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/${t[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(t[`sensitivity-group-id`]))}/levels/${t[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(t[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(t[`sensitivity-group-id`]??``),"sensitivity-level-id":String(t[`sensitivity-level-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
638
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.sensitivityLevels.delete({account_id:l,sensitivity_group_id:t[`sensitivity-group-id`],sensitivity_level_id:t[`sensitivity-level-id`]}));o(u,{successLabel:`Deleted`})})};function ff(e){return e.usage(`$0 zero-trust dlp sensitivity-levels get <sensitivity-level-id>
|
|
639
|
+
|
|
640
|
+
Gets a sensitivity level from a group.`).positional(`sensitivity-level-id`,{type:`string`,description:`Sensitivity level ID`,demandOption:!0}).option(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pf={command:`get <sensitivity-level-id>`,describe:`Retrieve a specific sensitivity level.`,builder:ff,handler:async t=>l({command:`zero-trust dlp sensitivity-levels get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-levels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/${t[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(t[`sensitivity-group-id`]))}/levels/${t[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(t[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(t[`sensitivity-group-id`]??``),"sensitivity-level-id":String(t[`sensitivity-level-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityLevels.get({account_id:l,sensitivity_group_id:t[`sensitivity-group-id`],sensitivity_level_id:t[`sensitivity-level-id`]}));o(u,{successLabel:`Loaded`})})};function mf(e){return e.usage(`$0 zero-trust dlp sensitivity-levels list
|
|
641
|
+
|
|
642
|
+
Lists sensitivity levels in a sensitivity group.`).option(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const hf={command:`list`,describe:`Retrieve all sensitivity levels in a sensitivity group`,builder:mf,handler:async t=>l({command:`zero-trust dlp sensitivity-levels list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-levels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/${t[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(t[`sensitivity-group-id`]))}/levels`,pathParams:{"sensitivity-group-id":String(t[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityLevels.list({account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]}));o(u,{successLabel:`Loaded`})})};function gf(e){return e.usage(`$0 zero-trust dlp sensitivity-levels update <sensitivity-level-id>
|
|
643
|
+
|
|
644
|
+
Updates a sensitivity level in a group.`).positional(`sensitivity-level-id`,{type:`string`,description:`Sensitivity level ID`,demandOption:!0}).option(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the sensitivity level to update.`})}const _f={command:`update <sensitivity-level-id>`,describe:`Update the attributes of a single sensitivity level.`,builder:gf,handler:async t=>l({command:`zero-trust dlp sensitivity-levels update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp sensitivity-levels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/${t[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(t[`sensitivity-group-id`]))}/levels/${t[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(t[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(t[`sensitivity-group-id`]??``),"sensitivity-level-id":String(t[`sensitivity-level-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityLevels.update({...e,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`],sensitivity_level_id:t[`sensitivity-level-id`]}));o(n,{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityLevels.update({...u,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`],sensitivity_level_id:t[`sensitivity-level-id`]}));o(f,{successLabel:`Updated`})})},vf={command:`sensitivity-levels`,describe:`Data Loss Prevention - manage sensitivity levels within sensitivity groups`,builder:e=>e.command(lf).command(df).command(pf).command(hf).command(_f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function yf(e){return e.usage(`$0 zero-trust dlp settings delete
|
|
645
|
+
|
|
646
|
+
Deletes account-level DLP settings and returns the initial values.`).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 bf={command:`delete`,describe:`Delete (reset) DLP account-level settings to initial values.`,builder:yf,handler:async t=>l({command:`zero-trust dlp settings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
647
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.dlp.settings.delete({account_id:l}));o(u,{successLabel:`Deleted`})})};function xf(e){return e.usage(`$0 zero-trust dlp settings edit
|
|
648
|
+
|
|
649
|
+
Missing fields keep their existing values.`).option(`ai-context-analysis`,{type:`boolean`,description:`Whether AI context analysis is enabled at the account level.`}).option(`ocr`,{type:`boolean`,description:`Whether OCR is enabled at the account level.`}).option(`payload-logging-masking-level`,{type:`string`,description:"Masking level for payload logs.\n\n- `full`: The entire payload is masked.\n- `partial`: Only partial payload content is masked.\n- `clear`: No masking is applied to the payload content.\n- `default`: DLP uses its default masking behavior.",choices:[`full`,`partial`,`clear`,`default`]}).option(`payload-logging-public-key`,{type:`string`,description:`Base64-encoded public key for encrypting payload logs.
|
|
650
|
+
|
|
651
|
+
- Set to a non-empty base64 string to enable payload logging with the given key.
|
|
652
|
+
- Set to an empty string to disable payload logging.
|
|
653
|
+
- Omit or set to null to leave unchanged (PATCH) or reset to disabled (PUT).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`DLP settings fields to update.`})}const Sf={command:`edit`,describe:`Partially update DLP account-level settings.`,builder:xf,handler:async t=>l({command:`zero-trust dlp settings edit`,classification:{safeFlags:[`ai-context-analysis`,`ocr`,`payload-logging-masking-level`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({ai_context_analysis:t[`ai-context-analysis`],ocr:t.ocr,payload_logging:{masking_level:m(t[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(t[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.settings.edit({body:e,account_id:l}));o(n,{successLabel:`Updated`});return}let u=p({ai_context_analysis:t[`ai-context-analysis`],ocr:t.ocr,payload_logging:{masking_level:m(t[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(t[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}),f=await c(`Updating`,async()=>i.zeroTrust.dlp.settings.edit({body:u,account_id:l}));o(f,{successLabel:`Updated`})})};function Cf(e){return e.usage(`$0 zero-trust dlp settings get
|
|
654
|
+
|
|
655
|
+
Gets the account-level DLP settings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const wf={command:`get`,describe:`Get DLP account-level settings.`,builder:Cf,handler:async t=>l({command:`zero-trust dlp settings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.dlp.settings.get({account_id:l}));o(u,{successLabel:`Loaded`})})};function Tf(e){return e.usage(`$0 zero-trust dlp settings update
|
|
656
|
+
|
|
657
|
+
Missing fields are reset to initial (unconfigured) values.`).option(`ai-context-analysis`,{type:`boolean`,description:`Whether AI context analysis is enabled at the account level.`}).option(`ocr`,{type:`boolean`,description:`Whether OCR is enabled at the account level.`}).option(`payload-logging-masking-level`,{type:`string`,description:"Masking level for payload logs.\n\n- `full`: The entire payload is masked.\n- `partial`: Only partial payload content is masked.\n- `clear`: No masking is applied to the payload content.\n- `default`: DLP uses its default masking behavior.",choices:[`full`,`partial`,`clear`,`default`]}).option(`payload-logging-public-key`,{type:`string`,description:`Base64-encoded public key for encrypting payload logs.
|
|
658
|
+
|
|
659
|
+
- Set to a non-empty base64 string to enable payload logging with the given key.
|
|
660
|
+
- Set to an empty string to disable payload logging.
|
|
661
|
+
- Omit or set to null to leave unchanged (PATCH) or reset to disabled (PUT).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`New DLP settings.`})}const Ef={command:`update`,describe:`Update DLP account-level settings (full replacement).`,builder:Tf,handler:async t=>l({command:`zero-trust dlp settings update`,classification:{safeFlags:[`ai-context-analysis`,`ocr`,`payload-logging-masking-level`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust dlp settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({ai_context_analysis:t[`ai-context-analysis`],ocr:t.ocr,payload_logging:{masking_level:m(t[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(t[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.dlp.settings.update({body:e,account_id:l}));o(n,{successLabel:`Updated`});return}let u=p({ai_context_analysis:t[`ai-context-analysis`],ocr:t.ocr,payload_logging:{masking_level:m(t[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(t[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}),f=await c(`Updating`,async()=>i.zeroTrust.dlp.settings.update({body:u,account_id:l}));o(f,{successLabel:`Updated`})})},Df={command:`settings`,describe:`Data Loss Prevention - manage account-level settings`,builder:e=>e.command(bf).command(Sf).command(wf).command(Ef).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Of={command:`dlp`,describe:`Operations for dlp`,builder:e=>e.command(jl).command(Hl).command($l).command(iu).command(hu).command(Au).command(Uu).command(cd).command(yd).command(Sd).command(Td).command(Bd).command(Gd).command(sf).command(vf).command(Df).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function kf(e){return e.usage(`$0 zero-trust gateway app-types list
|
|
662
|
+
|
|
663
|
+
List all application and application type mappings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Af={command:`list`,describe:`List application and application type mappings`,builder:kf,handler:async t=>l({command:`zero-trust gateway app-types list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway app-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/app_types`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.appTypes.list({account_id:l}));o(u,{successLabel:`Loaded`})})},jf={command:`app-types`,describe:`Operations for gateway.app-types`,builder:e=>e.command(Af).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Mf(e){return e.usage(`$0 zero-trust gateway categories list
|
|
664
|
+
|
|
665
|
+
List all categories.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Nf={command:`list`,describe:`List categories`,builder:Mf,handler:async t=>l({command:`zero-trust gateway categories list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/categories`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.categories.list({account_id:l}));o(u,{successLabel:`Loaded`})})},Pf={command:`categories`,describe:`Operations for gateway.categories`,builder:e=>e.command(Nf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ff(e){return e.usage(`$0 zero-trust gateway certificates activate <certificate-id>
|
|
666
|
+
|
|
667
|
+
Bind a single Zero Trust certificate to the edge.`).positional(`certificate-id`,{type:`string`,description:`Identify the certificate with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const If={command:`activate <certificate-id>`,describe:`Activate a Zero Trust certificate`,builder:Ff,handler:async t=>l({command:`zero-trust gateway certificates activate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway certificates activate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}/activate`,pathParams:{"certificate-id":String(t[`certificate-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.activate({account_id:l,certificate_id:t[`certificate-id`]}));o(u,{successLabel:`Created`})})};function Lf(e){return e.usage(`$0 zero-trust gateway certificates create
|
|
668
|
+
|
|
669
|
+
Create a new Zero Trust certificate.`).option(`validity-period-days`,{type:`number`,description:"Sets the certificate validity period in days (range: 1-10,950 days / ~30 years). Defaults to 1,825 days (5 years). **Important**: This field is only settable during the certificate creation. Certificates becomes immutable after creation - use the `/activate` and `/deactivate` endpoints to manage certificate lifecycle."}).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 Rf={command:`create`,describe:`Create Zero Trust certificate`,builder:Lf,handler:async t=>l({command:`zero-trust gateway certificates create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/certificates`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({validity_period_days:t[`validity-period-days`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}let u=p({validity_period_days:t[`validity-period-days`]}),f=await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function zf(e){return e.usage(`$0 zero-trust gateway certificates deactivate <certificate-id>
|
|
670
|
+
|
|
671
|
+
Unbind a single Zero Trust certificate from the edge.`).positional(`certificate-id`,{type:`string`,description:`Identify the certificate with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bf={command:`deactivate <certificate-id>`,describe:`Deactivate a Zero Trust certificate`,builder:zf,handler:async t=>l({command:`zero-trust gateway certificates deactivate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway certificates deactivate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}/deactivate`,pathParams:{"certificate-id":String(t[`certificate-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.deactivate({account_id:l,certificate_id:t[`certificate-id`]}));o(u,{successLabel:`Created`})})};function Vf(e){return e.usage(`$0 zero-trust gateway certificates delete <certificate-id>
|
|
672
|
+
|
|
673
|
+
Delete a gateway-managed Zero Trust certificate. You must deactivate the certificate from the edge (inactive) before deleting it.`).positional(`certificate-id`,{type:`string`,description:`Identify the certificate with a UUID.`,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 Hf={command:`delete <certificate-id>`,describe:`Delete Zero Trust certificate`,builder:Vf,handler:async t=>l({command:`zero-trust gateway certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
674
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.gateway.certificates.delete({account_id:l,certificate_id:t[`certificate-id`]}));o(u,{successLabel:`Deleted`})})};function Uf(e){return e.usage(`$0 zero-trust gateway certificates get <certificate-id>
|
|
675
|
+
|
|
676
|
+
Get a single Zero Trust certificate.`).positional(`certificate-id`,{type:`string`,description:`Identify the certificate with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wf={command:`get <certificate-id>`,describe:`Get Zero Trust certificate details`,builder:Uf,handler:async t=>l({command:`zero-trust gateway certificates get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.certificates.get({account_id:l,certificate_id:t[`certificate-id`]}));o(u,{successLabel:`Loaded`})})};function Gf(e){return e.usage(`$0 zero-trust gateway certificates list
|
|
677
|
+
|
|
678
|
+
List all Zero Trust certificates for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kf={command:`list`,describe:`List Zero Trust certificates`,builder:Gf,handler:async t=>l({command:`zero-trust gateway certificates list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/certificates`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.certificates.list({account_id:l}));o(u,{successLabel:`Loaded`})})},qf={command:`certificates`,describe:`Operations for gateway.certificates`,builder:e=>e.command(If).command(Rf).command(Bf).command(Hf).command(Wf).command(Kf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Jf(e){return e.usage("$0 zero-trust gateway configurations edit\n\nUpdate (PATCH) a single subcollection of settings such as `antivirus`, `tls_decrypt`, `activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, `certificate`, or `max_ttl_secs` without updating the entire configuration object. This endpoint returns an error if any settings collection lacks proper configuration.").option(`settings-activity-log-enabled`,{type:`boolean`,description:`Specify whether to log activity.`}).option(`settings-antivirus-enabled-download-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on downloads.`}).option(`settings-antivirus-enabled-upload-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on uploads.`}).option(`settings-antivirus-fail-closed`,{type:`boolean`,description:`Specify whether to block requests for unscannable files.`}).option(`settings-antivirus-notification-settings-enabled`,{type:`boolean`,description:`Specify whether to enable notifications.`}).option(`settings-antivirus-notification-settings-include-context`,{type:`boolean`,description:`Specify whether to include context information as query parameters.`}).option(`settings-antivirus-notification-settings-msg`,{type:`string`,description:`Specify the message to show in the notification.`}).option(`settings-antivirus-notification-settings-support-url`,{type:`string`,description:`Specify a URL that directs users to more information. If unset, the notification opens a block page.`}).option(`settings-block-page-background-color`,{type:`string`,description:"Specify the block page background color in `#rrggbb` format when the mode is customized_block_page."}).option(`settings-block-page-enabled`,{type:`boolean`,description:`Specify whether to enable the custom block page.`}).option(`settings-block-page-footer-text`,{type:`string`,description:`Specify the block page footer text when the mode is customized_block_page.`}).option(`settings-block-page-header-text`,{type:`string`,description:`Specify the block page header text when the mode is customized_block_page.`}).option(`settings-block-page-include-context`,{type:`boolean`,description:`Specify whether to append context to target_uri as query parameters. This applies only when the mode is redirect_uri.`}).option(`settings-block-page-logo-path`,{type:`string`,description:`Specify the full URL to the logo file when the mode is customized_block_page.`}).option(`settings-block-page-mailto-address`,{type:`string`,description:`Specify the admin email for users to contact when the mode is customized_block_page.`}).option(`settings-block-page-mailto-subject`,{type:`string`,description:`Specify the subject line for emails created from the block page when the mode is customized_block_page.`}).option(`settings-block-page-mode`,{type:`string`,description:`Specify whether to redirect users to a Cloudflare-hosted block page or a customer-provided URI.`,choices:[`customized_block_page`,`redirect_uri`]}).option(`settings-block-page-name`,{type:`string`,description:`Specify the block page title when the mode is customized_block_page.`}).option(`settings-block-page-suppress-footer`,{type:`boolean`,description:`Specify whether to suppress detailed information at the bottom of the block page when the mode is customized_block_page.`}).option(`settings-block-page-target-uri`,{type:`string`,description:`Specify the URI to redirect users to when the mode is redirect_uri.`}).option(`settings-body-scanning-inspection-mode`,{type:`string`,description:"Specify the inspection mode as either `deep` or `shallow`.",choices:[`deep`,`shallow`]}).option(`settings-browser-isolation-non-identity-enabled`,{type:`boolean`,description:`Specify whether to enable non-identity onramp support for Browser Isolation.`}).option(`settings-browser-isolation-url-browser-isolation-enabled`,{type:`boolean`,description:`Specify whether to enable Clientless Browser Isolation.`}).option(`settings-certificate-id`,{type:`string`,description:`Specify the UUID of the certificate used for interception. Ensure the certificate is available at the edge(previously called 'active'). A nil UUID directs Cloudflare to use the Root CA.`}).option(`settings-custom-certificate-enabled`,{type:`boolean`,description:`Specify whether to enable a custom certificate authority for signing Gateway traffic.`}).option(`settings-custom-certificate-id`,{type:`string`,description:`Specify the UUID of the certificate (ID from MTLS certificate store).`}).option(`settings-extended-email-matching-enabled`,{type:`boolean`,description:`Specify whether to match all variants of user emails (with + or . modifiers) used as criteria in Firewall policies.`}).option(`settings-fips-tls`,{type:`boolean`,description:`Enforce cipher suites and TLS versions compliant with FIPS 140-2.`}).option(`settings-host-selector-enabled`,{type:`boolean`,description:`Specify whether to enable filtering via hosts for egress policies.`}).option(`settings-inspection-mode`,{type:`string`,description:`Define the proxy inspection mode. 1. static: Gateway applies static inspection to HTTP on TCP(80). With TLS decryption on, Gateway inspects HTTPS traffic on TCP(443) and UDP(443). 2. dynamic: Gateway applies protocol detection to inspect HTTP and HTTPS traffic on any port. TLS decryption must remain on to inspect HTTPS traffic.`,choices:[`static`,`dynamic`]}).option(`settings-max-ttl-secs`,{type:`number`,description:"Account-level cap on DNS response TTLs, in seconds. Gateway rewrites DNS responses so returned record TTLs do not exceed this value. Null means no cap. Each DNS location can inherit, override, or disable it through the location `max_ttl` setting."}).option(`settings-protocol-detection-enabled`,{type:`boolean`,description:`Specify whether to detect protocols from the initial bytes of client traffic.`}).option(`settings-sandbox-enabled`,{type:`boolean`,description:`Specify whether to enable the sandbox.`}).option(`settings-sandbox-fallback-action`,{type:`string`,description:`Specify the action to take when the system cannot scan the file.`,choices:[`allow`,`block`]}).option(`settings-tls-decrypt-enabled`,{type:`boolean`,description:`Specify whether to inspect encrypted HTTP traffic.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify account settings.`}).check(e=>{if((/* @__PURE__ */ `settings-activity-log-enabled.settings-antivirus-enabled-download-phase.settings-antivirus-enabled-upload-phase.settings-antivirus-fail-closed.settings-antivirus-notification-settings-enabled.settings-antivirus-notification-settings-include-context.settings-antivirus-notification-settings-msg.settings-antivirus-notification-settings-support-url.settings-block-page-background-color.settings-block-page-enabled.settings-block-page-footer-text.settings-block-page-header-text.settings-block-page-include-context.settings-block-page-logo-path.settings-block-page-mailto-address.settings-block-page-mailto-subject.settings-block-page-mode.settings-block-page-name.settings-block-page-suppress-footer.settings-block-page-target-uri.settings-body-scanning-inspection-mode.settings-browser-isolation-non-identity-enabled.settings-browser-isolation-url-browser-isolation-enabled.settings-certificate-id.settings-custom-certificate-enabled.settings-custom-certificate-id.settings-extended-email-matching-enabled.settings-fips-tls.settings-host-selector-enabled.settings-inspection-mode.settings-max-ttl-secs.settings-protocol-detection-enabled.settings-sandbox-enabled.settings-sandbox-fallback-action.settings-tls-decrypt-enabled`.split(`.`)).some(t=>e[t]!==void 0)){let t=[`settings-certificate-id`,`settings-custom-certificate-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --settings-* flag is set`)}return!0})}const Yf={command:`edit`,describe:`Patch Zero Trust account configuration`,builder:Jf,handler:async t=>l({command:`zero-trust gateway configurations edit`,classification:{safeFlags:[`settings-activity-log-enabled`,`settings-antivirus-enabled-download-phase`,`settings-antivirus-enabled-upload-phase`,`settings-antivirus-fail-closed`,`settings-antivirus-notification-settings-enabled`,`settings-antivirus-notification-settings-include-context`,`settings-block-page-enabled`,`settings-block-page-include-context`,`settings-block-page-mode`,`settings-block-page-suppress-footer`,`settings-body-scanning-inspection-mode`,`settings-browser-isolation-non-identity-enabled`,`settings-browser-isolation-url-browser-isolation-enabled`,`settings-custom-certificate-enabled`,`settings-extended-email-matching-enabled`,`settings-fips-tls`,`settings-host-selector-enabled`,`settings-inspection-mode`,`settings-protocol-detection-enabled`,`settings-sandbox-enabled`,`settings-sandbox-fallback-action`,`settings-tls-decrypt-enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway configurations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({settings:{activity_log:{enabled:t[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:t[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:t[`settings-antivirus-enabled-upload-phase`],fail_closed:t[`settings-antivirus-fail-closed`],notification_settings:{enabled:t[`settings-antivirus-notification-settings-enabled`],include_context:t[`settings-antivirus-notification-settings-include-context`],msg:m(t[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(t[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(t[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:t[`settings-block-page-enabled`],footer_text:m(t[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(t[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:t[`settings-block-page-include-context`],logo_path:m(t[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(t[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(t[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(t[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(t[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:t[`settings-block-page-suppress-footer`],target_uri:m(t[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(t[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:t[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:t[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(t[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:t[`settings-custom-certificate-enabled`],id:m(t[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:t[`settings-extended-email-matching-enabled`]},fips:{tls:t[`settings-fips-tls`]},host_selector:{enabled:t[`settings-host-selector-enabled`]},inspection:{mode:m(t[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:t[`settings-max-ttl-secs`],protocol_detection:{enabled:t[`settings-protocol-detection-enabled`]},sandbox:{enabled:t[`settings-sandbox-enabled`],fallback_action:m(t[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:t[`settings-tls-decrypt-enabled`]}}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.edit({body:e,account_id:l}));o(n,{successLabel:`Updated`});return}let u=p({settings:{activity_log:{enabled:t[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:t[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:t[`settings-antivirus-enabled-upload-phase`],fail_closed:t[`settings-antivirus-fail-closed`],notification_settings:{enabled:t[`settings-antivirus-notification-settings-enabled`],include_context:t[`settings-antivirus-notification-settings-include-context`],msg:m(t[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(t[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(t[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:t[`settings-block-page-enabled`],footer_text:m(t[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(t[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:t[`settings-block-page-include-context`],logo_path:m(t[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(t[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(t[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(t[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(t[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:t[`settings-block-page-suppress-footer`],target_uri:m(t[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(t[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:t[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:t[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(t[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:t[`settings-custom-certificate-enabled`],id:m(t[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:t[`settings-extended-email-matching-enabled`]},fips:{tls:t[`settings-fips-tls`]},host_selector:{enabled:t[`settings-host-selector-enabled`]},inspection:{mode:m(t[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:t[`settings-max-ttl-secs`],protocol_detection:{enabled:t[`settings-protocol-detection-enabled`]},sandbox:{enabled:t[`settings-sandbox-enabled`],fallback_action:m(t[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:t[`settings-tls-decrypt-enabled`]}}}),f=await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.edit({body:u,account_id:l}));o(f,{successLabel:`Updated`})})};function Xf(e){return e.usage(`$0 zero-trust gateway configurations get
|
|
679
|
+
|
|
680
|
+
Retrieve the current Zero Trust account configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Zf={command:`get`,describe:`Get Zero Trust account configuration`,builder:Xf,handler:async t=>l({command:`zero-trust gateway configurations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway configurations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.configurations.get({account_id:l}));o(u,{successLabel:`Loaded`})})};function Qf(e){return e.usage(`$0 zero-trust gateway configurations update
|
|
681
|
+
|
|
682
|
+
Update the current Zero Trust account configuration.`).option(`settings-activity-log-enabled`,{type:`boolean`,description:`Specify whether to log activity.`}).option(`settings-antivirus-enabled-download-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on downloads.`}).option(`settings-antivirus-enabled-upload-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on uploads.`}).option(`settings-antivirus-fail-closed`,{type:`boolean`,description:`Specify whether to block requests for unscannable files.`}).option(`settings-antivirus-notification-settings-enabled`,{type:`boolean`,description:`Specify whether to enable notifications.`}).option(`settings-antivirus-notification-settings-include-context`,{type:`boolean`,description:`Specify whether to include context information as query parameters.`}).option(`settings-antivirus-notification-settings-msg`,{type:`string`,description:`Specify the message to show in the notification.`}).option(`settings-antivirus-notification-settings-support-url`,{type:`string`,description:`Specify a URL that directs users to more information. If unset, the notification opens a block page.`}).option(`settings-block-page-background-color`,{type:`string`,description:"Specify the block page background color in `#rrggbb` format when the mode is customized_block_page."}).option(`settings-block-page-enabled`,{type:`boolean`,description:`Specify whether to enable the custom block page.`}).option(`settings-block-page-footer-text`,{type:`string`,description:`Specify the block page footer text when the mode is customized_block_page.`}).option(`settings-block-page-header-text`,{type:`string`,description:`Specify the block page header text when the mode is customized_block_page.`}).option(`settings-block-page-include-context`,{type:`boolean`,description:`Specify whether to append context to target_uri as query parameters. This applies only when the mode is redirect_uri.`}).option(`settings-block-page-logo-path`,{type:`string`,description:`Specify the full URL to the logo file when the mode is customized_block_page.`}).option(`settings-block-page-mailto-address`,{type:`string`,description:`Specify the admin email for users to contact when the mode is customized_block_page.`}).option(`settings-block-page-mailto-subject`,{type:`string`,description:`Specify the subject line for emails created from the block page when the mode is customized_block_page.`}).option(`settings-block-page-mode`,{type:`string`,description:`Specify whether to redirect users to a Cloudflare-hosted block page or a customer-provided URI.`,choices:[`customized_block_page`,`redirect_uri`]}).option(`settings-block-page-name`,{type:`string`,description:`Specify the block page title when the mode is customized_block_page.`}).option(`settings-block-page-suppress-footer`,{type:`boolean`,description:`Specify whether to suppress detailed information at the bottom of the block page when the mode is customized_block_page.`}).option(`settings-block-page-target-uri`,{type:`string`,description:`Specify the URI to redirect users to when the mode is redirect_uri.`}).option(`settings-body-scanning-inspection-mode`,{type:`string`,description:"Specify the inspection mode as either `deep` or `shallow`.",choices:[`deep`,`shallow`]}).option(`settings-browser-isolation-non-identity-enabled`,{type:`boolean`,description:`Specify whether to enable non-identity onramp support for Browser Isolation.`}).option(`settings-browser-isolation-url-browser-isolation-enabled`,{type:`boolean`,description:`Specify whether to enable Clientless Browser Isolation.`}).option(`settings-certificate-id`,{type:`string`,description:`Specify the UUID of the certificate used for interception. Ensure the certificate is available at the edge(previously called 'active'). A nil UUID directs Cloudflare to use the Root CA.`}).option(`settings-custom-certificate-enabled`,{type:`boolean`,description:`Specify whether to enable a custom certificate authority for signing Gateway traffic.`}).option(`settings-custom-certificate-id`,{type:`string`,description:`Specify the UUID of the certificate (ID from MTLS certificate store).`}).option(`settings-extended-email-matching-enabled`,{type:`boolean`,description:`Specify whether to match all variants of user emails (with + or . modifiers) used as criteria in Firewall policies.`}).option(`settings-fips-tls`,{type:`boolean`,description:`Enforce cipher suites and TLS versions compliant with FIPS 140-2.`}).option(`settings-host-selector-enabled`,{type:`boolean`,description:`Specify whether to enable filtering via hosts for egress policies.`}).option(`settings-inspection-mode`,{type:`string`,description:`Define the proxy inspection mode. 1. static: Gateway applies static inspection to HTTP on TCP(80). With TLS decryption on, Gateway inspects HTTPS traffic on TCP(443) and UDP(443). 2. dynamic: Gateway applies protocol detection to inspect HTTP and HTTPS traffic on any port. TLS decryption must remain on to inspect HTTPS traffic.`,choices:[`static`,`dynamic`]}).option(`settings-max-ttl-secs`,{type:`number`,description:"Account-level cap on DNS response TTLs, in seconds. Gateway rewrites DNS responses so returned record TTLs do not exceed this value. Null means no cap. Each DNS location can inherit, override, or disable it through the location `max_ttl` setting."}).option(`settings-protocol-detection-enabled`,{type:`boolean`,description:`Specify whether to detect protocols from the initial bytes of client traffic.`}).option(`settings-sandbox-enabled`,{type:`boolean`,description:`Specify whether to enable the sandbox.`}).option(`settings-sandbox-fallback-action`,{type:`string`,description:`Specify the action to take when the system cannot scan the file.`,choices:[`allow`,`block`]}).option(`settings-tls-decrypt-enabled`,{type:`boolean`,description:`Specify whether to inspect encrypted HTTP traffic.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify account settings.`}).check(e=>{if((/* @__PURE__ */ `settings-activity-log-enabled.settings-antivirus-enabled-download-phase.settings-antivirus-enabled-upload-phase.settings-antivirus-fail-closed.settings-antivirus-notification-settings-enabled.settings-antivirus-notification-settings-include-context.settings-antivirus-notification-settings-msg.settings-antivirus-notification-settings-support-url.settings-block-page-background-color.settings-block-page-enabled.settings-block-page-footer-text.settings-block-page-header-text.settings-block-page-include-context.settings-block-page-logo-path.settings-block-page-mailto-address.settings-block-page-mailto-subject.settings-block-page-mode.settings-block-page-name.settings-block-page-suppress-footer.settings-block-page-target-uri.settings-body-scanning-inspection-mode.settings-browser-isolation-non-identity-enabled.settings-browser-isolation-url-browser-isolation-enabled.settings-certificate-id.settings-custom-certificate-enabled.settings-custom-certificate-id.settings-extended-email-matching-enabled.settings-fips-tls.settings-host-selector-enabled.settings-inspection-mode.settings-max-ttl-secs.settings-protocol-detection-enabled.settings-sandbox-enabled.settings-sandbox-fallback-action.settings-tls-decrypt-enabled`.split(`.`)).some(t=>e[t]!==void 0)){let t=[`settings-certificate-id`,`settings-custom-certificate-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --settings-* flag is set`)}return!0})}const $f={command:`update`,describe:`Update Zero Trust account configuration`,builder:Qf,handler:async t=>l({command:`zero-trust gateway configurations update`,classification:{safeFlags:[`settings-activity-log-enabled`,`settings-antivirus-enabled-download-phase`,`settings-antivirus-enabled-upload-phase`,`settings-antivirus-fail-closed`,`settings-antivirus-notification-settings-enabled`,`settings-antivirus-notification-settings-include-context`,`settings-block-page-enabled`,`settings-block-page-include-context`,`settings-block-page-mode`,`settings-block-page-suppress-footer`,`settings-body-scanning-inspection-mode`,`settings-browser-isolation-non-identity-enabled`,`settings-browser-isolation-url-browser-isolation-enabled`,`settings-custom-certificate-enabled`,`settings-extended-email-matching-enabled`,`settings-fips-tls`,`settings-host-selector-enabled`,`settings-inspection-mode`,`settings-protocol-detection-enabled`,`settings-sandbox-enabled`,`settings-sandbox-fallback-action`,`settings-tls-decrypt-enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway configurations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({settings:{activity_log:{enabled:t[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:t[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:t[`settings-antivirus-enabled-upload-phase`],fail_closed:t[`settings-antivirus-fail-closed`],notification_settings:{enabled:t[`settings-antivirus-notification-settings-enabled`],include_context:t[`settings-antivirus-notification-settings-include-context`],msg:m(t[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(t[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(t[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:t[`settings-block-page-enabled`],footer_text:m(t[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(t[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:t[`settings-block-page-include-context`],logo_path:m(t[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(t[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(t[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(t[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(t[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:t[`settings-block-page-suppress-footer`],target_uri:m(t[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(t[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:t[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:t[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(t[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:t[`settings-custom-certificate-enabled`],id:m(t[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:t[`settings-extended-email-matching-enabled`]},fips:{tls:t[`settings-fips-tls`]},host_selector:{enabled:t[`settings-host-selector-enabled`]},inspection:{mode:m(t[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:t[`settings-max-ttl-secs`],protocol_detection:{enabled:t[`settings-protocol-detection-enabled`]},sandbox:{enabled:t[`settings-sandbox-enabled`],fallback_action:m(t[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:t[`settings-tls-decrypt-enabled`]}}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.update({body:e,account_id:l}));o(n,{successLabel:`Updated`});return}let u=p({settings:{activity_log:{enabled:t[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:t[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:t[`settings-antivirus-enabled-upload-phase`],fail_closed:t[`settings-antivirus-fail-closed`],notification_settings:{enabled:t[`settings-antivirus-notification-settings-enabled`],include_context:t[`settings-antivirus-notification-settings-include-context`],msg:m(t[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(t[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(t[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:t[`settings-block-page-enabled`],footer_text:m(t[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(t[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:t[`settings-block-page-include-context`],logo_path:m(t[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(t[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(t[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(t[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(t[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:t[`settings-block-page-suppress-footer`],target_uri:m(t[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(t[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:t[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:t[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(t[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:t[`settings-custom-certificate-enabled`],id:m(t[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:t[`settings-extended-email-matching-enabled`]},fips:{tls:t[`settings-fips-tls`]},host_selector:{enabled:t[`settings-host-selector-enabled`]},inspection:{mode:m(t[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:t[`settings-max-ttl-secs`],protocol_detection:{enabled:t[`settings-protocol-detection-enabled`]},sandbox:{enabled:t[`settings-sandbox-enabled`],fallback_action:m(t[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:t[`settings-tls-decrypt-enabled`]}}}),f=await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.update({body:u,account_id:l}));o(f,{successLabel:`Updated`})})},ep={command:`configurations`,describe:`Operations for gateway.configurations`,builder:e=>e.command(Yf).command(Zf).command($f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tp(e){return e.usage(`$0 zero-trust gateway create
|
|
683
|
+
|
|
684
|
+
Create a Zero Trust account for an existing Cloudflare account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const np={command:`create`,describe:`Create Zero Trust account`,builder:tp,handler:async t=>l({command:`zero-trust gateway create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.gateway.create({account_id:l}));o(u,{successLabel:`Created`})})};function rp(e){return e.usage(`$0 zero-trust gateway dns-destination-ips list
|
|
685
|
+
|
|
686
|
+
List Zero Trust Gateway IPv4 address pairs for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ip={command:`list`,describe:`List Zero Trust Gateway DNS destination IPv4 address pairs`,builder:rp,handler:async t=>l({command:`zero-trust gateway dns-destination-ips list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway dns-destination-ips list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/dns_destination_ips`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.dnsDestinationIps.list({account_id:l}));o(u,{successLabel:`Loaded`})})},ap={command:`dns-destination-ips`,describe:`Operations for gateway.dns-destination-ips`,builder:e=>e.command(ip).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function op(e){return e.usage(`$0 zero-trust gateway egress-cidr-pairs list
|
|
687
|
+
|
|
688
|
+
Retrieve the list of egress CIDRs allocated to this Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sp={command:`list`,describe:`Get gateway egress CIDRs pairs assigned to this account`,builder:op,handler:async t=>l({command:`zero-trust gateway egress-cidr-pairs list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway egress-cidr-pairs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/egress_cidr_pairs`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.egressCidrPairs.list({account_id:l}));o(u,{successLabel:`Loaded`})})},cp={command:`egress-cidr-pairs`,describe:`Operations for gateway.egress-cidr-pairs`,builder:e=>e.command(sp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lp(e){return e.usage(`$0 zero-trust gateway list
|
|
689
|
+
|
|
690
|
+
Retrieve information about the current Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const up={command:`list`,describe:`Get Zero Trust account information`,builder:lp,handler:async t=>l({command:`zero-trust gateway list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function dp(e){return e.usage(`$0 zero-trust gateway lists create
|
|
691
|
+
|
|
692
|
+
Creates a new Zero Trust list.`).option(`description`,{type:`string`,description:`Provide the list description.`}).option(`items`,{type:`string`,description:`Add items to the list. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Specify the list name.`}).option(`type`,{type:`string`,description:`Specify the list type.`,choices:[`SERIAL`,`URL`,`DOMAIN`,`EMAIL`,`IP`,`CATEGORY`,`LOCATION`,`DEVICE`,`AAGUID`]}).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 fp={command:`create`,describe:`Create Zero Trust list`,builder:dp,handler:async t=>l({command:`zero-trust gateway lists create`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/lists`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),items:f(t.items,`items`),name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.gateway.lists.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`Specify the list name.`)),t.type===void 0&&(t.type=await _(`type`,`Specify the list type.`,[`SERIAL`,`URL`,`DOMAIN`,`EMAIL`,`IP`,`CATEGORY`,`LOCATION`,`DEVICE`,`AAGUID`]));let u=p({description:m(t.description,`description`,`text`),items:f(t.items,`items`),name:m(t.name,`name`,`text`),type:m(t.type,`type`,`text`)}),h=await c(`Creating`,async()=>i.zeroTrust.gateway.lists.create({...u,account_id:l}));o(h,{successLabel:`Created`})})};function pp(e){return e.usage(`$0 zero-trust gateway lists delete <list-id>
|
|
693
|
+
|
|
694
|
+
Deletes a Zero Trust list.`).positional(`list-id`,{type:`string`,description:`Identify the API resource with a UUID.`,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 mp={command:`delete <list-id>`,describe:`Delete Zero Trust list`,builder:pp,handler:async t=>l({command:`zero-trust gateway lists delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/lists/${t[`list-id`]==null?`<list-id>`:encodeURIComponent(String(t[`list-id`]))}`,pathParams:{"list-id":String(t[`list-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
695
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.gateway.lists.delete({account_id:l,list_id:t[`list-id`]}));o(u,{successLabel:`Deleted`})})};function hp(e){return e.usage(`$0 zero-trust gateway lists edit <list-id>
|
|
696
|
+
|
|
697
|
+
Appends or removes an item from a configured Zero Trust list.`).positional(`list-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`append`,{type:`string`,description:`Add items to the list. Provide as a JSON array of objects or @path/to/file.json.`}).option(`remove`,{type:`string`,array:!0,description:`Lists of item values you want to remove.`}).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 gp={command:`edit <list-id>`,describe:`Patch Zero Trust list.`,builder:hp,handler:async t=>l({command:`zero-trust gateway lists edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway lists edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/lists/${t[`list-id`]==null?`<list-id>`:encodeURIComponent(String(t[`list-id`]))}`,pathParams:{"list-id":String(t[`list-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({append:f(t.append,`append`),remove:t.remove}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.lists.edit({...e,account_id:l,list_id:t[`list-id`]}));o(n,{successLabel:`Updated`});return}let u=p({append:f(t.append,`append`),remove:t.remove}),m=await c(`Updating`,async()=>i.zeroTrust.gateway.lists.edit({...u,account_id:l,list_id:t[`list-id`]}));o(m,{successLabel:`Updated`})})};function _p(e){return e.usage(`$0 zero-trust gateway lists get <list-id>
|
|
698
|
+
|
|
699
|
+
Fetch a single Zero Trust list.`).positional(`list-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vp={command:`get <list-id>`,describe:`Get Zero Trust list details`,builder:_p,handler:async t=>l({command:`zero-trust gateway lists get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/lists/${t[`list-id`]==null?`<list-id>`:encodeURIComponent(String(t[`list-id`]))}`,pathParams:{"list-id":String(t[`list-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.lists.get({account_id:l,list_id:t[`list-id`]}));o(u,{successLabel:`Loaded`})})};function yp(e){return e.usage(`$0 zero-trust gateway lists items list
|
|
700
|
+
|
|
701
|
+
Fetch all items in a single Zero Trust list.`).option(`list-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bp={command:`list`,describe:`Get Zero Trust list items`,builder:yp,handler:async t=>l({command:`zero-trust gateway lists items list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/lists/${t[`list-id`]==null?`<list-id>`:encodeURIComponent(String(t[`list-id`]))}/items`,pathParams:{"list-id":String(t[`list-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.gateway.lists.items.list({account_id:u,list_id:t[`list-id`],...i}));o(d,{successLabel:`Loaded`})})},xp={command:`items`,describe:`Operations for gateway.lists.items`,builder:e=>e.command(bp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Sp(e){return e.usage(`$0 zero-trust gateway lists list
|
|
702
|
+
|
|
703
|
+
Fetch all Zero Trust lists for an account.`).option(`type`,{type:`string`,description:`Specify the list type.`,choices:[`SERIAL`,`URL`,`DOMAIN`,`EMAIL`,`IP`,`CATEGORY`,`LOCATION`,`DEVICE`,`AAGUID`]}).option(`filter`,{type:`string`,description:"Filter the returned lists by one or more `field:value` pairs.\nRepeat the parameter to apply multiple filters; they are combined with\nlogical AND (a list must satisfy every filter to be returned).\n\nSupported fields and their matching behaviour:\n * `name` — case-insensitive substring match on the list name.\n * `id` — substring match on the list ID (UUID), with or without dashes.\n * `type` — exact match on the list type. Supersedes the legacy `type` query\n parameter when both are supplied. Must be one of the valid type values.\n * `item_count` — exact integer match on the number of items in the list.\n\nEach entry must match one of the per-field patterns below: the field must be\none of `name`, `id`, `type`, or `item_count`; `name`/`id` accept any value,\n`type` is restricted to the valid list type values, and `item_count` must be\na non-negative integer."}).option(`search`,{type:`string`,description:"Case-insensitive substring match on the list name or description. When\ncombined with `filter`, both must match (logical AND)."}).option(`order-by`,{type:`string`,description:"Field to sort the returned lists by. When omitted, results are ordered by\n`created_at` in ascending order (i.e. creation order) for backwards\ncompatibility. Supported values:\n * `name` — sort alphabetically by list name.\n * `created_at` — sort by creation time; defaults to descending unless `direction` is set.\n * `updated_at` — sort by last-modified time; defaults to descending unless `direction` is set.\n * `item_count` — sort by number of items in the list.",choices:[`name`,`created_at`,`updated_at`,`item_count`]}).option(`direction`,{type:`string`,description:"Sort direction. Applies to the field named in `order_by`; when `order_by`\nis omitted it applies to the default `created_at` ordering. When\n`direction` is omitted the default is field-specific: explicitly choosing\n`created_at` or `updated_at` defaults to descending (newest first); `name`\nand `item_count` default to ascending; and the default `created_at`\nordering used when `order_by` is omitted is ascending (for backwards\ncompatibility).\n * `asc` — ascending.\n * `desc` — descending.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Cp={command:`list`,describe:`List Zero Trust lists`,builder:y(Sp),handler:async t=>l({command:`zero-trust gateway lists list`,classification:{safeFlags:[`type`,`order-by`,`direction`,`dry-run`]}},t,async()=>{let i={type:t.type,filter:t.filter,search:t.search,order_by:t[`order-by`],direction:t.direction};if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/lists`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.gateway.lists.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function wp(e){return e.usage(`$0 zero-trust gateway lists update <list-id>
|
|
704
|
+
|
|
705
|
+
Updates a configured Zero Trust list. Skips updating list items if not included in the payload. A non empty list items will overwrite the existing list.`).positional(`list-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`description`,{type:`string`,description:`Provide the list description.`}).option(`items`,{type:`string`,description:`Add items to the list. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Specify the list name.`}).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 Tp={command:`update <list-id>`,describe:`Update Zero Trust list`,builder:wp,handler:async t=>l({command:`zero-trust gateway lists update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/lists/${t[`list-id`]==null?`<list-id>`:encodeURIComponent(String(t[`list-id`]))}`,pathParams:{"list-id":String(t[`list-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),items:f(t.items,`items`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.lists.update({...e,account_id:l,list_id:t[`list-id`]}));o(n,{successLabel:`Updated`});return}t.name===void 0&&(t.name=await g(`name`,`Specify the list name.`));let u=p({description:m(t.description,`description`,`text`),items:f(t.items,`items`),name:m(t.name,`name`,`text`)}),h=await c(`Updating`,async()=>i.zeroTrust.gateway.lists.update({...u,account_id:l,list_id:t[`list-id`]}));o(h,{successLabel:`Updated`})})};function Ep(e){return e.usage("$0 zero-trust gateway lists upload\n\nCreate a new Zero Trust list by uploading a CSV file. The file must be `text/csv` or `text/plain` and cannot exceed 2 MB. The operation is processed asynchronously. Use the returned operation ID to poll for status.").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 Dp={command:`upload`,describe:`Create Zero Trust list from CSV`,builder:Ep,handler:async i=>l({command:`zero-trust gateway lists upload`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=await r();s({command:`cf zero-trust gateway lists upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/lists/upload`,pathParams:{},bodyKind:`multipart`,body:{body:i.body,file:i.file}});return}let l=await n(i),u=i.local?e:await a();if(i.accountId=u,i.file!==void 0||i.body!==void 0){let e=new FormData;if(i.file){let t=h(i.file);e.append(`file`,new Blob([t]),i.file.split(/[\\/]/).filter(Boolean).pop())}else i.body!==void 0&&e.append(`file`,i.body);let n=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${u}/gateway/lists/upload`,{body:e}));o(n,{successLabel:`Created`});return}if(i.body){let e=m(i.body,`body`,`binary`),n=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${u}/gateway/lists/upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}}));o(n,{successLabel:`Created`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Op={command:`lists`,describe:`Operations for gateway.lists`,builder:e=>e.command(fp).command(mp).command(gp).command(vp).command(Cp).command(Tp).command(Dp).command(xp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function kp(e){return e.usage(`$0 zero-trust gateway locations create
|
|
706
|
+
|
|
707
|
+
Create a new Zero Trust Gateway location.`).option(`client-default`,{type:`boolean`,description:`Indicate whether this location is the default location.`,default:!1}).option(`dns-destination-ips-id`,{type:`string`,description:`Specify the identifier of the pair of IPv4 addresses assigned to this location. When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged.`}).option(`ecs-support`,{type:`boolean`,description:`Indicate whether the location must resolve EDNS queries.`,default:!1}).option(`endpoints-doh-enabled`,{type:`boolean`,description:`Indicate whether the DOH endpoint is enabled for this location.`}).option(`endpoints-doh-require-token`,{type:`boolean`,description:`Specify whether the DOH endpoint requires user identity authentication.`}).option(`endpoints-dot-enabled`,{type:`boolean`,description:`Indicate whether the DOT endpoint is enabled for this location.`}).option(`endpoints-ipv4-enabled`,{type:`boolean`,description:`Indicate whether the IPv4 endpoint is enabled for this location.`}).option(`endpoints-ipv6-enabled`,{type:`boolean`,description:`Indicate whether the IPV6 endpoint is enabled for this location.`}).option(`max-ttl-mode`,{type:`string`,description:"`inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged.",choices:[`inherit`,`override`,`disabled`]}).option(`max-ttl-ttl-secs`,{type:`number`,description:"Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`."}).option(`name`,{type:`string`,description:`Specify the location name.`}).option(`networks`,{type:`string`,description:`Specify the list of network ranges from which requests at this location originate. The list takes effect only if it is non-empty and the IPv4 endpoint is enabled for this location. 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)`}).check(e=>{if([`max-ttl-mode`,`max-ttl-ttl-secs`].some(t=>e[t]!==void 0)){let t=[`max-ttl-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --max_ttl-* flag is set`)}return!0})}const Ap={command:`create`,describe:`Create a Zero Trust Gateway location`,builder:kp,handler:async t=>l({command:`zero-trust gateway locations create`,classification:{safeFlags:[`client-default`,`ecs-support`,`endpoints-doh-enabled`,`endpoints-doh-require-token`,`endpoints-dot-enabled`,`endpoints-ipv4-enabled`,`endpoints-ipv6-enabled`,`max-ttl-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway locations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/locations`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({client_default:t[`client-default`],dns_destination_ips_id:m(t[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:t[`ecs-support`],endpoints:{doh:{enabled:t[`endpoints-doh-enabled`],require_token:t[`endpoints-doh-require-token`]},dot:{enabled:t[`endpoints-dot-enabled`]},ipv4:{enabled:t[`endpoints-ipv4-enabled`]},ipv6:{enabled:t[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(t[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:t[`max-ttl-ttl-secs`]},name:m(t.name,`name`,`text`),networks:f(t.networks,`networks`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.gateway.locations.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.name===void 0&&(t.name=await g(`name`,`Specify the location name.`));let u=p({client_default:t[`client-default`],dns_destination_ips_id:m(t[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:t[`ecs-support`],endpoints:{doh:{enabled:t[`endpoints-doh-enabled`],require_token:t[`endpoints-doh-require-token`]},dot:{enabled:t[`endpoints-dot-enabled`]},ipv4:{enabled:t[`endpoints-ipv4-enabled`]},ipv6:{enabled:t[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(t[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:t[`max-ttl-ttl-secs`]},name:m(t.name,`name`,`text`),networks:f(t.networks,`networks`)}),h=await c(`Creating`,async()=>i.zeroTrust.gateway.locations.create({...u,account_id:l}));o(h,{successLabel:`Created`})})};function jp(e){return e.usage(`$0 zero-trust gateway locations delete <location-id>
|
|
708
|
+
|
|
709
|
+
Delete a configured Zero Trust Gateway location.`).positional(`location-id`,{type:`string`,description:`Location ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Mp={command:`delete <location-id>`,describe:`Delete a Zero Trust Gateway location`,builder:jp,handler:async t=>l({command:`zero-trust gateway locations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway locations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/locations/${t[`location-id`]==null?`<location-id>`:encodeURIComponent(String(t[`location-id`]))}`,pathParams:{"location-id":String(t[`location-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
710
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.gateway.locations.delete({account_id:l,location_id:t[`location-id`]}));o(u,{successLabel:`Deleted`})})};function Np(e){return e.usage(`$0 zero-trust gateway locations get <location-id>
|
|
711
|
+
|
|
712
|
+
Get a single Zero Trust Gateway location.`).positional(`location-id`,{type:`string`,description:`Location ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pp={command:`get <location-id>`,describe:`Get Zero Trust Gateway location details`,builder:Np,handler:async t=>l({command:`zero-trust gateway locations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway locations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/locations/${t[`location-id`]==null?`<location-id>`:encodeURIComponent(String(t[`location-id`]))}`,pathParams:{"location-id":String(t[`location-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.locations.get({account_id:l,location_id:t[`location-id`]}));o(u,{successLabel:`Loaded`})})};function Fp(e){return e.usage(`$0 zero-trust gateway locations list
|
|
713
|
+
|
|
714
|
+
List Zero Trust Gateway locations for an account.`).option(`filter`,{type:`string`,description:"Filter the returned locations by one or more `field:value` pairs.\nRepeat the parameter to apply multiple filters; they are combined with\nlogical AND (a location must satisfy every filter to be returned).\n\nSupported fields and their matching behaviour:\n * `name` — case-insensitive substring match on the location name.\n * `id` — substring match on the location ID (UUID), with or without dashes.\n * `is_default` — whether it is the default for the account.\n\nEach entry must match one of the per-field patterns below:\n * the field must be one of `name`, `id`, or `is_default`;\n * `name`/`id` accept any value;\n * `is_default` only accepts `true` or `false`; any other value returns `400`"}).option(`search`,{type:`string`,description:"Case-insensitive substring match on the location name. When combined\nwith `filter`, both must match (logical AND)."}).option(`order-by`,{type:`string`,description:"Field to sort the returned locations by. When omitted, the order of\nresults is unspecified. Supported values:\n * `name` — sort alphabetically by location name.\n * `created_at` — sort by creation time; defaults to descending unless `direction` is set.\n * `updated_at` — sort by last-modified time; defaults to descending unless `direction` is set.",choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:"Sort direction. Only takes effect when `order_by` is also provided; it\nis ignored otherwise. When `direction` is omitted the effective\ndirection is field-specific: `created_at` and `updated_at` default to\ndescending (newest first); `name` defaults to ascending.\n * `asc` — ascending.\n * `desc` — descending.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ip={command:`list`,describe:`List Zero Trust Gateway locations`,builder:y(Fp),handler:async t=>l({command:`zero-trust gateway locations list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},t,async()=>{let i={filter:t.filter,search:t.search,order_by:t[`order-by`],direction:t.direction};if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway locations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/locations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.gateway.locations.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function Lp(e){return e.usage(`$0 zero-trust gateway locations update <location-id>
|
|
715
|
+
|
|
716
|
+
Update a configured Zero Trust Gateway location.`).positional(`location-id`,{type:`string`,description:`Location ID`,demandOption:!0}).option(`client-default`,{type:`boolean`,description:`Indicate whether this location is the default location.`}).option(`dns-destination-ips-id`,{type:`string`,description:`Specify the identifier of the pair of IPv4 addresses assigned to this location. When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged.`}).option(`ecs-support`,{type:`boolean`,description:`Indicate whether the location must resolve EDNS queries.`}).option(`endpoints-doh-enabled`,{type:`boolean`,description:`Indicate whether the DOH endpoint is enabled for this location.`}).option(`endpoints-doh-require-token`,{type:`boolean`,description:`Specify whether the DOH endpoint requires user identity authentication.`}).option(`endpoints-dot-enabled`,{type:`boolean`,description:`Indicate whether the DOT endpoint is enabled for this location.`}).option(`endpoints-ipv4-enabled`,{type:`boolean`,description:`Indicate whether the IPv4 endpoint is enabled for this location.`}).option(`endpoints-ipv6-enabled`,{type:`boolean`,description:`Indicate whether the IPV6 endpoint is enabled for this location.`}).option(`max-ttl-mode`,{type:`string`,description:"`inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged.",choices:[`inherit`,`override`,`disabled`]}).option(`max-ttl-ttl-secs`,{type:`number`,description:"Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`."}).option(`name`,{type:`string`,description:`Specify the location name.`}).option(`networks`,{type:`string`,description:`Specify the list of network ranges from which requests at this location originate. The list takes effect only if it is non-empty and the IPv4 endpoint is enabled for this location. 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)`}).check(e=>{if([`max-ttl-mode`,`max-ttl-ttl-secs`].some(t=>e[t]!==void 0)){let t=[`max-ttl-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --max_ttl-* flag is set`)}return!0})}const Rp={command:`update <location-id>`,describe:`Update a Zero Trust Gateway location`,builder:Lp,handler:async t=>l({command:`zero-trust gateway locations update`,classification:{safeFlags:[`client-default`,`ecs-support`,`endpoints-doh-enabled`,`endpoints-doh-require-token`,`endpoints-dot-enabled`,`endpoints-ipv4-enabled`,`endpoints-ipv6-enabled`,`max-ttl-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway locations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/locations/${t[`location-id`]==null?`<location-id>`:encodeURIComponent(String(t[`location-id`]))}`,pathParams:{"location-id":String(t[`location-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({client_default:t[`client-default`],dns_destination_ips_id:m(t[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:t[`ecs-support`],endpoints:{doh:{enabled:t[`endpoints-doh-enabled`],require_token:t[`endpoints-doh-require-token`]},dot:{enabled:t[`endpoints-dot-enabled`]},ipv4:{enabled:t[`endpoints-ipv4-enabled`]},ipv6:{enabled:t[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(t[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:t[`max-ttl-ttl-secs`]},name:m(t.name,`name`,`text`),networks:f(t.networks,`networks`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.locations.update({...e,account_id:l,location_id:t[`location-id`]}));o(n,{successLabel:`Updated`});return}t.name===void 0&&(t.name=await g(`name`,`Specify the location name.`));let u=p({client_default:t[`client-default`],dns_destination_ips_id:m(t[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:t[`ecs-support`],endpoints:{doh:{enabled:t[`endpoints-doh-enabled`],require_token:t[`endpoints-doh-require-token`]},dot:{enabled:t[`endpoints-dot-enabled`]},ipv4:{enabled:t[`endpoints-ipv4-enabled`]},ipv6:{enabled:t[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(t[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:t[`max-ttl-ttl-secs`]},name:m(t.name,`name`,`text`),networks:f(t.networks,`networks`)}),h=await c(`Updating`,async()=>i.zeroTrust.gateway.locations.update({...u,account_id:l,location_id:t[`location-id`]}));o(h,{successLabel:`Updated`})})},zp={command:`locations`,describe:`Operations for gateway.locations`,builder:e=>e.command(Ap).command(Mp).command(Pp).command(Ip).command(Rp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Bp(e){return e.usage(`$0 zero-trust gateway logging get
|
|
717
|
+
|
|
718
|
+
Retrieve the current logging settings for the Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Vp={command:`get`,describe:`Get logging settings for the Zero Trust account`,builder:Bp,handler:async t=>l({command:`zero-trust gateway logging get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway logging get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/logging`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.logging.get({account_id:l}));o(u,{successLabel:`Loaded`})})};function Hp(e){return e.usage(`$0 zero-trust gateway logging update
|
|
719
|
+
|
|
720
|
+
Update logging settings for the current Zero Trust account.`).option(`redact-pii`,{type:`boolean`,description:`Indicate whether to redact personally identifiable information from activity logging (PII fields include source IP, user email, user ID, device ID, URL, referrer, and user agent).`}).option(`settings-by-rule-type-dns-log-all`,{type:`boolean`,description:`Specify whether to log all requests to this service.`}).option(`settings-by-rule-type-dns-log-blocks`,{type:`boolean`,description:`Specify whether to log only blocking requests to this service.`}).option(`settings-by-rule-type-http-log-all`,{type:`boolean`,description:`Specify whether to log all requests to this service.`}).option(`settings-by-rule-type-http-log-blocks`,{type:`boolean`,description:`Specify whether to log only blocking requests to this service.`}).option(`settings-by-rule-type-l4-log-all`,{type:`boolean`,description:`Specify whether to log all requests to this service.`}).option(`settings-by-rule-type-l4-log-blocks`,{type:`boolean`,description:`Specify whether to log only blocking requests to this service.`}).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 Up={command:`update`,describe:`Update Zero Trust account logging settings`,builder:Hp,handler:async t=>l({command:`zero-trust gateway logging update`,classification:{safeFlags:[`redact-pii`,`settings-by-rule-type-dns-log-all`,`settings-by-rule-type-dns-log-blocks`,`settings-by-rule-type-http-log-all`,`settings-by-rule-type-http-log-blocks`,`settings-by-rule-type-l4-log-all`,`settings-by-rule-type-l4-log-blocks`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway logging update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/logging`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({redact_pii:t[`redact-pii`],settings_by_rule_type:{dns:{log_all:t[`settings-by-rule-type-dns-log-all`],log_blocks:t[`settings-by-rule-type-dns-log-blocks`]},http:{log_all:t[`settings-by-rule-type-http-log-all`],log_blocks:t[`settings-by-rule-type-http-log-blocks`]},l4:{log_all:t[`settings-by-rule-type-l4-log-all`],log_blocks:t[`settings-by-rule-type-l4-log-blocks`]}}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.logging.update({body:e,account_id:l}));o(n,{successLabel:`Updated`});return}let u=p({redact_pii:t[`redact-pii`],settings_by_rule_type:{dns:{log_all:t[`settings-by-rule-type-dns-log-all`],log_blocks:t[`settings-by-rule-type-dns-log-blocks`]},http:{log_all:t[`settings-by-rule-type-http-log-all`],log_blocks:t[`settings-by-rule-type-http-log-blocks`]},l4:{log_all:t[`settings-by-rule-type-l4-log-all`],log_blocks:t[`settings-by-rule-type-l4-log-blocks`]}}}),f=await c(`Updating`,async()=>i.zeroTrust.gateway.logging.update({body:u,account_id:l}));o(f,{successLabel:`Updated`})})},Wp={command:`logging`,describe:`Operations for gateway.logging`,builder:e=>e.command(Vp).command(Up).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Gp(e){return e.usage(`$0 zero-trust gateway operations get <operation-id>
|
|
721
|
+
|
|
722
|
+
Fetch a single Zero Trust Gateway operation by its ID.`).positional(`operation-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kp={command:`get <operation-id>`,describe:`Zero Trust Gateway operation details`,builder:Gp,handler:async t=>l({command:`zero-trust gateway operations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/operations/${t[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(t[`operation-id`]))}`,pathParams:{"operation-id":String(t[`operation-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.operations.get({account_id:l,operation_id:t[`operation-id`]}));o(u,{successLabel:`Loaded`})})};function qp(e){return e.usage(`$0 zero-trust gateway operations list
|
|
723
|
+
|
|
724
|
+
List all Zero Trust Gateway operations for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Jp={command:`list`,describe:`List Zero Trust Gateway operations`,builder:qp,handler:async t=>l({command:`zero-trust gateway operations list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/operations`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.operations.list({account_id:l}));o(u,{successLabel:`Loaded`})})},Yp={command:`operations`,describe:`Operations for gateway.operations`,builder:e=>e.command(Kp).command(Jp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Xp(e){return e.usage(`$0 zero-trust gateway pacfiles create
|
|
725
|
+
|
|
726
|
+
Create a new Zero Trust Gateway PAC file.`).option(`contents`,{type:`string`,description:`Actual contents of the PAC file`}).option(`description`,{type:`string`,description:`Detailed description of the PAC file.`}).option(`name`,{type:`string`,description:`Name of the PAC file.`}).option(`slug`,{type:`string`,description:`URL-friendly version of the PAC file name. If not provided, it will be auto-generated`}).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 Zp={command:`create`,describe:`Create a PAC file`,builder:Xp,handler:async t=>l({command:`zero-trust gateway pacfiles create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway pacfiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/pacfiles`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({contents:m(t.contents,`contents`,`text`),description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),slug:m(t.slug,`slug`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.gateway.pacfiles.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.contents===void 0&&(t.contents=await g(`contents`,`Actual contents of the PAC file`)),t.name===void 0&&(t.name=await g(`name`,`Name of the PAC file.`));let u=p({contents:m(t.contents,`contents`,`text`),description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),slug:m(t.slug,`slug`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.gateway.pacfiles.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Qp(e){return e.usage(`$0 zero-trust gateway pacfiles delete <pacfile-id>
|
|
727
|
+
|
|
728
|
+
Delete a configured Zero Trust Gateway PAC file.`).positional(`pacfile-id`,{type:`string`,description:`Pacfile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const $p={command:`delete <pacfile-id>`,describe:`Delete a PAC file`,builder:Qp,handler:async t=>l({command:`zero-trust gateway pacfiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway pacfiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/pacfiles/${t[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(t[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(t[`pacfile-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
729
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.gateway.pacfiles.delete({account_id:l,pacfile_id:t[`pacfile-id`]}));o(u,{successLabel:`Deleted`})})};function em(e){return e.usage(`$0 zero-trust gateway pacfiles get <pacfile-id>
|
|
730
|
+
|
|
731
|
+
Get a single Zero Trust Gateway PAC file.`).positional(`pacfile-id`,{type:`string`,description:`Pacfile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tm={command:`get <pacfile-id>`,describe:`Get a PAC file`,builder:em,handler:async t=>l({command:`zero-trust gateway pacfiles get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway pacfiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/pacfiles/${t[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(t[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(t[`pacfile-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.pacfiles.get({account_id:l,pacfile_id:t[`pacfile-id`]}));o(u,{successLabel:`Loaded`})})};function nm(e){return e.usage(`$0 zero-trust gateway pacfiles list
|
|
732
|
+
|
|
733
|
+
List all Zero Trust Gateway PAC files for an account.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rm={command:`list`,describe:`List PAC files`,builder:nm,handler:async t=>l({command:`zero-trust gateway pacfiles list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway pacfiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/pacfiles`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.gateway.pacfiles.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function im(e){return e.usage(`$0 zero-trust gateway pacfiles update <pacfile-id>
|
|
734
|
+
|
|
735
|
+
Update a configured Zero Trust Gateway PAC file.`).positional(`pacfile-id`,{type:`string`,description:`Pacfile ID`,demandOption:!0}).option(`contents`,{type:`string`,description:`Actual contents of the PAC file`}).option(`description`,{type:`string`,description:`Detailed description of the PAC file.`}).option(`name`,{type:`string`,description:`Name of the PAC file.`}).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 am={command:`update <pacfile-id>`,describe:`Update a Zero Trust Gateway PAC file`,builder:im,handler:async t=>l({command:`zero-trust gateway pacfiles update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway pacfiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/pacfiles/${t[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(t[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(t[`pacfile-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({contents:m(t.contents,`contents`,`text`),description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.pacfiles.update({...e,account_id:l,pacfile_id:t[`pacfile-id`]}));o(n,{successLabel:`Updated`});return}t.contents===void 0&&(t.contents=await g(`contents`,`Actual contents of the PAC file`)),t.description===void 0&&(t.description=await g(`description`,`Detailed description of the PAC file.`)),t.name===void 0&&(t.name=await g(`name`,`Name of the PAC file.`));let u=p({contents:m(t.contents,`contents`,`text`),description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.gateway.pacfiles.update({...u,account_id:l,pacfile_id:t[`pacfile-id`]}));o(f,{successLabel:`Updated`})})},om={command:`pacfiles`,describe:`Operations for gateway.pacfiles`,builder:e=>e.command(Zp).command($p).command(tm).command(rm).command(am).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function sm(e){return e.usage(`$0 zero-trust gateway proxy-endpoints create
|
|
736
|
+
|
|
737
|
+
Create a new Zero Trust Gateway proxy endpoint.`).option(`kind`,{type:`string`,description:`The proxy endpoint kind.`,choices:[`ip`,`identity`],default:`ip`}).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 cm={command:`create`,describe:`Create a proxy endpoint`,builder:sm,handler:async t=>l({command:`zero-trust gateway proxy-endpoints create`,classification:{safeFlags:[`kind`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway proxy-endpoints create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/proxy_endpoints`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({kind:m(t.kind,`kind`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.gateway.proxyEndpoints.create({body:e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.kind===`ip`)throw Error(`The ip variant requires ips, which cannot be supplied as flags. Pass --body with a complete request body.`);t.kind===`identity`&&t.kind===void 0&&(t.kind=await g(`kind`,`The proxy endpoint kind.`,{question:`Enter value for --kind`}));let u=p({kind:m(t.kind,`kind`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.gateway.proxyEndpoints.create({body:u,account_id:l}));o(f,{successLabel:`Created`})})};function lm(e){return e.usage(`$0 zero-trust gateway proxy-endpoints delete <proxy-endpoint-id>
|
|
738
|
+
|
|
739
|
+
Delete a configured Zero Trust Gateway proxy endpoint.`).positional(`proxy-endpoint-id`,{type:`string`,description:`Proxy endpoint ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const um={command:`delete <proxy-endpoint-id>`,describe:`Delete a proxy endpoint`,builder:lm,handler:async t=>l({command:`zero-trust gateway proxy-endpoints delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway proxy-endpoints delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/proxy_endpoints/${t[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(t[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(t[`proxy-endpoint-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
740
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.gateway.proxyEndpoints.delete({account_id:l,proxy_endpoint_id:t[`proxy-endpoint-id`]}));o(u,{successLabel:`Deleted`})})};function dm(e){return e.usage(`$0 zero-trust gateway proxy-endpoints edit <proxy-endpoint-id>
|
|
741
|
+
|
|
742
|
+
Update a configured Zero Trust Gateway proxy endpoint.`).positional(`proxy-endpoint-id`,{type:`string`,description:`Proxy endpoint ID`,demandOption:!0}).option(`ips`,{type:`string`,array:!0,description:`Specify the list of CIDRs to restrict ingress connections.`}).option(`name`,{type:`string`,description:`Specify the name of the proxy endpoint.`}).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 fm={command:`edit <proxy-endpoint-id>`,describe:`Update a proxy endpoint`,builder:dm,handler:async t=>l({command:`zero-trust gateway proxy-endpoints edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway proxy-endpoints edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/proxy_endpoints/${t[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(t[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(t[`proxy-endpoint-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({ips:t.ips,name:m(t.name,`name`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.proxyEndpoints.edit({...e,account_id:l,proxy_endpoint_id:t[`proxy-endpoint-id`]}));o(n,{successLabel:`Updated`});return}let u=p({ips:t.ips,name:m(t.name,`name`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.gateway.proxyEndpoints.edit({...u,account_id:l,proxy_endpoint_id:t[`proxy-endpoint-id`]}));o(f,{successLabel:`Updated`})})};function pm(e){return e.usage(`$0 zero-trust gateway proxy-endpoints get <proxy-endpoint-id>
|
|
743
|
+
|
|
744
|
+
Get a single Zero Trust Gateway proxy endpoint.`).positional(`proxy-endpoint-id`,{type:`string`,description:`Proxy endpoint ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mm={command:`get <proxy-endpoint-id>`,describe:`Get a proxy endpoint`,builder:pm,handler:async t=>l({command:`zero-trust gateway proxy-endpoints get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway proxy-endpoints get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/proxy_endpoints/${t[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(t[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(t[`proxy-endpoint-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.proxyEndpoints.get({account_id:l,proxy_endpoint_id:t[`proxy-endpoint-id`]}));o(u,{successLabel:`Loaded`})})};function hm(e){return e.usage(`$0 zero-trust gateway proxy-endpoints list
|
|
745
|
+
|
|
746
|
+
List all Zero Trust Gateway proxy endpoints for an account.`).option(`filter`,{type:`string`,description:"Filter the returned proxy endpoints by one or more `field:value` pairs.\nRepeat the parameter to apply multiple filters; they are combined with\nlogical AND (an endpoint must satisfy every filter to be returned).\n\nSupported fields and their matching behaviour:\n * `name` — case-insensitive substring match on the endpoint name.\n * `id` — substring match on the endpoint ID (UUID), with or without dashes.\n * `kind` — exact match on the endpoint kind. The value must be `ip` or `identity`; any other value returns `400`.\n\nEach entry must match one of the per-field patterns below: the field\nmust be one of `name`, `id`, or `kind`; `name`/`id` accept any value,\nwhile `kind` only accepts `ip` or `identity`."}).option(`search`,{type:`string`,description:"Case-insensitive substring match on the endpoint name. When combined\nwith `filter`, both must match (logical AND)."}).option(`order-by`,{type:`string`,description:"Field to sort the returned endpoints by. When omitted, the order of\nresults is unspecified. Supported values:\n * `name` — sort alphabetically by endpoint name.\n * `created_at` — sort by creation time; defaults to descending unless `direction` is set.\n * `updated_at` — sort by last-modified time; defaults to descending unless `direction` is set.",choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:"Sort direction. Only takes effect when `order_by` is also provided; it\nis ignored otherwise. When `direction` is omitted the effective\ndirection is field-specific: `created_at` and `updated_at` default to\ndescending (newest first); `name` defaults to ascending.\n * `asc` — ascending.\n * `desc` — descending.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gm={command:`list`,describe:`List proxy endpoints`,builder:y(hm),handler:async t=>l({command:`zero-trust gateway proxy-endpoints list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},t,async()=>{let i={filter:t.filter,search:t.search,order_by:t[`order-by`],direction:t.direction};if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway proxy-endpoints list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/proxy_endpoints`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.gateway.proxyEndpoints.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},_m={command:`proxy-endpoints`,describe:`Operations for gateway.proxy-endpoints`,builder:e=>e.command(cm).command(um).command(fm).command(mm).command(gm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vm(e){return e.usage(`$0 zero-trust gateway rules bulk-edit
|
|
747
|
+
|
|
748
|
+
Update select fields of multiple Zero Trust Gateway rules in a single request. This is commonly used to reorder rules by updating their precedence values. Only the fields provided for each rule are updated.`).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 ym={command:`bulk-edit`,describe:`Patch multiple Zero Trust Gateway rules`,builder:vm,handler:async t=>l({command:`zero-trust gateway rules bulk-edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.rules.bulkEdit({body:e,account_id:l}));o(n,{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function bm(e){return e.usage(`$0 zero-trust gateway rules create
|
|
749
|
+
|
|
750
|
+
Create a new Zero Trust Gateway rule.`).option(`action`,{type:`string`,description:"Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to `true`.",choices:[`on`,`off`,`allow`,`block`,`scan`,`noscan`,`safesearch`,`ytrestricted`,`isolate`,`noisolate`,`override`,`l4_override`,`egress`,`resolve`,`quarantine`,`redirect`]}).option(`description`,{type:`string`,description:`Specify the rule description.`}).option(`device-posture`,{type:`string`,description:`Specify the wirefilter expression used for device posture check. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`,default:``}).option(`enabled`,{type:`boolean`,description:`Specify whether the rule is enabled.`,default:!1}).option(`expiration-duration`,{type:`number`,description:"Defines the default duration a policy active in minutes. Must set in order to use the `reset_expiration` endpoint on this rule."}).option(`filters`,{type:`string`,array:!0,description:`Specify the protocol or layer to evaluate the traffic, identity, and device posture expressions. Can only contain a single value.`}).option(`identity`,{type:`string`,description:`Specify the wirefilter expression used for identity matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`,default:``}).option(`name`,{type:`string`,description:`Specify the rule name.`}).option(`precedence`,{type:`number`,description:`Set the order of your rules. Lower values indicate higher precedence. At each processing phase, evaluate applicable rules in ascending order of this value. Refer to [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) to manage precedence via Terraform.`}).option(`rule-settings-allow-child-bypass`,{type:`boolean`,description:`Set to enable MSP children to bypass this rule. Only parent MSP accounts can set this. this rule. Settable for all types of rules.`}).option(`rule-settings-audit-ssh-command-logging`,{type:`boolean`,description:`Enable SSH command logging.`}).option(`rule-settings-biso-admin-controls-copy`,{type:`string`,description:`Configure copy behavior. If set to remote_only, users cannot copy isolated content from the remote browser to the local clipboard. If this field is absent, copying remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-dcp`,{type:`boolean`,description:'Set to false to enable copy-pasting. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-dd`,{type:`boolean`,description:'Set to false to enable downloading. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-dk`,{type:`boolean`,description:'Set to false to enable keyboard usage. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-download`,{type:`string`,description:`Configure download behavior. When set to remote_only, users can view downloads but cannot save them. If this field is absent, downloading remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-dp`,{type:`boolean`,description:'Set to false to enable printing. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-du`,{type:`boolean`,description:'Set to false to enable uploading. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-keyboard`,{type:`string`,description:`Configure keyboard usage behavior. If this field is absent, keyboard usage remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-paste`,{type:`string`,description:`Configure paste behavior. If set to remote_only, users cannot paste content from the local clipboard into isolated pages. If this field is absent, pasting remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-printing`,{type:`string`,description:`Configure print behavior. Default, Printing is enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-upload`,{type:`string`,description:`Configure upload behavior. If this field is absent, uploading remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-version`,{type:`string`,description:`Indicate which version of the browser isolation controls should apply.`,choices:[`v1`,`v2`]}).option(`rule-settings-biso-admin-controls-wm-id`,{type:`string`,description:`Specify the watermark ID (UUID) to apply to the isolated browser session. When present, enables watermark rendering in the isolated browser.`}).option(`rule-settings-block-page-include-context`,{type:`boolean`,description:`Specify whether to pass the context information as query parameters.`}).option(`rule-settings-block-page-target-uri`,{type:`string`,description:`Specify the URI to which the user is redirected.`}).option(`rule-settings-block-page-enabled`,{type:`boolean`,description:"Enable the custom block page. Settable only for `dns` rules with action `block`."}).option(`rule-settings-block-reason`,{type:`string`,description:"Explain why the rule blocks the request. The custom block page shows this text (if enabled). Settable only for `dns`, `l4`, and `http` rules when the action set to `block`."}).option(`rule-settings-bypass-parent-rule`,{type:`boolean`,description:`Set to enable MSP accounts to bypass their parent's rules. Only MSP child accounts can set this. Settable for all types of rules.`}).option(`rule-settings-check-session-duration`,{type:`string`,description:`Sets the required session freshness threshold. The API returns a normalized version of this value.`}).option(`rule-settings-check-session-enforce`,{type:`boolean`,description:`Enable session enforcement.`}).option(`rule-settings-delete-headers`,{type:`string`,array:!0,description:"Remove headers from allowed requests by name. A maximum of 20 header operations (add + set + delete) is allowed per policy. Each header name may not exceed 256 bytes. Settable only for `http` rules with the action set to `allow`."}).option(`rule-settings-egress-ipv4`,{type:`string`,description:`Specify the IPv4 address to use for egress.`}).option(`rule-settings-egress-ipv4-fallback`,{type:`string`,description:`Specify the fallback IPv4 address to use for egress when the primary IPv4 fails. Set '0.0.0.0' to indicate local egress via WARP IPs.`}).option(`rule-settings-egress-ipv6`,{type:`string`,description:`Specify the IPv6 range to use for egress.`}).option(`rule-settings-forensic-copy-enabled`,{type:`boolean`,description:`Enable sending the copy to storage.`}).option(`rule-settings-ignore-cname-category-matches`,{type:`boolean`,description:"Ignore category matches at CNAME domains in a response. When off, evaluate categories in this rule against all CNAME domain categories in the response. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-insecure-disable-dnssec-validation`,{type:`boolean`,description:"Specify whether to disable DNSSEC validation (for Allow actions) [INSECURE]. Settable only for `dns` rules."}).option(`rule-settings-ip-categories`,{type:`boolean`,description:"Enable IPs in DNS resolver category blocks. The system blocks only domain name categories unless you enable this setting. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-ip-indicator-feeds`,{type:`boolean`,description:"Indicates whether to include IPs in DNS resolver indicator feed blocks. Default, indicator feeds block only domain names. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-l4override-ip`,{type:`string`,description:`Defines the IPv4 or IPv6 address.`}).option(`rule-settings-l4override-port`,{type:`number`,description:`Defines a port number to use for TCP/UDP overrides.`}).option(`rule-settings-notification-settings-enabled`,{type:`boolean`,description:`Enable notification.`}).option(`rule-settings-notification-settings-include-context`,{type:`boolean`,description:`Indicates whether to pass the context information as query parameters.`}).option(`rule-settings-notification-settings-msg`,{type:`string`,description:`Customize the message shown in the notification.`}).option(`rule-settings-notification-settings-support-url`,{type:`string`,description:`Defines an optional URL to direct users to additional information. If unset, the notification opens a block page.`}).option(`rule-settings-override-host`,{type:`string`,description:"Defines a hostname for override, for the matching DNS queries. Settable only for `dns` rules with the action set to `override`."}).option(`rule-settings-override-ips`,{type:`string`,array:!0,description:"Defines a an IP or set of IPs for overriding matched DNS queries. Settable only for `dns` rules with the action set to `override`."}).option(`rule-settings-payload-log-enabled`,{type:`boolean`,description:`Enable DLP payload logging for this rule.`}).option(`rule-settings-quarantine-file-types`,{type:`string`,array:!0,description:`Specify the types of files to sandbox.`}).option(`rule-settings-redirect-include-context`,{type:`boolean`,description:`Specify whether to pass the context information as query parameters.`}).option(`rule-settings-redirect-preserve-path-and-query`,{type:`boolean`,description:`Specify whether to append the path and query parameters from the original request to target_uri.`}).option(`rule-settings-redirect-target-uri`,{type:`string`,description:`Specify the URI to which the user is redirected.`}).option(`rule-settings-resolve-dns-internally-fallback`,{type:`string`,description:`Specify the fallback behavior to apply when the internal DNS response code differs from 'NOERROR' or when the response data contains only CNAME records for 'A' or 'AAAA' queries.`,choices:[`none`,`public_dns`]}).option(`rule-settings-resolve-dns-internally-view-id`,{type:`string`,description:`Specify the internal DNS view identifier to pass to the internal DNS service.`}).option(`rule-settings-resolve-dns-through-cloudflare`,{type:`boolean`,description:"Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS resolver. Cannot set when 'dns_resolvers' specified or 'resolve_dns_internally' is set. Only valid when a rule's action set to 'resolve'. Settable only for `dns_resolver` rules."}).option(`rule-settings-untrusted-cert-action`,{type:`string`,description:`Defines the action performed when an untrusted certificate seen. The default action an error with HTTP code 526.`,choices:[`pass_through`,`block`,`error`]}).option(`schedule-fri`,{type:`string`,description:`Specify the time intervals when the rule is active on Fridays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Fridays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-mon`,{type:`string`,description:`Specify the time intervals when the rule is active on Mondays, in the increasing order from 00:00-24:00(capped at maximum of 6 time splits). If this parameter omitted, the rule is deactivated on Mondays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sat`,{type:`string`,description:`Specify the time intervals when the rule is active on Saturdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Saturdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sun`,{type:`string`,description:`Specify the time intervals when the rule is active on Sundays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Sundays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-thu`,{type:`string`,description:`Specify the time intervals when the rule is active on Thursdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Thursdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-time-zone`,{type:`string`,description:`Specify the time zone for rule evaluation. When a [valid time zone city name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) is provided, Gateway always uses the current time for that time zone. When this parameter is omitted, Gateway uses the time zone determined from the user's IP address. Colo time zone is used when the user's IP address does not resolve to a location.`}).option(`schedule-tue`,{type:`string`,description:`Specify the time intervals when the rule is active on Tuesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Tuesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-wed`,{type:`string`,description:`Specify the time intervals when the rule is active on Wednesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Wednesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`traffic`,{type:`string`,description:`Specify the wirefilter expression used for traffic matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`,default:``}).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)`}).check(e=>{if((/* @__PURE__ */ `rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-biso-admin-controls-wm-id.rule-settings-block-page-include-context.rule-settings-block-page-target-uri.rule-settings-block-page-enabled.rule-settings-block-reason.rule-settings-bypass-parent-rule.rule-settings-check-session-duration.rule-settings-check-session-enforce.rule-settings-delete-headers.rule-settings-egress-ipv4.rule-settings-egress-ipv4-fallback.rule-settings-egress-ipv6.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-l4override-ip.rule-settings-l4override-port.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-notification-settings-msg.rule-settings-notification-settings-support-url.rule-settings-override-host.rule-settings-override-ips.rule-settings-payload-log-enabled.rule-settings-quarantine-file-types.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-redirect-target-uri.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-internally-view-id.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action`.split(`.`)).some(t=>e[t]!==void 0)){let t=[`rule-settings-block-page-target-uri`,`rule-settings-redirect-target-uri`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --rule_settings-* flag is set`)}return!0})}const xm={command:`create`,describe:`Create a Zero Trust Gateway rule`,builder:bm,handler:async t=>l({command:`zero-trust gateway rules create`,classification:{safeFlags:/* @__PURE__ */ `action.enabled.rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-block-page-include-context.rule-settings-block-page-enabled.rule-settings-bypass-parent-rule.rule-settings-check-session-enforce.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-payload-log-enabled.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action.dry-run`.split(`.`)}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({action:m(t.action,`action`,`text`),description:m(t.description,`description`,`text`),device_posture:m(t[`device-posture`],`device-posture`,`text`),enabled:t.enabled,expiration:{duration:t[`expiration-duration`]},filters:t.filters,identity:m(t.identity,`identity`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,rule_settings:{allow_child_bypass:t[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:t[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(t[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:t[`rule-settings-biso-admin-controls-dcp`],dd:t[`rule-settings-biso-admin-controls-dd`],dk:t[`rule-settings-biso-admin-controls-dk`],download:m(t[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:t[`rule-settings-biso-admin-controls-dp`],du:t[`rule-settings-biso-admin-controls-du`],keyboard:m(t[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(t[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(t[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(t[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(t[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(t[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:t[`rule-settings-block-page-include-context`],target_uri:m(t[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:t[`rule-settings-block-page-enabled`],block_reason:m(t[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:t[`rule-settings-bypass-parent-rule`],check_session:{duration:m(t[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:t[`rule-settings-check-session-enforce`]},delete_headers:t[`rule-settings-delete-headers`],egress:{ipv4:m(t[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(t[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(t[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:t[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:t[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:t[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:t[`rule-settings-ip-categories`],ip_indicator_feeds:t[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(t[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:t[`rule-settings-l4override-port`]},notification_settings:{enabled:t[`rule-settings-notification-settings-enabled`],include_context:t[`rule-settings-notification-settings-include-context`],msg:m(t[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(t[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(t[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:t[`rule-settings-override-ips`],payload_log:{enabled:t[`rule-settings-payload-log-enabled`]},quarantine:{file_types:t[`rule-settings-quarantine-file-types`]},redirect:{include_context:t[`rule-settings-redirect-include-context`],preserve_path_and_query:t[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(t[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(t[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(t[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:t[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(t[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(t[`schedule-fri`],`schedule-fri`,`text`),mon:m(t[`schedule-mon`],`schedule-mon`,`text`),sat:m(t[`schedule-sat`],`schedule-sat`,`text`),sun:m(t[`schedule-sun`],`schedule-sun`,`text`),thu:m(t[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(t[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(t[`schedule-tue`],`schedule-tue`,`text`),wed:m(t[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(t.traffic,`traffic`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.gateway.rules.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.action===void 0&&(t.action=await _(`action`,"Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to `true`.",[`on`,`off`,`allow`,`block`,`scan`,`noscan`,`safesearch`,`ytrestricted`,`isolate`,`noisolate`,`override`,`l4_override`,`egress`,`resolve`,`quarantine`,`redirect`])),t.name===void 0&&(t.name=await g(`name`,`Specify the rule name.`));let u=p({action:m(t.action,`action`,`text`),description:m(t.description,`description`,`text`),device_posture:m(t[`device-posture`],`device-posture`,`text`),enabled:t.enabled,expiration:{duration:t[`expiration-duration`]},filters:t.filters,identity:m(t.identity,`identity`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,rule_settings:{allow_child_bypass:t[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:t[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(t[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:t[`rule-settings-biso-admin-controls-dcp`],dd:t[`rule-settings-biso-admin-controls-dd`],dk:t[`rule-settings-biso-admin-controls-dk`],download:m(t[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:t[`rule-settings-biso-admin-controls-dp`],du:t[`rule-settings-biso-admin-controls-du`],keyboard:m(t[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(t[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(t[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(t[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(t[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(t[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:t[`rule-settings-block-page-include-context`],target_uri:m(t[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:t[`rule-settings-block-page-enabled`],block_reason:m(t[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:t[`rule-settings-bypass-parent-rule`],check_session:{duration:m(t[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:t[`rule-settings-check-session-enforce`]},delete_headers:t[`rule-settings-delete-headers`],egress:{ipv4:m(t[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(t[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(t[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:t[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:t[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:t[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:t[`rule-settings-ip-categories`],ip_indicator_feeds:t[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(t[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:t[`rule-settings-l4override-port`]},notification_settings:{enabled:t[`rule-settings-notification-settings-enabled`],include_context:t[`rule-settings-notification-settings-include-context`],msg:m(t[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(t[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(t[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:t[`rule-settings-override-ips`],payload_log:{enabled:t[`rule-settings-payload-log-enabled`]},quarantine:{file_types:t[`rule-settings-quarantine-file-types`]},redirect:{include_context:t[`rule-settings-redirect-include-context`],preserve_path_and_query:t[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(t[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(t[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(t[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:t[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(t[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(t[`schedule-fri`],`schedule-fri`,`text`),mon:m(t[`schedule-mon`],`schedule-mon`,`text`),sat:m(t[`schedule-sat`],`schedule-sat`,`text`),sun:m(t[`schedule-sun`],`schedule-sun`,`text`),thu:m(t[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(t[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(t[`schedule-tue`],`schedule-tue`,`text`),wed:m(t[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(t.traffic,`traffic`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.gateway.rules.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Sm(e){return e.usage(`$0 zero-trust gateway rules delete <rule-id>
|
|
751
|
+
|
|
752
|
+
Delete a Zero Trust Gateway rule.`).positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,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 Cm={command:`delete <rule-id>`,describe:`Delete a Zero Trust Gateway rule`,builder:Sm,handler:async t=>l({command:`zero-trust gateway rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
753
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.gateway.rules.delete({account_id:l,rule_id:t[`rule-id`]}));o(u,{successLabel:`Deleted`})})};function wm(e){return e.usage("$0 zero-trust gateway rules edit <rule-id>\n\nUpdate select fields of an existing Zero Trust Gateway rule. Only the fields provided in the request body are updated. This endpoint supports a limited subset of fields (`name`, `description`, `precedence`, `enabled`). To update other fields such as `action`, `traffic`, `identity`, `device_posture`, `rule_settings`, `schedule`, or `expiration`, use the PUT endpoint for a full rule replacement.").positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`description`,{type:`string`,description:`Specify the rule description.`}).option(`enabled`,{type:`boolean`,description:`Specify whether the rule is enabled.`}).option(`name`,{type:`string`,description:`Specify the rule name.`}).option(`precedence`,{type:`number`,description:`Set the order of your rules. Lower values indicate higher precedence. At each processing phase, evaluate applicable rules in ascending order of this value. Refer to [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) to manage precedence via Terraform.`}).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 Tm={command:`edit <rule-id>`,describe:`Patch a Zero Trust Gateway rule`,builder:wm,handler:async t=>l({command:`zero-trust gateway rules edit`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),precedence:t.precedence}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.rules.edit({...e,account_id:l,rule_id:t[`rule-id`]}));o(n,{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),precedence:t.precedence}),f=await c(`Updating`,async()=>i.zeroTrust.gateway.rules.edit({...u,account_id:l,rule_id:t[`rule-id`]}));o(f,{successLabel:`Updated`})})};function Em(e){return e.usage(`$0 zero-trust gateway rules get <rule-id>
|
|
754
|
+
|
|
755
|
+
Get a single Zero Trust Gateway rule.`).positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Dm={command:`get <rule-id>`,describe:`Get Zero Trust Gateway rule details.`,builder:Em,handler:async t=>l({command:`zero-trust gateway rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.rules.get({account_id:l,rule_id:t[`rule-id`]}));o(u,{successLabel:`Loaded`})})};function Om(e){return e.usage(`$0 zero-trust gateway rules list-tenant
|
|
756
|
+
|
|
757
|
+
List Zero Trust Gateway rules for the parent account of an account in the MSP configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const km={command:`list-tenant`,describe:`List Zero Trust Gateway rules inherited from the parent account`,builder:Om,handler:async t=>l({command:`zero-trust gateway rules list-tenant`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway rules list-tenant`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules/tenant`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.gateway.rules.listTenant({account_id:l}));o(u,{successLabel:`Loaded`})})};function Am(e){return e.usage(`$0 zero-trust gateway rules list
|
|
758
|
+
|
|
759
|
+
List Zero Trust Gateway rules for an account.`).option(`filter`,{type:`string`,description:"Filter the returned rules by one or more `field:value` pairs. Repeat the\nparameter to combine filters with logical AND.\n\nSupported fields are `name`, `id`, `action`, `enabled`, `source_account`,\n`is_shared`, `filters`, and `expression` (max 1024 bytes). The `source_account`\nvalue is matched as a normalized UUID substring. The `filters` value must\nbe one of the rule filter names and matches a member of the rule's `filters`\narray. The `expression` filter performs a case-insensitive literal\nsubstring match across traffic, identity, and device posture expressions."}).option(`search`,{type:`string`,description:`Case-insensitive substring search across rule name and description.`}).option(`order-by`,{type:`string`,description:"Field to sort the returned rules by. Supported values are `name`,\n`created_at`, `updated_at`, and `precedence`.",choices:[`name`,`created_at`,`updated_at`,`precedence`]}).option(`direction`,{type:`string`,description:"Sort direction. When `order_by` is omitted, this controls the direction\nof the existing precedence ordering. Shared rules remain first in either\ndirection. Accepted values are `asc` and `desc`.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jm={command:`list`,describe:`List Zero Trust Gateway rules`,builder:y(Am),handler:async t=>l({command:`zero-trust gateway rules list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},t,async()=>{let i={filter:t.filter,search:t.search,order_by:t[`order-by`],direction:t.direction};if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.gateway.rules.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function Mm(e){return e.usage("$0 zero-trust gateway rules reset-expiration <rule-id>\n\nResets the expiration of a Zero Trust Gateway Rule if its duration elapsed and it has a default duration. The Zero Trust Gateway Rule must have values for both `expiration.expires_at` and `expiration.duration`.").positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Nm={command:`reset-expiration <rule-id>`,describe:`Reset the expiration of a Zero Trust Gateway Rule`,builder:Mm,handler:async t=>l({command:`zero-trust gateway rules reset-expiration`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway rules reset-expiration`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}/reset_expiration`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.gateway.rules.resetExpiration({account_id:l,rule_id:t[`rule-id`]}));o(u,{successLabel:`Created`})})};function Pm(e){return e.usage(`$0 zero-trust gateway rules update <rule-id>
|
|
760
|
+
|
|
761
|
+
Update a configured Zero Trust Gateway rule.`).positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`action`,{type:`string`,description:"Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to `true`.",choices:[`on`,`off`,`allow`,`block`,`scan`,`noscan`,`safesearch`,`ytrestricted`,`isolate`,`noisolate`,`override`,`l4_override`,`egress`,`resolve`,`quarantine`,`redirect`]}).option(`description`,{type:`string`,description:`Specify the rule description.`}).option(`device-posture`,{type:`string`,description:`Specify the wirefilter expression used for device posture check. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`}).option(`enabled`,{type:`boolean`,description:`Specify whether the rule is enabled.`}).option(`expiration-duration`,{type:`number`,description:"Defines the default duration a policy active in minutes. Must set in order to use the `reset_expiration` endpoint on this rule."}).option(`filters`,{type:`string`,array:!0,description:`Specify the protocol or layer to evaluate the traffic, identity, and device posture expressions. Can only contain a single value.`}).option(`identity`,{type:`string`,description:`Specify the wirefilter expression used for identity matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`}).option(`name`,{type:`string`,description:`Specify the rule name.`}).option(`precedence`,{type:`number`,description:`Set the order of your rules. Lower values indicate higher precedence. At each processing phase, evaluate applicable rules in ascending order of this value. Refer to [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) to manage precedence via Terraform.`}).option(`rule-settings-allow-child-bypass`,{type:`boolean`,description:`Set to enable MSP children to bypass this rule. Only parent MSP accounts can set this. this rule. Settable for all types of rules.`}).option(`rule-settings-audit-ssh-command-logging`,{type:`boolean`,description:`Enable SSH command logging.`}).option(`rule-settings-biso-admin-controls-copy`,{type:`string`,description:`Configure copy behavior. If set to remote_only, users cannot copy isolated content from the remote browser to the local clipboard. If this field is absent, copying remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-dcp`,{type:`boolean`,description:'Set to false to enable copy-pasting. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-dd`,{type:`boolean`,description:'Set to false to enable downloading. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-dk`,{type:`boolean`,description:'Set to false to enable keyboard usage. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-download`,{type:`string`,description:`Configure download behavior. When set to remote_only, users can view downloads but cannot save them. If this field is absent, downloading remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-dp`,{type:`boolean`,description:'Set to false to enable printing. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-du`,{type:`boolean`,description:'Set to false to enable uploading. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-keyboard`,{type:`string`,description:`Configure keyboard usage behavior. If this field is absent, keyboard usage remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-paste`,{type:`string`,description:`Configure paste behavior. If set to remote_only, users cannot paste content from the local clipboard into isolated pages. If this field is absent, pasting remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-printing`,{type:`string`,description:`Configure print behavior. Default, Printing is enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-upload`,{type:`string`,description:`Configure upload behavior. If this field is absent, uploading remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-version`,{type:`string`,description:`Indicate which version of the browser isolation controls should apply.`,choices:[`v1`,`v2`]}).option(`rule-settings-biso-admin-controls-wm-id`,{type:`string`,description:`Specify the watermark ID (UUID) to apply to the isolated browser session. When present, enables watermark rendering in the isolated browser.`}).option(`rule-settings-block-page-include-context`,{type:`boolean`,description:`Specify whether to pass the context information as query parameters.`}).option(`rule-settings-block-page-target-uri`,{type:`string`,description:`Specify the URI to which the user is redirected.`}).option(`rule-settings-block-page-enabled`,{type:`boolean`,description:"Enable the custom block page. Settable only for `dns` rules with action `block`."}).option(`rule-settings-block-reason`,{type:`string`,description:"Explain why the rule blocks the request. The custom block page shows this text (if enabled). Settable only for `dns`, `l4`, and `http` rules when the action set to `block`."}).option(`rule-settings-bypass-parent-rule`,{type:`boolean`,description:`Set to enable MSP accounts to bypass their parent's rules. Only MSP child accounts can set this. Settable for all types of rules.`}).option(`rule-settings-check-session-duration`,{type:`string`,description:`Sets the required session freshness threshold. The API returns a normalized version of this value.`}).option(`rule-settings-check-session-enforce`,{type:`boolean`,description:`Enable session enforcement.`}).option(`rule-settings-delete-headers`,{type:`string`,array:!0,description:"Remove headers from allowed requests by name. A maximum of 20 header operations (add + set + delete) is allowed per policy. Each header name may not exceed 256 bytes. Settable only for `http` rules with the action set to `allow`."}).option(`rule-settings-egress-ipv4`,{type:`string`,description:`Specify the IPv4 address to use for egress.`}).option(`rule-settings-egress-ipv4-fallback`,{type:`string`,description:`Specify the fallback IPv4 address to use for egress when the primary IPv4 fails. Set '0.0.0.0' to indicate local egress via WARP IPs.`}).option(`rule-settings-egress-ipv6`,{type:`string`,description:`Specify the IPv6 range to use for egress.`}).option(`rule-settings-forensic-copy-enabled`,{type:`boolean`,description:`Enable sending the copy to storage.`}).option(`rule-settings-ignore-cname-category-matches`,{type:`boolean`,description:"Ignore category matches at CNAME domains in a response. When off, evaluate categories in this rule against all CNAME domain categories in the response. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-insecure-disable-dnssec-validation`,{type:`boolean`,description:"Specify whether to disable DNSSEC validation (for Allow actions) [INSECURE]. Settable only for `dns` rules."}).option(`rule-settings-ip-categories`,{type:`boolean`,description:"Enable IPs in DNS resolver category blocks. The system blocks only domain name categories unless you enable this setting. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-ip-indicator-feeds`,{type:`boolean`,description:"Indicates whether to include IPs in DNS resolver indicator feed blocks. Default, indicator feeds block only domain names. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-l4override-ip`,{type:`string`,description:`Defines the IPv4 or IPv6 address.`}).option(`rule-settings-l4override-port`,{type:`number`,description:`Defines a port number to use for TCP/UDP overrides.`}).option(`rule-settings-notification-settings-enabled`,{type:`boolean`,description:`Enable notification.`}).option(`rule-settings-notification-settings-include-context`,{type:`boolean`,description:`Indicates whether to pass the context information as query parameters.`}).option(`rule-settings-notification-settings-msg`,{type:`string`,description:`Customize the message shown in the notification.`}).option(`rule-settings-notification-settings-support-url`,{type:`string`,description:`Defines an optional URL to direct users to additional information. If unset, the notification opens a block page.`}).option(`rule-settings-override-host`,{type:`string`,description:"Defines a hostname for override, for the matching DNS queries. Settable only for `dns` rules with the action set to `override`."}).option(`rule-settings-override-ips`,{type:`string`,array:!0,description:"Defines a an IP or set of IPs for overriding matched DNS queries. Settable only for `dns` rules with the action set to `override`."}).option(`rule-settings-payload-log-enabled`,{type:`boolean`,description:`Enable DLP payload logging for this rule.`}).option(`rule-settings-quarantine-file-types`,{type:`string`,array:!0,description:`Specify the types of files to sandbox.`}).option(`rule-settings-redirect-include-context`,{type:`boolean`,description:`Specify whether to pass the context information as query parameters.`}).option(`rule-settings-redirect-preserve-path-and-query`,{type:`boolean`,description:`Specify whether to append the path and query parameters from the original request to target_uri.`}).option(`rule-settings-redirect-target-uri`,{type:`string`,description:`Specify the URI to which the user is redirected.`}).option(`rule-settings-resolve-dns-internally-fallback`,{type:`string`,description:`Specify the fallback behavior to apply when the internal DNS response code differs from 'NOERROR' or when the response data contains only CNAME records for 'A' or 'AAAA' queries.`,choices:[`none`,`public_dns`]}).option(`rule-settings-resolve-dns-internally-view-id`,{type:`string`,description:`Specify the internal DNS view identifier to pass to the internal DNS service.`}).option(`rule-settings-resolve-dns-through-cloudflare`,{type:`boolean`,description:"Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS resolver. Cannot set when 'dns_resolvers' specified or 'resolve_dns_internally' is set. Only valid when a rule's action set to 'resolve'. Settable only for `dns_resolver` rules."}).option(`rule-settings-untrusted-cert-action`,{type:`string`,description:`Defines the action performed when an untrusted certificate seen. The default action an error with HTTP code 526.`,choices:[`pass_through`,`block`,`error`]}).option(`schedule-fri`,{type:`string`,description:`Specify the time intervals when the rule is active on Fridays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Fridays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-mon`,{type:`string`,description:`Specify the time intervals when the rule is active on Mondays, in the increasing order from 00:00-24:00(capped at maximum of 6 time splits). If this parameter omitted, the rule is deactivated on Mondays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sat`,{type:`string`,description:`Specify the time intervals when the rule is active on Saturdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Saturdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sun`,{type:`string`,description:`Specify the time intervals when the rule is active on Sundays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Sundays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-thu`,{type:`string`,description:`Specify the time intervals when the rule is active on Thursdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Thursdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-time-zone`,{type:`string`,description:`Specify the time zone for rule evaluation. When a [valid time zone city name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) is provided, Gateway always uses the current time for that time zone. When this parameter is omitted, Gateway uses the time zone determined from the user's IP address. Colo time zone is used when the user's IP address does not resolve to a location.`}).option(`schedule-tue`,{type:`string`,description:`Specify the time intervals when the rule is active on Tuesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Tuesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-wed`,{type:`string`,description:`Specify the time intervals when the rule is active on Wednesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Wednesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`traffic`,{type:`string`,description:`Specify the wirefilter expression used for traffic matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`}).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)`}).check(e=>{if((/* @__PURE__ */ `rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-biso-admin-controls-wm-id.rule-settings-block-page-include-context.rule-settings-block-page-target-uri.rule-settings-block-page-enabled.rule-settings-block-reason.rule-settings-bypass-parent-rule.rule-settings-check-session-duration.rule-settings-check-session-enforce.rule-settings-delete-headers.rule-settings-egress-ipv4.rule-settings-egress-ipv4-fallback.rule-settings-egress-ipv6.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-l4override-ip.rule-settings-l4override-port.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-notification-settings-msg.rule-settings-notification-settings-support-url.rule-settings-override-host.rule-settings-override-ips.rule-settings-payload-log-enabled.rule-settings-quarantine-file-types.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-redirect-target-uri.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-internally-view-id.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action`.split(`.`)).some(t=>e[t]!==void 0)){let t=[`rule-settings-block-page-target-uri`,`rule-settings-redirect-target-uri`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --rule_settings-* flag is set`)}return!0})}const Fm={command:`update <rule-id>`,describe:`Update a Zero Trust Gateway rule`,builder:Pm,handler:async t=>l({command:`zero-trust gateway rules update`,classification:{safeFlags:/* @__PURE__ */ `action.enabled.rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-block-page-include-context.rule-settings-block-page-enabled.rule-settings-bypass-parent-rule.rule-settings-check-session-enforce.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-payload-log-enabled.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action.dry-run`.split(`.`)}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust gateway rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules/${t[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(t[`rule-id`]))}`,pathParams:{"rule-id":String(t[`rule-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({action:m(t.action,`action`,`text`),description:m(t.description,`description`,`text`),device_posture:m(t[`device-posture`],`device-posture`,`text`),enabled:t.enabled,expiration:{duration:t[`expiration-duration`]},filters:t.filters,identity:m(t.identity,`identity`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,rule_settings:{allow_child_bypass:t[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:t[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(t[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:t[`rule-settings-biso-admin-controls-dcp`],dd:t[`rule-settings-biso-admin-controls-dd`],dk:t[`rule-settings-biso-admin-controls-dk`],download:m(t[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:t[`rule-settings-biso-admin-controls-dp`],du:t[`rule-settings-biso-admin-controls-du`],keyboard:m(t[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(t[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(t[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(t[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(t[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(t[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:t[`rule-settings-block-page-include-context`],target_uri:m(t[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:t[`rule-settings-block-page-enabled`],block_reason:m(t[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:t[`rule-settings-bypass-parent-rule`],check_session:{duration:m(t[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:t[`rule-settings-check-session-enforce`]},delete_headers:t[`rule-settings-delete-headers`],egress:{ipv4:m(t[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(t[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(t[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:t[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:t[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:t[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:t[`rule-settings-ip-categories`],ip_indicator_feeds:t[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(t[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:t[`rule-settings-l4override-port`]},notification_settings:{enabled:t[`rule-settings-notification-settings-enabled`],include_context:t[`rule-settings-notification-settings-include-context`],msg:m(t[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(t[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(t[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:t[`rule-settings-override-ips`],payload_log:{enabled:t[`rule-settings-payload-log-enabled`]},quarantine:{file_types:t[`rule-settings-quarantine-file-types`]},redirect:{include_context:t[`rule-settings-redirect-include-context`],preserve_path_and_query:t[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(t[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(t[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(t[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:t[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(t[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(t[`schedule-fri`],`schedule-fri`,`text`),mon:m(t[`schedule-mon`],`schedule-mon`,`text`),sat:m(t[`schedule-sat`],`schedule-sat`,`text`),sun:m(t[`schedule-sun`],`schedule-sun`,`text`),thu:m(t[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(t[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(t[`schedule-tue`],`schedule-tue`,`text`),wed:m(t[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(t.traffic,`traffic`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.gateway.rules.update({...e,account_id:l,rule_id:t[`rule-id`]}));o(n,{successLabel:`Updated`});return}t.action===void 0&&(t.action=await _(`action`,"Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to `true`.",[`on`,`off`,`allow`,`block`,`scan`,`noscan`,`safesearch`,`ytrestricted`,`isolate`,`noisolate`,`override`,`l4_override`,`egress`,`resolve`,`quarantine`,`redirect`])),t.name===void 0&&(t.name=await g(`name`,`Specify the rule name.`));let u=p({action:m(t.action,`action`,`text`),description:m(t.description,`description`,`text`),device_posture:m(t[`device-posture`],`device-posture`,`text`),enabled:t.enabled,expiration:{duration:t[`expiration-duration`]},filters:t.filters,identity:m(t.identity,`identity`,`text`),name:m(t.name,`name`,`text`),precedence:t.precedence,rule_settings:{allow_child_bypass:t[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:t[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(t[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:t[`rule-settings-biso-admin-controls-dcp`],dd:t[`rule-settings-biso-admin-controls-dd`],dk:t[`rule-settings-biso-admin-controls-dk`],download:m(t[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:t[`rule-settings-biso-admin-controls-dp`],du:t[`rule-settings-biso-admin-controls-du`],keyboard:m(t[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(t[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(t[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(t[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(t[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(t[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:t[`rule-settings-block-page-include-context`],target_uri:m(t[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:t[`rule-settings-block-page-enabled`],block_reason:m(t[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:t[`rule-settings-bypass-parent-rule`],check_session:{duration:m(t[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:t[`rule-settings-check-session-enforce`]},delete_headers:t[`rule-settings-delete-headers`],egress:{ipv4:m(t[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(t[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(t[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:t[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:t[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:t[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:t[`rule-settings-ip-categories`],ip_indicator_feeds:t[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(t[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:t[`rule-settings-l4override-port`]},notification_settings:{enabled:t[`rule-settings-notification-settings-enabled`],include_context:t[`rule-settings-notification-settings-include-context`],msg:m(t[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(t[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(t[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:t[`rule-settings-override-ips`],payload_log:{enabled:t[`rule-settings-payload-log-enabled`]},quarantine:{file_types:t[`rule-settings-quarantine-file-types`]},redirect:{include_context:t[`rule-settings-redirect-include-context`],preserve_path_and_query:t[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(t[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(t[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(t[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:t[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(t[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(t[`schedule-fri`],`schedule-fri`,`text`),mon:m(t[`schedule-mon`],`schedule-mon`,`text`),sat:m(t[`schedule-sat`],`schedule-sat`,`text`),sun:m(t[`schedule-sun`],`schedule-sun`,`text`),thu:m(t[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(t[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(t[`schedule-tue`],`schedule-tue`,`text`),wed:m(t[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(t.traffic,`traffic`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.gateway.rules.update({...u,account_id:l,rule_id:t[`rule-id`]}));o(f,{successLabel:`Updated`})})},Im={command:`rules`,describe:`Operations for gateway.rules`,builder:e=>e.command(ym).command(xm).command(Cm).command(Tm).command(Dm).command(jm).command(km).command(Nm).command(Fm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Lm={command:`gateway`,describe:`Operations for gateway`,builder:e=>e.command(np).command(up).command(jf).command(Pf).command(qf).command(ep).command(ap).command(cp).command(Op).command(zp).command(Wp).command(Yp).command(om).command(_m).command(Im).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Rm(e){return e.usage(`$0 zero-trust identity-providers create
|
|
762
|
+
|
|
763
|
+
Adds a new identity provider to Access.`).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 zm={command:`create`,describe:`Add an Access identity provider`,builder:Rm,handler:async t=>l({command:`zero-trust identity-providers create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/identity_providers`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Creating`,async()=>l.zeroTrust.identityProviders.create({body:e,account_or_zone:u,account_or_zone_id:f}));o(n,{successLabel:`Created`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Bm(e){return e.usage(`$0 zero-trust identity-providers delete <identity-provider-id>
|
|
764
|
+
|
|
765
|
+
Deletes an identity provider from Access.`).positional(`identity-provider-id`,{type:`string`,description:`UUID.`,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 Vm={command:`delete <identity-provider-id>`,describe:`Delete an Access identity provider`,builder:Bm,handler:async t=>l({command:`zero-trust identity-providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/identity_providers/${t[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(t[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(n),"identity-provider-id":String(t[`identity-provider-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=d:t.accountId=d,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
766
|
+
`);return}let f=await c(`Deleting`,async()=>l.zeroTrust.identityProviders.delete({account_or_zone:u,account_or_zone_id:d,identity_provider_id:t[`identity-provider-id`]}));o(f,{successLabel:`Deleted`})})};function Hm(e){return e.usage(`$0 zero-trust identity-providers federation-grants create
|
|
767
|
+
|
|
768
|
+
Creates an IdP federation grant for the specified identity provider, making it available for federation to other accounts in the same Cloudflare organization. The account must belong to a Cloudflare organization. One-time pin and Cloudflare-managed identity providers cannot be federated. An account can federate at most five identity providers at a time.`).option(`idp-id`,{type:`string`,description:`UID of the identity provider to federate. Must be an existing identity provider in this account. One-time pin and Cloudflare-managed identity providers cannot be federated.`}).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 Um={command:`create`,describe:`Create an IdP federation grant`,builder:Hm,handler:async t=>l({command:`zero-trust identity-providers federation-grants create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers federation-grants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/idp_federation_grants`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({idp_id:m(t[`idp-id`],`idp-id`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.identityProviders.federationGrants.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t[`idp-id`]===void 0&&(t[`idp-id`]=await g(`idp-id`,`UID of the identity provider to federate. Must be an existing identity provider in this account. One-time pin and Cloudflare-managed identity providers cannot be federated.`));let u=p({idp_id:m(t[`idp-id`],`idp-id`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.identityProviders.federationGrants.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Wm(e){return e.usage(`$0 zero-trust identity-providers federation-grants delete <grant-id>
|
|
769
|
+
|
|
770
|
+
Deletes an IdP federation grant. The identity provider remains in the account, but it is no longer available for federation to other accounts.`).positional(`grant-id`,{type:`string`,description:`UID of the IdP federation grant.`,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 Gm={command:`delete <grant-id>`,describe:`Delete an IdP federation grant`,builder:Wm,handler:async t=>l({command:`zero-trust identity-providers federation-grants delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers federation-grants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/idp_federation_grants/${t[`grant-id`]==null?`<grant-id>`:encodeURIComponent(String(t[`grant-id`]))}`,pathParams:{"grant-id":String(t[`grant-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
771
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.identityProviders.federationGrants.delete({account_id:l,grant_id:t[`grant-id`]}));o(u,{successLabel:`Deleted`})})};function Km(e){return e.usage(`$0 zero-trust identity-providers federation-grants get <grant-id>
|
|
772
|
+
|
|
773
|
+
Retrieves a single IdP federation grant by its UID.`).positional(`grant-id`,{type:`string`,description:`UID of the IdP federation grant.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qm={command:`get <grant-id>`,describe:`Get an IdP federation grant`,builder:Km,handler:async t=>l({command:`zero-trust identity-providers federation-grants get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers federation-grants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/idp_federation_grants/${t[`grant-id`]==null?`<grant-id>`:encodeURIComponent(String(t[`grant-id`]))}`,pathParams:{"grant-id":String(t[`grant-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.identityProviders.federationGrants.get({account_id:l,grant_id:t[`grant-id`]}));o(u,{successLabel:`Loaded`})})};function Jm(e){return e.usage(`$0 zero-trust identity-providers federation-grants list
|
|
774
|
+
|
|
775
|
+
Lists the IdP federation grants owned by the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ym={command:`list`,describe:`List IdP federation grants`,builder:Jm,handler:async t=>l({command:`zero-trust identity-providers federation-grants list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers federation-grants list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/idp_federation_grants`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.identityProviders.federationGrants.list({account_id:l}));o(u,{successLabel:`Loaded`})})},Xm={command:`federation-grants`,describe:`Operations for identity-providers.federation-grants`,builder:e=>e.command(Um).command(Gm).command(qm).command(Ym).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Zm(e){return e.usage(`$0 zero-trust identity-providers get <identity-provider-id>
|
|
776
|
+
|
|
777
|
+
Fetches a configured identity provider.`).positional(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Qm={command:`get <identity-provider-id>`,describe:`Get an Access identity provider`,builder:Zm,handler:async t=>l({command:`zero-trust identity-providers get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/identity_providers/${t[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(t[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(n),"identity-provider-id":String(t[`identity-provider-id`]??``),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();u===`zones`?t.zoneId=d:t.accountId=d;let f=await c(`Loading`,async()=>l.zeroTrust.identityProviders.get({account_or_zone:u,account_or_zone_id:d,identity_provider_id:t[`identity-provider-id`]}));o(f,{successLabel:`Loaded`})})};function $m(e){return e.usage(`$0 zero-trust identity-providers list
|
|
778
|
+
|
|
779
|
+
Lists all configured identity providers.`).option(`scim-enabled`,{type:`string`,description:`Indicates to Access to only retrieve identity providers that have the System for Cross-Domain Identity Management (SCIM) enabled.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const eh={command:`list`,describe:`List Access identity providers`,builder:$m,handler:async t=>l({command:`zero-trust identity-providers list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let l={scim_enabled:t[`scim-enabled`],page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/identity_providers`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},query:l,bodyKind:`none`});return}let u=await n(t),d=t.zone===void 0?`accounts`:`zones`,f=d===`zones`?await i({zone:t.zone},u,{quiet:t.quiet}):t.local?e:await a();d===`zones`?t.zoneId=f:t.accountId=f;let p=await c(`Loading`,async()=>u.zeroTrust.identityProviders.list({account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})};function th(e){return e.usage("$0 zero-trust identity-providers saml-certificate create <identity-provider-id>\n\nCreates a new SAML encryption certificate set and assigns it to the specified SAML Identity Provider. This endpoint is idempotent - if the IdP already has a certificate set assigned, the existing certificate set is returned with a 200 status. **Workflow for enabling SAML encryption:** 1. Call this endpoint to create and assign a certificate set to the IdP 2. Update the IdP configuration (PUT `/identity_providers/{id}`) with: - `config.enable_encryption: true` - `saml_certificate_set_id: <uid from step 1>` 3. Configure the certificate's public key in your external SAML Identity Provider").positional(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const nh={command:`create <identity-provider-id>`,describe:`Create SAML encryption certificate for Identity Provider`,builder:th,handler:async t=>l({command:`zero-trust identity-providers saml-certificate create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers saml-certificate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/identity_providers/${t[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(t[`identity-provider-id`]))}/saml_certificate`,pathParams:{"identity-provider-id":String(t[`identity-provider-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Creating`,async()=>i.zeroTrust.identityProviders.samlCertificate.create({account_id:l,identity_provider_id:t[`identity-provider-id`]}));o(u,{successLabel:`Created`})})},rh={command:`saml-certificate`,describe:`Operations for identity-providers.saml-certificate`,builder:e=>e.command(nh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ih(e){return e.usage(`$0 zero-trust identity-providers scim groups delete <group-id>
|
|
780
|
+
|
|
781
|
+
Deletes a SCIM Group resource from the identity provider's SCIM population.`).positional(`group-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`identity-provider-id`,{type:`string`,description:`UUID.`,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 ah={command:`delete <group-id>`,describe:`Delete a SCIM Group resource`,builder:ih,handler:async t=>l({command:`zero-trust identity-providers scim groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/identity_providers/${t[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(t[`identity-provider-id`]))}/scim/groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"identity-provider-id":String(t[`identity-provider-id`]??``),"group-id":String(t[`group-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
782
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.identityProviders.scim.groups.delete({account_id:l,identity_provider_id:t[`identity-provider-id`],group_id:t[`group-id`]}));o(u,{successLabel:`Deleted`})})};function oh(e){return e.usage(`$0 zero-trust identity-providers scim groups get <group-id>
|
|
783
|
+
|
|
784
|
+
Returns a SCIM Group resource, including its direct members, synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).positional(`group-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sh={command:`get <group-id>`,describe:`Get a SCIM Group resource`,builder:oh,handler:async t=>l({command:`zero-trust identity-providers scim groups get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers scim groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/identity_providers/${t[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(t[`identity-provider-id`]))}/scim/groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"identity-provider-id":String(t[`identity-provider-id`]??``),"group-id":String(t[`group-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.identityProviders.scim.groups.get({account_id:l,identity_provider_id:t[`identity-provider-id`],group_id:t[`group-id`]}));o(u,{successLabel:`Loaded`})})};function ch(e){return e.usage(`$0 zero-trust identity-providers scim groups list
|
|
785
|
+
|
|
786
|
+
Lists SCIM Group resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).option(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`cf-resource-id`,{type:`string`,description:'The unique Cloudflare-generated Id of the SCIM Group resource; also known as the "Id".\nPass once for a single lookup (`?cf_resource_id=A`) or repeat the parameter\n(`?cf_resource_id=A&cf_resource_id=B`) to look up multiple groups in one request,\nup to 50 values. Mutually exclusive with `idp_resource_id`, `name`,\n`search_contains`, and `search_starts_with`.'}).option(`idp-resource-id`,{type:`string`,description:'The IdP-generated Id of the SCIM Group resource; also known as the "external Id".\nPass once for a single lookup (`?idp_resource_id=A`) or repeat the parameter\n(`?idp_resource_id=A&idp_resource_id=B`) to look up multiple groups in one request,\nup to 50 values. Mutually exclusive with `cf_resource_id`, `name`,\n`search_contains`, and `search_starts_with`.'}).option(`name`,{type:`string`,description:`The display name of the SCIM Group resource.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lh={command:`list`,describe:`List SCIM Group resources`,builder:ch,handler:async t=>l({command:`zero-trust identity-providers scim groups list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={cf_resource_id:t[`cf-resource-id`],idp_resource_id:t[`idp-resource-id`],name:t.name,page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/identity_providers/${t[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(t[`identity-provider-id`]))}/scim/groups`,pathParams:{"identity-provider-id":String(t[`identity-provider-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.identityProviders.scim.groups.list({account_id:u,identity_provider_id:t[`identity-provider-id`],...i}));o(d,{successLabel:`Loaded`})})},uh={command:`groups`,describe:`Operations for identity-providers.scim.groups`,builder:e=>e.command(ah).command(sh).command(lh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function dh(e){return e.usage(`$0 zero-trust identity-providers scim users delete <user-id>
|
|
787
|
+
|
|
788
|
+
Deletes a SCIM User resource from the identity provider's SCIM population.`).positional(`user-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`identity-provider-id`,{type:`string`,description:`UUID.`,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 fh={command:`delete <user-id>`,describe:`Delete a SCIM User resource`,builder:dh,handler:async t=>l({command:`zero-trust identity-providers scim users delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers scim users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/identity_providers/${t[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(t[`identity-provider-id`]))}/scim/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"identity-provider-id":String(t[`identity-provider-id`]??``),"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
789
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.identityProviders.scim.users.delete({account_id:l,identity_provider_id:t[`identity-provider-id`],user_id:t[`user-id`]}));o(u,{successLabel:`Deleted`})})};function ph(e){return e.usage(`$0 zero-trust identity-providers scim users get <user-id>
|
|
790
|
+
|
|
791
|
+
Returns a SCIM User resource synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).positional(`user-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mh={command:`get <user-id>`,describe:`Get a SCIM User resource`,builder:ph,handler:async t=>l({command:`zero-trust identity-providers scim users get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers scim users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/identity_providers/${t[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(t[`identity-provider-id`]))}/scim/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"identity-provider-id":String(t[`identity-provider-id`]??``),"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.identityProviders.scim.users.get({account_id:l,identity_provider_id:t[`identity-provider-id`],user_id:t[`user-id`]}));o(u,{successLabel:`Loaded`})})};function hh(e){return e.usage(`$0 zero-trust identity-providers scim users list
|
|
792
|
+
|
|
793
|
+
Lists SCIM User resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).option(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`cf-resource-id`,{type:`string`,description:'The unique Cloudflare-generated Id of the SCIM User resource; also known as the "Id".\nPass once for a single lookup (`?cf_resource_id=A`) or repeat the parameter\n(`?cf_resource_id=A&cf_resource_id=B`) to look up multiple users in one request,\nup to 50 values. Mutually exclusive with `idp_resource_id`, `username`, `email`,\n`name`, `search_contains`, and `search_starts_with`.'}).option(`idp-resource-id`,{type:`string`,description:'The IdP-generated Id of the SCIM User resource; also known as the "external Id".\nPass once for a single lookup (`?idp_resource_id=A`) or repeat the parameter\n(`?idp_resource_id=A&idp_resource_id=B`) to look up multiple users in one request,\nup to 50 values. Mutually exclusive with `cf_resource_id`, `username`, `email`,\n`name`, `search_contains`, and `search_starts_with`.'}).option(`username`,{type:`string`,description:`The username of the SCIM User resource.`}).option(`email`,{type:`string`,description:`The email address of the SCIM User resource.`}).option(`name`,{type:`string`,description:`The name of the SCIM User resource.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gh={command:`list`,describe:`List SCIM User resources`,builder:hh,handler:async t=>l({command:`zero-trust identity-providers scim users list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={cf_resource_id:t[`cf-resource-id`],idp_resource_id:t[`idp-resource-id`],username:t.username,email:t.email,name:t.name,page:t.page,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf zero-trust identity-providers scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/identity_providers/${t[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(t[`identity-provider-id`]))}/scim/users`,pathParams:{"identity-provider-id":String(t[`identity-provider-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.zeroTrust.identityProviders.scim.users.list({account_id:u,identity_provider_id:t[`identity-provider-id`],...i}));o(d,{successLabel:`Loaded`})})},_h={command:`users`,describe:`Operations for identity-providers.scim.users`,builder:e=>e.command(fh).command(mh).command(gh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},vh={command:`scim`,describe:`Operations for identity-providers.scim`,builder:e=>e.command(uh).command(_h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function yh(e){return e.usage(`$0 zero-trust identity-providers update <identity-provider-id>
|
|
794
|
+
|
|
795
|
+
Updates a configured identity provider.`).positional(`identity-provider-id`,{type:`string`,description:`UUID.`,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 bh={command:`update <identity-provider-id>`,describe:`Update an Access identity provider`,builder:yh,handler:async t=>l({command:`zero-trust identity-providers update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/identity_providers/${t[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(t[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(n),"identity-provider-id":String(t[`identity-provider-id`]??``),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Updating`,async()=>l.zeroTrust.identityProviders.update({body:e,account_or_zone:u,account_or_zone_id:f,identity_provider_id:t[`identity-provider-id`]}));o(n,{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},xh={command:`identity-providers`,describe:`Operations for identity-providers`,builder:e=>e.command(zm).command(Vm).command(Qm).command(eh).command(bh).command(Xm).command(rh).command(vh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Sh(e){return e.usage(`$0 zero-trust organization create
|
|
796
|
+
|
|
797
|
+
Sets up a Zero Trust organization for your account or zone.`).option(`allow-authenticate-via-warp`,{type:`boolean`,description:`When set to true, users can authenticate via WARP for any application in your organization. Application settings will take precedence over this value.`,default:!1}).option(`auth-domain`,{type:`string`,description:"The unique subdomain assigned to your Zero Trust organization. If omitted on creation, a unique subdomain is auto-generated in the format `adjective-noun-hex4` (e.g. `frosty-moon-7a3b.cloudflareaccess.com`)."}).option(`auto-redirect-to-identity`,{type:`boolean`,description:"When set to `true`, users skip the identity provider selection step during login.",default:!1}).option(`deny-unmatched-requests`,{type:`boolean`,description:"Determines whether to deny all requests to Cloudflare-protected resources that lack an associated Access application. If enabled, you must explicitly configure an Access application and policy to allow traffic to your Cloudflare-protected resources. For domains you want to be public across all subdomains, add the domain to the `deny_unmatched_requests_exempted_zone_names` array."}).option(`deny-unmatched-requests-exempted-zone-names`,{type:`string`,array:!0,description:"Contains zone names to exempt from the `deny_unmatched_requests` feature. Requests to a subdomain in an exempted zone will block unauthenticated traffic by default if there is a configured Access application and policy that matches the request."}).option(`is-ui-read-only`,{type:`boolean`,description:`Lock all settings as Read-Only in the Dashboard, regardless of user permission. Updates may only be made via the API or Terraform for this account when enabled.`,default:!1}).option(`login-design-background-color`,{type:`string`,description:`The background color on your login page.`}).option(`login-design-footer-text`,{type:`string`,description:`The text at the bottom of your login page.`}).option(`login-design-header-text`,{type:`string`,description:`The text at the top of your login page.`}).option(`login-design-logo-path`,{type:`string`,description:`The URL of the logo on your login page.`}).option(`login-design-text-color`,{type:`string`,description:`The text color on your login page.`}).option(`mfa-config-allowed-authenticators`,{type:`string`,array:!0,description:"Lists the MFA methods that users can authenticate with. The `piv_key` and `ssh_fido2_key` values are supported only for infrastructure applications."}).option(`mfa-config-amr-matching-session-duration`,{type:`string`,description:`Allows a user to skip MFA via Authentication Method Reference (AMR) matching when the AMR claim provided by the IdP the user used to authenticate contains "mfa". Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days).`}).option(`mfa-config-required-aaguids`,{type:`string`,description:`Specifies a Cloudflare List of required FIDO2 authenticator device AAGUIDs.`}).option(`mfa-config-session-duration`,{type:`string`,description:"Defines the duration of an MFA session. Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). Examples:`5m` or `24h`."}).option(`mfa-piv-key-requirements-pin-policy`,{type:`string`,description:"Defines when a PIN is required to use the SSH key. Valid values: `never` (no PIN required), `once` (PIN required once per session), `always` (PIN required for each use).",choices:[`never`,`once`,`always`]}).option(`mfa-piv-key-requirements-require-fips-device`,{type:`boolean`,description:`Requires the PIV key to be stored on a FIPS 140-2 Level 1 or higher validated device.`}).option(`mfa-piv-key-requirements-ssh-key-size`,{type:`string`,array:!0,description:`Specifies the allowed SSH key sizes in bits. Valid sizes depend on key type. Ed25519 has a fixed key size and does not accept this parameter.`}).option(`mfa-piv-key-requirements-ssh-key-type`,{type:`string`,array:!0,description:"Specifies the allowed SSH key types. Valid values are `ecdsa`, `ed25519`, and `rsa`."}).option(`mfa-piv-key-requirements-touch-policy`,{type:`string`,description:"Defines when physical touch is required to use the SSH key. Valid values: `never` (no touch required), `always` (touch required for each use), `cached` (touch cached for 15 seconds).",choices:[`never`,`always`,`cached`]}).option(`mfa-required-for-all-apps`,{type:`boolean`,description:`Determines whether global MFA settings apply to applications by default. The organization must have MFA enabled with at least one authentication method and a session duration configured. Note: 'allowed_authenticators' cannot contain only the infrastructure SSH authenticators ('piv_key' and 'ssh_fido2_key') if the organization has any non-infrastructure applications.`,default:!1}).option(`name`,{type:`string`,description:`The name of your Zero Trust organization. When omitted on creation, defaults to the provided auth_domain; when both are omitted, defaults to the auto-generated subdomain slug (e.g. frosty-moon-7a3b).`}).option(`service-token-inactivity-action`,{type:`string`,description:`The action applied to an inactive service token.`,choices:[`disable`,`delete`]}).option(`service-token-inactivity-enabled`,{type:`boolean`,description:`Whether automatic enforcement for inactive service tokens is enabled.`}).option(`service-token-inactivity-inactivity-threshold-days`,{type:`number`,description:`The number of days a service token must be inactive before the configured action is applied.`}).option(`session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h."}).option(`strict-service-token-auth`,{type:`boolean`,description:`Enables new behaviors for requests made with Access service tokens. Unauthorized requests emit audit logs, and return a 401 or 403 status code in the response instead of redirecting to the login page. Successful requests no longer receive a CF_Authorization cookie in the response. Zero Trust organizations created on or after October 5, 2026 will have this setting enabled by default, and cannot disable it.`}).option(`ui-read-only-toggle-reason`,{type:`string`,description:`A description of the reason why the UI read only field is being toggled.`}).option(`user-seat-expiration-inactive-time`,{type:`string`,description:"The amount of time a user seat is inactive before it expires. When the user seat exceeds the set time of inactivity, the user is removed as an active seat and no longer counts against your Teams seat count. Minimum value for this setting is 1 month (730h). Must be in the format `300ms` or `2h45m`. Valid time units are: `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`."}).option(`warp-auth-non-browser-401`,{type:`boolean`,description:`When enabled, unsuccessful WARP authentication requests with a non-HTML Accept header return a 401 response instead of redirecting to the login page.`,default:!1}).option(`warp-auth-session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `30m` or `2h45m`. Valid time units are: m, h."}).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)`}).check(e=>{if([`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].some(t=>e[t]!==void 0)){let t=[`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --service_token_inactivity-* flag is set`)}return!0})}const Ch={command:`create`,describe:`Create your Zero Trust organization`,builder:Sh,handler:async t=>l({command:`zero-trust organization create`,classification:{safeFlags:[`allow-authenticate-via-warp`,`auto-redirect-to-identity`,`deny-unmatched-requests`,`is-ui-read-only`,`mfa-piv-key-requirements-pin-policy`,`mfa-piv-key-requirements-require-fips-device`,`mfa-piv-key-requirements-touch-policy`,`mfa-required-for-all-apps`,`service-token-inactivity-action`,`service-token-inactivity-enabled`,`strict-service-token-auth`,`warp-auth-non-browser-401`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust organization create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/organizations`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({allow_authenticate_via_warp:t[`allow-authenticate-via-warp`],auth_domain:m(t[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:t[`auto-redirect-to-identity`],deny_unmatched_requests:t[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:t[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:t[`is-ui-read-only`],login_design:{background_color:m(t[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(t[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(t[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(t[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(t[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:t[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(t[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(t[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(t[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(t[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:t[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:t[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:t[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(t[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:t[`mfa-required-for-all-apps`],name:m(t.name,`name`,`text`),service_token_inactivity:{action:m(t[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:t[`service-token-inactivity-enabled`],inactivity_threshold_days:t[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(t[`session-duration`],`session-duration`,`text`),strict_service_token_auth:t[`strict-service-token-auth`],ui_read_only_toggle_reason:m(t[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(t[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:t[`warp-auth-non-browser-401`],warp_auth_session_duration:m(t[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Creating`,async()=>l.zeroTrust.organization.create({...e,account_or_zone:u,account_or_zone_id:f}));o(n,{successLabel:`Created`});return}let h=p({allow_authenticate_via_warp:t[`allow-authenticate-via-warp`],auth_domain:m(t[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:t[`auto-redirect-to-identity`],deny_unmatched_requests:t[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:t[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:t[`is-ui-read-only`],login_design:{background_color:m(t[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(t[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(t[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(t[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(t[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:t[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(t[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(t[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(t[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(t[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:t[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:t[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:t[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(t[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:t[`mfa-required-for-all-apps`],name:m(t.name,`name`,`text`),service_token_inactivity:{action:m(t[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:t[`service-token-inactivity-enabled`],inactivity_threshold_days:t[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(t[`session-duration`],`session-duration`,`text`),strict_service_token_auth:t[`strict-service-token-auth`],ui_read_only_toggle_reason:m(t[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(t[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:t[`warp-auth-non-browser-401`],warp_auth_session_duration:m(t[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}),g=await c(`Creating`,async()=>l.zeroTrust.organization.create({...h,account_or_zone:u,account_or_zone_id:f}));o(g,{successLabel:`Created`})})};function wh(e){return e.usage(`$0 zero-trust organization doh get
|
|
798
|
+
|
|
799
|
+
Returns the DoH settings for your Zero Trust organization.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Th={command:`get`,describe:`Get your Zero Trust organization DoH settings`,builder:wh,handler:async t=>l({command:`zero-trust organization doh get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust organization doh get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/organizations/doh`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.organization.doh.get({account_id:l}));o(u,{successLabel:`Loaded`})})};function Eh(e){return e.usage(`$0 zero-trust organization doh update
|
|
800
|
+
|
|
801
|
+
Updates the DoH settings for your Zero Trust organization.`).option(`doh-jwt-duration`,{type:`string`,description:"The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note that the maximum duration for this setting is the same as the key rotation period on the account. Default expiration is 24h"}).option(`service-token-id`,{type:`string`,description:`The uuid of the service token you want to use for DoH authentication`}).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 Dh={command:`update`,describe:`Update your Zero Trust organization DoH settings`,builder:Eh,handler:async t=>l({command:`zero-trust organization doh update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust organization doh update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/organizations/doh`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({doh_jwt_duration:m(t[`doh-jwt-duration`],`doh-jwt-duration`,`text`),service_token_id:m(t[`service-token-id`],`service-token-id`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.organization.doh.update({...e,account_id:l}));o(n,{successLabel:`Updated`});return}let u=p({doh_jwt_duration:m(t[`doh-jwt-duration`],`doh-jwt-duration`,`text`),service_token_id:m(t[`service-token-id`],`service-token-id`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.organization.doh.update({...u,account_id:l}));o(f,{successLabel:`Updated`})})},Oh={command:`doh`,describe:`Operations for organization.doh`,builder:e=>e.command(Th).command(Dh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function kh(e){return e.usage(`$0 zero-trust organization get
|
|
802
|
+
|
|
803
|
+
Returns the configuration for your Zero Trust organization.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ah={command:`get`,describe:`Get your Zero Trust organization`,builder:kh,handler:async t=>l({command:`zero-trust organization get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust organization get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/organizations`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`none`});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,d=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();u===`zones`?t.zoneId=d:t.accountId=d;let f=await c(`Loading`,async()=>l.zeroTrust.organization.get({account_or_zone:u,account_or_zone_id:d}));o(f,{successLabel:`Loaded`})})};function jh(e){return e.usage(`$0 zero-trust organization update
|
|
804
|
+
|
|
805
|
+
Updates the configuration for your Zero Trust organization.`).option(`allow-authenticate-via-warp`,{type:`boolean`,description:`When set to true, users can authenticate via WARP for any application in your organization. Application settings will take precedence over this value.`}).option(`auth-domain`,{type:`string`,description:"The unique subdomain assigned to your Zero Trust organization. If omitted on creation, a unique subdomain is auto-generated in the format `adjective-noun-hex4` (e.g. `frosty-moon-7a3b.cloudflareaccess.com`)."}).option(`auto-redirect-to-identity`,{type:`boolean`,description:"When set to `true`, users skip the identity provider selection step during login."}).option(`custom-pages-forbidden`,{type:`string`,description:`The uid of the custom page to use when a user is denied access after failing a non-identity rule.`}).option(`custom-pages-identity-denied`,{type:`string`,description:`The uid of the custom page to use when a user is denied access.`}).option(`deny-unmatched-requests`,{type:`boolean`,description:"Determines whether to deny all requests to Cloudflare-protected resources that lack an associated Access application. If enabled, you must explicitly configure an Access application and policy to allow traffic to your Cloudflare-protected resources. For domains you want to be public across all subdomains, add the domain to the `deny_unmatched_requests_exempted_zone_names` array."}).option(`deny-unmatched-requests-exempted-zone-names`,{type:`string`,array:!0,description:"Contains zone names to exempt from the `deny_unmatched_requests` feature. Requests to a subdomain in an exempted zone will block unauthenticated traffic by default if there is a configured Access application and policy that matches the request."}).option(`is-ui-read-only`,{type:`boolean`,description:`Lock all settings as Read-Only in the Dashboard, regardless of user permission. Updates may only be made via the API or Terraform for this account when enabled.`}).option(`login-design-background-color`,{type:`string`,description:`The background color on your login page.`}).option(`login-design-footer-text`,{type:`string`,description:`The text at the bottom of your login page.`}).option(`login-design-header-text`,{type:`string`,description:`The text at the top of your login page.`}).option(`login-design-logo-path`,{type:`string`,description:`The URL of the logo on your login page.`}).option(`login-design-text-color`,{type:`string`,description:`The text color on your login page.`}).option(`mfa-config-allowed-authenticators`,{type:`string`,array:!0,description:"Lists the MFA methods that users can authenticate with. The `piv_key` and `ssh_fido2_key` values are supported only for infrastructure applications."}).option(`mfa-config-amr-matching-session-duration`,{type:`string`,description:`Allows a user to skip MFA via Authentication Method Reference (AMR) matching when the AMR claim provided by the IdP the user used to authenticate contains "mfa". Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days).`}).option(`mfa-config-required-aaguids`,{type:`string`,description:`Specifies a Cloudflare List of required FIDO2 authenticator device AAGUIDs.`}).option(`mfa-config-session-duration`,{type:`string`,description:"Defines the duration of an MFA session. Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). Examples:`5m` or `24h`."}).option(`mfa-piv-key-requirements-pin-policy`,{type:`string`,description:"Defines when a PIN is required to use the SSH key. Valid values: `never` (no PIN required), `once` (PIN required once per session), `always` (PIN required for each use).",choices:[`never`,`once`,`always`]}).option(`mfa-piv-key-requirements-require-fips-device`,{type:`boolean`,description:`Requires the PIV key to be stored on a FIPS 140-2 Level 1 or higher validated device.`}).option(`mfa-piv-key-requirements-ssh-key-size`,{type:`string`,array:!0,description:`Specifies the allowed SSH key sizes in bits. Valid sizes depend on key type. Ed25519 has a fixed key size and does not accept this parameter.`}).option(`mfa-piv-key-requirements-ssh-key-type`,{type:`string`,array:!0,description:"Specifies the allowed SSH key types. Valid values are `ecdsa`, `ed25519`, and `rsa`."}).option(`mfa-piv-key-requirements-touch-policy`,{type:`string`,description:"Defines when physical touch is required to use the SSH key. Valid values: `never` (no touch required), `always` (touch required for each use), `cached` (touch cached for 15 seconds).",choices:[`never`,`always`,`cached`]}).option(`mfa-required-for-all-apps`,{type:`boolean`,description:`Determines whether global MFA settings apply to applications by default. The organization must have MFA enabled with at least one authentication method and a session duration configured. Note: 'allowed_authenticators' cannot contain only the infrastructure SSH authenticators ('piv_key' and 'ssh_fido2_key') if the organization has any non-infrastructure applications.`}).option(`name`,{type:`string`,description:`The name of your Zero Trust organization. When omitted on creation, defaults to the provided auth_domain; when both are omitted, defaults to the auto-generated subdomain slug (e.g. frosty-moon-7a3b).`}).option(`service-token-inactivity-action`,{type:`string`,description:`The action applied to an inactive service token.`,choices:[`disable`,`delete`]}).option(`service-token-inactivity-enabled`,{type:`boolean`,description:`Whether automatic enforcement for inactive service tokens is enabled.`}).option(`service-token-inactivity-inactivity-threshold-days`,{type:`number`,description:`The number of days a service token must be inactive before the configured action is applied.`}).option(`session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h."}).option(`strict-service-token-auth`,{type:`boolean`,description:`Enables new behaviors for requests made with Access service tokens. Unauthorized requests emit audit logs, and return a 401 or 403 status code in the response instead of redirecting to the login page. Successful requests no longer receive a CF_Authorization cookie in the response. Zero Trust organizations created on or after October 5, 2026 will have this setting enabled by default, and cannot disable it.`}).option(`ui-read-only-toggle-reason`,{type:`string`,description:`A description of the reason why the UI read only field is being toggled.`}).option(`user-seat-expiration-inactive-time`,{type:`string`,description:"The amount of time a user seat is inactive before it expires. When the user seat exceeds the set time of inactivity, the user is removed as an active seat and no longer counts against your Teams seat count. Minimum value for this setting is 1 month (730h). Must be in the format `300ms` or `2h45m`. Valid time units are: `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`."}).option(`warp-auth-non-browser-401`,{type:`boolean`,description:`When enabled, unsuccessful WARP authentication requests with a non-HTML Accept header return a 401 response instead of redirecting to the login page.`}).option(`warp-auth-session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `30m` or `2h45m`. Valid time units are: m, h."}).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)`}).check(e=>{if([`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].some(t=>e[t]!==void 0)){let t=[`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --service_token_inactivity-* flag is set`)}return!0})}const Mh={command:`update`,describe:`Update your Zero Trust organization`,builder:jh,handler:async t=>l({command:`zero-trust organization update`,classification:{safeFlags:[`allow-authenticate-via-warp`,`auto-redirect-to-identity`,`deny-unmatched-requests`,`is-ui-read-only`,`mfa-piv-key-requirements-pin-policy`,`mfa-piv-key-requirements-require-fips-device`,`mfa-piv-key-requirements-touch-policy`,`mfa-required-for-all-apps`,`service-token-inactivity-action`,`service-token-inactivity-enabled`,`strict-service-token-auth`,`warp-auth-non-browser-401`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=t.zone===void 0?await r():void 0,n=t.zone===void 0?`accounts`:`zones`,i=t.zone??e??`<account-id>`;s({command:`cf zero-trust organization update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/access/organizations`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},bodyKind:`json`,body:t.body===void 0?p({allow_authenticate_via_warp:t[`allow-authenticate-via-warp`],auth_domain:m(t[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:t[`auto-redirect-to-identity`],custom_pages:{forbidden:m(t[`custom-pages-forbidden`],`custom-pages-forbidden`,`text`),identity_denied:m(t[`custom-pages-identity-denied`],`custom-pages-identity-denied`,`text`)},deny_unmatched_requests:t[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:t[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:t[`is-ui-read-only`],login_design:{background_color:m(t[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(t[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(t[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(t[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(t[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:t[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(t[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(t[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(t[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(t[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:t[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:t[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:t[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(t[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:t[`mfa-required-for-all-apps`],name:m(t.name,`name`,`text`),service_token_inactivity:{action:m(t[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:t[`service-token-inactivity-enabled`],inactivity_threshold_days:t[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(t[`session-duration`],`session-duration`,`text`),strict_service_token_auth:t[`strict-service-token-auth`],ui_read_only_toggle_reason:m(t[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(t[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:t[`warp-auth-non-browser-401`],warp_auth_session_duration:m(t[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}):d(t.body)});return}let l=await n(t),u=t.zone===void 0?`accounts`:`zones`,f=u===`zones`?await i({zone:t.zone},l,{quiet:t.quiet}):t.local?e:await a();if(u===`zones`?t.zoneId=f:t.accountId=f,t.body){let e=d(t.body),n=await c(`Updating`,async()=>l.zeroTrust.organization.update({...e,account_or_zone:u,account_or_zone_id:f}));o(n,{successLabel:`Updated`});return}let h=p({allow_authenticate_via_warp:t[`allow-authenticate-via-warp`],auth_domain:m(t[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:t[`auto-redirect-to-identity`],custom_pages:{forbidden:m(t[`custom-pages-forbidden`],`custom-pages-forbidden`,`text`),identity_denied:m(t[`custom-pages-identity-denied`],`custom-pages-identity-denied`,`text`)},deny_unmatched_requests:t[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:t[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:t[`is-ui-read-only`],login_design:{background_color:m(t[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(t[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(t[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(t[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(t[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:t[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(t[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(t[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(t[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(t[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:t[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:t[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:t[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(t[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:t[`mfa-required-for-all-apps`],name:m(t.name,`name`,`text`),service_token_inactivity:{action:m(t[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:t[`service-token-inactivity-enabled`],inactivity_threshold_days:t[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(t[`session-duration`],`session-duration`,`text`),strict_service_token_auth:t[`strict-service-token-auth`],ui_read_only_toggle_reason:m(t[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(t[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:t[`warp-auth-non-browser-401`],warp_auth_session_duration:m(t[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}),g=await c(`Updating`,async()=>l.zeroTrust.organization.update({...h,account_or_zone:u,account_or_zone_id:f}));o(g,{successLabel:`Updated`})})},Nh={command:`organization`,describe:`Operations for organization`,builder:e=>e.command(Ch).command(Ah).command(Mh).command(Oh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ph(e){return e.usage(`$0 zero-trust risk-scoring behaviours get
|
|
806
|
+
|
|
807
|
+
Retrieves configured risk score behaviors that define how user actions affect their overall risk score.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fh={command:`get`,describe:`Get all behaviors and associated configuration`,builder:Ph,handler:async t=>l({command:`zero-trust risk-scoring behaviours get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring behaviours get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/behaviors`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.riskScoring.behaviours.get({account_id:l}));o(u,{successLabel:`Loaded`})})};function Ih(e){return e.usage(`$0 zero-trust risk-scoring behaviours update
|
|
808
|
+
|
|
809
|
+
Updates risk score behavior configurations, defining weights and thresholds for risk calculation.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Behaviors.`})}const Lh={command:`update`,describe:`Update configuration for risk behaviors`,builder:Ih,handler:async t=>l({command:`zero-trust risk-scoring behaviours update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring behaviours update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/behaviors`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.riskScoring.behaviours.update({body:e,account_id:l}));o(n,{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Rh={command:`behaviours`,describe:`User Risk Scoring - manage behaviors used to calculate user risk scores`,builder:e=>e.command(Fh).command(Lh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function zh(e){return e.usage(`$0 zero-trust risk-scoring get <user-id>
|
|
810
|
+
|
|
811
|
+
Retrieves the detailed risk score breakdown for a specific user, including contributing factors.`).positional(`user-id`,{type:`string`,description:`User ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bh={command:`get <user-id>`,describe:`Get risk event/score information for a specific user`,builder:zh,handler:async t=>l({command:`zero-trust risk-scoring get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.riskScoring.get({account_id:l,user_id:t[`user-id`]}));o(u,{successLabel:`Loaded`})})};function Vh(e){return e.usage(`$0 zero-trust risk-scoring integrations create
|
|
812
|
+
|
|
813
|
+
Creates a new Zero Trust risk score integration, connecting external risk signals to Cloudflare's risk scoring system.`).option(`integration-type`,{type:`string`,description:`The integration_type field`,choices:[`Okta`]}).option(`reference-id`,{type:`string`,description:`A reference id that can be supplied by the client. Currently this should be set to the Access-Okta IDP ID (a UUIDv4).
|
|
814
|
+
https://developers.cloudflare.com/api/operations/access-identity-providers-get-an-access-identity-provider`}).option(`tenant-url`,{type:`string`,description:`The base url of the tenant, e.g. "https://tenant.okta.com".`}).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 Hh={command:`create`,describe:`Create new risk score integration.`,builder:Vh,handler:async t=>l({command:`zero-trust risk-scoring integrations create`,classification:{safeFlags:[`integration-type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/integrations`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({integration_type:m(t[`integration-type`],`integration-type`,`text`),reference_id:m(t[`reference-id`],`reference-id`,`text`),tenant_url:m(t[`tenant-url`],`tenant-url`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.zeroTrust.riskScoring.integrations.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t[`integration-type`]===void 0&&(t[`integration-type`]=await _(`integration-type`,`The integration_type field`,[`Okta`])),t[`tenant-url`]===void 0&&(t[`tenant-url`]=await g(`tenant-url`,`The base url of the tenant, e.g. "https://tenant.okta.com".`));let u=p({integration_type:m(t[`integration-type`],`integration-type`,`text`),reference_id:m(t[`reference-id`],`reference-id`,`text`),tenant_url:m(t[`tenant-url`],`tenant-url`,`text`)}),f=await c(`Creating`,async()=>i.zeroTrust.riskScoring.integrations.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function Uh(e){return e.usage(`$0 zero-trust risk-scoring integrations delete <integration-id>
|
|
815
|
+
|
|
816
|
+
Removes a Zero Trust risk score integration, disconnecting the external risk signal source.`).positional(`integration-id`,{type:`string`,description:`Integration ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Wh={command:`delete <integration-id>`,describe:`Delete a risk score integration.`,builder:Uh,handler:async t=>l({command:`zero-trust risk-scoring integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/integrations/${t[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(t[`integration-id`]))}`,pathParams:{"integration-id":String(t[`integration-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
817
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.riskScoring.integrations.delete({account_id:l,integration_id:t[`integration-id`]}));o(u,{successLabel:`Deleted`})})};function Gh(e){return e.usage(`$0 zero-trust risk-scoring integrations get <integration-id>
|
|
818
|
+
|
|
819
|
+
Gets a Zero Trust risk score integration by ID.`).positional(`integration-id`,{type:`string`,description:`Integration ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kh={command:`get <integration-id>`,describe:`Get risk score integration by id.`,builder:Gh,handler:async t=>l({command:`zero-trust risk-scoring integrations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/integrations/${t[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(t[`integration-id`]))}`,pathParams:{"integration-id":String(t[`integration-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.get({account_id:l,integration_id:t[`integration-id`]}));o(u,{successLabel:`Loaded`})})};function qh(e){return e.usage(`$0 zero-trust risk-scoring integrations list
|
|
820
|
+
|
|
821
|
+
Lists all configured Zero Trust risk score integrations for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Jh={command:`list`,describe:`List all risk score integrations for the account.`,builder:qh,handler:async t=>l({command:`zero-trust risk-scoring integrations list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/integrations`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.list({account_id:l}));o(u,{successLabel:`Loaded`})})};function Yh(e){return e.usage(`$0 zero-trust risk-scoring integrations references get <reference-id>
|
|
822
|
+
|
|
823
|
+
Retrieves a Zero Trust risk score integration using its external reference ID.`).positional(`reference-id`,{type:`string`,description:`Reference ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xh={command:`get <reference-id>`,describe:`Get risk score integration by reference id.`,builder:Yh,handler:async t=>l({command:`zero-trust risk-scoring integrations references get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring integrations references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/integrations/reference_id/${t[`reference-id`]==null?`<reference-id>`:encodeURIComponent(String(t[`reference-id`]))}`,pathParams:{"reference-id":String(t[`reference-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.references.get({account_id:l,reference_id:t[`reference-id`]}));o(u,{successLabel:`Loaded`})})},Zh={command:`references`,describe:`User Risk Scoring - retrieve integrations by external reference`,builder:e=>e.command(Xh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qh(e){return e.usage(`$0 zero-trust risk-scoring integrations update <integration-id>
|
|
824
|
+
|
|
825
|
+
Overwrite the reference_id, tenant_url, and active values with the ones provided.`).positional(`integration-id`,{type:`string`,description:`Integration ID`,demandOption:!0}).option(`active`,{type:`boolean`,description:`Whether this integration is enabled. If disabled, no risk changes will be exported to the third-party.`}).option(`reference-id`,{type:`string`,description:`A reference id that can be supplied by the client. Currently this should be set to the Access-Okta IDP ID (a UUIDv4).
|
|
826
|
+
https://developers.cloudflare.com/api/operations/access-identity-providers-get-an-access-identity-provider`}).option(`tenant-url`,{type:`string`,description:`The base url of the tenant, e.g. "https://tenant.okta.com".`}).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 <integration-id>`,describe:`Update a risk score integration.`,builder:Qh,handler:async t=>l({command:`zero-trust risk-scoring integrations update`,classification:{safeFlags:[`active`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/integrations/${t[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(t[`integration-id`]))}`,pathParams:{"integration-id":String(t[`integration-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({active:t.active,reference_id:m(t[`reference-id`],`reference-id`,`text`),tenant_url:m(t[`tenant-url`],`tenant-url`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.riskScoring.integrations.update({...e,account_id:l,integration_id:t[`integration-id`]}));o(n,{successLabel:`Updated`});return}if(t.active===void 0)throw Error(`--active is required (or pass --body with this field set).`);t[`tenant-url`]===void 0&&(t[`tenant-url`]=await g(`tenant-url`,`The base url of the tenant, e.g. "https://tenant.okta.com".`));let u=p({active:t.active,reference_id:m(t[`reference-id`],`reference-id`,`text`),tenant_url:m(t[`tenant-url`],`tenant-url`,`text`)}),f=await c(`Updating`,async()=>i.zeroTrust.riskScoring.integrations.update({...u,account_id:l,integration_id:t[`integration-id`]}));o(f,{successLabel:`Updated`})})},eg={command:`integrations`,describe:`User Risk Scoring - manage integrations that provide risk score signals`,builder:e=>e.command(Hh).command(Wh).command(Kh).command(Jh).command($h).command(Zh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tg(e){return e.usage(`$0 zero-trust risk-scoring reset <user-id>
|
|
827
|
+
|
|
828
|
+
Resets risk scores for specified users, clearing their accumulated risk history.`).positional(`user-id`,{type:`string`,description:`User ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ng={command:`reset <user-id>`,describe:`Clear the risk score for a particular user`,builder:tg,handler:async t=>l({command:`zero-trust risk-scoring reset`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring reset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}/reset`,pathParams:{"user-id":String(t[`user-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force,message:`This operation wipes risk-scoring history.`})){process.stderr.write(`Aborted.
|
|
829
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.riskScoring.reset({account_id:l,user_id:t[`user-id`]}));o(u,{successLabel:`Deleted`})})};function rg(e){return e.usage(`$0 zero-trust risk-scoring summary get
|
|
830
|
+
|
|
831
|
+
Gets an aggregate summary of risk scores across the account, including distribution and trends.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ig={command:`get`,describe:`Get risk score info for all users in the account`,builder:rg,handler:async t=>l({command:`zero-trust risk-scoring summary get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust risk-scoring summary get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/summary`,pathParams:{},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.zeroTrust.riskScoring.summary.get({account_id:l}));o(u,{successLabel:`Loaded`})})},ag={command:`summary`,describe:`User Risk Scoring - retrieve account risk score summaries`,builder:e=>e.command(ig).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},og={command:`risk-scoring`,describe:`User Risk Scoring - retrieve and reset user risk scores`,builder:e=>e.command(Bh).command(ng).command(Rh).command(eg).command(ag).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function sg(e){return e.usage("$0 zero-trust seats edit\n\nRemoves a user from a Zero Trust seat when both `access_seat` and `gateway_seat` are set to false.").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 cg={command:`edit`,describe:`Update a user seat`,builder:sg,handler:async t=>l({command:`zero-trust seats edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust seats edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/seats`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.zeroTrust.seats.edit({body:e,account_id:l}));o(n,{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},lg={command:`seats`,describe:`Operations for seats`,builder:e=>e.command(cg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ug(e){return e.usage(`$0 zero-trust users mfa authenticators delete <authenticator-id>
|
|
832
|
+
|
|
833
|
+
Deletes a specific MFA device or passkey, including a PIV key or FIDO2 key enrollment, for a user. Admin deletion remains available when MFA is disabled. Successful deletion revokes the enrollment and returns a null result.`).positional(`authenticator-id`,{type:`string`,description:`The unique identifier for the MFA device.`,demandOption:!0}).option(`user-id`,{type:`string`,description:`UUID.`,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 dg={command:`delete <authenticator-id>`,describe:`Delete a user's authenticator`,builder:ug,handler:async t=>l({command:`zero-trust users mfa authenticators delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust users mfa authenticators delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}/mfa_authenticators/${t[`authenticator-id`]==null?`<authenticator-id>`:encodeURIComponent(String(t[`authenticator-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``),"authenticator-id":String(t[`authenticator-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
834
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.users.mfa.authenticators.delete({account_id:l,user_id:t[`user-id`],authenticator_id:t[`authenticator-id`]}));o(u,{successLabel:`Deleted`})})},fg={command:`authenticators`,describe:`Operations for users.mfa.authenticators`,builder:e=>e.command(dg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},pg={command:`mfa`,describe:`Operations for users.mfa`,builder:e=>e.command(fg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function mg(e){return e.usage(`$0 zero-trust users passkeys delete <authenticator-id>
|
|
835
|
+
|
|
836
|
+
Alias of the authenticator deletion endpoint for passkey management. The identifier is the passkey's authenticator ID from the last-seen identity response. Successful deletion revokes the enrollment and returns a null result.`).positional(`authenticator-id`,{type:`string`,description:`The unique identifier for the MFA device.`,demandOption:!0}).option(`user-id`,{type:`string`,description:`UUID.`,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 hg={command:`delete <authenticator-id>`,describe:`Delete a user's passkey`,builder:mg,handler:async t=>l({command:`zero-trust users passkeys delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf zero-trust users passkeys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users/${t[`user-id`]==null?`<user-id>`:encodeURIComponent(String(t[`user-id`]))}/passkeys/${t[`authenticator-id`]==null?`<authenticator-id>`:encodeURIComponent(String(t[`authenticator-id`]))}`,pathParams:{"user-id":String(t[`user-id`]??``),"authenticator-id":String(t[`authenticator-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
837
|
+
`);return}let u=await c(`Deleting`,async()=>i.zeroTrust.users.passkeys.delete({account_id:l,user_id:t[`user-id`],authenticator_id:t[`authenticator-id`]}));o(u,{successLabel:`Deleted`})})},gg={command:`passkeys`,describe:`Operations for users.passkeys`,builder:e=>e.command(hg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_g={command:`users`,describe:`Operations for users`,builder:e=>e.command(pg).command(gg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},vg={command:`zero-trust`,describe:`Cloudflare's SASE platform — secure access, device posture, DLP, tunnels, gateway policies, and network segmentation`,builder:e=>e.command(Tr).command(Mr).command(ka).command(Pa).command(Hs).command(bl).command(Of).command(Lm).command(xh).command(Nh).command(og).command(lg).command(_g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{vg as default};
|