cf 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/commands.json +6724 -3970
- package/dist/_meta/hand-written-commands.json +150 -32
- package/dist/_meta/schemas.json +2083 -2159
- package/dist/abuse-reports-BAQR1w79.mjs +26 -0
- package/dist/access-C8KMplzp.mjs +27 -0
- package/dist/account-B-KQSR0L.mjs +12 -0
- package/dist/account-tags-EncLJpLc.mjs +15 -0
- package/dist/accounts-BA4Mp3A_.mjs +132 -0
- package/dist/acm-ByxUJcqF.mjs +15 -0
- package/dist/addressing-C-ym0h0G.mjs +93 -0
- package/dist/agent-memory-CkPSiZDI.mjs +34 -0
- package/dist/ai-DkE_Q64s.mjs +31 -0
- package/dist/ai-audit-pPcjYWI5.mjs +6 -0
- package/dist/ai-gateway-DtrwF1lQ.mjs +147 -0
- package/dist/ai-search-DLD_kDS1.mjs +79 -0
- package/dist/ai-security-jyZcBl9g.mjs +10 -0
- package/dist/alerting-DOROjm8E.mjs +56 -0
- package/dist/analytics-rQ-h-plT.mjs +21 -0
- package/dist/analytics_engine-Cg9gCAMt.mjs +4 -0
- package/dist/{lifecycle-XswDq0ZB.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
- package/dist/api-security-B8p8vp8u.mjs +154 -0
- package/dist/argo-g8SjUb_t.mjs +10 -0
- package/dist/artifacts-B1PaeF5h.mjs +43 -0
- package/dist/audit-logs-DmU_PHy_.mjs +4 -0
- package/dist/auth-CZqics6E.mjs +2 -0
- package/dist/auth-Cp7gT-AF.mjs +8 -0
- package/dist/billing-CvTbUg-H.mjs +23 -0
- package/dist/bot-management-z53tbcbH.mjs +9 -0
- package/dist/botnet-feed-CSBbJdr_.mjs +11 -0
- package/dist/brand-protection-DzV211IQ.mjs +27 -0
- package/dist/browser-extension-C0Hi9CHX.mjs +15 -0
- package/dist/browser-run-DYQvMAyo.mjs +46 -0
- package/dist/build-BPIp8J5F.mjs +2 -0
- package/dist/build-OC77a1zq.mjs +2 -0
- package/dist/builds-CwKRqjQ5.mjs +71 -0
- package/dist/cache-CugNPPsJ.mjs +45 -0
- package/dist/certificate-authorities-DaEnJYge.mjs +6 -0
- package/dist/cf-oadujOtC.mjs +18 -0
- package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
- package/dist/chunk-DL5FNmn1.mjs +2 -0
- package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
- package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
- package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
- package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
- package/dist/client-certificates-DZUIqBTB.mjs +13 -0
- package/dist/client-side-security-Dk6F1ENG.mjs +63 -0
- package/dist/cloud-connector-avpf86kG.mjs +6 -0
- package/dist/cloudflared-DhItYrCq.mjs +2 -0
- package/dist/cloudforce-one-DNRhUD8z.mjs +456 -0
- package/dist/command-B2Qe-WUa.mjs +2 -0
- package/dist/command-CF0giIIc.mjs +3 -0
- package/dist/command-D45NW-R3.mjs +2 -0
- package/dist/command-DIvPLK8x.mjs +2 -0
- package/dist/{completions-nPO9PdSu.mjs → completions-xPLd1cvL.mjs} +3 -3
- package/dist/{config-B8lwPpVl.mjs → config-B4vIa0zp.mjs} +1 -1
- package/dist/config.d.mts +1 -1729
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-BSztJ-Ko.mjs +6 -0
- package/dist/connector-telemetry-events-_M8CCK6_.mjs +6 -0
- package/dist/connector-telemetry-snapshots-DySvmR9a.mjs +6 -0
- package/dist/connectors-BSmhzNB7.mjs +15 -0
- package/dist/containers-B5vDcFzo.mjs +78 -0
- package/dist/{shared-YJtB5KZB.mjs → containers-CFzvhmyz.mjs} +85 -84
- package/dist/content-scan-CeLZAcbT.mjs +14 -0
- package/dist/cps-BlI_Od72.mjs +6 -0
- package/dist/csamScanner-Cn7d0HWS.mjs +10 -0
- package/dist/ct-alerting-lhgFPu-y.mjs +5 -0
- package/dist/custom-certificates-Ba4Do5qt.mjs +17 -0
- package/dist/custom-csrs-MNUIx8yX.mjs +11 -0
- package/dist/custom-hostnames-Dj1SBd0J.mjs +27 -0
- package/dist/custom-nameservers-C7nzhNzV.mjs +9 -0
- package/dist/custom-pages-BgfhGksj.mjs +21 -0
- package/dist/d1-P2kWbdID.mjs +45 -0
- package/dist/data-security-pBIozmRL.mjs +71 -0
- package/dist/dcv-delegation-Bpy9WnKZ.mjs +4 -0
- package/dist/delegate-GctF_lrq.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-QTGENpOM.mjs → deploy-CVYdt3NK.mjs} +1 -1
- package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-DpOgndz4.mjs} +1 -1
- package/dist/dev-PPUBjWcm.mjs +4 -0
- package/dist/diagnostics-C62habGQ.mjs +15 -0
- package/dist/dialog-C_ccBiZp.mjs +2 -0
- package/dist/dist-B4pQ4CXK.mjs +48 -0
- package/dist/{dist-DW5BPGFs.mjs → dist-BpadEMNY.mjs} +1 -1
- package/dist/dist-dc4E1u01.mjs +272 -0
- package/dist/dls-CpkcyQ8C.mjs +17 -0
- package/dist/dns-DG1X4Wap.mjs +135 -0
- package/dist/dns-firewall-B1gGHEDo.mjs +71 -0
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
- package/dist/dry-run-CLX6Pbtq.mjs +2 -0
- package/dist/durable-objects-D214VhxH.mjs +8 -0
- package/dist/email-auth-Ba4ONan2.mjs +6 -0
- package/dist/email-routing-BlqKnqNM.mjs +45 -0
- package/dist/email-security-Dl1E1Dko.mjs +160 -0
- package/dist/email-sending-DIRSSRIz.mjs +47 -0
- package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
- package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
- package/dist/fieldExtractors-zqYKMCEn.mjs +9 -0
- package/dist/firewall-DdsDh8GD.mjs +56 -0
- package/dist/flagship-CkUIVW7c.mjs +28 -0
- package/dist/fraud-BUpZgvQT.mjs +22 -0
- package/dist/google-tag-gateway-Bi1uLnEU.mjs +6 -0
- package/dist/healthchecks-DjQWb3EM.mjs +22 -0
- package/dist/hostnames-ClBLPbct.mjs +11 -0
- package/dist/hyperdrive-U54xZsWU.mjs +37 -0
- package/dist/iam-T-wWmOep.mjs +52 -0
- package/dist/images-ia5UG1GW.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BhswZLMI.mjs +76 -0
- package/dist/interactive-B6woOLo-.mjs +32 -0
- package/dist/interactive-DnUvQHjc.mjs +2 -0
- package/dist/ips-Dad_EvhM.mjs +4 -0
- package/dist/keyless-certificates-BhHaxLjM.mjs +13 -0
- package/dist/keys-DjIPvqj4.mjs +4 -0
- package/dist/kv-DzXVnK94.mjs +21 -0
- package/dist/leaked-credential-checks-B9G_ZTNH.mjs +18 -0
- package/dist/lifecycle-Ichnb2x1.mjs +2 -0
- package/dist/load-balancers-3wGHPsYz.mjs +76 -0
- package/dist/local-B6b2OIBW.mjs +2 -0
- package/dist/local-BrfySqnx.mjs +2 -0
- package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
- package/dist/login-CEQbOgBM.mjs +5 -0
- package/dist/login-DEWvGuaU.mjs +2 -0
- package/dist/logo-matches-YGRPstPi.mjs +6 -0
- package/dist/logos-BirufUgo.mjs +7 -0
- package/dist/logpush-BlNbUHyV.mjs +46 -0
- package/dist/logs-DmFlVF9q.mjs +48 -0
- package/dist/magic-cloud-networking-B3Wj2dhJ.mjs +71 -0
- package/dist/magic-network-monitoring-ry63w2Rw.mjs +36 -0
- package/dist/magic-transit-CBVOK2aa.mjs +387 -0
- package/dist/managed-defense-BdW6s483.mjs +18 -0
- package/dist/managed-transforms-BIeiofIS.mjs +9 -0
- package/dist/matches-CAnwci0P.mjs +6 -0
- package/dist/mcp-BfhOMGFE.mjs +32 -0
- package/dist/mesh-CxUL2Wf-.mjs +26 -0
- package/dist/mtls-certificates-CzmTw4zs.mjs +13 -0
- package/dist/network-C68psMbz.mjs +50 -0
- package/dist/network-interconnects-CLsMrTuk.mjs +73 -0
- package/dist/oauth-D4bkeMAw.mjs +14 -0
- package/dist/oauth-DouM-qz0.mjs +2 -0
- package/dist/oauth-clients-DbUmVE_5.mjs +16 -0
- package/dist/oauth-scopes-CQ18rwBg.mjs +4 -0
- package/dist/observability-DpYxkFeZ.mjs +80 -0
- package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-C4CKEADM.mjs} +3 -3
- package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
- package/dist/organization-Dg55Xfz7.mjs +75 -0
- package/dist/organizations-QnyzGjB2.mjs +4 -0
- package/dist/origin-ca-certificates-Co5lqIGL.mjs +11 -0
- package/dist/origin-post-quantum-encryption-Cz8JZamC.mjs +6 -0
- package/dist/origin-tls-client-auth-Dd0T1Kfv.mjs +30 -0
- package/dist/{output-COcSQsfn.mjs → output-Bia1u2k5.mjs} +1 -1
- package/dist/page-rules--D3eXrCf.mjs +39 -0
- package/dist/pages-Ce8DDgNr.mjs +60 -0
- package/dist/pay-per-crawl-CpkEbasz.mjs +65 -0
- package/dist/pay-per-use-fyM1DWgY.mjs +6 -0
- package/dist/pipelines-CAqCgBLh.mjs +44 -0
- package/dist/precursor-DBnn4Q35.mjs +4 -0
- package/dist/previews-y_nSqWK5.mjs +4 -0
- package/dist/progress-Bi02B6v4.mjs +2 -0
- package/dist/project-settings-DSXevRvj.mjs +3 -0
- package/dist/prompt-Bx2PB-tt.mjs +3 -0
- package/dist/queries-dg-CVXjf.mjs +9 -0
- package/dist/queues-C_ilLbRI.mjs +63 -0
- package/dist/r2-data-catalog-DGv6aROr.mjs +44 -0
- package/dist/r2-hZAkra-l.mjs +127 -0
- package/dist/radar-BO9b0aZy.mjs +300 -0
- package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNTQkXbg.mjs} +1 -1
- package/dist/realtime-eSavuSeE.mjs +172 -0
- package/dist/registrar-Ct30kOXZ.mjs +43 -0
- package/dist/registrar-sandbox-Dmn9zGUk.mjs +56 -0
- package/dist/{registry-CWUfXloz.mjs → registry-vreNkX6u.mjs} +1 -1
- package/dist/reporting-B-F5aWUJ.mjs +14 -0
- package/dist/request-headers-Dnbzv6RZ.mjs +2 -0
- package/dist/request-tracers-CaubpUFV.mjs +4 -0
- package/dist/resolve-BXemCSyA.mjs +2 -0
- package/dist/resolve-CUDKxUrW.mjs +2 -0
- package/dist/resource-sharing-6Snv-b69.mjs +40 -0
- package/dist/resource-tagging-W_LFiX2J.mjs +4 -0
- package/dist/rules-C26eyeA5.mjs +18 -0
- package/dist/rulesets-BKzIwVtJ.mjs +37 -0
- package/dist/rum-Xdw5hyWY.mjs +30 -0
- package/dist/run-BBBMrSrs.mjs +2 -0
- package/dist/run-BRucX7Rz.mjs +2 -0
- package/dist/{schema-C8hU6G9R.mjs → schema-DqtYndhB.mjs} +1 -1
- package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CebDI0f1.mjs} +4 -4
- package/dist/scim-odJTXiIe.mjs +18 -0
- package/dist/{sdk-C12y5qCN.mjs → sdk-CvIO3tWS.mjs} +1 -1
- package/dist/secrets-store-RYpWWzaw.mjs +24 -0
- package/dist/security-center-B3D95vCa.mjs +30 -0
- package/dist/security-txt-BSytVv-9.mjs +9 -0
- package/dist/shared-D67owd9x.mjs +2 -0
- package/dist/smart-shield-C83Sfnf4.mjs +24 -0
- package/dist/snippets-B6oE9WIa.mjs +20 -0
- package/dist/source-BR4_k2ad.mjs +6 -0
- package/dist/spawn-CKqJ9J4_.mjs +523 -0
- package/dist/spectrum-CfxY--X_.mjs +83 -0
- package/dist/speed-DzK-kiWt.mjs +24 -0
- package/dist/src-B3h6tKMt.mjs +108 -0
- package/dist/ssl-dnjzPcSB.mjs +45 -0
- package/dist/startup-profile-CYEokTVe.mjs +2 -0
- package/dist/startup-profile-CgWHy4rE.mjs +17 -0
- package/dist/state-BxCejn42.mjs +2 -0
- package/dist/state-DSzkxXML.mjs +2 -0
- package/dist/stream-oFyhS4Wi.mjs +102 -0
- package/dist/submit-4f-ravmC.mjs +4 -0
- package/dist/tags-DrIP6Uiq.mjs +4 -0
- package/dist/{telemetry-DjGNSlkU.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
- package/dist/telemetry-Ds4epd3D.mjs +2 -0
- package/dist/telemetry-mKEb8lYB.mjs +2 -0
- package/dist/tenant-C-gc3NWv.mjs +12 -0
- package/dist/tenant-custom-nameservers-DduTQIwh.mjs +9 -0
- package/dist/{tools-D9RZkZRc.mjs → tools-BMKpYraQ.mjs} +1 -1
- package/dist/tunnels-D0QYsskp.mjs +29 -0
- package/dist/turnstile-C6Q3spRB.mjs +33 -0
- package/dist/ui-DH95w1Qk.mjs +5 -0
- package/dist/undici-DTSBJHNS.mjs +96 -0
- package/dist/update-check-BBS1K1jt.mjs +2 -0
- package/dist/update-check-CTLoakFV.mjs +2 -0
- package/dist/update-check-worker.mjs +2 -0
- package/dist/url-info-Cs0V89qq.mjs +4 -0
- package/dist/url-normalization-DaEQYy5h.mjs +9 -0
- package/dist/url-scanner-C4YVeQ4v.mjs +16 -0
- package/dist/user-BV1VY3Kl.mjs +112 -0
- package/dist/values-qDS63E43.mjs +4 -0
- package/dist/vectorize-NFzD3mP5.mjs +32 -0
- package/dist/version-W6_TN_kN.mjs +2 -0
- package/dist/waiting-rooms-Y9YGj3ih.mjs +53 -0
- package/dist/web-assets-Gd6z8dbt.mjs +64 -0
- package/dist/web3-DCJx4NRp.mjs +28 -0
- package/dist/workers-B-j-1ygi.mjs +36 -0
- package/dist/workers-builds-DPrNKjZW.mjs +14 -0
- package/dist/workers-for-platforms-BjKAhMLA.mjs +25 -0
- package/dist/workers-vpc-C5YoCnQK.mjs +13 -0
- package/dist/workflows-C2KKIJjl.mjs +43 -0
- package/dist/zaraz-CVLCs1IX.mjs +22 -0
- package/dist/zero-trust-BtJi4OXF.mjs +795 -0
- package/dist/zone-hKgt0WzO.mjs +4 -0
- package/dist/zones-CCNyaD3J.mjs +124 -0
- package/package.json +15 -12
- package/dist/_meta/agent-context.json +0 -193
- package/dist/abuse-reports-BbaHw4ST.mjs +0 -8
- package/dist/access-D6Xz892p.mjs +0 -11
- package/dist/account-DvxcqeaK.mjs +0 -2
- package/dist/account-tags-CeqfEWpz.mjs +0 -9
- package/dist/accounts-Bx-8BMH9.mjs +0 -30
- package/dist/acm--0opdSGE.mjs +0 -3
- package/dist/addressing-BS1ynzLA.mjs +0 -13
- package/dist/agent-context-BPhyrSns.mjs +0 -8
- package/dist/agent-memory-DczzpEw5.mjs +0 -6
- package/dist/ai-CDdCTcQl.mjs +0 -5
- package/dist/ai-audit-Bx9KMQYh.mjs +0 -2
- package/dist/ai-gateway-BSXJEaYS.mjs +0 -13
- package/dist/ai-search-DRQj1aMu.mjs +0 -7
- package/dist/ai-security-C_Rb0lGT.mjs +0 -4
- package/dist/alerting-BAR9eFs2.mjs +0 -6
- package/dist/analytics-BaUZwNc5.mjs +0 -4
- package/dist/analytics_engine-DkEzlhfT.mjs +0 -2
- package/dist/api-security-jA0lOk6a.mjs +0 -50
- package/dist/argo-Cz4pDagx.mjs +0 -2
- package/dist/artifacts-BcLTGfAv.mjs +0 -5
- package/dist/audit-logs-DbIv4n6u.mjs +0 -2
- package/dist/auth-rW5d3jtr.mjs +0 -5
- package/dist/auth-tvDdC1J-.mjs +0 -8
- package/dist/billing-Md87QjqW.mjs +0 -3
- package/dist/bot-management-VHMo4hpU.mjs +0 -5
- package/dist/botnet-feed-BHqfo3sa.mjs +0 -3
- package/dist/brand-protection-HUeR6Pof.mjs +0 -3
- package/dist/browser-extension-199oZg3X.mjs +0 -3
- package/dist/browser-run-DDasyux-.mjs +0 -4
- package/dist/build-0QlYUfFS.mjs +0 -2
- package/dist/builds-B-lXn6JR.mjs +0 -9
- package/dist/cache-CevKpiTM.mjs +0 -9
- package/dist/certificate-authorities-DAg-aO1B.mjs +0 -2
- package/dist/cf-C11NGkjx.mjs +0 -18
- package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
- package/dist/chunk-QBZBEHZB-BuiXJn8j.mjs +0 -2
- package/dist/chunk-vbHwaUoU.mjs +0 -2
- package/dist/client-certificates-Bay7oPLE.mjs +0 -3
- package/dist/client-side-security-CbU9xn0k.mjs +0 -37
- package/dist/cloud-connector-AH2ClcSL.mjs +0 -2
- package/dist/cloudforce-one-DwOfS75V.mjs +0 -32
- package/dist/command-CMzMsll4.mjs +0 -2
- package/dist/connector-interrupts-DcLrqM2V.mjs +0 -2
- package/dist/connector-telemetry-events-PrJWgNs9.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +0 -2
- package/dist/connectors-CEAy30E-.mjs +0 -3
- package/dist/containers-BsbDqbSn.mjs +0 -58
- package/dist/content-scan-BdK936iO.mjs +0 -4
- package/dist/cps-oP97-qkm.mjs +0 -2
- package/dist/csamScanner-DUNN4INg.mjs +0 -6
- package/dist/ct-alerting-dV_gsV2w.mjs +0 -3
- package/dist/custom-certificates-DYspvjo4.mjs +0 -5
- package/dist/custom-csrs-DjSWLQRu.mjs +0 -3
- package/dist/custom-hostnames-df1lH6IY.mjs +0 -5
- package/dist/custom-nameservers-CLTbN-9R.mjs +0 -3
- package/dist/custom-pages-DzKnSgL3.mjs +0 -3
- package/dist/d1-JBEqjJoj.mjs +0 -20
- package/dist/data-security-CIktWnXt.mjs +0 -7
- package/dist/dcv-delegation-_r6Vc6VL.mjs +0 -2
- package/dist/dev-CAubuxCc.mjs +0 -4
- package/dist/diagnostics-B0DRh714.mjs +0 -3
- package/dist/dist-12KzRsBM.mjs +0 -387
- package/dist/dist-BCVqQpg2.mjs +0 -2
- package/dist/dist-Cp3uJN1x.mjs +0 -48
- package/dist/dist-S9K_8gq9.mjs +0 -9
- package/dist/dls-CFzTHcZM.mjs +0 -3
- package/dist/dns-Dw6u-NV1.mjs +0 -29
- package/dist/dns-firewall-CIPptslp.mjs +0 -57
- package/dist/dry-run-DiVy1lVo.mjs +0 -2
- package/dist/durable-objects-CCkeqqBq.mjs +0 -2
- package/dist/email-auth-kdxO51Oz.mjs +0 -2
- package/dist/email-routing-BLggZdQq.mjs +0 -6
- package/dist/email-security-DjADlgdM.mjs +0 -18
- package/dist/email-sending-Cz7E7GoP.mjs +0 -7
- package/dist/error-sanitization-DfLijlBJ.mjs +0 -2
- package/dist/fieldExtractors-BWaMi6lD.mjs +0 -3
- package/dist/firewall-5t6OBIOl.mjs +0 -8
- package/dist/flagship-CzG_VoNR.mjs +0 -4
- package/dist/fraud-UOg_69Ob.mjs +0 -20
- package/dist/google-tag-gateway-DirkD-Q2.mjs +0 -2
- package/dist/healthchecks-BkHZGTp1.mjs +0 -4
- package/dist/hostnames-EUYOZm21.mjs +0 -3
- package/dist/hyperdrive-ZoLJlJCL.mjs +0 -21
- package/dist/iam-BQ2xSgYN.mjs +0 -6
- package/dist/images-CkEq6ScP.mjs +0 -8
- package/dist/intel-DDWEdGyl.mjs +0 -8
- package/dist/interactive-B2E03Fs-.mjs +0 -11
- package/dist/interactive-_B-EqD0Y.mjs +0 -23
- package/dist/ips-54Qmy-Uw.mjs +0 -2
- package/dist/keyless-certificates-CXHLc3Qz.mjs +0 -3
- package/dist/keys-rvI4TC3Z.mjs +0 -2
- package/dist/kv-CAeN1zBy.mjs +0 -5
- package/dist/leaked-credential-checks-CbbwtG-p.mjs +0 -4
- package/dist/load-balancers-BFwdwAIU.mjs +0 -6
- package/dist/local-C6XsFD_W.mjs +0 -2
- package/dist/logexplorer-D8rOPB5I.mjs +0 -17
- package/dist/logo-matches-Y3PxVn7t.mjs +0 -2
- package/dist/logos-BN8SvJhS.mjs +0 -3
- package/dist/logpush-BnLA4WVm.mjs +0 -4
- package/dist/logs-CDo7Y5sA.mjs +0 -3
- package/dist/magic-cloud-networking-wPuLwu-F.mjs +0 -5
- package/dist/magic-network-monitoring-BNERUpxS.mjs +0 -4
- package/dist/magic-transit-6tvVOECW.mjs +0 -111
- package/dist/managed-defense-AYwBOYIH.mjs +0 -2
- package/dist/managed-transforms-HZZNrkC7.mjs +0 -3
- package/dist/matches-Dp91L3dL.mjs +0 -2
- package/dist/mcp-P7pcieiT.mjs +0 -4
- package/dist/mesh-DjFrk6PL.mjs +0 -4
- package/dist/mtls-certificates-DZMoef2H.mjs +0 -3
- package/dist/network-7cd1U6-I.mjs +0 -6
- package/dist/network-interconnects-CQ7cPZjK.mjs +0 -41
- package/dist/oauth-DH3kMXSs.mjs +0 -14
- package/dist/oauth-clients-P9t-eMnx.mjs +0 -4
- package/dist/oauth-scopes-C3r9Qh_y.mjs +0 -2
- package/dist/observability-M1DnLhMR.mjs +0 -10
- package/dist/organization-cUE7GDCt.mjs +0 -45
- package/dist/organizations-C-Hcpd0w.mjs +0 -2
- package/dist/origin-ca-certificates-C8cJMyQH.mjs +0 -3
- package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +0 -2
- package/dist/origin-tls-client-auth-BsjR5EAV.mjs +0 -4
- package/dist/page-rules-B-zq1EUb.mjs +0 -27
- package/dist/pages-B6YpkPos.mjs +0 -14
- package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
- package/dist/pipelines-BJc_RylD.mjs +0 -6
- package/dist/precursor-CLQu7suY.mjs +0 -4
- package/dist/progress-V6SZV3Ux.mjs +0 -2
- package/dist/prompt-DjRTpML4.mjs +0 -3
- package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
- package/dist/queries-DSrrket-.mjs +0 -3
- package/dist/queues-Tf7kPBpn.mjs +0 -7
- package/dist/r2-DmKNnxtC.mjs +0 -25
- package/dist/r2-data-catalog-DBxoifOq.mjs +0 -16
- package/dist/radar-Csk7Ab-b.mjs +0 -2
- package/dist/realtime-CDehZVhV.mjs +0 -20
- package/dist/registrar-sandbox-BxVdfnam.mjs +0 -56
- package/dist/registrar-vflzeNQ9.mjs +0 -43
- package/dist/reporting-BaPZ1PHN.mjs +0 -2
- package/dist/request-headers-CC4eHmI2.mjs +0 -3
- package/dist/request-tracers-C_UVBexV.mjs +0 -2
- package/dist/resolve-B8CyM1mi.mjs +0 -2
- package/dist/resource-sharing-CoB4S9j1.mjs +0 -6
- package/dist/resource-tagging-CUiUC5g4.mjs +0 -2
- package/dist/rules-4O8076_s.mjs +0 -4
- package/dist/rulesets-C84MxTYo.mjs +0 -5
- package/dist/rum-Bvwkrntx.mjs +0 -4
- package/dist/run-CRfinkSe.mjs +0 -2
- package/dist/schemas-O_ZNaF8R.mjs +0 -65
- package/dist/scim-BvxQmde6.mjs +0 -4
- package/dist/secrets-store-DOKWiC-j.mjs +0 -7
- package/dist/security-center-Bhy_aC-w.mjs +0 -2
- package/dist/security-txt-L7HJ9tq5.mjs +0 -3
- package/dist/smart-shield-COMXuQ1S.mjs +0 -4
- package/dist/snippets-DffQhlKt.mjs +0 -4
- package/dist/spawn-C1AISA2V.mjs +0 -526
- package/dist/spectrum-Cmf7SqQE.mjs +0 -63
- package/dist/speed-m8cdhLFS.mjs +0 -4
- package/dist/src-C8phrg-8.mjs +0 -109
- package/dist/ssl-D4ffsdSw.mjs +0 -15
- package/dist/startup-profile-Dx95Y5cl.mjs +0 -17
- package/dist/state-CHif8Y5I.mjs +0 -2
- package/dist/stream-DPF5fojV.mjs +0 -16
- package/dist/submit-Br8hfP0_.mjs +0 -2
- package/dist/tags-Bnt4JuxQ.mjs +0 -2
- package/dist/telemetry-Ch1vCICm.mjs +0 -2
- package/dist/tenant-D8u0CxoC.mjs +0 -2
- package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +0 -3
- package/dist/tunnels-BkNPpTHa.mjs +0 -5
- package/dist/turnstile-MgwRECJv.mjs +0 -23
- package/dist/ui-DQSZeaG5.mjs +0 -5
- package/dist/url-info-Ddp7MgcI.mjs +0 -2
- package/dist/url-normalization-3ptK9ntV.mjs +0 -3
- package/dist/url-scanner-Psb9ollR.mjs +0 -2
- package/dist/user-DWdshcIu.mjs +0 -12
- package/dist/values-CDKQL1z2.mjs +0 -2
- package/dist/vectorize-CTYYUyQj.mjs +0 -4
- package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
- package/dist/web-assets-CpDwDEx8.mjs +0 -8
- package/dist/web3-YsjDyAzH.mjs +0 -4
- package/dist/workers-BKKxaZcz.mjs +0 -6
- package/dist/workers-builds-BWo5vUA9.mjs +0 -2
- package/dist/workers-for-platforms-ASJsxYdM.mjs +0 -5
- package/dist/workers-vpc-RkTnRvA2.mjs +0 -3
- package/dist/workflows-KrIFI9ns.mjs +0 -5
- package/dist/zaraz-DglXbVzZ.mjs +0 -2
- package/dist/zero-trust-RilTdSjX.mjs +0 -91
- package/dist/zone-DsBtVkvT.mjs +0 -2
- package/dist/zones-BFxvWFQW.mjs +0 -44
- /package/dist/{alerts-B2SJO4nd.mjs → alerts-CstOk8n0.mjs} +0 -0
- /package/dist/{autorag-iNjZXw1n.mjs → autorag-PRTwXGgn.mjs} +0 -0
- /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
- /package/dist/{brands-BrVnNrT3.mjs → brands-BHRXlWDm.mjs} +0 -0
- /package/dist/{clear-an9o3dJ3.mjs → clear-UvKESVx3.mjs} +0 -0
- /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-tt_LZMbn.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
- /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-BqTDXNBo.mjs} +0 -0
- /package/dist/{health-CIUg1C5o.mjs → health-CwPzzrV6.mjs} +0 -0
- /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
- /package/dist/{internal-DmpATljO.mjs → internal-WLHfxX64.mjs} +0 -0
- /package/dist/{live-B66u3_0g.mjs → live-D_k7eHdv.mjs} +0 -0
- /package/dist/{metadata-D062SVyy.mjs → metadata-APBiectA.mjs} +0 -0
- /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
- /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-C3K9smdl.mjs} +0 -0
- /package/dist/{ready-C-H2cwp_.mjs → ready-CvwvbdTX.mjs} +0 -0
- /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
- /package/dist/{refute-uSlzkQKq.mjs → refute-CIAFMj00.mjs} +0 -0
- /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
- /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
- /package/dist/{search-BlKeSfVD.mjs → search-12jA1b4l.mjs} +0 -0
- /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
- /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
- /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-CJTc9Pde.mjs} +0 -0
- /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
- /package/dist/{verify-S-TmhUDr.mjs → verify-CZW5Fo1q.mjs} +0 -0
|
@@ -0,0 +1,795 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{_ as t,m as n,v as r}from"./oauth-D4bkeMAw.mjs";import{a as i,r as a}from"./auth-Cp7gT-AF.mjs";import{t as o}from"./output-Bia1u2k5.mjs";import{t as s}from"./dry-run-CLX6Pbtq.mjs";import{t as c}from"./progress-Bi02B6v4.mjs";import{t as l}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-CUWbw_Tq.mjs";import{n as m,t as h}from"./input-validation-Ch4Vllrm.mjs";import{a as g,i as _,n as v}from"./prompt-Bx2PB-tt.mjs";import{t as y}from"./cli-types-tt_LZMbn.mjs";import{n as ee,t as te}from"./raw-fetch-DNTQkXbg.mjs";function b(e){return e.usage(`$0 zero-trust access applications cas create <app-id>
|
|
3
|
+
|
|
4
|
+
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 x={command:`create <app-id>`,describe:`Create a short-lived certificate CA`,builder:b,handler:async i=>l({command:`zero-trust access applications cas create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Creating`,async()=>l.zeroTrust.access.applications.cas.create({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Created`})})};function S(e){return e.usage(`$0 zero-trust access applications cas delete <app-id>
|
|
5
|
+
|
|
6
|
+
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 C={command:`delete <app-id>`,describe:`Delete a short-lived certificate CA`,builder:S,handler:async i=>l({command:`zero-trust access applications cas delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.applications.cas.delete({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Deleted`})})};function w(e){return e.usage(`$0 zero-trust access applications cas get <app-id>
|
|
8
|
+
|
|
9
|
+
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 T={command:`get <app-id>`,describe:`Get a short-lived certificate CA`,builder:w,handler:async i=>l({command:`zero-trust access applications cas get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.cas.get({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Loaded`})})};function E(e){return e.usage(`$0 zero-trust access applications cas list
|
|
10
|
+
|
|
11
|
+
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 D={command:`list`,describe:`List short-lived certificate CAs`,builder:E,handler:async i=>l({command:`zero-trust access applications cas list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/ca`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await t({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await n();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.applications.cas.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})},O={command:`cas`,describe:`Operations for access.applications.cas`,builder:e=>e.command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.usage(`$0 zero-trust access applications create
|
|
12
|
+
|
|
13
|
+
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 A={command:`create`,describe:`Add an Access application`,builder:k,handler:async i=>l({command:`zero-trust access applications create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.access.applications.create({body:e,account_or_zone:u,account_or_zone_id:f})),{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.`)})};function j(e){return e.usage(`$0 zero-trust access applications delete <app-id>
|
|
14
|
+
|
|
15
|
+
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 M={command:`delete <app-id>`,describe:`Delete an Access application`,builder:j,handler:async i=>l({command:`zero-trust access applications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
|
|
16
|
+
`);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.applications.delete({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Deleted`})})};function N(e){return e.usage(`$0 zero-trust access applications get <app-id>
|
|
17
|
+
|
|
18
|
+
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 P={command:`get <app-id>`,describe:`Get an Access application`,builder:N,handler:async i=>l({command:`zero-trust access applications get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.get({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Loaded`})})};function F(e){return e.usage(`$0 zero-trust access applications list
|
|
19
|
+
|
|
20
|
+
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 I={command:`list`,describe:`List Access applications`,builder:F,handler:async i=>l({command:`zero-trust access applications list`,classification:{safeFlags:[`exact`,`dry-run`]}},i,async()=>{let l={name:i.name,domain:i.domain,aud:i.aud,target_attributes:i[`target-attributes`],exact:i.exact,search:i.search,page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await t({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await n();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.applications.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function L(e){return e.usage(`$0 zero-trust access applications policies create <app-id>
|
|
21
|
+
|
|
22
|
+
Creates a policy applying exclusive to a single application that defines the users or groups who can reach it. We recommend creating a reusable policy instead and subsequently referencing its ID in the application's 'policies' array.`).positional(`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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`create <app-id>`,describe:`Create an Access application policy`,builder:L,handler:async i=>l({command:`zero-trust access applications policies create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/policies`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.access.applications.policies.create({body:e,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{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.`)})};function z(e){return e.usage(`$0 zero-trust access applications policies delete <policy-id>
|
|
23
|
+
|
|
24
|
+
Deletes an Access policy specific to an application. To delete a reusable policy, use the /account or zones/{account or zone_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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const B={command:`delete <policy-id>`,describe:`Delete an Access application policy`,builder:z,handler:async i=>l({command:`zero-trust access applications policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/policies/${i[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(i[`policy-id`]))}`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"policy-id":String(i[`policy-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
|
|
25
|
+
`);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.applications.policies.delete({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`],policy_id:i[`policy-id`]})),{successLabel:`Deleted`})})};function V(e){return e.usage(`$0 zero-trust access applications policies get <policy-id>
|
|
26
|
+
|
|
27
|
+
Fetches a single Access policy configured for an application. Returns both exclusively owned and reusable policies used by the application.`).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 H={command:`get <policy-id>`,describe:`Get an Access application policy`,builder:V,handler:async i=>l({command:`zero-trust access applications policies get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/policies/${i[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(i[`policy-id`]))}`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"policy-id":String(i[`policy-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.policies.get({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`],policy_id:i[`policy-id`]})),{successLabel:`Loaded`})})};function U(e){return e.usage(`$0 zero-trust access applications policies list
|
|
28
|
+
|
|
29
|
+
Lists Access policies configured for an application. Returns both exclusively scoped and reusable policies used by the application.`).option(`app-id`,{type:`string`,description:`The application ID.`,demandOption:!0}).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 W={command:`list`,describe:`List Access application policies`,builder:U,handler:async i=>l({command:`zero-trust access applications policies list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/policies`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await t({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await n();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.applications.policies.list({account_or_zone:d,account_or_zone_id:f,app_id:i[`app-id`],...l})),{successLabel:`Loaded`})})};function G(e){return e.usage(`$0 zero-trust access applications policies update <policy-id>
|
|
30
|
+
|
|
31
|
+
Updates an Access policy specific to an application. To update a reusable policy, use the /account or zones/{account or zone_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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`update <policy-id>`,describe:`Update an Access application policy`,builder:G,handler:async i=>l({command:`zero-trust access applications policies update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/policies/${i[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(i[`policy-id`]))}`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"policy-id":String(i[`policy-id`]??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.applications.policies.update({body:e,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`],policy_id:i[`policy-id`]})),{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.`)})},q={command:`policies`,describe:`Operations for access.applications.policies`,builder:e=>e.command(R).command(B).command(H).command(W).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.usage(`$0 zero-trust access applications policy-tests create
|
|
32
|
+
|
|
33
|
+
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 Y={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){s({command:`cf zero-trust access applications policy-tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/policy-tests`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.access.applications.policyTests.create({...e,account_id:l})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>i.zeroTrust.access.applications.policyTests.create({account_id:l})),{successLabel:`Created`})})};function X(e){return e.usage(`$0 zero-trust access applications policy-tests get <policy-test-id>
|
|
34
|
+
|
|
35
|
+
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 Z={command:`get <policy-test-id>`,describe:`Get the current status of a given Access policy test`,builder:X,handler:async t=>l({command:`zero-trust access applications policy-tests get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access applications policy-tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.applications.policyTests.get({account_id:l,policy_test_id:t[`policy-test-id`]})),{successLabel:`Loaded`})})};function Q(e){return e.usage(`$0 zero-trust access applications policy-tests users list
|
|
36
|
+
|
|
37
|
+
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 ne={command:`list`,describe:`Get an Access policy test users page`,builder:y(Q),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){s({command:`cf zero-trust access applications policy-tests users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.policyTests.users.list({account_id:u,policy_test_id:t[`policy-test-id`],...i})),{successLabel:`Loaded`})})},re={command:`users`,describe:`Operations for access.applications.policy-tests.users`,builder:e=>e.command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ie={command:`policy-tests`,describe:`Operations for access.applications.policy-tests`,builder:e=>e.command(Y).command(Z).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.usage(`$0 zero-trust access applications revoke-tokens <app-id>
|
|
38
|
+
|
|
39
|
+
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 oe={command:`revoke-tokens <app-id>`,describe:`Revoke application tokens`,builder:ae,handler:async i=>l({command:`zero-trust access applications revoke-tokens`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications revoke-tokens`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/revoke_tokens`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force,message:`This operation invalidates every service token for the app.`})){process.stderr.write(`Aborted.
|
|
40
|
+
`);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.applications.revokeTokens({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Deleted`})})};function se(e){return e.usage(`$0 zero-trust access applications settings edit <app-id>
|
|
41
|
+
|
|
42
|
+
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 ce={command:`edit <app-id>`,describe:`Update Access application settings`,builder:se,handler:async i=>l({command:`zero-trust access applications settings edit`,classification:{safeFlags:[`allow-iframe`,`skip-interstitial`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/settings`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({allow_iframe:i[`allow-iframe`],skip_interstitial:i[`skip-interstitial`]}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.applications.settings.edit({body:e,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{successLabel:`Updated`});return}let m=p({allow_iframe:i[`allow-iframe`],skip_interstitial:i[`skip-interstitial`]});o(await c(`Updating`,async()=>l.zeroTrust.access.applications.settings.edit({body:m,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{successLabel:`Updated`})})};function le(e){return e.usage(`$0 zero-trust access applications settings update <app-id>
|
|
43
|
+
|
|
44
|
+
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 ue={command:`update <app-id>`,describe:`Update Access application settings`,builder:le,handler:async i=>l({command:`zero-trust access applications settings update`,classification:{safeFlags:[`allow-iframe`,`skip-interstitial`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/settings`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({allow_iframe:i[`allow-iframe`],skip_interstitial:i[`skip-interstitial`]}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.applications.settings.update({body:e,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{successLabel:`Updated`});return}let m=p({allow_iframe:i[`allow-iframe`],skip_interstitial:i[`skip-interstitial`]});o(await c(`Updating`,async()=>l.zeroTrust.access.applications.settings.update({body:m,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{successLabel:`Updated`})})},de={command:`settings`,describe:`Operations for access.applications.settings`,builder:e=>e.command(ce).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fe(e){return e.usage(`$0 zero-trust access applications update <app-id>
|
|
45
|
+
|
|
46
|
+
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 pe={command:`update <app-id>`,describe:`Update an Access application`,builder:fe,handler:async i=>l({command:`zero-trust access applications update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.applications.update({body:e,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{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.`)})};function me(e){return e.usage(`$0 zero-trust access applications user-policy-checks list
|
|
47
|
+
|
|
48
|
+
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 he={command:`list`,describe:`Test Access policies`,builder:me,handler:async i=>l({command:`zero-trust access applications user-policy-checks list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications user-policy-checks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/user_policy_checks`,pathParams:{"account-or-zone":String(t),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.userPolicyChecks.list({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Loaded`})})},ge={command:`user-policy-checks`,describe:`Operations for access.applications.user-policy-checks`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_e={command:`applications`,describe:`Operations for access.applications`,builder:e=>e.command(A).command(M).command(P).command(I).command(oe).command(pe).command(O).command(q).command(ie).command(de).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.usage(`$0 zero-trust access authenticator-device-aaguids list
|
|
49
|
+
|
|
50
|
+
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 ye={command:`list`,describe:`List authenticator device AAGUIDs`,builder:ve,handler:async t=>l({command:`zero-trust access authenticator-device-aaguids list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access authenticator-device-aaguids list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/authenticator_device_aaguids`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.authenticatorDeviceAaguids.list({account_id:l})),{successLabel:`Loaded`})})},be={command:`authenticator-device-aaguids`,describe:`Operations for access.authenticator-device-aaguids`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.usage(`$0 zero-trust access bookmarks create <bookmark-id>
|
|
51
|
+
|
|
52
|
+
Create a new Bookmark application.`).positional(`bookmark-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`create <bookmark-id>`,describe:`Create a Bookmark application`,builder:xe,handler:async t=>l({command:`zero-trust access bookmarks create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access bookmarks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/bookmarks/${t[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(t[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(t[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.bookmarks.create({account_id:l,bookmark_id:t[`bookmark-id`]})),{successLabel:`Created`})})};function Ce(e){return e.usage(`$0 zero-trust access bookmarks delete <bookmark-id>
|
|
53
|
+
|
|
54
|
+
Deletes a Bookmark application.`).positional(`bookmark-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 we={command:`delete <bookmark-id>`,describe:`Delete a Bookmark application`,builder:Ce,handler:async t=>l({command:`zero-trust access bookmarks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access bookmarks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/bookmarks/${t[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(t[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(t[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
55
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.bookmarks.delete({account_id:l,bookmark_id:t[`bookmark-id`]})),{successLabel:`Deleted`})})};function Te(e){return e.usage(`$0 zero-trust access bookmarks get <bookmark-id>
|
|
56
|
+
|
|
57
|
+
Fetches a single Bookmark application.`).positional(`bookmark-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get <bookmark-id>`,describe:`Get a Bookmark application`,builder:Te,handler:async t=>l({command:`zero-trust access bookmarks get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access bookmarks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/bookmarks/${t[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(t[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(t[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.bookmarks.get({account_id:l,bookmark_id:t[`bookmark-id`]})),{successLabel:`Loaded`})})};function De(e){return e.usage(`$0 zero-trust access bookmarks list
|
|
58
|
+
|
|
59
|
+
Lists Bookmark applications.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`List Bookmark applications`,builder:De,handler:async t=>l({command:`zero-trust access bookmarks list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access bookmarks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/bookmarks`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.bookmarks.list({account_id:l})),{successLabel:`Loaded`})})};function ke(e){return e.usage(`$0 zero-trust access bookmarks update <bookmark-id>
|
|
60
|
+
|
|
61
|
+
Updates a configured Bookmark application.`).positional(`bookmark-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`update <bookmark-id>`,describe:`Update a Bookmark application`,builder:ke,handler:async t=>l({command:`zero-trust access bookmarks update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access bookmarks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/bookmarks/${t[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(t[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(t[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Updating`,async()=>i.zeroTrust.access.bookmarks.update({account_id:l,bookmark_id:t[`bookmark-id`]})),{successLabel:`Updated`})})},je={command:`bookmarks`,describe:`Operations for access.bookmarks`,builder:e=>e.command(Se).command(we).command(Ee).command(Oe).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Me(e){return e.usage(`$0 zero-trust access certificates create
|
|
62
|
+
|
|
63
|
+
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 Ne={command:`create`,describe:`Add an mTLS certificate`,builder:Me,handler:async i=>l({command:`zero-trust access certificates create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/certificates`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({associated_hostnames:i[`associated-hostnames`],certificate:m(i.certificate,`certificate`,`text`),name:m(i.name,`name`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.access.certificates.create({...e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`});return}i.certificate===void 0&&(i.certificate=await g(`certificate`,`The certificate content.`)),i.name===void 0&&(i.name=await g(`name`,`The name of the certificate.`));let h=p({associated_hostnames:i[`associated-hostnames`],certificate:m(i.certificate,`certificate`,`text`),name:m(i.name,`name`,`text`)});o(await c(`Creating`,async()=>l.zeroTrust.access.certificates.create({...h,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`})})};function Pe(e){return e.usage(`$0 zero-trust access certificates delete <certificate-id>
|
|
64
|
+
|
|
65
|
+
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 Fe={command:`delete <certificate-id>`,describe:`Delete an mTLS certificate`,builder:Pe,handler:async i=>l({command:`zero-trust access certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"account-or-zone":String(t),"certificate-id":String(i[`certificate-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
|
|
66
|
+
`);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.certificates.delete({account_or_zone:u,account_or_zone_id:d,certificate_id:i[`certificate-id`]})),{successLabel:`Deleted`})})};function Ie(e){return e.usage(`$0 zero-trust access certificates get <certificate-id>
|
|
67
|
+
|
|
68
|
+
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 Le={command:`get <certificate-id>`,describe:`Get an mTLS certificate`,builder:Ie,handler:async i=>l({command:`zero-trust access certificates get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"account-or-zone":String(t),"certificate-id":String(i[`certificate-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.certificates.get({account_or_zone:u,account_or_zone_id:d,certificate_id:i[`certificate-id`]})),{successLabel:`Loaded`})})};function Re(e){return e.usage(`$0 zero-trust access certificates list
|
|
69
|
+
|
|
70
|
+
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 ze={command:`list`,describe:`List mTLS certificates`,builder:Re,handler:async i=>l({command:`zero-trust access certificates list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/certificates`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await t({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await n();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.certificates.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function Be(e){return e.usage(`$0 zero-trust access certificates settings get
|
|
71
|
+
|
|
72
|
+
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 Ve={command:`get`,describe:`List all mTLS hostname settings`,builder:Be,handler:async i=>l({command:`zero-trust access certificates settings get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/certificates/settings`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.certificates.settings.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})})};function He(e){return e.usage(`$0 zero-trust access certificates settings update
|
|
73
|
+
|
|
74
|
+
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 Ue={command:`update`,describe:`Update an mTLS certificate's hostname settings`,builder:He,handler:async i=>l({command:`zero-trust access certificates settings update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/certificates/settings`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({settings:f(i.settings,`settings`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,m=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=m:i.accountId=m,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.certificates.settings.update({...e,account_or_zone:u,account_or_zone_id:m})),{successLabel:`Updated`});return}if(i.settings===void 0)throw Error(`--settings is required (or pass --body with this field set).`);let h=p({settings:f(i.settings,`settings`)});o(await c(`Updating`,async()=>l.zeroTrust.access.certificates.settings.update({...h,account_or_zone:u,account_or_zone_id:m})),{successLabel:`Updated`})})},We={command:`settings`,describe:`Operations for access.certificates.settings`,builder:e=>e.command(Ve).command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ge(e){return e.usage(`$0 zero-trust access certificates update <certificate-id>
|
|
75
|
+
|
|
76
|
+
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 Ke={command:`update <certificate-id>`,describe:`Update an mTLS certificate`,builder:Ge,handler:async i=>l({command:`zero-trust access certificates update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"account-or-zone":String(t),"certificate-id":String(i[`certificate-id`]??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({associated_hostnames:i[`associated-hostnames`],name:m(i.name,`name`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.certificates.update({...e,account_or_zone:u,account_or_zone_id:f,certificate_id:i[`certificate-id`]})),{successLabel:`Updated`});return}if(i[`associated-hostnames`]===void 0)throw Error(`--associated-hostnames is required (or pass --body with this field set).`);let h=p({associated_hostnames:i[`associated-hostnames`],name:m(i.name,`name`,`text`)});o(await c(`Updating`,async()=>l.zeroTrust.access.certificates.update({...h,account_or_zone:u,account_or_zone_id:f,certificate_id:i[`certificate-id`]})),{successLabel:`Updated`})})},qe={command:`certificates`,describe:`Operations for access.certificates`,builder:e=>e.command(Ne).command(Fe).command(Le).command(ze).command(Ke).command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Je(e){return e.usage(`$0 zero-trust access custom-pages create
|
|
77
|
+
|
|
78
|
+
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 Ye={command:`create`,describe:`Create a custom page`,builder:Je,handler:async t=>l({command:`zero-trust access custom-pages create`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access custom-pages create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.access.customPages.create({body:e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.access.customPages.create({body:u,account_id:l})),{successLabel:`Created`})})};function Xe(e){return e.usage(`$0 zero-trust access custom-pages delete <custom-page-id>
|
|
79
|
+
|
|
80
|
+
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 Ze={command:`delete <custom-page-id>`,describe:`Delete a custom page`,builder:Xe,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){s({command:`cf zero-trust access custom-pages delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
81
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.customPages.delete({account_id:l,custom_page_id:t[`custom-page-id`]})),{successLabel:`Deleted`})})};function Qe(e){return e.usage(`$0 zero-trust access custom-pages get <custom-page-id>
|
|
82
|
+
|
|
83
|
+
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 $e={command:`get <custom-page-id>`,describe:`Get a custom page`,builder:Qe,handler:async t=>l({command:`zero-trust access custom-pages get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.customPages.get({account_id:l,custom_page_id:t[`custom-page-id`]})),{successLabel:`Loaded`})})};function et(e){return e.usage(`$0 zero-trust access custom-pages list
|
|
84
|
+
|
|
85
|
+
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 tt={command:`list`,describe:`List custom pages`,builder:et,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){s({command:`cf zero-trust access custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/custom_pages`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.customPages.list({account_id:u,...i})),{successLabel:`Loaded`})})};function nt(e){return e.usage(`$0 zero-trust access custom-pages update <custom-page-id>
|
|
86
|
+
|
|
87
|
+
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 rt={command:`update <custom-page-id>`,describe:`Update a custom page`,builder:nt,handler:async t=>l({command:`zero-trust access custom-pages update`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.access.customPages.update({body:e,account_id:l,custom_page_id:t[`custom-page-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.access.customPages.update({body:u,account_id:l,custom_page_id:t[`custom-page-id`]})),{successLabel:`Updated`})})};function it(e){return e.usage(`$0 zero-trust access custom-pages validate
|
|
88
|
+
|
|
89
|
+
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(`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 at={command:`validate`,describe:`Validate a custom page template`,builder:it,handler:async t=>l({command:`zero-trust access custom-pages validate`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access custom-pages validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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.version}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.access.customPages.validate({...e,account_id:l})),{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.version});o(await c(`Creating`,async()=>i.zeroTrust.access.customPages.validate({...u,account_id:l})),{successLabel:`Created`})})},ot={command:`custom-pages`,describe:`Operations for access.custom-pages`,builder:e=>e.command(Ye).command(Ze).command($e).command(tt).command(rt).command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function st(e){return e.usage(`$0 zero-trust access gateway-ca create
|
|
90
|
+
|
|
91
|
+
Adds a new SSH Certificate Authority (CA).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ct={command:`create`,describe:`Add a new SSH Certificate Authority (CA)`,builder:st,handler:async t=>l({command:`zero-trust access gateway-ca create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access gateway-ca create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/gateway_ca`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.gatewayCa.create({account_id:l})),{successLabel:`Created`})})};function lt(e){return e.usage(`$0 zero-trust access gateway-ca delete <certificate-id>
|
|
92
|
+
|
|
93
|
+
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 ut={command:`delete <certificate-id>`,describe:`Delete an SSH Certificate Authority (CA)`,builder:lt,handler:async t=>l({command:`zero-trust access gateway-ca delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access gateway-ca delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
94
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.gatewayCa.delete({account_id:l,certificate_id:t[`certificate-id`]})),{successLabel:`Deleted`})})};function dt(e){return e.usage(`$0 zero-trust access gateway-ca list
|
|
95
|
+
|
|
96
|
+
Lists SSH Certificate Authorities (CA).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ft={command:`list`,describe:`List SSH Certificate Authorities (CA)`,builder:dt,handler:async t=>l({command:`zero-trust access gateway-ca list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access gateway-ca list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/gateway_ca`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.gatewayCa.list({account_id:l})),{successLabel:`Loaded`})})},pt={command:`gateway-ca`,describe:`Operations for access.gateway-ca`,builder:e=>e.command(ct).command(ut).command(ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function mt(e){return e.usage(`$0 zero-trust access groups create
|
|
97
|
+
|
|
98
|
+
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 ht={command:`create`,describe:`Create an Access group`,builder:mt,handler:async i=>l({command:`zero-trust access groups create`,classification:{safeFlags:[`is-default`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/groups`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({exclude:f(i.exclude,`exclude`),include:f(i.include,`include`),is_default:i[`is-default`],name:m(i.name,`name`,`text`),require:f(i.require,`require`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,h=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=h:i.accountId=h,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.access.groups.create({...e,account_or_zone:u,account_or_zone_id:h})),{successLabel:`Created`});return}if(i.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);i.name===void 0&&(i.name=await g(`name`,`The name of the Access group.`));let _=p({exclude:f(i.exclude,`exclude`),include:f(i.include,`include`),is_default:i[`is-default`],name:m(i.name,`name`,`text`),require:f(i.require,`require`)});o(await c(`Creating`,async()=>l.zeroTrust.access.groups.create({..._,account_or_zone:u,account_or_zone_id:h})),{successLabel:`Created`})})};function gt(e){return e.usage(`$0 zero-trust access groups delete <group-id>
|
|
99
|
+
|
|
100
|
+
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 _t={command:`delete <group-id>`,describe:`Delete an Access group`,builder:gt,handler:async i=>l({command:`zero-trust access groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/groups/${i[`group-id`]==null?`<group-id>`:encodeURIComponent(String(i[`group-id`]))}`,pathParams:{"account-or-zone":String(t),"group-id":String(i[`group-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
|
|
101
|
+
`);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.groups.delete({account_or_zone:u,account_or_zone_id:d,group_id:i[`group-id`]})),{successLabel:`Deleted`})})};function vt(e){return e.usage(`$0 zero-trust access groups get <group-id>
|
|
102
|
+
|
|
103
|
+
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 yt={command:`get <group-id>`,describe:`Get an Access group`,builder:vt,handler:async i=>l({command:`zero-trust access groups get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/groups/${i[`group-id`]==null?`<group-id>`:encodeURIComponent(String(i[`group-id`]))}`,pathParams:{"account-or-zone":String(t),"group-id":String(i[`group-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.groups.get({account_or_zone:u,account_or_zone_id:d,group_id:i[`group-id`]})),{successLabel:`Loaded`})})};function bt(e){return e.usage(`$0 zero-trust access groups list
|
|
104
|
+
|
|
105
|
+
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 xt={command:`list`,describe:`List Access groups`,builder:bt,handler:async i=>l({command:`zero-trust access groups list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={name:i.name,search:i.search,page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/groups`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await t({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await n();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.groups.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function St(e){return e.usage(`$0 zero-trust access groups update <group-id>
|
|
106
|
+
|
|
107
|
+
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 Ct={command:`update <group-id>`,describe:`Update an Access group`,builder:St,handler:async i=>l({command:`zero-trust access groups update`,classification:{safeFlags:[`is-default`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/groups/${i[`group-id`]==null?`<group-id>`:encodeURIComponent(String(i[`group-id`]))}`,pathParams:{"account-or-zone":String(t),"group-id":String(i[`group-id`]??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({exclude:f(i.exclude,`exclude`),include:f(i.include,`include`),is_default:i[`is-default`],name:m(i.name,`name`,`text`),require:f(i.require,`require`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,h=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=h:i.accountId=h,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.groups.update({...e,account_or_zone:u,account_or_zone_id:h,group_id:i[`group-id`]})),{successLabel:`Updated`});return}if(i.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);i.name===void 0&&(i.name=await g(`name`,`The name of the Access group.`));let _=p({exclude:f(i.exclude,`exclude`),include:f(i.include,`include`),is_default:i[`is-default`],name:m(i.name,`name`,`text`),require:f(i.require,`require`)});o(await c(`Updating`,async()=>l.zeroTrust.access.groups.update({..._,account_or_zone:u,account_or_zone_id:h,group_id:i[`group-id`]})),{successLabel:`Updated`})})},wt={command:`groups`,describe:`Operations for access.groups`,builder:e=>e.command(ht).command(_t).command(yt).command(xt).command(Ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Tt(e){return e.usage(`$0 zero-trust access idp-federation-grants create
|
|
108
|
+
|
|
109
|
+
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 Et={command:`create`,describe:`Create an IdP federation grant`,builder:Tt,handler:async t=>l({command:`zero-trust access idp-federation-grants create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access idp-federation-grants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.access.idpFederationGrants.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.access.idpFederationGrants.create({...u,account_id:l})),{successLabel:`Created`})})};function Dt(e){return e.usage(`$0 zero-trust access idp-federation-grants delete <grant-id>
|
|
110
|
+
|
|
111
|
+
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 Ot={command:`delete <grant-id>`,describe:`Delete an IdP federation grant`,builder:Dt,handler:async t=>l({command:`zero-trust access idp-federation-grants delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access idp-federation-grants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
112
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.idpFederationGrants.delete({account_id:l,grant_id:t[`grant-id`]})),{successLabel:`Deleted`})})};function kt(e){return e.usage(`$0 zero-trust access idp-federation-grants get <grant-id>
|
|
113
|
+
|
|
114
|
+
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 At={command:`get <grant-id>`,describe:`Get an IdP federation grant`,builder:kt,handler:async t=>l({command:`zero-trust access idp-federation-grants get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access idp-federation-grants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.idpFederationGrants.get({account_id:l,grant_id:t[`grant-id`]})),{successLabel:`Loaded`})})};function jt(e){return e.usage(`$0 zero-trust access idp-federation-grants list
|
|
115
|
+
|
|
116
|
+
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 Mt={command:`list`,describe:`List IdP federation grants`,builder:jt,handler:async t=>l({command:`zero-trust access idp-federation-grants list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access idp-federation-grants list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/idp_federation_grants`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.idpFederationGrants.list({account_id:l})),{successLabel:`Loaded`})})},Nt={command:`idp-federation-grants`,describe:`Operations for access.idp-federation-grants`,builder:e=>e.command(Et).command(Ot).command(At).command(Mt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pt(e){return e.usage(`$0 zero-trust access keys get
|
|
117
|
+
|
|
118
|
+
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 Ft={command:`get`,describe:`Get the Access key configuration`,builder:Pt,handler:async t=>l({command:`zero-trust access keys get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/keys`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.keys.get({account_id:l})),{successLabel:`Loaded`})})};function It(e){return e.usage(`$0 zero-trust access keys rotate
|
|
119
|
+
|
|
120
|
+
Perfoms a key rotation for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Lt={command:`rotate`,describe:`Rotate Access keys`,builder:It,handler:async t=>l({command:`zero-trust access keys rotate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access keys rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/keys/rotate`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.keys.rotate({account_id:l})),{successLabel:`Created`})})};function Rt(e){return e.usage(`$0 zero-trust access keys update
|
|
121
|
+
|
|
122
|
+
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 zt={command:`update`,describe:`Update the Access key configuration`,builder:Rt,handler:async t=>l({command:`zero-trust access keys update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access keys update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.access.keys.update({...e,account_id:l})),{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`]});o(await c(`Updating`,async()=>i.zeroTrust.access.keys.update({...u,account_id:l})),{successLabel:`Updated`})})},Bt={command:`keys`,describe:`Operations for access.keys`,builder:e=>e.command(Ft).command(Lt).command(zt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Vt(e){return e.usage(`$0 zero-trust access logs access-requests list
|
|
123
|
+
|
|
124
|
+
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.
|
|
125
|
+
When omitted, all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ht={command:`list`,describe:`Get Access authentication logs`,builder:y(Vt),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){s({command:`cf zero-trust access logs access-requests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/logs/access_requests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.logs.accessRequests.list({account_id:u,...i})),{successLabel:`Loaded`})})},Ut={command:`access-requests`,describe:`Operations for access.logs.access-requests`,builder:e=>e.command(Ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Wt(e){return e.usage(`$0 zero-trust access logs jit-requests get <knock-request-id>
|
|
126
|
+
|
|
127
|
+
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 Gt={command:`get <knock-request-id>`,describe:`Get an Access JIT request log`,builder:Wt,handler:async t=>l({command:`zero-trust access logs jit-requests get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access logs jit-requests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.logs.jitRequests.get({account_id:l,knock_request_id:t[`knock-request-id`]})),{successLabel:`Loaded`})})};function Kt(e){return e.usage(`$0 zero-trust access logs jit-requests list
|
|
128
|
+
|
|
129
|
+
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 qt={command:`list`,describe:`List Access JIT request logs`,builder:y(Kt),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){s({command:`cf zero-trust access logs jit-requests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/logs/jit_requests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.logs.jitRequests.list({account_id:u,...i})),{successLabel:`Loaded`})})},Jt={command:`jit-requests`,describe:`Operations for access.logs.jit-requests`,builder:e=>e.command(Gt).command(qt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Yt(e){return e.usage(`$0 zero-trust access logs scim updates list
|
|
130
|
+
|
|
131
|
+
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 Xt={command:`list`,describe:`List Access SCIM update logs`,builder:y(Yt),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){s({command:`cf zero-trust access logs scim updates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/logs/scim/updates`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.logs.scim.updates.list({account_id:u,...i})),{successLabel:`Loaded`})})},Zt={command:`updates`,describe:`Operations for access.logs.scim.updates`,builder:e=>e.command(Xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Qt={command:`scim`,describe:`Operations for access.logs.scim`,builder:e=>e.command(Zt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$t={command:`logs`,describe:`Operations for access.logs`,builder:e=>e.command(Ut).command(Jt).command(Qt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function en(e){return e.usage(`$0 zero-trust access policies create
|
|
132
|
+
|
|
133
|
+
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 tn={command:`create`,describe:`Create an Access reusable policy`,builder:en,handler:async t=>l({command:`zero-trust access policies create`,classification:{safeFlags:[`decision`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.access.policies.create({body:e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.access.policies.create({body:u,account_id:l})),{successLabel:`Created`})})};function nn(e){return e.usage(`$0 zero-trust access policies delete <policy-id>
|
|
134
|
+
|
|
135
|
+
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 rn={command:`delete <policy-id>`,describe:`Delete an Access reusable policy`,builder:nn,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){s({command:`cf zero-trust access policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
136
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.policies.delete({account_id:l,policy_id:t[`policy-id`]})),{successLabel:`Deleted`})})};function an(e){return e.usage(`$0 zero-trust access policies get <policy-id>
|
|
137
|
+
|
|
138
|
+
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 on={command:`get <policy-id>`,describe:`Get an Access reusable policy`,builder:an,handler:async t=>l({command:`zero-trust access policies get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.policies.get({account_id:l,policy_id:t[`policy-id`]})),{successLabel:`Loaded`})})};function sn(e){return e.usage(`$0 zero-trust access policies list
|
|
139
|
+
|
|
140
|
+
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 cn={command:`list`,describe:`List Access reusable policies`,builder:sn,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){s({command:`cf zero-trust access policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/policies`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.policies.list({account_id:u,...i})),{successLabel:`Loaded`})})};function ln(e){return e.usage(`$0 zero-trust access policies update <policy-id>
|
|
141
|
+
|
|
142
|
+
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 un={command:`update <policy-id>`,describe:`Update an Access reusable policy`,builder:ln,handler:async t=>l({command:`zero-trust access policies update`,classification:{safeFlags:[`decision`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.access.policies.update({body:e,account_id:l,policy_id:t[`policy-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.access.policies.update({body:u,account_id:l,policy_id:t[`policy-id`]})),{successLabel:`Updated`})})},dn={command:`policies`,describe:`Operations for access.policies`,builder:e=>e.command(tn).command(rn).command(on).command(cn).command(un).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fn(e){return e.usage(`$0 zero-trust access saml-certificates get-pem <saml-cert-set-id>
|
|
143
|
+
|
|
144
|
+
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 pn={command:`get-pem <saml-cert-set-id>`,describe:`Download current certificate in PEM format`,builder:fn,handler:async t=>l({command:`zero-trust access saml-certificates get-pem`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access saml-certificates get-pem`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.samlCertificates.getPem({account_id:l,saml_cert_set_id:t[`saml-cert-set-id`]})),{successLabel:`Loaded`})})};function mn(e){return e.usage(`$0 zero-trust access saml-certificates get <saml-cert-set-id>
|
|
145
|
+
|
|
146
|
+
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 hn={command:`get <saml-cert-set-id>`,describe:`Get SAML certificate set`,builder:mn,handler:async t=>l({command:`zero-trust access saml-certificates get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access saml-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.samlCertificates.get({account_id:l,saml_cert_set_id:t[`saml-cert-set-id`]})),{successLabel:`Loaded`})})};function gn(e){return e.usage(`$0 zero-trust access saml-certificates list
|
|
147
|
+
|
|
148
|
+
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 _n={command:`list`,describe:`List SAML certificate sets`,builder:gn,handler:async t=>l({command:`zero-trust access saml-certificates list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={page:t.page,per_page:t[`per-page`],id:t.id};if(t.dryRun){s({command:`cf zero-trust access saml-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/saml_certificates`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.samlCertificates.list({account_id:u,...i})),{successLabel:`Loaded`})})};function vn(e){return e.usage(`$0 zero-trust access saml-certificates rotate <saml-cert-set-id>
|
|
149
|
+
|
|
150
|
+
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 yn={command:`rotate <saml-cert-set-id>`,describe:`Rotate SAML certificate`,builder:vn,handler:async t=>l({command:`zero-trust access saml-certificates rotate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access saml-certificates rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.samlCertificates.rotate({account_id:l,saml_cert_set_id:t[`saml-cert-set-id`]})),{successLabel:`Created`})})},bn={command:`saml-certificates`,describe:`Operations for access.saml-certificates`,builder:e=>e.command(hn).command(pn).command(_n).command(yn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xn(e){return e.usage(`$0 zero-trust access service-tokens create
|
|
151
|
+
|
|
152
|
+
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 Sn={command:`create`,describe:`Create a service token`,builder:xn,handler:async i=>l({command:`zero-trust access service-tokens create`,classification:{safeFlags:[`enabled`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/service_tokens`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({client_secret_version:i[`client-secret-version`],duration:m(i.duration,`duration`,`text`),enabled:i.enabled,name:m(i.name,`name`,`text`),previous_client_secret_expires_at:m(i[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.access.serviceTokens.create({...e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`});return}i.name===void 0&&(i.name=await g(`name`,`The name of the service token.`));let h=p({client_secret_version:i[`client-secret-version`],duration:m(i.duration,`duration`,`text`),enabled:i.enabled,name:m(i.name,`name`,`text`),previous_client_secret_expires_at:m(i[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)});o(await c(`Creating`,async()=>l.zeroTrust.access.serviceTokens.create({...h,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`})})};function Cn(e){return e.usage(`$0 zero-trust access service-tokens delete <service-token-id>
|
|
153
|
+
|
|
154
|
+
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 wn={command:`delete <service-token-id>`,describe:`Delete a service token`,builder:Cn,handler:async i=>l({command:`zero-trust access service-tokens delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/service_tokens/${i[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(i[`service-token-id`]))}`,pathParams:{"account-or-zone":String(t),"service-token-id":String(i[`service-token-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
|
|
155
|
+
`);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.serviceTokens.delete({account_or_zone:u,account_or_zone_id:d,service_token_id:i[`service-token-id`]})),{successLabel:`Deleted`})})};function Tn(e){return e.usage(`$0 zero-trust access service-tokens get <service-token-id>
|
|
156
|
+
|
|
157
|
+
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 En={command:`get <service-token-id>`,describe:`Get a service token`,builder:Tn,handler:async i=>l({command:`zero-trust access service-tokens get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/service_tokens/${i[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(i[`service-token-id`]))}`,pathParams:{"account-or-zone":String(t),"service-token-id":String(i[`service-token-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.serviceTokens.get({account_or_zone:u,account_or_zone_id:d,service_token_id:i[`service-token-id`]})),{successLabel:`Loaded`})})};function Dn(e){return e.usage(`$0 zero-trust access service-tokens list
|
|
158
|
+
|
|
159
|
+
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 On={command:`list`,describe:`List service tokens`,builder:Dn,handler:async i=>l({command:`zero-trust access service-tokens list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={name:i.name,search:i.search,page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/service_tokens`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await t({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await n();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.serviceTokens.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function kn(e){return e.usage(`$0 zero-trust access service-tokens refresh <service-token-id>
|
|
160
|
+
|
|
161
|
+
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 An={command:`refresh <service-token-id>`,describe:`Refresh a service token`,builder:kn,handler:async t=>l({command:`zero-trust access service-tokens refresh`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access service-tokens refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.refresh({account_id:l,service_token_id:t[`service-token-id`]})),{successLabel:`Created`})})};function jn(e){return e.usage(`$0 zero-trust access service-tokens rotate <service-token-id>
|
|
162
|
+
|
|
163
|
+
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 Mn={command:`rotate <service-token-id>`,describe:`Rotate a service token`,builder:jn,handler:async t=>l({command:`zero-trust access service-tokens rotate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access service-tokens rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.rotate({...e,account_id:l,service_token_id:t[`service-token-id`]})),{successLabel:`Created`});return}let u=p({previous_client_secret_expires_at:m(t[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.rotate({...u,account_id:l,service_token_id:t[`service-token-id`]})),{successLabel:`Created`})})};function Nn(e){return e.usage(`$0 zero-trust access service-tokens update <service-token-id>
|
|
164
|
+
|
|
165
|
+
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 Pn={command:`update <service-token-id>`,describe:`Update a service token`,builder:Nn,handler:async i=>l({command:`zero-trust access service-tokens update`,classification:{safeFlags:[`enabled`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/service_tokens/${i[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(i[`service-token-id`]))}`,pathParams:{"account-or-zone":String(t),"service-token-id":String(i[`service-token-id`]??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({client_secret_version:i[`client-secret-version`],duration:m(i.duration,`duration`,`text`),enabled:i.enabled,name:m(i.name,`name`,`text`),previous_client_secret_expires_at:m(i[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.serviceTokens.update({...e,account_or_zone:u,account_or_zone_id:f,service_token_id:i[`service-token-id`]})),{successLabel:`Updated`});return}let h=p({client_secret_version:i[`client-secret-version`],duration:m(i.duration,`duration`,`text`),enabled:i.enabled,name:m(i.name,`name`,`text`),previous_client_secret_expires_at:m(i[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)});o(await c(`Updating`,async()=>l.zeroTrust.access.serviceTokens.update({...h,account_or_zone:u,account_or_zone_id:f,service_token_id:i[`service-token-id`]})),{successLabel:`Updated`})})},Fn={command:`service-tokens`,describe:`Operations for access.service-tokens`,builder:e=>e.command(Sn).command(wn).command(En).command(On).command(An).command(Mn).command(Pn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function In(e){return e.usage(`$0 zero-trust access tags create
|
|
166
|
+
|
|
167
|
+
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 Ln={command:`create`,describe:`Create a tag`,builder:In,handler:async t=>l({command:`zero-trust access tags create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.access.tags.create({...e,account_id:l})),{successLabel:`Created`});return}let u=p({name:m(t.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.access.tags.create({...u,account_id:l})),{successLabel:`Created`})})};function Rn(e){return e.usage(`$0 zero-trust access tags delete <tag-name>
|
|
168
|
+
|
|
169
|
+
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 zn={command:`delete <tag-name>`,describe:`Delete a tag`,builder:Rn,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){s({command:`cf zero-trust access tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
170
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.tags.delete({account_id:l,tag_name:t[`tag-name`]})),{successLabel:`Deleted`})})};function Bn(e){return e.usage(`$0 zero-trust access tags get <tag-name>
|
|
171
|
+
|
|
172
|
+
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 Vn={command:`get <tag-name>`,describe:`Get a tag`,builder:Bn,handler:async t=>l({command:`zero-trust access tags get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.tags.get({account_id:l,tag_name:t[`tag-name`]})),{successLabel:`Loaded`})})};function Hn(e){return e.usage(`$0 zero-trust access tags list
|
|
173
|
+
|
|
174
|
+
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 Un={command:`list`,describe:`List tags`,builder:Hn,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){s({command:`cf zero-trust access tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/tags`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.tags.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Wn(e){return e.usage(`$0 zero-trust access tags update <tag-name>
|
|
175
|
+
|
|
176
|
+
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 Gn={command:`update <tag-name>`,describe:`Update a tag`,builder:Wn,handler:async t=>l({command:`zero-trust access tags update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.access.tags.update({...e,account_id:l,tag_name:t[`tag-name`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.access.tags.update({...u,account_id:l,tag_name:t[`tag-name`]})),{successLabel:`Updated`})})},Kn={command:`tags`,describe:`Operations for access.tags`,builder:e=>e.command(Ln).command(zn).command(Vn).command(Un).command(Gn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qn(e){return e.usage(`$0 zero-trust access users active-sessions get <nonce>
|
|
177
|
+
|
|
178
|
+
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 Jn={command:`get <nonce>`,describe:`Get single active session`,builder:qn,handler:async t=>l({command:`zero-trust access users active-sessions get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access users active-sessions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.activeSessions.get({account_id:l,user_id:t[`user-id`],nonce:t.nonce})),{successLabel:`Loaded`})})};function Yn(e){return e.usage(`$0 zero-trust access users active-sessions list
|
|
179
|
+
|
|
180
|
+
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 Xn={command:`list`,describe:`Get active sessions`,builder:Yn,handler:async t=>l({command:`zero-trust access users active-sessions list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access users active-sessions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.activeSessions.list({account_id:l,user_id:t[`user-id`]})),{successLabel:`Loaded`})})},Zn={command:`active-sessions`,describe:`Operations for access.users.active-sessions`,builder:e=>e.command(Jn).command(Xn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qn(e){return e.usage(`$0 zero-trust access users create
|
|
181
|
+
|
|
182
|
+
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 $n={command:`create`,describe:`Create a user`,builder:Qn,handler:async t=>l({command:`zero-trust access users create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.access.users.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.access.users.create({...u,account_id:l})),{successLabel:`Created`})})};function er(e){return e.usage(`$0 zero-trust access users delete <user-id>
|
|
183
|
+
|
|
184
|
+
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 tr={command:`delete <user-id>`,describe:`Delete a user`,builder:er,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){s({command:`cf zero-trust access users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
185
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.users.delete({account_id:l,user_id:t[`user-id`]})),{successLabel:`Deleted`})})};function nr(e){return e.usage(`$0 zero-trust access users failed-logins list
|
|
186
|
+
|
|
187
|
+
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 rr={command:`list`,describe:`Get failed logins`,builder:nr,handler:async t=>l({command:`zero-trust access users failed-logins list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access users failed-logins list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.failedLogins.list({account_id:l,user_id:t[`user-id`]})),{successLabel:`Loaded`})})},ir={command:`failed-logins`,describe:`Operations for access.users.failed-logins`,builder:e=>e.command(rr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ar(e){return e.usage(`$0 zero-trust access users get <user-id>
|
|
188
|
+
|
|
189
|
+
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 or={command:`get <user-id>`,describe:`Get a user`,builder:ar,handler:async t=>l({command:`zero-trust access users get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.get({account_id:l,user_id:t[`user-id`]})),{successLabel:`Loaded`})})};function sr(e){return e.usage(`$0 zero-trust access users last-seen-identity get <user-id>
|
|
190
|
+
|
|
191
|
+
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 cr={command:`get <user-id>`,describe:`Get last seen identity`,builder:sr,handler:async t=>l({command:`zero-trust access users last-seen-identity get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access users last-seen-identity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.lastSeenIdentity.get({account_id:l,user_id:t[`user-id`]})),{successLabel:`Loaded`})})},lr={command:`last-seen-identity`,describe:`Operations for access.users.last-seen-identity`,builder:e=>e.command(cr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ur(e){return e.usage(`$0 zero-trust access users list
|
|
192
|
+
|
|
193
|
+
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 dr={command:`list`,describe:`Get users`,builder:ur,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){s({command:`cf zero-trust access users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/users`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.users.list({account_id:u,...i})),{successLabel:`Loaded`})})};function fr(e){return e.usage(`$0 zero-trust access users update <user-id>
|
|
194
|
+
|
|
195
|
+
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 pr={command:`update <user-id>`,describe:`Update a user`,builder:fr,handler:async t=>l({command:`zero-trust access users update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust access users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.access.users.update({...e,account_id:l,user_id:t[`user-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.access.users.update({...u,account_id:l,user_id:t[`user-id`]})),{successLabel:`Updated`})})},mr={command:`users`,describe:`Operations for access.users`,builder:e=>e.command($n).command(tr).command(or).command(dr).command(pr).command(Zn).command(ir).command(lr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},hr={command:`access`,describe:`Operations for access`,builder:e=>e.command(_e).command(be).command(je).command(qe).command(ot).command(pt).command(wt).command(Nt).command(Bt).command($t).command(dn).command(bn).command(Fn).command(Kn).command(mr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function gr(e){return e.usage(`$0 zero-trust apps policies make reusable update <policy-id>
|
|
196
|
+
|
|
197
|
+
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 _r={command:`update <policy-id>`,describe:`Convert an Access application policy to a reusable policy`,builder:gr,handler:async t=>l({command:`zero-trust apps policies make reusable update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust apps policies make reusable update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Updating`,async()=>i.zeroTrust.apps.policies.make.reusable.update({account_id:l,app_id:t[`app-id`],policy_id:t[`policy-id`]})),{successLabel:`Updated`})})},vr={command:`reusable`,describe:`Operations for apps.policies.make.reusable`,builder:e=>e.command(_r).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},yr={command:`make`,describe:`Operations for apps.policies.make`,builder:e=>e.command(vr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},br={command:`policies`,describe:`Operations for apps.policies`,builder:e=>e.command(yr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xr(e){return e.usage(`$0 zero-trust apps review status list
|
|
198
|
+
|
|
199
|
+
Retrieve the statuses of your applications.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Sr={command:`list`,describe:`List applications review statuses`,builder:xr,handler:async t=>l({command:`zero-trust apps review status list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust apps review status list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/apps/review_status`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.apps.review.status.list({account_id:l})),{successLabel:`Loaded`})})};function Cr(e){return e.usage(`$0 zero-trust apps review status update
|
|
200
|
+
|
|
201
|
+
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 wr={command:`update`,describe:`Update applications review statuses`,builder:Cr,handler:async t=>l({command:`zero-trust apps review status update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust apps review status update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.apps.review.status.update({...e,account_id:l})),{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`]});o(await c(`Updating`,async()=>i.zeroTrust.apps.review.status.update({...u,account_id:l})),{successLabel:`Updated`})})},Tr={command:`status`,describe:`Operations for apps.review.status`,builder:e=>e.command(Sr).command(wr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Er={command:`review`,describe:`Operations for apps.review`,builder:e=>e.command(Tr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Dr={command:`apps`,describe:`Operations for apps`,builder:e=>e.command(br).command(Er).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Or(e){return e.usage(`$0 zero-trust casb applications auth-methods list
|
|
202
|
+
|
|
203
|
+
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 kr={command:`list`,describe:`Get auth methods`,builder:y(Or),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){s({command:`cf zero-trust casb applications auth-methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.applications.authMethods.list({account_id:u,application_id:t[`application-id`],...i})),{successLabel:`Loaded`})})},Ar={command:`auth-methods`,describe:`Operations for casb.applications.auth-methods`,builder:e=>e.command(kr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function jr(e){return e.usage(`$0 zero-trust casb applications get <application-id>
|
|
204
|
+
|
|
205
|
+
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 Mr={command:`get <application-id>`,describe:`Get application details`,builder:y(jr),handler:async t=>l({command:`zero-trust casb applications get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust casb applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.casb.applications.get({account_id:l,application_id:t[`application-id`]})),{successLabel:`Loaded`})})};function Nr(e){return e.usage(`$0 zero-trust casb applications list
|
|
206
|
+
|
|
207
|
+
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 Pr={command:`list`,describe:`List applications`,builder:Nr,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){s({command:`cf zero-trust casb applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/one/applications`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.applications.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Fr(e){return e.usage(`$0 zero-trust casb applications setup-flows list
|
|
208
|
+
|
|
209
|
+
Returns all available setup flows for the application, one per auth method.`).option(`application-id`,{type:`string`,description:`Application/vendor identifier.`,demandOption:!0}).option(`auth-method`,{type:`string`,description:`Filter by auth method id. Get available ids from GET /v2/applications.`}).option(`environment`,{type:`string`,description:`Filter by environment.`,choices:[`fedramp`,`standard`]}).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 Ir={command:`list`,describe:`Get application setup flows`,builder:y(Fr),handler:async t=>l({command:`zero-trust casb applications setup-flows list`,classification:{safeFlags:[`environment`,`dry-run`]}},t,async()=>{let i={auth_method:t[`auth-method`],environment:t.environment,page:t.page,page_size:t[`page-size`]};if(t.dryRun){s({command:`cf zero-trust casb applications setup-flows list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/one/applications/${t[`application-id`]==null?`<application-id>`:encodeURIComponent(String(t[`application-id`]))}/setup-flows`,pathParams:{"application-id":String(t[`application-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.applications.setupFlows.list({account_id:u,application_id:t[`application-id`],...i})),{successLabel:`Loaded`})})},Lr={command:`setup-flows`,describe:`Operations for casb.applications.setup-flows`,builder:e=>e.command(Ir).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Rr={command:`applications`,describe:`Operations for casb.applications`,builder:e=>e.command(Mr).command(Pr).command(Ar).command(Lr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function zr(e){return e.usage(`$0 zero-trust casb integrations create
|
|
210
|
+
|
|
211
|
+
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 Br={command:`create`,describe:`Create integration`,builder:zr,handler:async t=>l({command:`zero-trust casb integrations create`,classification:{safeFlags:[`application`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust casb integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/one/integrations`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({application:m(t.application,`application`,`text`),auth_method:m(t[`auth-method`],`auth-method`,`text`),dlp_profiles:t[`dlp-profiles`],name:m(t.name,`name`,`text`),permissions:t.permissions,use_cases:t[`use-cases`]}):d(t.body)});return}let l=await a(t),f=t.local?e:await n();if(t.accountId=f,t.file){let e=h(t.file);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${f}/one/integrations`,{body:e,headers:{"Content-Type":`text/plain;charset=UTF-8`}})),{successLabel:`Created`});return}if(t.body){let e=d(t.body);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${f}/one/integrations`,{body:e})),{successLabel:`Created`});return}t.application===void 0&&(t.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`])),t.name===void 0&&(t.name=await g(`name`,`Name of the integration.`));let v={};t.application!==void 0&&u(v,[`application`],m(t.application,`application`,`text`)),t[`auth-method`]!==void 0&&u(v,[`auth_method`],m(t[`auth-method`],`auth-method`,`text`)),t[`dlp-profiles`]!==void 0&&u(v,[`dlp_profiles`],t[`dlp-profiles`]),t.name!==void 0&&u(v,[`name`],m(t.name,`name`,`text`)),t.permissions!==void 0&&u(v,[`permissions`],t.permissions),t[`use-cases`]!==void 0&&u(v,[`use_cases`],t[`use-cases`]),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${f}/one/integrations`,{body:Object.keys(v).length>0?v:void 0})),{successLabel:`Created`})})};function Vr(e){return e.usage(`$0 zero-trust casb integrations delete <id>
|
|
212
|
+
|
|
213
|
+
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 Hr={command:`delete <id>`,describe:`Delete integration`,builder:Vr,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){s({command:`cf zero-trust casb integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
214
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.casb.integrations.delete({account_id:l,id:t.id})),{successLabel:`Deleted`})})};function Ur(e){return e.usage(`$0 zero-trust casb integrations get <id>
|
|
215
|
+
|
|
216
|
+
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 Wr={command:`get <id>`,describe:`Get integration details`,builder:Ur,handler:async t=>l({command:`zero-trust casb integrations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust casb integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.casb.integrations.get({account_id:l,id:t.id})),{successLabel:`Loaded`})})};function Gr(e){return e.usage(`$0 zero-trust casb integrations list
|
|
217
|
+
|
|
218
|
+
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 Kr={command:`list`,describe:`List integrations`,builder:y(Gr),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){s({command:`cf zero-trust casb integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/one/integrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.integrations.list({account_id:u,...i})),{successLabel:`Loaded`})})};function qr(e){return e.usage(`$0 zero-trust casb integrations pause <id>
|
|
219
|
+
|
|
220
|
+
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 Jr={command:`pause <id>`,describe:`Pause integration`,builder:qr,handler:async t=>l({command:`zero-trust casb integrations pause`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust casb integrations pause`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/pause`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.casb.integrations.pause({account_id:l,id:t.id})),{successLabel:`Created`})})};function Yr(e){return e.usage(`$0 zero-trust casb integrations resume <id>
|
|
221
|
+
|
|
222
|
+
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 Xr={command:`resume <id>`,describe:`Resume integration`,builder:Yr,handler:async t=>l({command:`zero-trust casb integrations resume`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust casb integrations resume`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}/resume`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.casb.integrations.resume({account_id:l,id:t.id})),{successLabel:`Created`})})};function Zr(e){return e.usage(`$0 zero-trust casb integrations update <id>
|
|
223
|
+
|
|
224
|
+
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 Qr={command:`update <id>`,describe:`Update integration`,builder:Zr,handler:async t=>l({command:`zero-trust casb integrations update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust casb integrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/one/integrations/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`json`,body:t.body===void 0?p({dlp_profiles:t[`dlp-profiles`],name:m(t.name,`name`,`text`),permissions:t.permissions,use_cases:t[`use-cases`]}):d(t.body)});return}let l=await a(t),f=t.local?e:await n();if(t.accountId=f,t.file){let e=h(t.file);o(await c(`Updating`,async()=>i(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(t.id))}`,{body:e,headers:{"Content-Type":`text/plain;charset=UTF-8`}})),{successLabel:`Updated`});return}if(t.body){let e=d(t.body);o(await c(`Updating`,async()=>i(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(t.id))}`,{body:e})),{successLabel:`Updated`});return}let g={};t[`dlp-profiles`]!==void 0&&u(g,[`dlp_profiles`],t[`dlp-profiles`]),t.name!==void 0&&u(g,[`name`],m(t.name,`name`,`text`)),t.permissions!==void 0&&u(g,[`permissions`],t.permissions),t[`use-cases`]!==void 0&&u(g,[`use_cases`],t[`use-cases`]),o(await c(`Updating`,async()=>i(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(t.id))}`,{body:Object.keys(g).length>0?g:void 0})),{successLabel:`Updated`})})},$r={command:`integrations`,describe:`Operations for casb.integrations`,builder:e=>e.command(Br).command(Hr).command(Wr).command(Kr).command(Jr).command(Xr).command(Qr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ei={command:`casb`,describe:`Operations for casb`,builder:e=>e.command(Rr).command($r).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ti(e){return e.usage(`$0 zero-trust connectivity-settings edit
|
|
225
|
+
|
|
226
|
+
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 ni={command:`edit`,describe:`Updates the Zero Trust Connectivity Settings`,builder:ti,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){s({command:`cf zero-trust connectivity-settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.connectivitySettings.edit({...e,account_id:l})),{successLabel:`Updated`});return}let u=p({icmp_proxy_enabled:t[`icmp-proxy-enabled`],offramp_warp_enabled:t[`offramp-warp-enabled`]});o(await c(`Updating`,async()=>i.zeroTrust.connectivitySettings.edit({...u,account_id:l})),{successLabel:`Updated`})})};function ri(e){return e.usage(`$0 zero-trust connectivity-settings get
|
|
227
|
+
|
|
228
|
+
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 ii={command:`get`,describe:`Get Zero Trust Connectivity Settings`,builder:ri,handler:async t=>l({command:`zero-trust connectivity-settings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust connectivity-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/zerotrust/connectivity_settings`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.connectivitySettings.get({account_id:l})),{successLabel:`Loaded`})})},ai={command:`connectivity-settings`,describe:`Operations for connectivity-settings`,builder:e=>e.command(ni).command(ii).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oi(e){return e.usage(`$0 zero-trust devices client-versions list
|
|
229
|
+
|
|
230
|
+
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 si={command:`list`,describe:`List client versions`,builder:y(oi),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){s({command:`cf zero-trust devices client-versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/client-versions`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.clientVersions.list({account_id:u,...i})),{successLabel:`Loaded`})})};function ci(e){return e.usage(`$0 zero-trust devices client-versions target-environments list
|
|
231
|
+
|
|
232
|
+
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 li={command:`list`,describe:`List available target environments`,builder:ci,handler:async t=>l({command:`zero-trust devices client-versions target-environments list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices client-versions target-environments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/client-versions/target-environments`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.clientVersions.targetEnvironments.list({account_id:l})),{successLabel:`Loaded`})})},ui={command:`target-environments`,describe:`Operations for devices.client-versions.target-environments`,builder:e=>e.command(li).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},di={command:`client-versions`,describe:`Operations for devices.client-versions`,builder:e=>e.command(si).command(ui).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fi(e){return e.usage(`$0 zero-trust devices delete <device-id>
|
|
233
|
+
|
|
234
|
+
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 pi={command:`delete <device-id>`,describe:`Delete device`,builder:fi,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){s({command:`cf zero-trust devices delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
235
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.delete({account_id:l,device_id:t[`device-id`]})),{successLabel:`Deleted`})})};function mi(e){return e.usage(`$0 zero-trust devices deployment-groups create
|
|
236
|
+
|
|
237
|
+
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 hi={command:`create`,describe:`Create deployment group`,builder:mi,handler:async t=>l({command:`zero-trust devices deployment-groups create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices deployment-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.deploymentGroups.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.deploymentGroups.create({...u,account_id:l})),{successLabel:`Created`})})};function gi(e){return e.usage(`$0 zero-trust devices deployment-groups delete <group-id>
|
|
238
|
+
|
|
239
|
+
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 _i={command:`delete <group-id>`,describe:`Delete deployment group`,builder:gi,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){s({command:`cf zero-trust devices deployment-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
240
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.deploymentGroups.delete({account_id:l,group_id:t[`group-id`]})),{successLabel:`Deleted`})})};function vi(e){return e.usage(`$0 zero-trust devices deployment-groups get <group-id>
|
|
241
|
+
|
|
242
|
+
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 yi={command:`get <group-id>`,describe:`Get deployment group`,builder:vi,handler:async t=>l({command:`zero-trust devices deployment-groups get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices deployment-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.deploymentGroups.get({account_id:l,group_id:t[`group-id`]})),{successLabel:`Loaded`})})};function bi(e){return e.usage(`$0 zero-trust devices deployment-groups list
|
|
243
|
+
|
|
244
|
+
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 xi={command:`list`,describe:`List deployment groups`,builder:bi,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){s({command:`cf zero-trust devices deployment-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/deployment-groups`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.deploymentGroups.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Si(e){return e.usage(`$0 zero-trust devices deployment-groups update <group-id>
|
|
245
|
+
|
|
246
|
+
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 Ci={command:`update <group-id>`,describe:`Update deployment group`,builder:Si,handler:async t=>l({command:`zero-trust devices deployment-groups update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices deployment-groups update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.deploymentGroups.update({...e,account_id:l,group_id:t[`group-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.devices.deploymentGroups.update({...u,account_id:l,group_id:t[`group-id`]})),{successLabel:`Updated`})})},wi={command:`deployment-groups`,describe:`Operations for devices.deployment-groups`,builder:e=>e.command(hi).command(_i).command(yi).command(xi).command(Ci).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ti(e){return e.usage(`$0 zero-trust devices emergency-disconnect get
|
|
247
|
+
|
|
248
|
+
Fetch the Global WARP disconnect state.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ei={command:`get`,describe:`Get Global Disconnect`,builder:Ti,handler:async t=>l({command:`zero-trust devices emergency-disconnect get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices emergency-disconnect get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/resilience/disconnect`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.emergencyDisconnect.get({account_id:l})),{successLabel:`Loaded`})})};function Di(e){return e.usage(`$0 zero-trust devices emergency-disconnect set
|
|
249
|
+
|
|
250
|
+
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 Oi={command:`set`,describe:`Set Global Disconnect`,builder:Di,handler:async t=>l({command:`zero-trust devices emergency-disconnect set`,classification:{safeFlags:[`disconnect`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices emergency-disconnect set`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.emergencyDisconnect.set({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.emergencyDisconnect.set({...u,account_id:l})),{successLabel:`Created`})})},ki={command:`emergency-disconnect`,describe:`Operations for devices.emergency-disconnect`,builder:e=>e.command(Ei).command(Oi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ai(e){return e.usage(`$0 zero-trust devices get <device-id>
|
|
251
|
+
|
|
252
|
+
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 ji={command:`get <device-id>`,describe:`Get device`,builder:Ai,handler:async t=>l({command:`zero-trust devices get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={include:t.include};if(t.dryRun){s({command:`cf zero-trust devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.get({account_id:u,device_id:t[`device-id`],...i})),{successLabel:`Loaded`})})};function Mi(e){return e.usage(`$0 zero-trust devices ip-profiles create
|
|
253
|
+
|
|
254
|
+
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 Ni={command:`create`,describe:`Create IP profile`,builder:Mi,handler:async t=>l({command:`zero-trust devices ip-profiles create`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices ip-profiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.ipProfiles.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.ipProfiles.create({...u,account_id:l})),{successLabel:`Created`})})};function Pi(e){return e.usage(`$0 zero-trust devices ip-profiles delete <profile-id>
|
|
255
|
+
|
|
256
|
+
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 Fi={command:`delete <profile-id>`,describe:`Delete IP profile`,builder:Pi,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){s({command:`cf zero-trust devices ip-profiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
257
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.ipProfiles.delete({account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Deleted`})})};function Ii(e){return e.usage(`$0 zero-trust devices ip-profiles get <profile-id>
|
|
258
|
+
|
|
259
|
+
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 Li={command:`get <profile-id>`,describe:`Get IP profile`,builder:Ii,handler:async t=>l({command:`zero-trust devices ip-profiles get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices ip-profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.ipProfiles.get({account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Loaded`})})};function Ri(e){return e.usage(`$0 zero-trust devices ip-profiles list
|
|
260
|
+
|
|
261
|
+
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 zi={command:`list`,describe:`List IP profiles`,builder:Ri,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){s({command:`cf zero-trust devices ip-profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/ip-profiles`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.ipProfiles.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Bi(e){return e.usage(`$0 zero-trust devices ip-profiles update <profile-id>
|
|
262
|
+
|
|
263
|
+
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 Vi={command:`update <profile-id>`,describe:`Update IP profile`,builder:Bi,handler:async t=>l({command:`zero-trust devices ip-profiles update`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices ip-profiles update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.ipProfiles.update({...e,account_id:l,profile_id:t[`profile-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.devices.ipProfiles.update({...u,account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Updated`})})},Hi={command:`ip-profiles`,describe:`Operations for devices.ip-profiles`,builder:e=>e.command(Ni).command(Fi).command(Li).command(zi).command(Vi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ui(e){return e.usage(`$0 zero-trust devices list
|
|
264
|
+
|
|
265
|
+
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 Wi={command:`list`,describe:`List devices`,builder:y(Ui),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){s({command:`cf zero-trust devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/physical-devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Gi(e){return e.usage(`$0 zero-trust devices networks create
|
|
266
|
+
|
|
267
|
+
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 Ki={command:`create`,describe:`Create a device managed network`,builder:Gi,handler:async t=>l({command:`zero-trust devices networks create`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices networks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.networks.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.networks.create({...u,account_id:l})),{successLabel:`Created`})})};function qi(e){return e.usage(`$0 zero-trust devices networks delete <network-id>
|
|
268
|
+
|
|
269
|
+
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 Ji={command:`delete <network-id>`,describe:`Delete a device managed network`,builder:qi,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){s({command:`cf zero-trust devices networks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
270
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.networks.delete({account_id:l,network_id:t[`network-id`]})),{successLabel:`Deleted`})})};function Yi(e){return e.usage(`$0 zero-trust devices networks get <network-id>
|
|
271
|
+
|
|
272
|
+
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 Xi={command:`get <network-id>`,describe:`Get device managed network details`,builder:Yi,handler:async t=>l({command:`zero-trust devices networks get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices networks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.networks.get({account_id:l,network_id:t[`network-id`]})),{successLabel:`Loaded`})})};function Zi(e){return e.usage(`$0 zero-trust devices networks list
|
|
273
|
+
|
|
274
|
+
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 Qi={command:`list`,describe:`List your device managed networks`,builder:Zi,handler:async t=>l({command:`zero-trust devices networks list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices networks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/networks`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.networks.list({account_id:l})),{successLabel:`Loaded`})})};function $i(e){return e.usage(`$0 zero-trust devices networks update <network-id>
|
|
275
|
+
|
|
276
|
+
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 ea={command:`update <network-id>`,describe:`Update a device managed network`,builder:$i,handler:async t=>l({command:`zero-trust devices networks update`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices networks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.networks.update({...e,account_id:l,network_id:t[`network-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.devices.networks.update({...u,account_id:l,network_id:t[`network-id`]})),{successLabel:`Updated`})})},ta={command:`networks`,describe:`Operations for devices.networks`,builder:e=>e.command(Ki).command(Ji).command(Xi).command(Qi).command(ea).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function na(e){return e.usage(`$0 zero-trust devices override-codes create
|
|
277
|
+
|
|
278
|
+
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 ra={command:`create`,describe:`Generate an uninstall protection override code`,builder:na,handler:async t=>l({command:`zero-trust devices override-codes create`,classification:{safeFlags:[`scope`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices override-codes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.overrideCodes.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.overrideCodes.create({...u,account_id:l})),{successLabel:`Created`})})},ia={command:`override-codes`,describe:`Operations for devices.override-codes`,builder:e=>e.command(ra).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function aa(e){return e.usage(`$0 zero-trust devices posture integrations create
|
|
279
|
+
|
|
280
|
+
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 oa={command:`create`,describe:`Create posture integration`,builder:aa,handler:async t=>l({command:`zero-trust devices posture integrations create`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices posture integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.posture.integrations.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.posture.integrations.create({...u,account_id:l})),{successLabel:`Created`})})};function sa(e){return e.usage(`$0 zero-trust devices posture integrations delete <integration-id>
|
|
281
|
+
|
|
282
|
+
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 ca={command:`delete <integration-id>`,describe:`Delete posture integration`,builder:sa,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){s({command:`cf zero-trust devices posture integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
283
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.posture.integrations.delete({account_id:l,integration_id:t[`integration-id`]})),{successLabel:`Deleted`})})};function la(e){return e.usage(`$0 zero-trust devices posture integrations get <integration-id>
|
|
284
|
+
|
|
285
|
+
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 ua={command:`get <integration-id>`,describe:`Get posture integration`,builder:la,handler:async t=>l({command:`zero-trust devices posture integrations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices posture integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.posture.integrations.get({account_id:l,integration_id:t[`integration-id`]})),{successLabel:`Loaded`})})};function da(e){return e.usage(`$0 zero-trust devices posture integrations list
|
|
286
|
+
|
|
287
|
+
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 fa={command:`list`,describe:`List posture integrations`,builder:da,handler:async t=>l({command:`zero-trust devices posture integrations list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices posture integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/posture/integration`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.posture.integrations.list({account_id:l})),{successLabel:`Loaded`})})};function pa(e){return e.usage(`$0 zero-trust devices posture integrations update <integration-id>
|
|
288
|
+
|
|
289
|
+
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 ma={command:`update <integration-id>`,describe:`Update posture integration`,builder:pa,handler:async t=>l({command:`zero-trust devices posture integrations update`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices posture integrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.posture.integrations.update({...e,account_id:l,integration_id:t[`integration-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.devices.posture.integrations.update({...u,account_id:l,integration_id:t[`integration-id`]})),{successLabel:`Updated`})})},ha={command:`integrations`,describe:`Operations for devices.posture.integrations`,builder:e=>e.command(oa).command(ca).command(ua).command(fa).command(ma).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ga(e){return e.usage(`$0 zero-trust devices posture rules create
|
|
290
|
+
|
|
291
|
+
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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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 _a={command:`create`,describe:`Create posture rule`,builder:ga,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){s({command:`cf zero-trust devices posture rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.posture.rules.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.posture.rules.create({...u,account_id:l})),{successLabel:`Created`})})};function va(e){return e.usage(`$0 zero-trust devices posture rules delete <rule-id>
|
|
292
|
+
|
|
293
|
+
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 ya={command:`delete <rule-id>`,describe:`Delete posture rule`,builder:va,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){s({command:`cf zero-trust devices posture rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
294
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.posture.rules.delete({account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Deleted`})})};function ba(e){return e.usage(`$0 zero-trust devices posture rules get <rule-id>
|
|
295
|
+
|
|
296
|
+
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 xa={command:`get <rule-id>`,describe:`Get posture rule`,builder:ba,handler:async t=>l({command:`zero-trust devices posture rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices posture rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.posture.rules.get({account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Loaded`})})};function Sa(e){return e.usage(`$0 zero-trust devices posture rules list
|
|
297
|
+
|
|
298
|
+
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 Ca={command:`list`,describe:`List posture rules`,builder:Sa,handler:async t=>l({command:`zero-trust devices posture rules list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices posture rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/posture`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.posture.rules.list({account_id:l})),{successLabel:`Loaded`})})};function wa(e){return e.usage(`$0 zero-trust devices posture rules update <rule-id>
|
|
299
|
+
|
|
300
|
+
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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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`,`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 Ta={command:`update <rule-id>`,describe:`Update posture rule`,builder:wa,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){s({command:`cf zero-trust devices posture rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.posture.rules.update({...e,account_id:l,rule_id:t[`rule-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.devices.posture.rules.update({...u,account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Updated`})})},Ea={command:`rules`,describe:`Operations for devices.posture.rules`,builder:e=>e.command(_a).command(ya).command(xa).command(Ca).command(Ta).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Da={command:`posture`,describe:`Operations for devices.posture`,builder:e=>e.command(ha).command(Ea).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oa(e){return e.usage(`$0 zero-trust devices profiles custom create
|
|
301
|
+
|
|
302
|
+
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".`}).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 ka={command:`create`,describe:`Create a device settings profile`,builder:Oa,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){s({command:`cf zero-trust devices profiles custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.profiles.custom.create({...e,account_id:l})),{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`)}});o(await c(`Creating`,async()=>i.zeroTrust.devices.profiles.custom.create({...u,account_id:l})),{successLabel:`Created`})})};function Aa(e){return e.usage(`$0 zero-trust devices profiles custom delete <policy-id>
|
|
303
|
+
|
|
304
|
+
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 ja={command:`delete <policy-id>`,describe:`Delete a device settings profile`,builder:Aa,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){s({command:`cf zero-trust devices profiles custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
305
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.profiles.custom.delete({account_id:l,policy_id:t[`policy-id`]})),{successLabel:`Deleted`})})};function Ma(e){return e.usage(`$0 zero-trust devices profiles custom get <policy-id>
|
|
306
|
+
|
|
307
|
+
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 Na={command:`get <policy-id>`,describe:`Get device settings profile by ID`,builder:Ma,handler:async t=>l({command:`zero-trust devices profiles custom get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices profiles custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.profiles.custom.get({account_id:l,policy_id:t[`policy-id`]})),{successLabel:`Loaded`})})};function Pa(e){return e.usage(`$0 zero-trust devices profiles custom list
|
|
308
|
+
|
|
309
|
+
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 Fa={command:`list`,describe:`List device settings profiles`,builder:y(Pa),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){s({command:`cf zero-trust devices profiles custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/policies`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.profiles.custom.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Ia(e){return e.usage(`$0 zero-trust devices profiles custom update <policy-id>
|
|
310
|
+
|
|
311
|
+
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".`}).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 La={command:`update <policy-id>`,describe:`Update a device settings profile`,builder:Ia,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){s({command:`cf zero-trust devices profiles custom update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.profiles.custom.update({...e,account_id:l,policy_id:t[`policy-id`]})),{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`)}});o(await c(`Updating`,async()=>i.zeroTrust.devices.profiles.custom.update({...u,account_id:l,policy_id:t[`policy-id`]})),{successLabel:`Updated`})})},Ra={command:`custom`,describe:`Operations for devices.profiles.custom`,builder:e=>e.command(ka).command(ja).command(Na).command(Fa).command(La).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function za(e){return e.usage(`$0 zero-trust devices profiles default get
|
|
312
|
+
|
|
313
|
+
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 Ba={command:`get`,describe:`Get the default device settings profile`,builder:za,handler:async t=>l({command:`zero-trust devices profiles default get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices profiles default get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/policy`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.profiles.default.get({account_id:l})),{successLabel:`Loaded`})})};function Va(e){return e.usage(`$0 zero-trust devices profiles default update
|
|
314
|
+
|
|
315
|
+
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 Ha={command:`update`,describe:`Update the default device settings profile`,builder:Va,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){s({command:`cf zero-trust devices profiles default update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.profiles.default.update({...e,account_id:l})),{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`)}});o(await c(`Updating`,async()=>i.zeroTrust.devices.profiles.default.update({...u,account_id:l})),{successLabel:`Updated`})})},Ua={command:`default`,describe:`Operations for devices.profiles.default`,builder:e=>e.command(Ba).command(Ha).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Wa={command:`profiles`,describe:`Operations for devices.profiles`,builder:e=>e.command(Ra).command(Ua).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ga(e){return e.usage(`$0 zero-trust devices registrations bulk-delete
|
|
316
|
+
|
|
317
|
+
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 Ka={command:`bulk-delete`,describe:`Delete registrations`,builder:Ga,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){s({command:`cf zero-trust devices registrations bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/registrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();if(t.accountId=u,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
318
|
+
`);return}o(await c(`Deleting`,async()=>l.zeroTrust.devices.registrations.bulkDelete({account_id:u,...i})),{successLabel:`Deleted`})})};function qa(e){return e.usage(`$0 zero-trust devices registrations delete <registration-id>
|
|
319
|
+
|
|
320
|
+
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 Ja={command:`delete <registration-id>`,describe:`Delete registration`,builder:qa,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){s({command:`cf zero-trust devices registrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
321
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.registrations.delete({account_id:l,registration_id:t[`registration-id`]})),{successLabel:`Deleted`})})};function Ya(e){return e.usage(`$0 zero-trust devices registrations get <registration-id>
|
|
322
|
+
|
|
323
|
+
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 Xa={command:`get <registration-id>`,describe:`Get registration`,builder:Ya,handler:async t=>l({command:`zero-trust devices registrations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={include:t.include};if(t.dryRun){s({command:`cf zero-trust devices registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.registrations.get({account_id:u,registration_id:t[`registration-id`],...i})),{successLabel:`Loaded`})})};function Za(e){return e.usage(`$0 zero-trust devices registrations list
|
|
324
|
+
|
|
325
|
+
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 Qa={command:`list`,describe:`List registrations`,builder:y(Za),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){s({command:`cf zero-trust devices registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/registrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.registrations.list({account_id:u,...i})),{successLabel:`Loaded`})})};function $a(e){return e.usage(`$0 zero-trust devices registrations override-codes get <registration-id>
|
|
326
|
+
|
|
327
|
+
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 eo={command:`get <registration-id>`,describe:`Get override codes`,builder:$a,handler:async t=>l({command:`zero-trust devices registrations override-codes get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices registrations override-codes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.registrations.overrideCodes.get({account_id:l,registration_id:t[`registration-id`]})),{successLabel:`Loaded`})})},to={command:`override-codes`,describe:`Operations for devices.registrations.override-codes`,builder:e=>e.command(eo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},no={command:`registrations`,describe:`Operations for devices.registrations`,builder:e=>e.command(Ka).command(Ja).command(Xa).command(Qa).command(to).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ro(e){return e.usage(`$0 zero-trust devices settings delete
|
|
328
|
+
|
|
329
|
+
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 io={command:`delete`,describe:`Reset device settings`,builder:ro,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){s({command:`cf zero-trust devices settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
330
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.settings.delete({account_id:l})),{successLabel:`Deleted`})})};function ao(e){return e.usage(`$0 zero-trust devices settings get
|
|
331
|
+
|
|
332
|
+
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 oo={command:`get`,describe:`Get device settings`,builder:ao,handler:async t=>l({command:`zero-trust devices settings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.settings.get({account_id:l})),{successLabel:`Loaded`})})};function so(e){return e.usage(`$0 zero-trust devices settings update
|
|
333
|
+
|
|
334
|
+
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 co={command:`update`,describe:`Update device settings`,builder:so,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){s({command:`cf zero-trust devices settings update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.settings.update({body:e,account_id:l})),{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`]});o(await c(`Updating`,async()=>i.zeroTrust.devices.settings.update({body:u,account_id:l})),{successLabel:`Updated`})})},lo={command:`settings`,describe:`Operations for devices.settings`,builder:e=>e.command(io).command(oo).command(co).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function uo(e){return e.usage(`$0 zero-trust devices update <device-id>
|
|
335
|
+
|
|
336
|
+
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 fo={command:`update <device-id>`,describe:`Update device`,builder:uo,handler:async t=>l({command:`zero-trust devices update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust devices update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.update({...e,account_id:l,device_id:t[`device-id`]})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>i.zeroTrust.devices.update({account_id:l,device_id:t[`device-id`]})),{successLabel:`Updated`})})},po={command:`devices`,describe:`Operations for devices`,builder:e=>e.command(pi).command(ji).command(Wi).command(fo).command(di).command(wi).command(ki).command(Hi).command(ta).command(ia).command(Da).command(Wa).command(no).command(lo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function mo(e){return e.usage(`$0 zero-trust dex colos list
|
|
337
|
+
|
|
338
|
+
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 ho={command:`list`,describe:`List Cloudflare colos`,builder:y(mo),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){s({command:`cf zero-trust dex colos list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/colos`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.colos.list({account_id:u,...i})),{successLabel:`Loaded`})})},go={command:`colos`,describe:`Operations for dex.colos`,builder:e=>e.command(ho).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _o(e){return e.usage(`$0 zero-trust dex commands create
|
|
339
|
+
|
|
340
|
+
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 vo={command:`create`,describe:`Create account commands`,builder:_o,handler:async t=>l({command:`zero-trust dex commands create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dex commands create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dex.commands.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dex.commands.create({...u,account_id:l})),{successLabel:`Created`})})};function yo(e){return e.usage(`$0 zero-trust dex commands eligible-devices list
|
|
341
|
+
|
|
342
|
+
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 bo={command:`list`,describe:`List devices eligible for remote captures`,builder:yo,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){s({command:`cf zero-trust dex commands eligible-devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/commands/devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.commands.eligibleDevices.list({account_id:u,...i})),{successLabel:`Loaded`})})},xo={command:`eligible-devices`,describe:`Operations for dex.commands.eligible-devices`,builder:e=>e.command(bo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function So(e){return e.usage(`$0 zero-trust dex commands list
|
|
343
|
+
|
|
344
|
+
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 Co={command:`list`,describe:`List account commands`,builder:y(So),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){s({command:`cf zero-trust dex commands list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/commands`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.commands.list({account_id:u,...i})),{successLabel:`Loaded`})})};function wo(e){return e.usage(`$0 zero-trust dex commands quota get
|
|
345
|
+
|
|
346
|
+
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 To={command:`get`,describe:`Returns account commands usage, quota, and reset time`,builder:wo,handler:async t=>l({command:`zero-trust dex commands quota get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dex commands quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/commands/quota`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.commands.quota.get({account_id:l})),{successLabel:`Loaded`})})},Eo={command:`quota`,describe:`Operations for dex.commands.quota`,builder:e=>e.command(To).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Do(e){return e.usage(`$0 zero-trust dex commands results get <filename>
|
|
347
|
+
|
|
348
|
+
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 Oo={command:`get <filename>`,describe:`Download command output file`,builder:Do,handler:async t=>l({command:`zero-trust dex commands results get`,classification:{safeFlags:[`dry-run`,`text`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dex commands results get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t);let i=t.local?e:await n();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)})},ko={command:`results`,describe:`Operations for dex.commands.results`,builder:e=>e.command(Oo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ao={command:`commands`,describe:`Operations for dex.commands`,builder:e=>e.command(vo).command(Co).command(xo).command(Eo).command(ko).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function jo(e){return e.usage(`$0 zero-trust dex devices aggregates live get
|
|
349
|
+
|
|
350
|
+
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 Mo={command:`get`,describe:`Get live aggregate device details by dimension`,builder:jo,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){s({command:`cf zero-trust dex devices aggregates live get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/fleet-status/live`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.aggregates.live.get({account_id:u,...i})),{successLabel:`Loaded`})})},No={command:`live`,describe:`Operations for dex.devices.aggregates.live`,builder:e=>e.command(Mo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Po(e){return e.usage(`$0 zero-trust dex devices aggregates over-time get
|
|
351
|
+
|
|
352
|
+
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 Fo={command:`get`,describe:`Get over time aggregate details for devices by dimension`,builder:Po,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){s({command:`cf zero-trust dex devices aggregates over-time get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/fleet-status/over-time`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.aggregates.overTime.get({account_id:u,...i})),{successLabel:`Loaded`})})},Io={command:`over-time`,describe:`Operations for dex.devices.aggregates.over-time`,builder:e=>e.command(Fo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Lo={command:`aggregates`,describe:`Operations for dex.devices.aggregates`,builder:e=>e.command(No).command(Io).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ro(e){return e.usage(`$0 zero-trust dex devices get <device-id>
|
|
353
|
+
|
|
354
|
+
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 zo={command:`get <device-id>`,describe:`Get the latest status of a device.`,builder:Ro,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){s({command:`cf zero-trust dex devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.get({account_id:u,device_id:t[`device-id`],...i})),{successLabel:`Loaded`})})};function Bo(e){return e.usage(`$0 zero-trust dex devices list
|
|
355
|
+
|
|
356
|
+
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(`status`,{type:`string`,description:`Network status.`}).option(`platform`,{type:`string`,description:`Operating system.`}).option(`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 Vo={command:`list`,describe:`List details of devices using WARP.`,builder:y(Bo),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`],status:t.status,platform:t.platform,version:t.version,source:t.source};if(t.dryRun){s({command:`cf zero-trust dex devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/fleet-status/devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Ho(e){return e.usage(`$0 zero-trust dex devices over-time get <device-id>
|
|
357
|
+
|
|
358
|
+
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 Uo={command:`get <device-id>`,describe:`Get the status over time for a device`,builder:y(Ho),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){s({command:`cf zero-trust dex devices over-time get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.overTime.get({account_id:u,device_id:t[`device-id`],...i})),{successLabel:`Loaded`})})},Wo={command:`over-time`,describe:`Operations for dex.devices.over-time`,builder:e=>e.command(Uo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Go={command:`devices`,describe:`Operations for dex.devices`,builder:e=>e.command(zo).command(Vo).command(Lo).command(Wo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ko(e){return e.usage(`$0 zero-trust dex isps list
|
|
359
|
+
|
|
360
|
+
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 qo={command:`list`,describe:`List device ISPs`,builder:y(Ko),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){s({command:`cf zero-trust dex isps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.isps.list({account_id:u,device_id:t[`device-id`],...i})),{successLabel:`Loaded`})})},Jo={command:`isps`,describe:`Operations for dex.isps`,builder:e=>e.command(qo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Yo(e){return e.usage(`$0 zero-trust dex overview tests list
|
|
361
|
+
|
|
362
|
+
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 Xo={command:`list`,describe:`List DEX test analytics`,builder:y(Yo),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){s({command:`cf zero-trust dex overview tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/tests/overview`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.overview.tests.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Zo(e){return e.usage(`$0 zero-trust dex overview tests unique-devices get
|
|
363
|
+
|
|
364
|
+
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 Qo={command:`get`,describe:`Get count of devices targeted`,builder:Zo,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){s({command:`cf zero-trust dex overview tests unique-devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/tests/unique-devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.overview.tests.uniqueDevices.get({account_id:u,...i})),{successLabel:`Loaded`})})},$o={command:`unique-devices`,describe:`Operations for dex.overview.tests.unique-devices`,builder:e=>e.command(Qo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},es={command:`tests`,describe:`Operations for dex.overview.tests`,builder:e=>e.command(Xo).command($o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ts={command:`overview`,describe:`Operations for dex.overview`,builder:e=>e.command(es).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ns(e){return e.usage(`$0 zero-trust dex rules create
|
|
365
|
+
|
|
366
|
+
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 rs={command:`create`,describe:`Create a DEX Rule`,builder:ns,handler:async t=>l({command:`zero-trust dex rules create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dex rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dex.rules.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dex.rules.create({...u,account_id:l})),{successLabel:`Created`})})};function is(e){return e.usage(`$0 zero-trust dex rules delete <rule-id>
|
|
367
|
+
|
|
368
|
+
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 as={command:`delete <rule-id>`,describe:`Delete a DEX Rule`,builder:is,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){s({command:`cf zero-trust dex rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
369
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dex.rules.delete({account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Deleted`})})};function os(e){return e.usage(`$0 zero-trust dex rules get <rule-id>
|
|
370
|
+
|
|
371
|
+
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 ss={command:`get <rule-id>`,describe:`Get DEX Rule`,builder:os,handler:async t=>l({command:`zero-trust dex rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dex rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.rules.get({account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Loaded`})})};function cs(e){return e.usage(`$0 zero-trust dex rules list
|
|
372
|
+
|
|
373
|
+
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 ls={command:`list`,describe:`List DEX Rules`,builder:y(cs),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){s({command:`cf zero-trust dex rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/rules`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.rules.list({account_id:u,...i})),{successLabel:`Loaded`})})};function us(e){return e.usage(`$0 zero-trust dex rules update <rule-id>
|
|
374
|
+
|
|
375
|
+
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 ds={command:`update <rule-id>`,describe:`Update a DEX Rule`,builder:us,handler:async t=>l({command:`zero-trust dex rules update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dex rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dex.rules.update({...e,account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),match:m(t.match,`match`,`text`),name:m(t.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dex.rules.update({...u,account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Updated`})})},fs={command:`rules`,describe:`Operations for dex.rules`,builder:e=>e.command(rs).command(as).command(ss).command(ls).command(ds).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ps(e){return e.usage(`$0 zero-trust dex test-results http get <test-id>
|
|
376
|
+
|
|
377
|
+
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 ms={command:`get <test-id>`,describe:`Get details and aggregate metrics for an http test`,builder:y(ps),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){s({command:`cf zero-trust dex test-results http get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.http.get({account_id:u,test_id:t[`test-id`],...i})),{successLabel:`Loaded`})})};function hs(e){return e.usage(`$0 zero-trust dex test-results http percentiles get <test-id>
|
|
378
|
+
|
|
379
|
+
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 gs={command:`get <test-id>`,describe:`Get percentiles for an http test`,builder:hs,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){s({command:`cf zero-trust dex test-results http percentiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.http.percentiles.get({account_id:u,test_id:t[`test-id`],...i})),{successLabel:`Loaded`})})},_s={command:`percentiles`,describe:`Operations for dex.test-results.http.percentiles`,builder:e=>e.command(gs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},vs={command:`http`,describe:`Operations for dex.test-results.http`,builder:e=>e.command(ms).command(_s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ys(e){return e.usage(`$0 zero-trust dex test-results traceroute get <test-id>
|
|
380
|
+
|
|
381
|
+
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 bs={command:`get <test-id>`,describe:`Get details and aggregate metrics for a traceroute test`,builder:y(ys),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){s({command:`cf zero-trust dex test-results traceroute get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.traceroute.get({account_id:u,test_id:t[`test-id`],...i})),{successLabel:`Loaded`})})};function xs(e){return e.usage(`$0 zero-trust dex test-results traceroute network-path get <test-result-id>
|
|
382
|
+
|
|
383
|
+
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 Ss={command:`get <test-result-id>`,describe:`Get details for a specific traceroute test run`,builder:xs,handler:async t=>l({command:`zero-trust dex test-results traceroute network-path get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dex test-results traceroute network-path get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.testResults.traceroute.networkPath.get({account_id:l,test_result_id:t[`test-result-id`]})),{successLabel:`Loaded`})})},Cs={command:`network-path`,describe:`Operations for dex.test-results.traceroute.network-path`,builder:e=>e.command(Ss).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ws(e){return e.usage(`$0 zero-trust dex test-results traceroute percentiles get <test-id>
|
|
384
|
+
|
|
385
|
+
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 Ts={command:`get <test-id>`,describe:`Get percentiles for a traceroute test`,builder:ws,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){s({command:`cf zero-trust dex test-results traceroute percentiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.traceroute.percentiles.get({account_id:u,test_id:t[`test-id`],...i})),{successLabel:`Loaded`})})},Es={command:`percentiles`,describe:`Operations for dex.test-results.traceroute.percentiles`,builder:e=>e.command(Ts).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ds={command:`traceroute`,describe:`Operations for dex.test-results.traceroute`,builder:e=>e.command(bs).command(Cs).command(Es).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Os={command:`test-results`,describe:`Operations for dex.test-results`,builder:e=>e.command(vs).command(Ds).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ks(e){return e.usage(`$0 zero-trust dex tests create
|
|
386
|
+
|
|
387
|
+
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(`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 As={command:`create`,describe:`Create Device DEX test`,builder:ks,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){s({command:`cf zero-trust dex tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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`),targeted:t.targeted}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dex.tests.create({body:e,account_id:l})),{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`),targeted:t.targeted});o(await c(`Creating`,async()=>i.zeroTrust.dex.tests.create({body:u,account_id:l})),{successLabel:`Created`})})};function js(e){return e.usage(`$0 zero-trust dex tests delete <dex-test-id>
|
|
388
|
+
|
|
389
|
+
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 Ms={command:`delete <dex-test-id>`,describe:`Delete Device DEX test`,builder:js,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){s({command:`cf zero-trust dex tests delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
390
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dex.tests.delete({account_id:l,dex_test_id:t[`dex-test-id`]})),{successLabel:`Deleted`})})};function Ns(e){return e.usage(`$0 zero-trust dex tests get <dex-test-id>
|
|
391
|
+
|
|
392
|
+
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 Ps={command:`get <dex-test-id>`,describe:`Get Device DEX test`,builder:Ns,handler:async t=>l({command:`zero-trust dex tests get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dex tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.tests.get({account_id:l,dex_test_id:t[`dex-test-id`]})),{successLabel:`Loaded`})})};function Fs(e){return e.usage(`$0 zero-trust dex tests list
|
|
393
|
+
|
|
394
|
+
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 Is={command:`list`,describe:`List Device DEX tests`,builder:y(Fs),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){s({command:`cf zero-trust dex tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/devices/dex_tests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.tests.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Ls(e){return e.usage(`$0 zero-trust dex tests network-path get <test-id>
|
|
395
|
+
|
|
396
|
+
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 Rs={command:`get <test-id>`,describe:`Get network path breakdown for a traceroute test`,builder:y(Ls),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){s({command:`cf zero-trust dex tests network-path get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.tests.networkPath.get({account_id:u,test_id:t[`test-id`],...i})),{successLabel:`Loaded`})})},zs={command:`network-path`,describe:`Operations for dex.tests.network-path`,builder:e=>e.command(Rs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Bs(e){return e.usage(`$0 zero-trust dex tests update <dex-test-id>
|
|
397
|
+
|
|
398
|
+
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(`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 Vs={command:`update <dex-test-id>`,describe:`Update Device DEX test`,builder:Bs,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){s({command:`cf zero-trust dex tests update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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`),targeted:t.targeted}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dex.tests.update({body:e,account_id:l,dex_test_id:t[`dex-test-id`]})),{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`),targeted:t.targeted});o(await c(`Updating`,async()=>i.zeroTrust.dex.tests.update({body:u,account_id:l,dex_test_id:t[`dex-test-id`]})),{successLabel:`Updated`})})},Hs={command:`tests`,describe:`Operations for dex.tests`,builder:e=>e.command(As).command(Ms).command(Ps).command(Is).command(Vs).command(zs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Us(e){return e.usage(`$0 zero-trust dex warp-change-events list
|
|
399
|
+
|
|
400
|
+
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 Ws={command:`list`,describe:`List WARP change events.`,builder:y(Us),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){s({command:`cf zero-trust dex warp-change-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dex/warp-change-events`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.warpChangeEvents.list({account_id:u,...i})),{successLabel:`Loaded`})})},Gs={command:`warp-change-events`,describe:`Operations for dex.warp-change-events`,builder:e=>e.command(Ws).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ks={command:`dex`,describe:`Digital Experience Monitoring — synthetic tests, fleet-wide device metrics, and network path diagnostics`,builder:e=>e.command(go).command(Ao).command(Go).command(Jo).command(ts).command(fs).command(Os).command(Hs).command(Gs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qs(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics create
|
|
401
|
+
|
|
402
|
+
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 Js={command:`create`,describe:`Create custom prompt topic`,builder:qs,handler:async t=>l({command:`zero-trust dlp custom-prompt-topics create`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.customPromptTopics.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.customPromptTopics.create({...u,account_id:l})),{successLabel:`Created`})})};function Ys(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics delete <entry-id>
|
|
403
|
+
|
|
404
|
+
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 Xs={command:`delete <entry-id>`,describe:`Delete custom prompt topic`,builder:Ys,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){s({command:`cf zero-trust dlp custom-prompt-topics delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
405
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.customPromptTopics.delete({account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Deleted`})})};function Zs(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics get <entry-id>
|
|
406
|
+
|
|
407
|
+
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 Qs={command:`get <entry-id>`,describe:`Get custom prompt topic`,builder:Zs,handler:async t=>l({command:`zero-trust dlp custom-prompt-topics get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.customPromptTopics.get({account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Loaded`})})};function $s(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics list
|
|
408
|
+
|
|
409
|
+
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 ec={command:`list`,describe:`List custom prompt topics`,builder:$s,handler:async t=>l({command:`zero-trust dlp custom-prompt-topics list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/custom_prompt_topics`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.customPromptTopics.list({account_id:l})),{successLabel:`Loaded`})})};function tc(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics update <entry-id>
|
|
410
|
+
|
|
411
|
+
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 nc={command:`update <entry-id>`,describe:`Update custom prompt topic`,builder:tc,handler:async t=>l({command:`zero-trust dlp custom-prompt-topics update`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.customPromptTopics.update({...e,account_id:l,entry_id:t[`entry-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.customPromptTopics.update({...u,account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Updated`})})},rc={command:`custom-prompt-topics`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Js).command(Xs).command(Qs).command(ec).command(nc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ic(e){return e.usage(`$0 zero-trust dlp data-classes create
|
|
412
|
+
|
|
413
|
+
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 ac={command:`create`,describe:`Creates a new data class`,builder:ic,handler:async t=>l({command:`zero-trust dlp data-classes create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-classes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataClasses.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataClasses.create({...u,account_id:l})),{successLabel:`Created`})})};function oc(e){return e.usage(`$0 zero-trust dlp data-classes delete <data-class-id>
|
|
414
|
+
|
|
415
|
+
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 sc={command:`delete <data-class-id>`,describe:`Delete a single data class`,builder:oc,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){s({command:`cf zero-trust dlp data-classes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
416
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.dataClasses.delete({account_id:l,data_class_id:t[`data-class-id`]})),{successLabel:`Deleted`})})};function cc(e){return e.usage(`$0 zero-trust dlp data-classes get <data-class-id>
|
|
417
|
+
|
|
418
|
+
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 lc={command:`get <data-class-id>`,describe:`Retrieve a specific data class`,builder:cc,handler:async t=>l({command:`zero-trust dlp data-classes get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-classes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataClasses.get({account_id:l,data_class_id:t[`data-class-id`]})),{successLabel:`Loaded`})})};function uc(e){return e.usage(`$0 zero-trust dlp data-classes list
|
|
419
|
+
|
|
420
|
+
Lists data classes configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const dc={command:`list`,describe:`Retrieve all data classes in an account`,builder:uc,handler:async t=>l({command:`zero-trust dlp data-classes list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-classes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/data_classes`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataClasses.list({account_id:l})),{successLabel:`Loaded`})})};function fc(e){return e.usage(`$0 zero-trust dlp data-classes update <data-class-id>
|
|
421
|
+
|
|
422
|
+
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 pc={command:`update <data-class-id>`,describe:`Update the attributes of a single data class`,builder:fc,handler:async t=>l({command:`zero-trust dlp data-classes update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-classes update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataClasses.update({...e,account_id:l,data_class_id:t[`data-class-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataClasses.update({...u,account_id:l,data_class_id:t[`data-class-id`]})),{successLabel:`Updated`})})},mc={command:`data-classes`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(ac).command(sc).command(lc).command(dc).command(pc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function hc(e){return e.usage(`$0 zero-trust dlp data-tag-categories create
|
|
423
|
+
|
|
424
|
+
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 gc={command:`create`,describe:`Creates a new data tag category.`,builder:hc,handler:async t=>l({command:`zero-trust dlp data-tag-categories create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-tag-categories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTagCategories.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTagCategories.create({...u,account_id:l})),{successLabel:`Created`})})};function $(e){return e.usage(`$0 zero-trust dlp data-tag-categories delete <category-id>
|
|
425
|
+
|
|
426
|
+
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 _c={command:`delete <category-id>`,describe:`Delete a single data tag category.`,builder:$,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){s({command:`cf zero-trust dlp data-tag-categories delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
427
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.dataTagCategories.delete({account_id:l,category_id:t[`category-id`]})),{successLabel:`Deleted`})})};function vc(e){return e.usage(`$0 zero-trust dlp data-tag-categories get <category-id>
|
|
428
|
+
|
|
429
|
+
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 yc={command:`get <category-id>`,describe:`Retrieve a specific data tag category.`,builder:vc,handler:async t=>l({command:`zero-trust dlp data-tag-categories get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-tag-categories get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategories.get({account_id:l,category_id:t[`category-id`]})),{successLabel:`Loaded`})})};function bc(e){return e.usage(`$0 zero-trust dlp data-tag-categories list
|
|
430
|
+
|
|
431
|
+
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 xc={command:`list`,describe:`Retrieve all data tag categories in an account`,builder:bc,handler:async t=>l({command:`zero-trust dlp data-tag-categories list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-tag-categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/data_tag_categories`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategories.list({account_id:l})),{successLabel:`Loaded`})})};function Sc(e){return e.usage(`$0 zero-trust dlp data-tag-categories update <category-id>
|
|
432
|
+
|
|
433
|
+
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 Cc={command:`update <category-id>`,describe:`Update the attributes of a single data tag category.`,builder:Sc,handler:async t=>l({command:`zero-trust dlp data-tag-categories update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-tag-categories update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTagCategories.update({...e,account_id:l,category_id:t[`category-id`]})),{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),tags:f(t.tags,`tags`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTagCategories.update({...u,account_id:l,category_id:t[`category-id`]})),{successLabel:`Updated`})})},wc={command:`data-tag-categories`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(gc).command(_c).command(yc).command(xc).command(Cc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Tc(e){return e.usage(`$0 zero-trust dlp data-tag-category-templates get <template-id>
|
|
434
|
+
|
|
435
|
+
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 Ec={command:`get <template-id>`,describe:`Retrieve a specific data tag category template.`,builder:Tc,handler:async t=>l({command:`zero-trust dlp data-tag-category-templates get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-tag-category-templates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategoryTemplates.get({account_id:l,template_id:t[`template-id`]})),{successLabel:`Loaded`})})};function Dc(e){return e.usage(`$0 zero-trust dlp data-tag-category-templates list
|
|
436
|
+
|
|
437
|
+
Lists available data tag category templates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oc={command:`list`,describe:`Retrieve all data tag category templates in an account`,builder:Dc,handler:async t=>l({command:`zero-trust dlp data-tag-category-templates list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-tag-category-templates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/data_tag_category_templates`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategoryTemplates.list({account_id:l})),{successLabel:`Loaded`})})},kc={command:`data-tag-category-templates`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Ec).command(Oc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ac(e){return e.usage(`$0 zero-trust dlp data-tags create <category-id>
|
|
438
|
+
|
|
439
|
+
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 jc={command:`create <category-id>`,describe:`Creates a new data tag.`,builder:Ac,handler:async t=>l({command:`zero-trust dlp data-tags create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTags.create({body:e,account_id:l,category_id:t[`category-id`]})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTags.create({body:u,account_id:l,category_id:t[`category-id`]})),{successLabel:`Created`})})};function Mc(e){return e.usage(`$0 zero-trust dlp data-tags delete <tag-id>
|
|
440
|
+
|
|
441
|
+
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 Nc={command:`delete <tag-id>`,describe:`Delete a single data tag.`,builder:Mc,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){s({command:`cf zero-trust dlp data-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
442
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.dataTags.delete({account_id:l,category_id:t[`category-id`],tag_id:t[`tag-id`]})),{successLabel:`Deleted`})})};function Pc(e){return e.usage(`$0 zero-trust dlp data-tags get <tag-id>
|
|
443
|
+
|
|
444
|
+
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 Fc={command:`get <tag-id>`,describe:`Retrieve a specific data tag.`,builder:Pc,handler:async t=>l({command:`zero-trust dlp data-tags get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTags.get({account_id:l,category_id:t[`category-id`],tag_id:t[`tag-id`]})),{successLabel:`Loaded`})})};function Ic(e){return e.usage(`$0 zero-trust dlp data-tags list
|
|
445
|
+
|
|
446
|
+
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 Lc={command:`list`,describe:`Retrieve all data tags in a data tag category`,builder:Ic,handler:async t=>l({command:`zero-trust dlp data-tags list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTags.list({account_id:l,category_id:t[`category-id`]})),{successLabel:`Loaded`})})};function Rc(e){return e.usage(`$0 zero-trust dlp data-tags update <tag-id>
|
|
447
|
+
|
|
448
|
+
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 zc={command:`update <tag-id>`,describe:`Update the attributes of a single data tag.`,builder:Rc,handler:async t=>l({command:`zero-trust dlp data-tags update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp data-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTags.update({...e,account_id:l,category_id:t[`category-id`],tag_id:t[`tag-id`]})),{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTags.update({...u,account_id:l,category_id:t[`category-id`],tag_id:t[`tag-id`]})),{successLabel:`Updated`})})},Bc={command:`data-tags`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(jc).command(Nc).command(Fc).command(Lc).command(zc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Vc(e){return e.usage(`$0 zero-trust dlp datasets create
|
|
449
|
+
|
|
450
|
+
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.
|
|
451
|
+
Determines if the words should be matched in a case-sensitive manner
|
|
452
|
+
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
|
|
453
|
+
|
|
454
|
+
Non-secret custom word lists with no header are always version 1.
|
|
455
|
+
Secret EDM lists with no header are version 1.
|
|
456
|
+
Multicolumn CSV with headers are version 2.
|
|
457
|
+
Omitting this field provides the default value 0, which is interpreted
|
|
458
|
+
the same as 1.`}).option(`name`,{type:`string`,description:`The name field`}).option(`secret`,{type:`boolean`,description:`Generate a secret dataset.
|
|
459
|
+
|
|
460
|
+
If true, the response will include a secret to use with the EDM encoder.
|
|
461
|
+
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 Hc={command:`create`,describe:`Create a new dataset`,builder:Vc,handler:async t=>l({command:`zero-trust dlp datasets create`,classification:{safeFlags:[`case-sensitive`,`secret`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp datasets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.create({...e,account_id:l})),{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});o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.create({...u,account_id:l})),{successLabel:`Created`})})};function Uc(e){return e.usage(`$0 zero-trust dlp datasets delete <dataset-id>
|
|
462
|
+
|
|
463
|
+
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 Wc={command:`delete <dataset-id>`,describe:`Delete a dataset`,builder:Uc,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){s({command:`cf zero-trust dlp datasets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
464
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.datasets.delete({account_id:l,dataset_id:t[`dataset-id`]})),{successLabel:`Deleted`})})};function Gc(e){return e.usage(`$0 zero-trust dlp datasets get <dataset-id>
|
|
465
|
+
|
|
466
|
+
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 Kc={command:`get <dataset-id>`,describe:`Fetch a specific dataset`,builder:Gc,handler:async t=>l({command:`zero-trust dlp datasets get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp datasets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.datasets.get({account_id:l,dataset_id:t[`dataset-id`]})),{successLabel:`Loaded`})})};function qc(e){return e.usage(`$0 zero-trust dlp datasets list
|
|
467
|
+
|
|
468
|
+
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 Jc={command:`list`,describe:`Fetch all datasets`,builder:qc,handler:async t=>l({command:`zero-trust dlp datasets list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/datasets`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.datasets.list({account_id:l})),{successLabel:`Loaded`})})};function Yc(e){return e.usage(`$0 zero-trust dlp datasets update <dataset-id>
|
|
469
|
+
|
|
470
|
+
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.
|
|
471
|
+
|
|
472
|
+
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 Xc={command:`update <dataset-id>`,describe:`Update details about a dataset`,builder:Yc,handler:async t=>l({command:`zero-trust dlp datasets update`,classification:{safeFlags:[`case-sensitive`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp datasets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.datasets.update({...e,account_id:l,dataset_id:t[`dataset-id`]})),{successLabel:`Updated`});return}let u=p({case_sensitive:t[`case-sensitive`],description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.datasets.update({...u,account_id:l,dataset_id:t[`dataset-id`]})),{successLabel:`Updated`})})};function Zc(e){return e.usage(`$0 zero-trust dlp datasets upload create <dataset-id>
|
|
473
|
+
|
|
474
|
+
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 Qc={command:`create <dataset-id>`,describe:`Prepare to upload a new version of a dataset`,builder:Zc,handler:async t=>l({command:`zero-trust dlp datasets upload create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp datasets upload create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.upload.create({account_id:l,dataset_id:t[`dataset-id`]})),{successLabel:`Created`})})};function $c(e){return e.usage(`$0 zero-trust dlp datasets upload edit <version>
|
|
475
|
+
|
|
476
|
+
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 el={command:`edit <version>`,describe:`Upload a new version of a dataset`,builder:$c,handler:async t=>l({command:`zero-trust dlp datasets upload edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp datasets upload edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}/upload/${t.version==null?`<version>`:encodeURIComponent(String(t.version))}`,pathParams:{"dataset-id":String(t[`dataset-id`]??``),version:String(t.version??``)},bodyKind:`octet-stream`,body:t.body});return}let l=await a(t),u=t.local?e:await n();if(t.accountId=u,t.file){let e=h(t.file);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(t[`dataset-id`]))}/upload/${encodeURIComponent(String(t.version))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}if(t.body){let e=m(t.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(t[`dataset-id`]))}/upload/${encodeURIComponent(String(t.version))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{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.`)})},tl={command:`upload`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Qc).command(el).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function nl(e){return e.usage(`$0 zero-trust dlp datasets versions create <version>
|
|
477
|
+
|
|
478
|
+
This is used for multi-column EDMv2 datasets. The EDMv2 format can only be created in the Cloudflare dashboard. The columns in the response appear in the same order as in the request.`).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:`array of new columns to create for this dataset version.`})}const rl={command:`create <version>`,describe:`Sets the column information for a multi-column upload`,builder:nl,handler:async t=>l({command:`zero-trust dlp datasets versions create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp datasets versions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}/versions/${t.version==null?`<version>`:encodeURIComponent(String(t.version))}`,pathParams:{"dataset-id":String(t[`dataset-id`]??``),version:String(t.version??``)},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.versions.create({body:e,account_id:l,dataset_id:t[`dataset-id`],version:t.version})),{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 il(e){return e.usage(`$0 zero-trust dlp datasets versions entries create <entry-id>
|
|
479
|
+
|
|
480
|
+
This is used for multi-column EDMv2 datasets. The EDMv2 format can only be created in the Cloudflare dashboard.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`version`,{type:`string`,description:`Version`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Dataset content.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const al={command:`create <entry-id>`,describe:`Upload a new version of a multi-column dataset`,builder:il,handler:async t=>l({command:`zero-trust dlp datasets versions entries create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp datasets versions entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}/versions/${t.version==null?`<version>`:encodeURIComponent(String(t.version))}/entries/${t[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(t[`entry-id`]))}`,pathParams:{"dataset-id":String(t[`dataset-id`]??``),version:String(t.version??``),"entry-id":String(t[`entry-id`]??``)},bodyKind:`octet-stream`,body:t.body});return}let l=await a(t),u=t.local?e:await n();if(t.accountId=u,t.file){let e=h(t.file);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(t[`dataset-id`]))}/versions/${encodeURIComponent(String(t.version))}/entries/${encodeURIComponent(String(t[`entry-id`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}if(t.body){let e=m(t.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(t[`dataset-id`]))}/versions/${encodeURIComponent(String(t.version))}/entries/${encodeURIComponent(String(t[`entry-id`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{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.`)})},ol={command:`entries`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(al).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},sl={command:`versions`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(rl).command(ol).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},cl={command:`datasets`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Hc).command(Wc).command(Kc).command(Jc).command(Xc).command(tl).command(sl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ll(e){return e.usage(`$0 zero-trust dlp email account-mapping create
|
|
481
|
+
|
|
482
|
+
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 ul={command:`create`,describe:`Create mapping`,builder:ll,handler:async t=>l({command:`zero-trust dlp email account-mapping create`,classification:{safeFlags:[`auth-requirements-type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp email account-mapping create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.accountMapping.create({...e,account_id:l})),{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`)}});o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.accountMapping.create({...u,account_id:l})),{successLabel:`Created`})})};function dl(e){return e.usage(`$0 zero-trust dlp email account-mapping get
|
|
483
|
+
|
|
484
|
+
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 fl={command:`get`,describe:`Get mapping`,builder:dl,handler:async t=>l({command:`zero-trust dlp email account-mapping get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp email account-mapping get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/email/account_mapping`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.email.accountMapping.get({account_id:l})),{successLabel:`Loaded`})})},pl={command:`account-mapping`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(ul).command(fl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ml(e){return e.usage(`$0 zero-trust dlp email rules bulk-edit
|
|
485
|
+
|
|
486
|
+
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 hl={command:`bulk-edit`,describe:`Update email scanner rule priorities`,builder:ml,handler:async t=>l({command:`zero-trust dlp email rules bulk-edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp email rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.bulkEdit({...e,account_id:l})),{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 gl(e){return e.usage(`$0 zero-trust dlp email rules create
|
|
487
|
+
|
|
488
|
+
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 _l={command:`create`,describe:`Create email scanner rule`,builder:gl,handler:async t=>l({command:`zero-trust dlp email rules create`,classification:{safeFlags:[`action-action`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp email rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.rules.create({body:e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.rules.create({body:u,account_id:l})),{successLabel:`Created`})})};function vl(e){return e.usage(`$0 zero-trust dlp email rules delete <rule-id>
|
|
489
|
+
|
|
490
|
+
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 yl={command:`delete <rule-id>`,describe:`Delete email scanner rule`,builder:vl,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){s({command:`cf zero-trust dlp email rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
491
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.email.rules.delete({account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Deleted`})})};function bl(e){return e.usage(`$0 zero-trust dlp email rules get <rule-id>
|
|
492
|
+
|
|
493
|
+
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 xl={command:`get <rule-id>`,describe:`Get an email scanner rule`,builder:bl,handler:async t=>l({command:`zero-trust dlp email rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp email rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.email.rules.get({account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Loaded`})})};function Sl(e){return e.usage(`$0 zero-trust dlp email rules list
|
|
494
|
+
|
|
495
|
+
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 Cl={command:`list`,describe:`List all email scanner rules`,builder:Sl,handler:async t=>l({command:`zero-trust dlp email rules list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp email rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.email.rules.list({account_id:l})),{successLabel:`Loaded`})})};function wl(e){return e.usage(`$0 zero-trust dlp email rules update <rule-id>
|
|
496
|
+
|
|
497
|
+
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 Tl={command:`update <rule-id>`,describe:`Update email scanner rule`,builder:wl,handler:async t=>l({command:`zero-trust dlp email rules update`,classification:{safeFlags:[`action-action`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp email rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.update({body:e,account_id:l,rule_id:t[`rule-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.update({body:u,account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Updated`})})},El={command:`rules`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(hl).command(_l).command(yl).command(xl).command(Cl).command(Tl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Dl={command:`email`,describe:`Operations for dlp.email`,builder:e=>e.command(pl).command(El).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ol(e){return e.usage(`$0 zero-trust dlp entries create
|
|
498
|
+
|
|
499
|
+
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 kl={command:`create`,describe:`Create custom entry`,builder:Ol,handler:async t=>l({command:`zero-trust dlp entries create`,classification:{safeFlags:[`enabled`,`pattern-validation`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.create({...u,account_id:l})),{successLabel:`Created`})})};function Al(e){return e.usage(`$0 zero-trust dlp entries custom update <entry-id>
|
|
500
|
+
|
|
501
|
+
Updates a DLP custom 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(`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.`})}const jl={command:`update <entry-id>`,describe:`Update custom entry`,builder:Al,handler:async t=>l({command:`zero-trust dlp entries custom update`,classification:{safeFlags:[`pattern-validation`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/entries/custom/${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`)},enabled:t.enabled}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.custom.update({...e,account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Updated`});return}if(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`)),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`)},enabled:t.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.custom.update({...u,account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Updated`})})},Ml={command:`custom`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(jl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Nl(e){return e.usage(`$0 zero-trust dlp entries delete <entry-id>
|
|
502
|
+
|
|
503
|
+
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 Pl={command:`delete <entry-id>`,describe:`Delete custom entry`,builder:Nl,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){s({command:`cf zero-trust dlp entries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
504
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.entries.delete({account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Deleted`})})};function Fl(e){return e.usage(`$0 zero-trust dlp entries get <entry-id>
|
|
505
|
+
|
|
506
|
+
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 Il={command:`get <entry-id>`,describe:`Get DLP Entry`,builder:Fl,handler:async t=>l({command:`zero-trust dlp entries get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.entries.get({account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Loaded`})})};function Ll(e){return e.usage(`$0 zero-trust dlp entries integration create
|
|
507
|
+
|
|
508
|
+
Integration entries can't be created, this will update an existing integration entry. This is needed for our generated terraform API.`).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`entry-id`,{type:`string`,description:`The entry_id field`}).option(`profile-id`,{type:`string`,description:`This field is not used as the owning profile.
|
|
509
|
+
For predefined entries it is already set to a predefined profile.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`This endpoint will update an existing integration entry. It is not possible to create new integration entries.`})}const Rl={command:`create`,describe:`Create integration entry`,builder:Ll,handler:async t=>l({command:`zero-trust dlp entries integration create`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries integration create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/entries/integration`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({enabled:t.enabled,entry_id:m(t[`entry-id`],`entry-id`,`text`),profile_id:m(t[`profile-id`],`profile-id`,`text`)}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.integration.create({body:e,account_id:l})),{successLabel:`Created`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t[`entry-id`]===void 0&&(t[`entry-id`]=await g(`entry-id`,`The entry_id field`));let u=p({enabled:t.enabled,entry_id:m(t[`entry-id`],`entry-id`,`text`),profile_id:m(t[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.integration.create({body:u,account_id:l})),{successLabel:`Created`})})};function zl(e){return e.usage(`$0 zero-trust dlp entries integration delete <entry-id>
|
|
510
|
+
|
|
511
|
+
This is a no-op as integration entires can't be deleted but is needed for our generated terraform API.`).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 Bl={command:`delete <entry-id>`,describe:`Delete integration entry`,builder:zl,handler:async t=>l({command:`zero-trust dlp entries integration delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries integration delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/entries/integration/${t[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(t[`entry-id`]))}`,pathParams:{"entry-id":String(t[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
512
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.entries.integration.delete({account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Deleted`})})};function Vl(e){return e.usage(`$0 zero-trust dlp entries integration update <entry-id>
|
|
513
|
+
|
|
514
|
+
Updates a DLP entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).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:`Enable or disable integration entry in owning profile.`})}const Hl={command:`update <entry-id>`,describe:`Update integration entry`,builder:Vl,handler:async t=>l({command:`zero-trust dlp entries integration update`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries integration update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/entries/integration/${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({enabled:t.enabled}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.integration.update({body:e,account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({enabled:t.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.integration.update({body:u,account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Updated`})})},Ul={command:`integration`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Rl).command(Bl).command(Hl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Wl(e){return e.usage(`$0 zero-trust dlp entries list
|
|
515
|
+
|
|
516
|
+
Lists all DLP entries in an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Gl={command:`list`,describe:`List all entries`,builder:Wl,handler:async t=>l({command:`zero-trust dlp entries list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/entries`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.entries.list({account_id:l})),{successLabel:`Loaded`})})};function Kl(e){return e.usage(`$0 zero-trust dlp entries predefined create
|
|
517
|
+
|
|
518
|
+
Predefined entries can't be created, this will update an existing predefined entry. This is needed for our generated terraform API.`).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`entry-id`,{type:`string`,description:`The entry_id field`}).option(`profile-id`,{type:`string`,description:`This field is not used as the owning profile.
|
|
519
|
+
For predefined entries it is already set to a predefined profile.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`This endpoint will update an existing predefined entry. It is not possible to create new predefined entries.`})}const ql={command:`create`,describe:`Create predefined entry`,builder:Kl,handler:async t=>l({command:`zero-trust dlp entries predefined create`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries predefined create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/entries/predefined`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({enabled:t.enabled,entry_id:m(t[`entry-id`],`entry-id`,`text`),profile_id:m(t[`profile-id`],`profile-id`,`text`)}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.predefined.create({body:e,account_id:l})),{successLabel:`Created`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t[`entry-id`]===void 0&&(t[`entry-id`]=await g(`entry-id`,`The entry_id field`));let u=p({enabled:t.enabled,entry_id:m(t[`entry-id`],`entry-id`,`text`),profile_id:m(t[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.predefined.create({body:u,account_id:l})),{successLabel:`Created`})})};function Jl(e){return e.usage(`$0 zero-trust dlp entries predefined delete <entry-id>
|
|
520
|
+
|
|
521
|
+
This is a no-op as predefined entires can't be deleted but is needed for our generated terraform API.`).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 Yl={command:`delete <entry-id>`,describe:`Delete predefined entry`,builder:Jl,handler:async t=>l({command:`zero-trust dlp entries predefined delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries predefined delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/entries/predefined/${t[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(t[`entry-id`]))}`,pathParams:{"entry-id":String(t[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
522
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.entries.predefined.delete({account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Deleted`})})};function Xl(e){return e.usage(`$0 zero-trust dlp entries predefined update <entry-id>
|
|
523
|
+
|
|
524
|
+
Updates a DLP entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).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:`Settings to enable or disable predefined entry in owning profile.`})}const Zl={command:`update <entry-id>`,describe:`Update predefined entry`,builder:Xl,handler:async t=>l({command:`zero-trust dlp entries predefined update`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/entries/predefined/${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({enabled:t.enabled}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.predefined.update({body:e,account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({enabled:t.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.predefined.update({body:u,account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Updated`})})},Ql={command:`predefined`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(ql).command(Yl).command(Zl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $l(e){return e.usage(`$0 zero-trust dlp entries update <entry-id>
|
|
525
|
+
|
|
526
|
+
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 eu={command:`update <entry-id>`,describe:`Update entry`,builder:$l,handler:async t=>l({command:`zero-trust dlp entries update`,classification:{safeFlags:[`pattern-validation`,`type`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp entries update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.update({body:e,account_id:l,entry_id:t[`entry-id`]})),{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});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.update({body:u,account_id:l,entry_id:t[`entry-id`]})),{successLabel:`Updated`})})},tu={command:`entries`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(kl).command(Pl).command(Il).command(Gl).command(eu).command(Ml).command(Ul).command(Ql).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function nu(e){return e.usage(`$0 zero-trust dlp limits list
|
|
527
|
+
|
|
528
|
+
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 ru={command:`list`,describe:`Fetch limits associated with DLP for account`,builder:nu,handler:async t=>l({command:`zero-trust dlp limits list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp limits list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/limits`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.limits.list({account_id:l})),{successLabel:`Loaded`})})},iu={command:`limits`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(ru).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function au(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 ou={command:`validate`,describe:`Validate a DLP regex pattern`,builder:au,handler:async t=>l({command:`zero-trust dlp patterns validate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp patterns validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.patterns.validate({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.patterns.validate({...u,account_id:l})),{successLabel:`Created`})})},su={command:`patterns`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(ou).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function cu(e){return e.usage(`$0 zero-trust dlp payload-logs get
|
|
529
|
+
|
|
530
|
+
Gets the current payload logging configuration for DLP, showing whether matched content is being logged.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lu={command:`get`,describe:`Get payload log settings`,builder:cu,handler:async t=>l({command:`zero-trust dlp payload-logs get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp payload-logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/payload_log`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.payloadLogs.get({account_id:l})),{successLabel:`Loaded`})})};function uu(e){return e.usage(`$0 zero-trust dlp payload-logs update
|
|
531
|
+
|
|
532
|
+
Enables or disables payload logging for DLP matches. When enabled, matched content is stored for review.`).option(`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(`public-key`,{type:`string`,description:`Base64-encoded public key for encrypting payload logs.
|
|
533
|
+
|
|
534
|
+
- Set to null or empty string to disable payload logging.
|
|
535
|
+
- Set to a non-empty base64 string to enable payload logging with the given key.
|
|
536
|
+
|
|
537
|
+
For customers with configurable payload masking feature rolled out:
|
|
538
|
+
- If the field is missing, the existing setting will be kept. Note that this is different from setting to null or empty string.
|
|
539
|
+
|
|
540
|
+
For all other customers:
|
|
541
|
+
- If the field is missing, the existing setting will be cleared.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`New payload log settings.`})}const du={command:`update`,describe:`Set payload log settings`,builder:uu,handler:async t=>l({command:`zero-trust dlp payload-logs update`,classification:{safeFlags:[`masking-level`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp payload-logs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/payload_log`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({masking_level:m(t[`masking-level`],`masking-level`,`text`),public_key:m(t[`public-key`],`public-key`,`text`)}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.payloadLogs.update({...e,account_id:l})),{successLabel:`Updated`});return}let u=p({masking_level:m(t[`masking-level`],`masking-level`,`text`),public_key:m(t[`public-key`],`public-key`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.payloadLogs.update({...u,account_id:l})),{successLabel:`Updated`})})},fu={command:`payload-logs`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(lu).command(du).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pu(e){return e.usage(`$0 zero-trust dlp profiles custom create
|
|
542
|
+
|
|
543
|
+
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 mu={command:`create`,describe:`Create custom profile`,builder:pu,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){s({command:`cf zero-trust dlp profiles custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.custom.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.custom.create({...u,account_id:l})),{successLabel:`Created`})})};function hu(e){return e.usage(`$0 zero-trust dlp profiles custom delete <profile-id>
|
|
544
|
+
|
|
545
|
+
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 gu={command:`delete <profile-id>`,describe:`Delete custom profile`,builder:hu,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){s({command:`cf zero-trust dlp profiles custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
546
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.profiles.custom.delete({account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Deleted`})})};function _u(e){return e.usage(`$0 zero-trust dlp profiles custom get <profile-id>
|
|
547
|
+
|
|
548
|
+
Fetches a custom 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 vu={command:`get <profile-id>`,describe:`Get custom profile`,builder:_u,handler:async t=>l({command:`zero-trust dlp profiles custom get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp profiles custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.profiles.custom.get({account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Loaded`})})};function yu(e){return e.usage(`$0 zero-trust dlp profiles custom update <profile-id>
|
|
549
|
+
|
|
550
|
+
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.
|
|
551
|
+
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 bu={command:`update <profile-id>`,describe:`Update custom profile`,builder:yu,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){s({command:`cf zero-trust dlp profiles custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.custom.update({...e,account_id:l,profile_id:t[`profile-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.custom.update({...u,account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Updated`})})},xu={command:`custom`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(mu).command(gu).command(vu).command(bu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Su(e){return e.usage(`$0 zero-trust dlp profiles get <profile-id>
|
|
552
|
+
|
|
553
|
+
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 Cu={command:`get <profile-id>`,describe:`Get DLP Profile`,builder:Su,handler:async t=>l({command:`zero-trust dlp profiles get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.profiles.get({account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Loaded`})})};function wu(e){return e.usage(`$0 zero-trust dlp profiles list
|
|
554
|
+
|
|
555
|
+
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 Tu={command:`list`,describe:`List all profiles`,builder:wu,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){s({command:`cf zero-trust dlp profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/profiles`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dlp.profiles.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Eu(e){return e.usage(`$0 zero-trust dlp profiles predefined create <profile-id>
|
|
556
|
+
|
|
557
|
+
This is similar to \`update_predefined\` but only returns entries that are enabled. This is needed for our terraform API Creates 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`,default:!1}).option(`allowed-match-count`,{type:`number`,description:`The allowed_match_count field`,default:0}).option(`confidence-threshold`,{type:`string`,description:`The confidence_threshold field`,default:`low`}).option(`enabled-entries`,{type:`string`,array:!0,description:`The enabled_entries field`}).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`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Predefined profiles can not be created. This endpoint will only update an existing predefined profiles settings.`})}const Du={command:`create <profile-id>`,describe:`Create predefined profile`,builder:Eu,handler:async t=>l({command:`zero-trust dlp profiles predefined create`,classification:{safeFlags:[`ai-context-enabled`,`ocr-enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp profiles predefined create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/profiles/predefined/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}/config`,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`),enabled_entries:t[`enabled-entries`],entries:f(t.entries,`entries`),ocr_enabled:t[`ocr-enabled`]}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.predefined.create({body:e,account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Created`});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`),enabled_entries:t[`enabled-entries`],entries:f(t.entries,`entries`),ocr_enabled:t[`ocr-enabled`]});o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.predefined.create({body:u,account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Created`})})};function Ou(e){return e.usage(`$0 zero-trust dlp profiles predefined delete <profile-id>
|
|
558
|
+
|
|
559
|
+
This is a no-op as predefined profiles can't be deleted but is needed for our generated terraform API.`).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 ku={command:`delete <profile-id>`,describe:`Delete predefined profile`,builder:Ou,handler:async t=>l({command:`zero-trust dlp profiles predefined delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp profiles predefined delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/profiles/predefined/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
560
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.profiles.predefined.delete({account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Deleted`})})};function Au(e){return e.usage(`$0 zero-trust dlp profiles predefined get <profile-id>
|
|
561
|
+
|
|
562
|
+
This is similar to \`get_predefined\` but only returns entries that are enabled. This is needed for our terraform API Fetches a predefined 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 ju={command:`get <profile-id>`,describe:`Get predefined profile config`,builder:Au,handler:async t=>l({command:`zero-trust dlp profiles predefined get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp profiles predefined get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/profiles/predefined/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}/config`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.profiles.predefined.get({account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Loaded`})})};function Mu(e){return e.usage(`$0 zero-trust dlp profiles predefined update <profile-id>
|
|
563
|
+
|
|
564
|
+
This is similar to \`update_predefined\` but only returns entries that are enabled. This is needed for our terraform API 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(`enabled-entries`,{type:`string`,array:!0,description:`The enabled_entries field`}).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.`})}const Nu={command:`update <profile-id>`,describe:`Update predefined profile config`,builder:Mu,handler:async t=>l({command:`zero-trust dlp profiles predefined update`,classification:{safeFlags:[`ai-context-enabled`,`ocr-enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp profiles predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/profiles/predefined/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}/config`,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`),enabled_entries:t[`enabled-entries`],entries:f(t.entries,`entries`),ocr_enabled:t[`ocr-enabled`]}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.predefined.update({body:e,account_id:l,profile_id:t[`profile-id`]})),{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`),enabled_entries:t[`enabled-entries`],entries:f(t.entries,`entries`),ocr_enabled:t[`ocr-enabled`]});o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.predefined.update({body:u,account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Updated`})})},Pu={command:`predefined`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Du).command(ku).command(ju).command(Nu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fu={command:`profiles`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Cu).command(Tu).command(xu).command(Pu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Iu(e){return e.usage(`$0 zero-trust dlp sensitivity-group-templates get <template-id>
|
|
565
|
+
|
|
566
|
+
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 Lu={command:`get <template-id>`,describe:`Retrieve a specific sensitivity group template.`,builder:Iu,handler:async t=>l({command:`zero-trust dlp sensitivity-group-templates get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-group-templates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroupTemplates.get({account_id:l,template_id:t[`template-id`]})),{successLabel:`Loaded`})})};function Ru(e){return e.usage(`$0 zero-trust dlp sensitivity-group-templates list
|
|
567
|
+
|
|
568
|
+
Lists available sensitivity group templates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const zu={command:`list`,describe:`Retrieve all sensitivity group templates in an account`,builder:Ru,handler:async t=>l({command:`zero-trust dlp sensitivity-group-templates list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-group-templates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/sensitivity_groups/templates`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroupTemplates.list({account_id:l})),{successLabel:`Loaded`})})},Bu={command:`sensitivity-group-templates`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Lu).command(zu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Vu(e){return e.usage(`$0 zero-trust dlp sensitivity-groups create
|
|
569
|
+
|
|
570
|
+
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 Hu={command:`create`,describe:`Creates a new sensitivity group.`,builder:Vu,handler:async t=>l({command:`zero-trust dlp sensitivity-groups create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityGroups.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityGroups.create({...u,account_id:l})),{successLabel:`Created`})})};function Uu(e){return e.usage(`$0 zero-trust dlp sensitivity-groups delete <sensitivity-group-id>
|
|
571
|
+
|
|
572
|
+
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 Wu={command:`delete <sensitivity-group-id>`,describe:`Delete a single sensitivity group.`,builder:Uu,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){s({command:`cf zero-trust dlp sensitivity-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
573
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.sensitivityGroups.delete({account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]})),{successLabel:`Deleted`})})};function Gu(e){return e.usage(`$0 zero-trust dlp sensitivity-groups get-level-order <sensitivity-group-id>
|
|
574
|
+
|
|
575
|
+
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 Ku={command:`get-level-order <sensitivity-group-id>`,describe:`Retrieve the ordered list of level IDs for a sensitivity group.`,builder:Gu,handler:async t=>l({command:`zero-trust dlp sensitivity-groups get-level-order`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-groups get-level-order`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.getLevelOrder({account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]})),{successLabel:`Loaded`})})};function qu(e){return e.usage(`$0 zero-trust dlp sensitivity-groups get <sensitivity-group-id>
|
|
576
|
+
|
|
577
|
+
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 Ju={command:`get <sensitivity-group-id>`,describe:`Retrieve a specific sensitivity group.`,builder:qu,handler:async t=>l({command:`zero-trust dlp sensitivity-groups get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.get({account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]})),{successLabel:`Loaded`})})};function Yu(e){return e.usage(`$0 zero-trust dlp sensitivity-groups list
|
|
578
|
+
|
|
579
|
+
Lists sensitivity groups configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xu={command:`list`,describe:`Retrieve all sensitivity groups in an account`,builder:Yu,handler:async t=>l({command:`zero-trust dlp sensitivity-groups list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/sensitivity_groups`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.list({account_id:l})),{successLabel:`Loaded`})})};function Zu(e){return e.usage(`$0 zero-trust dlp sensitivity-groups update-level-order <sensitivity-group-id>
|
|
580
|
+
|
|
581
|
+
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 Qu={command:`update-level-order <sensitivity-group-id>`,describe:`Set the ordering of levels within a sensitivity group.`,builder:Zu,handler:async t=>l({command:`zero-trust dlp sensitivity-groups update-level-order`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-groups update-level-order`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.updateLevelOrder({body:e,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]})),{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`]});o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.updateLevelOrder({body:u,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]})),{successLabel:`Updated`})})};function $u(e){return e.usage(`$0 zero-trust dlp sensitivity-groups update <sensitivity-group-id>
|
|
582
|
+
|
|
583
|
+
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 ed={command:`update <sensitivity-group-id>`,describe:`Update the attributes of a single sensitivity group.`,builder:$u,handler:async t=>l({command:`zero-trust dlp sensitivity-groups update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.update({...e,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]})),{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),levels:f(t.levels,`levels`),name:m(t.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.update({...u,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]})),{successLabel:`Updated`})})},td={command:`sensitivity-groups`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Hu).command(Wu).command(Ju).command(Ku).command(Xu).command(ed).command(Qu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function nd(e){return e.usage(`$0 zero-trust dlp sensitivity-levels create <sensitivity-group-id>
|
|
584
|
+
|
|
585
|
+
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 rd={command:`create <sensitivity-group-id>`,describe:`Creates a new sensitivity level.`,builder:nd,handler:async t=>l({command:`zero-trust dlp sensitivity-levels create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-levels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityLevels.create({body:e,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityLevels.create({body:u,account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]})),{successLabel:`Created`})})};function id(e){return e.usage(`$0 zero-trust dlp sensitivity-levels delete <sensitivity-level-id>
|
|
586
|
+
|
|
587
|
+
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 ad={command:`delete <sensitivity-level-id>`,describe:`Delete a single sensitivity level.`,builder:id,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){s({command:`cf zero-trust dlp sensitivity-levels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
588
|
+
`);return}o(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`]})),{successLabel:`Deleted`})})};function od(e){return e.usage(`$0 zero-trust dlp sensitivity-levels get <sensitivity-level-id>
|
|
589
|
+
|
|
590
|
+
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 sd={command:`get <sensitivity-level-id>`,describe:`Retrieve a specific sensitivity level.`,builder:od,handler:async t=>l({command:`zero-trust dlp sensitivity-levels get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-levels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(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`]})),{successLabel:`Loaded`})})};function cd(e){return e.usage(`$0 zero-trust dlp sensitivity-levels list
|
|
591
|
+
|
|
592
|
+
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 ld={command:`list`,describe:`Retrieve all sensitivity levels in a sensitivity group`,builder:cd,handler:async t=>l({command:`zero-trust dlp sensitivity-levels list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-levels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityLevels.list({account_id:l,sensitivity_group_id:t[`sensitivity-group-id`]})),{successLabel:`Loaded`})})};function ud(e){return e.usage(`$0 zero-trust dlp sensitivity-levels update <sensitivity-level-id>
|
|
593
|
+
|
|
594
|
+
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 dd={command:`update <sensitivity-level-id>`,describe:`Update the attributes of a single sensitivity level.`,builder:ud,handler:async t=>l({command:`zero-trust dlp sensitivity-levels update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust dlp sensitivity-levels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(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`]})),{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`)});o(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`]})),{successLabel:`Updated`})})},fd={command:`sensitivity-levels`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(rd).command(ad).command(sd).command(ld).command(dd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},pd={command:`dlp`,describe:`Operations for dlp`,builder:e=>e.command(rc).command(mc).command(wc).command(kc).command(Bc).command(cl).command(Dl).command(tu).command(iu).command(su).command(fu).command(Fu).command(Bu).command(td).command(fd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function md(e){return e.usage(`$0 zero-trust document-fingerprints create document fingerprints
|
|
595
|
+
|
|
596
|
+
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 hd={command:`fingerprints`,describe:`Creates a new document fingerprint.`,builder:md,handler:async t=>l({command:`zero-trust document-fingerprints create document fingerprints`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust document-fingerprints create document fingerprints`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.document.fingerprints({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.document.fingerprints({...u,account_id:l})),{successLabel:`Created`})})},gd={command:`document`,describe:`Document Fingerprints operations`,builder:e=>e.command(hd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _d(e){return e.usage(`$0 zero-trust document-fingerprints create v2 <document-fingerprint-id>
|
|
597
|
+
|
|
598
|
+
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 vd={command:`v2 <document-fingerprint-id>`,describe:`Update the attributes of a single document fingerprint.`,builder:_d,handler:async t=>l({command:`zero-trust document-fingerprints create v2`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust document-fingerprints create v2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.v2({...e,account_id:l,document_fingerprint_id:t[`document-fingerprint-id`]})),{successLabel:`Created`});return}let u=p({description:m(t.description,`description`,`text`),match_percent:t[`match-percent`],name:m(t.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.v2({...u,account_id:l,document_fingerprint_id:t[`document-fingerprint-id`]})),{successLabel:`Created`})})},yd={command:`create`,describe:`Document Fingerprints operations`,builder:e=>e.command(vd).command(gd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bd(e){return e.usage(`$0 zero-trust document-fingerprints delete <document-fingerprint-id>
|
|
599
|
+
|
|
600
|
+
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 xd={command:`delete <document-fingerprint-id>`,describe:`Delete a single document fingerprint.`,builder:bd,handler:async t=>l({command:`zero-trust document-fingerprints delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust document-fingerprints delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
601
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.documentFingerprints.delete({account_id:l,document_fingerprint_id:t[`document-fingerprint-id`]})),{successLabel:`Deleted`})})};function Sd(e){return e.usage(`$0 zero-trust document-fingerprints get document fingerprints <document-fingerprint-id>
|
|
602
|
+
|
|
603
|
+
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 Cd={command:`fingerprints <document-fingerprint-id>`,describe:`Retrieve data about a specific document fingerprint.`,builder:Sd,handler:async t=>l({command:`zero-trust document-fingerprints get document fingerprints`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust document-fingerprints get document fingerprints`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.documentFingerprints.get.document.fingerprints({account_id:l,document_fingerprint_id:t[`document-fingerprint-id`]})),{successLabel:`Loaded`})})},wd={command:`document`,describe:`Document Fingerprints operations`,builder:e=>e.command(Cd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Td(e){return e.usage(`$0 zero-trust document-fingerprints get fingerprints all
|
|
604
|
+
|
|
605
|
+
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 Ed={command:`all`,describe:`Retrieve data about all document fingerprints.`,builder:Td,handler:async t=>l({command:`zero-trust document-fingerprints get fingerprints all`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust document-fingerprints get fingerprints all`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/document_fingerprints`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.documentFingerprints.get.fingerprints.all({account_id:l})),{successLabel:`Loaded`})})},Dd={command:`fingerprints`,describe:`Document Fingerprints operations`,builder:e=>e.command(Ed).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Od={command:`get`,describe:`Operations for document-fingerprints.get`,builder:e=>e.command(wd).command(Dd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function kd(e){return e.usage(`$0 zero-trust document-fingerprints update <document-fingerprint-id>
|
|
606
|
+
|
|
607
|
+
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 Ad={command:`update <document-fingerprint-id>`,describe:`Uploads a new version for a document fingerprint.`,builder:kd,handler:async t=>l({command:`zero-trust document-fingerprints update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust document-fingerprints update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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:`multipart`,body:{body:t.body,file:t.file}});return}let l=await a(t),u=t.local?e:await n();if(t.accountId=u,t.file!==void 0||t.body!==void 0){let e=new FormData;if(t.file){let n=h(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);o(await c(`Updating`,async()=>i(l,`PUT`,`/accounts/${u}/dlp/document_fingerprints/${encodeURIComponent(String(t[`document-fingerprint-id`]))}`,{body:e})),{successLabel:`Updated`});return}if(t.body){let e=m(t.body,`body`,`binary`);o(await c(`Updating`,async()=>i(l,`PUT`,`/accounts/${u}/dlp/document_fingerprints/${encodeURIComponent(String(t[`document-fingerprint-id`]))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{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.`)})},jd={command:`document-fingerprints`,describe:`Document Fingerprints operations`,builder:e=>e.command(xd).command(Ad).command(yd).command(Od).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Md(e){return e.usage(`$0 zero-trust gateway app-types list
|
|
608
|
+
|
|
609
|
+
List all application and application type mappings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Nd={command:`list`,describe:`List application and application type mappings`,builder:Md,handler:async t=>l({command:`zero-trust gateway app-types list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway app-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/app_types`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.appTypes.list({account_id:l})),{successLabel:`Loaded`})})},Pd={command:`app-types`,describe:`Operations for gateway.app-types`,builder:e=>e.command(Nd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fd(e){return e.usage(`$0 zero-trust gateway audit-ssh-settings get
|
|
610
|
+
|
|
611
|
+
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 Id={command:`get`,describe:`Get Zero Trust SSH settings`,builder:Fd,handler:async t=>l({command:`zero-trust gateway audit-ssh-settings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway audit-ssh-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/audit_ssh_settings`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.auditSshSettings.get({account_id:l})),{successLabel:`Loaded`})})};function Ld(e){return e.usage(`$0 zero-trust gateway audit-ssh-settings rotate-seed
|
|
612
|
+
|
|
613
|
+
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 Rd={command:`rotate-seed`,describe:`Rotate Zero Trust SSH account seed`,builder:Ld,handler:async t=>l({command:`zero-trust gateway audit-ssh-settings rotate-seed`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway audit-ssh-settings rotate-seed`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/audit_ssh_settings/rotate_seed`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.auditSshSettings.rotateSeed({account_id:l})),{successLabel:`Created`})})};function zd(e){return e.usage(`$0 zero-trust gateway audit-ssh-settings update
|
|
614
|
+
|
|
615
|
+
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 Bd={command:`update`,describe:`Update Zero Trust SSH settings`,builder:zd,handler:async t=>l({command:`zero-trust gateway audit-ssh-settings update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway audit-ssh-settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.auditSshSettings.update({...e,account_id:l})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.auditSshSettings.update({...u,account_id:l})),{successLabel:`Updated`})})},Vd={command:`audit-ssh-settings`,describe:`Operations for gateway.audit-ssh-settings`,builder:e=>e.command(Id).command(Rd).command(Bd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Hd(e){return e.usage(`$0 zero-trust gateway categories list
|
|
616
|
+
|
|
617
|
+
List all categories.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ud={command:`list`,describe:`List categories`,builder:Hd,handler:async t=>l({command:`zero-trust gateway categories list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/categories`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.categories.list({account_id:l})),{successLabel:`Loaded`})})},Wd={command:`categories`,describe:`Operations for gateway.categories`,builder:e=>e.command(Ud).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Gd(e){return e.usage(`$0 zero-trust gateway certificates activate <certificate-id>
|
|
618
|
+
|
|
619
|
+
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 Kd={command:`activate <certificate-id>`,describe:`Activate a Zero Trust certificate`,builder:Gd,handler:async t=>l({command:`zero-trust gateway certificates activate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway certificates activate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.activate({account_id:l,certificate_id:t[`certificate-id`]})),{successLabel:`Created`})})};function qd(e){return e.usage(`$0 zero-trust gateway certificates create
|
|
620
|
+
|
|
621
|
+
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 Jd={command:`create`,describe:`Create Zero Trust certificate`,builder:qd,handler:async t=>l({command:`zero-trust gateway certificates create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.create({...e,account_id:l})),{successLabel:`Created`});return}let u=p({validity_period_days:t[`validity-period-days`]});o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.create({...u,account_id:l})),{successLabel:`Created`})})};function Yd(e){return e.usage(`$0 zero-trust gateway certificates deactivate <certificate-id>
|
|
622
|
+
|
|
623
|
+
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 Xd={command:`deactivate <certificate-id>`,describe:`Deactivate a Zero Trust certificate`,builder:Yd,handler:async t=>l({command:`zero-trust gateway certificates deactivate`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway certificates deactivate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.deactivate({account_id:l,certificate_id:t[`certificate-id`]})),{successLabel:`Created`})})};function Zd(e){return e.usage(`$0 zero-trust gateway certificates delete <certificate-id>
|
|
624
|
+
|
|
625
|
+
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 Qd={command:`delete <certificate-id>`,describe:`Delete Zero Trust certificate`,builder:Zd,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){s({command:`cf zero-trust gateway certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
626
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.certificates.delete({account_id:l,certificate_id:t[`certificate-id`]})),{successLabel:`Deleted`})})};function $d(e){return e.usage(`$0 zero-trust gateway certificates get <certificate-id>
|
|
627
|
+
|
|
628
|
+
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 ef={command:`get <certificate-id>`,describe:`Get Zero Trust certificate details`,builder:$d,handler:async t=>l({command:`zero-trust gateway certificates get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.certificates.get({account_id:l,certificate_id:t[`certificate-id`]})),{successLabel:`Loaded`})})};function tf(e){return e.usage(`$0 zero-trust gateway certificates list
|
|
629
|
+
|
|
630
|
+
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 nf={command:`list`,describe:`List Zero Trust certificates`,builder:tf,handler:async t=>l({command:`zero-trust gateway certificates list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/certificates`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.certificates.list({account_id:l})),{successLabel:`Loaded`})})},rf={command:`certificates`,describe:`Operations for gateway.certificates`,builder:e=>e.command(Kd).command(Jd).command(Xd).command(Qd).command(ef).command(nf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function af(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(`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 of={command:`edit`,describe:`Patch Zero Trust account configuration`,builder:af,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){s({command:`cf zero-trust gateway configurations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.edit({body:e,account_id:l})),{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`]}}});o(await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.edit({body:u,account_id:l})),{successLabel:`Updated`})})};function sf(e){return e.usage(`$0 zero-trust gateway configurations get
|
|
631
|
+
|
|
632
|
+
Retrieve the current Zero Trust account configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const cf={command:`get`,describe:`Get Zero Trust account configuration`,builder:sf,handler:async t=>l({command:`zero-trust gateway configurations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway configurations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.configurations.get({account_id:l})),{successLabel:`Loaded`})})};function lf(e){return e.usage(`$0 zero-trust gateway configurations update
|
|
633
|
+
|
|
634
|
+
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(`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 uf={command:`update`,describe:`Update Zero Trust account configuration`,builder:lf,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){s({command:`cf zero-trust gateway configurations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.update({body:e,account_id:l})),{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`]}}});o(await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.update({body:u,account_id:l})),{successLabel:`Updated`})})},df={command:`configurations`,describe:`Operations for gateway.configurations`,builder:e=>e.command(of).command(cf).command(uf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ff(e){return e.usage(`$0 zero-trust gateway create
|
|
635
|
+
|
|
636
|
+
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 pf={command:`create`,describe:`Create Zero Trust account`,builder:ff,handler:async t=>l({command:`zero-trust gateway create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.create({account_id:l})),{successLabel:`Created`})})};function mf(e){return e.usage(`$0 zero-trust gateway dns-destination-ips list
|
|
637
|
+
|
|
638
|
+
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 hf={command:`list`,describe:`List Zero Trust Gateway DNS destination IPv4 address pairs`,builder:mf,handler:async t=>l({command:`zero-trust gateway dns-destination-ips list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway dns-destination-ips list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/dns_destination_ips`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.dnsDestinationIps.list({account_id:l})),{successLabel:`Loaded`})})},gf={command:`dns-destination-ips`,describe:`Operations for gateway.dns-destination-ips`,builder:e=>e.command(hf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _f(e){return e.usage(`$0 zero-trust gateway egress-cidr-pairs list
|
|
639
|
+
|
|
640
|
+
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 vf={command:`list`,describe:`Get gateway egress CIDRs pairs assigned to this account`,builder:_f,handler:async t=>l({command:`zero-trust gateway egress-cidr-pairs list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway egress-cidr-pairs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/egress_cidr_pairs`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.egressCidrPairs.list({account_id:l})),{successLabel:`Loaded`})})},yf={command:`egress-cidr-pairs`,describe:`Operations for gateway.egress-cidr-pairs`,builder:e=>e.command(vf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bf(e){return e.usage(`$0 zero-trust gateway list
|
|
641
|
+
|
|
642
|
+
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 xf={command:`list`,describe:`Get Zero Trust account information`,builder:bf,handler:async t=>l({command:`zero-trust gateway list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.list({account_id:l})),{successLabel:`Loaded`})})};function Sf(e){return e.usage(`$0 zero-trust gateway lists create
|
|
643
|
+
|
|
644
|
+
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 Cf={command:`create`,describe:`Create Zero Trust list`,builder:Sf,handler:async t=>l({command:`zero-trust gateway lists create`,classification:{safeFlags:[`type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.lists.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.lists.create({...u,account_id:l})),{successLabel:`Created`})})};function wf(e){return e.usage(`$0 zero-trust gateway lists delete <list-id>
|
|
645
|
+
|
|
646
|
+
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 Tf={command:`delete <list-id>`,describe:`Delete Zero Trust list`,builder:wf,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){s({command:`cf zero-trust gateway lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
647
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.lists.delete({account_id:l,list_id:t[`list-id`]})),{successLabel:`Deleted`})})};function Ef(e){return e.usage(`$0 zero-trust gateway lists edit <list-id>
|
|
648
|
+
|
|
649
|
+
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 Df={command:`edit <list-id>`,describe:`Patch Zero Trust list.`,builder:Ef,handler:async t=>l({command:`zero-trust gateway lists edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway lists edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.edit({...e,account_id:l,list_id:t[`list-id`]})),{successLabel:`Updated`});return}let u=p({append:f(t.append,`append`),remove:t.remove});o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.edit({...u,account_id:l,list_id:t[`list-id`]})),{successLabel:`Updated`})})};function Of(e){return e.usage(`$0 zero-trust gateway lists get <list-id>
|
|
650
|
+
|
|
651
|
+
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 kf={command:`get <list-id>`,describe:`Get Zero Trust list details`,builder:Of,handler:async t=>l({command:`zero-trust gateway lists get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.lists.get({account_id:l,list_id:t[`list-id`]})),{successLabel:`Loaded`})})};function Af(e){return e.usage(`$0 zero-trust gateway lists items list
|
|
652
|
+
|
|
653
|
+
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 jf={command:`list`,describe:`Get Zero Trust list items`,builder:Af,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){s({command:`cf zero-trust gateway lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.lists.items.list({account_id:u,list_id:t[`list-id`],...i})),{successLabel:`Loaded`})})},Mf={command:`items`,describe:`Operations for gateway.lists.items`,builder:e=>e.command(jf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Nf(e){return e.usage(`$0 zero-trust gateway lists list
|
|
654
|
+
|
|
655
|
+
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 Pf={command:`list`,describe:`List Zero Trust lists`,builder:y(Nf),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){s({command:`cf zero-trust gateway lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/lists`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.lists.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Ff(e){return e.usage(`$0 zero-trust gateway lists update <list-id>
|
|
656
|
+
|
|
657
|
+
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 If={command:`update <list-id>`,describe:`Update Zero Trust list`,builder:Ff,handler:async t=>l({command:`zero-trust gateway lists update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.update({...e,account_id:l,list_id:t[`list-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.update({...u,account_id:l,list_id:t[`list-id`]})),{successLabel:`Updated`})})};function Lf(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 Rf={command:`upload`,describe:`Create Zero Trust list from CSV`,builder:Lf,handler:async t=>l({command:`zero-trust gateway lists upload`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway lists upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/lists/upload`,pathParams:{},bodyKind:`multipart`,body:{body:t.body,file:t.file}});return}let l=await a(t),u=t.local?e:await n();if(t.accountId=u,t.file!==void 0||t.body!==void 0){let e=new FormData;if(t.file){let n=h(t.file);e.append(`file`,new Blob([n]),t.file.split(/[\\/]/).filter(Boolean).pop())}else t.body!==void 0&&e.append(`file`,t.body);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/gateway/lists/upload`,{body:e})),{successLabel:`Created`});return}if(t.body){let e=m(t.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/gateway/lists/upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{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.`)})},zf={command:`lists`,describe:`Operations for gateway.lists`,builder:e=>e.command(Cf).command(Tf).command(Df).command(kf).command(Pf).command(If).command(Rf).command(Mf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Bf(e){return e.usage(`$0 zero-trust gateway locations create
|
|
658
|
+
|
|
659
|
+
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 Vf={command:`create`,describe:`Create a Zero Trust Gateway location`,builder:Bf,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){s({command:`cf zero-trust gateway locations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.locations.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.locations.create({...u,account_id:l})),{successLabel:`Created`})})};function Hf(e){return e.usage(`$0 zero-trust gateway locations delete <location-id>
|
|
660
|
+
|
|
661
|
+
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 Uf={command:`delete <location-id>`,describe:`Delete a Zero Trust Gateway location`,builder:Hf,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){s({command:`cf zero-trust gateway locations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
662
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.locations.delete({account_id:l,location_id:t[`location-id`]})),{successLabel:`Deleted`})})};function Wf(e){return e.usage(`$0 zero-trust gateway locations get <location-id>
|
|
663
|
+
|
|
664
|
+
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 Gf={command:`get <location-id>`,describe:`Get Zero Trust Gateway location details`,builder:Wf,handler:async t=>l({command:`zero-trust gateway locations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway locations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.locations.get({account_id:l,location_id:t[`location-id`]})),{successLabel:`Loaded`})})};function Kf(e){return e.usage(`$0 zero-trust gateway locations list
|
|
665
|
+
|
|
666
|
+
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 qf={command:`list`,describe:`List Zero Trust Gateway locations`,builder:y(Kf),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){s({command:`cf zero-trust gateway locations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/locations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.locations.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Jf(e){return e.usage(`$0 zero-trust gateway locations update <location-id>
|
|
667
|
+
|
|
668
|
+
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 Yf={command:`update <location-id>`,describe:`Update a Zero Trust Gateway location`,builder:Jf,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){s({command:`cf zero-trust gateway locations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.locations.update({...e,account_id:l,location_id:t[`location-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.locations.update({...u,account_id:l,location_id:t[`location-id`]})),{successLabel:`Updated`})})},Xf={command:`locations`,describe:`Operations for gateway.locations`,builder:e=>e.command(Vf).command(Uf).command(Gf).command(qf).command(Yf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Zf(e){return e.usage(`$0 zero-trust gateway logging get
|
|
669
|
+
|
|
670
|
+
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 Qf={command:`get`,describe:`Get logging settings for the Zero Trust account`,builder:Zf,handler:async t=>l({command:`zero-trust gateway logging get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway logging get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/logging`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.logging.get({account_id:l})),{successLabel:`Loaded`})})};function $f(e){return e.usage(`$0 zero-trust gateway logging update
|
|
671
|
+
|
|
672
|
+
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 ep={command:`update`,describe:`Update Zero Trust account logging settings`,builder:$f,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){s({command:`cf zero-trust gateway logging update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.logging.update({body:e,account_id:l})),{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`]}}});o(await c(`Updating`,async()=>i.zeroTrust.gateway.logging.update({body:u,account_id:l})),{successLabel:`Updated`})})},tp={command:`logging`,describe:`Operations for gateway.logging`,builder:e=>e.command(Qf).command(ep).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function np(e){return e.usage(`$0 zero-trust gateway operations get <operation-id>
|
|
673
|
+
|
|
674
|
+
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 rp={command:`get <operation-id>`,describe:`Zero Trust Gateway operation details`,builder:np,handler:async t=>l({command:`zero-trust gateway operations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.operations.get({account_id:l,operation_id:t[`operation-id`]})),{successLabel:`Loaded`})})};function ip(e){return e.usage(`$0 zero-trust gateway operations list
|
|
675
|
+
|
|
676
|
+
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 ap={command:`list`,describe:`List Zero Trust Gateway operations`,builder:ip,handler:async t=>l({command:`zero-trust gateway operations list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/operations`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.operations.list({account_id:l})),{successLabel:`Loaded`})})},op={command:`operations`,describe:`Operations for gateway.operations`,builder:e=>e.command(rp).command(ap).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function sp(e){return e.usage(`$0 zero-trust gateway pacfiles create
|
|
677
|
+
|
|
678
|
+
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 cp={command:`create`,describe:`Create a PAC file`,builder:sp,handler:async t=>l({command:`zero-trust gateway pacfiles create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway pacfiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.pacfiles.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.pacfiles.create({...u,account_id:l})),{successLabel:`Created`})})};function lp(e){return e.usage(`$0 zero-trust gateway pacfiles delete <pacfile-id>
|
|
679
|
+
|
|
680
|
+
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 up={command:`delete <pacfile-id>`,describe:`Delete a PAC file`,builder:lp,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){s({command:`cf zero-trust gateway pacfiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
681
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.pacfiles.delete({account_id:l,pacfile_id:t[`pacfile-id`]})),{successLabel:`Deleted`})})};function dp(e){return e.usage(`$0 zero-trust gateway pacfiles get <pacfile-id>
|
|
682
|
+
|
|
683
|
+
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 fp={command:`get <pacfile-id>`,describe:`Get a PAC file`,builder:dp,handler:async t=>l({command:`zero-trust gateway pacfiles get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway pacfiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.pacfiles.get({account_id:l,pacfile_id:t[`pacfile-id`]})),{successLabel:`Loaded`})})};function pp(e){return e.usage(`$0 zero-trust gateway pacfiles list
|
|
684
|
+
|
|
685
|
+
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 mp={command:`list`,describe:`List PAC files`,builder:pp,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){s({command:`cf zero-trust gateway pacfiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/pacfiles`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.pacfiles.list({account_id:u,...i})),{successLabel:`Loaded`})})};function hp(e){return e.usage(`$0 zero-trust gateway pacfiles update <pacfile-id>
|
|
686
|
+
|
|
687
|
+
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 gp={command:`update <pacfile-id>`,describe:`Update a Zero Trust Gateway PAC file`,builder:hp,handler:async t=>l({command:`zero-trust gateway pacfiles update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway pacfiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.pacfiles.update({...e,account_id:l,pacfile_id:t[`pacfile-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.pacfiles.update({...u,account_id:l,pacfile_id:t[`pacfile-id`]})),{successLabel:`Updated`})})},_p={command:`pacfiles`,describe:`Operations for gateway.pacfiles`,builder:e=>e.command(cp).command(up).command(fp).command(mp).command(gp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vp(e){return e.usage(`$0 zero-trust gateway proxy-endpoints create
|
|
688
|
+
|
|
689
|
+
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 yp={command:`create`,describe:`Create a proxy endpoint`,builder:vp,handler:async t=>l({command:`zero-trust gateway proxy-endpoints create`,classification:{safeFlags:[`kind`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway proxy-endpoints create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.proxyEndpoints.create({body:e,account_id:l})),{successLabel:`Created`});return}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`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.proxyEndpoints.create({body:u,account_id:l})),{successLabel:`Created`})})};function bp(e){return e.usage(`$0 zero-trust gateway proxy-endpoints delete <proxy-endpoint-id>
|
|
690
|
+
|
|
691
|
+
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 xp={command:`delete <proxy-endpoint-id>`,describe:`Delete a proxy endpoint`,builder:bp,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){s({command:`cf zero-trust gateway proxy-endpoints delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
692
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.proxyEndpoints.delete({account_id:l,proxy_endpoint_id:t[`proxy-endpoint-id`]})),{successLabel:`Deleted`})})};function Sp(e){return e.usage(`$0 zero-trust gateway proxy-endpoints edit <proxy-endpoint-id>
|
|
693
|
+
|
|
694
|
+
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 Cp={command:`edit <proxy-endpoint-id>`,describe:`Update a proxy endpoint`,builder:Sp,handler:async t=>l({command:`zero-trust gateway proxy-endpoints edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway proxy-endpoints edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.proxyEndpoints.edit({...e,account_id:l,proxy_endpoint_id:t[`proxy-endpoint-id`]})),{successLabel:`Updated`});return}let u=p({ips:t.ips,name:m(t.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.proxyEndpoints.edit({...u,account_id:l,proxy_endpoint_id:t[`proxy-endpoint-id`]})),{successLabel:`Updated`})})};function wp(e){return e.usage(`$0 zero-trust gateway proxy-endpoints get <proxy-endpoint-id>
|
|
695
|
+
|
|
696
|
+
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 Tp={command:`get <proxy-endpoint-id>`,describe:`Get a proxy endpoint`,builder:wp,handler:async t=>l({command:`zero-trust gateway proxy-endpoints get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway proxy-endpoints get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.proxyEndpoints.get({account_id:l,proxy_endpoint_id:t[`proxy-endpoint-id`]})),{successLabel:`Loaded`})})};function Ep(e){return e.usage(`$0 zero-trust gateway proxy-endpoints list
|
|
697
|
+
|
|
698
|
+
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 Dp={command:`list`,describe:`List proxy endpoints`,builder:y(Ep),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){s({command:`cf zero-trust gateway proxy-endpoints list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/proxy_endpoints`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.proxyEndpoints.list({account_id:u,...i})),{successLabel:`Loaded`})})},Op={command:`proxy-endpoints`,describe:`Operations for gateway.proxy-endpoints`,builder:e=>e.command(yp).command(xp).command(Cp).command(Tp).command(Dp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function kp(e){return e.usage(`$0 zero-trust gateway rules bulk-edit
|
|
699
|
+
|
|
700
|
+
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 Ap={command:`bulk-edit`,describe:`Patch multiple Zero Trust Gateway rules`,builder:kp,handler:async t=>l({command:`zero-trust gateway rules bulk-edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/rules`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.bulkEdit({body:e,account_id:l})),{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 jp(e){return e.usage(`$0 zero-trust gateway rules create
|
|
701
|
+
|
|
702
|
+
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(`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 Mp={command:`create`,describe:`Create a Zero Trust Gateway rule`,builder:jp,handler:async t=>l({command:`zero-trust gateway rules create`,classification:{safeFlags:`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){s({command:`cf zero-trust gateway rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.rules.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.rules.create({...u,account_id:l})),{successLabel:`Created`})})};function Np(e){return e.usage(`$0 zero-trust gateway rules delete <rule-id>
|
|
703
|
+
|
|
704
|
+
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 Pp={command:`delete <rule-id>`,describe:`Delete a Zero Trust Gateway rule`,builder:Np,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){s({command:`cf zero-trust gateway rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
705
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.rules.delete({account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Deleted`})})};function Fp(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 Ip={command:`edit <rule-id>`,describe:`Patch a Zero Trust Gateway rule`,builder:Fp,handler:async t=>l({command:`zero-trust gateway rules edit`,classification:{safeFlags:[`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.edit({...e,account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Updated`});return}let u=p({description:m(t.description,`description`,`text`),enabled:t.enabled,name:m(t.name,`name`,`text`),precedence:t.precedence});o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.edit({...u,account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Updated`})})};function Lp(e){return e.usage(`$0 zero-trust gateway rules get <rule-id>
|
|
706
|
+
|
|
707
|
+
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 Rp={command:`get <rule-id>`,describe:`Get Zero Trust Gateway rule details.`,builder:Lp,handler:async t=>l({command:`zero-trust gateway rules get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.rules.get({account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Loaded`})})};function zp(e){return e.usage(`$0 zero-trust gateway rules list-tenant
|
|
708
|
+
|
|
709
|
+
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 Bp={command:`list-tenant`,describe:`List Zero Trust Gateway rules inherited from the parent account`,builder:zp,handler:async t=>l({command:`zero-trust gateway rules list-tenant`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway rules list-tenant`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/rules/tenant`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.rules.listTenant({account_id:l})),{successLabel:`Loaded`})})};function Vp(e){return e.usage(`$0 zero-trust gateway rules list
|
|
710
|
+
|
|
711
|
+
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 Hp={command:`list`,describe:`List Zero Trust Gateway rules`,builder:y(Vp),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){s({command:`cf zero-trust gateway rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/gateway/rules`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.rules.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Up(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 Wp={command:`reset-expiration <rule-id>`,describe:`Reset the expiration of a Zero Trust Gateway Rule`,builder:Up,handler:async t=>l({command:`zero-trust gateway rules reset-expiration`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust gateway rules reset-expiration`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.rules.resetExpiration({account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Created`})})};function Gp(e){return e.usage(`$0 zero-trust gateway rules update <rule-id>
|
|
712
|
+
|
|
713
|
+
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(`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 Kp={command:`update <rule-id>`,describe:`Update a Zero Trust Gateway rule`,builder:Gp,handler:async t=>l({command:`zero-trust gateway rules update`,classification:{safeFlags:`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){s({command:`cf zero-trust gateway rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.update({...e,account_id:l,rule_id:t[`rule-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.update({...u,account_id:l,rule_id:t[`rule-id`]})),{successLabel:`Updated`})})},qp={command:`rules`,describe:`Operations for gateway.rules`,builder:e=>e.command(Ap).command(Mp).command(Pp).command(Ip).command(Rp).command(Hp).command(Bp).command(Wp).command(Kp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Jp={command:`gateway`,describe:`Operations for gateway`,builder:e=>e.command(pf).command(xf).command(Pd).command(Vd).command(Wd).command(rf).command(df).command(gf).command(yf).command(zf).command(Xf).command(tp).command(op).command(_p).command(Op).command(qp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Yp(e){return e.usage(`$0 zero-trust identity-providers create
|
|
714
|
+
|
|
715
|
+
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 Xp={command:`create`,describe:`Add an Access identity provider`,builder:Yp,handler:async i=>l({command:`zero-trust identity-providers create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/identity_providers`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.identityProviders.create({body:e,account_or_zone:u,account_or_zone_id:f})),{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.`)})};function Zp(e){return e.usage(`$0 zero-trust identity-providers delete <identity-provider-id>
|
|
716
|
+
|
|
717
|
+
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 Qp={command:`delete <identity-provider-id>`,describe:`Delete an Access identity provider`,builder:Zp,handler:async i=>l({command:`zero-trust identity-providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/identity_providers/${i[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(i[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(t),"identity-provider-id":String(i[`identity-provider-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
|
|
718
|
+
`);return}o(await c(`Deleting`,async()=>l.zeroTrust.identityProviders.delete({account_or_zone:u,account_or_zone_id:d,identity_provider_id:i[`identity-provider-id`]})),{successLabel:`Deleted`})})};function $p(e){return e.usage(`$0 zero-trust identity-providers get <identity-provider-id>
|
|
719
|
+
|
|
720
|
+
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 em={command:`get <identity-provider-id>`,describe:`Get an Access identity provider`,builder:$p,handler:async i=>l({command:`zero-trust identity-providers get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/identity_providers/${i[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(i[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(t),"identity-provider-id":String(i[`identity-provider-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.identityProviders.get({account_or_zone:u,account_or_zone_id:d,identity_provider_id:i[`identity-provider-id`]})),{successLabel:`Loaded`})})};function tm(e){return e.usage(`$0 zero-trust identity-providers list
|
|
721
|
+
|
|
722
|
+
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 nm={command:`list`,describe:`List Access identity providers`,builder:tm,handler:async i=>l({command:`zero-trust identity-providers list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={scim_enabled:i[`scim-enabled`],page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/identity_providers`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await t({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await n();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.identityProviders.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function rm(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 im={command:`create <identity-provider-id>`,describe:`Create SAML encryption certificate for Identity Provider`,builder:rm,handler:async t=>l({command:`zero-trust identity-providers saml-certificate create`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust identity-providers saml-certificate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.identityProviders.samlCertificate.create({account_id:l,identity_provider_id:t[`identity-provider-id`]})),{successLabel:`Created`})})},am={command:`saml-certificate`,describe:`Operations for identity-providers.saml-certificate`,builder:e=>e.command(im).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function om(e){return e.usage(`$0 zero-trust identity-providers scim groups list
|
|
723
|
+
|
|
724
|
+
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 sm={command:`list`,describe:`List SCIM Group resources`,builder:om,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){s({command:`cf zero-trust identity-providers scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.identityProviders.scim.groups.list({account_id:u,identity_provider_id:t[`identity-provider-id`],...i})),{successLabel:`Loaded`})})},cm={command:`groups`,describe:`Operations for identity-providers.scim.groups`,builder:e=>e.command(sm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lm(e){return e.usage(`$0 zero-trust identity-providers scim users list
|
|
725
|
+
|
|
726
|
+
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 um={command:`list`,describe:`List SCIM User resources`,builder:lm,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){s({command:`cf zero-trust identity-providers scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),u=t.local?e:await n();t.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.identityProviders.scim.users.list({account_id:u,identity_provider_id:t[`identity-provider-id`],...i})),{successLabel:`Loaded`})})},dm={command:`users`,describe:`Operations for identity-providers.scim.users`,builder:e=>e.command(um).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fm={command:`scim`,describe:`Operations for identity-providers.scim`,builder:e=>e.command(cm).command(dm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pm(e){return e.usage(`$0 zero-trust identity-providers update <identity-provider-id>
|
|
727
|
+
|
|
728
|
+
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 mm={command:`update <identity-provider-id>`,describe:`Update an Access identity provider`,builder:pm,handler:async i=>l({command:`zero-trust identity-providers update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/identity_providers/${i[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(i[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(t),"identity-provider-id":String(i[`identity-provider-id`]??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.identityProviders.update({body:e,account_or_zone:u,account_or_zone_id:f,identity_provider_id:i[`identity-provider-id`]})),{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.`)})},hm={command:`identity-providers`,describe:`Operations for identity-providers`,builder:e=>e.command(Xp).command(Qp).command(em).command(nm).command(mm).command(am).command(fm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function gm(e){return e.usage(`$0 zero-trust organizations create
|
|
729
|
+
|
|
730
|
+
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.`}).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.`}).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(`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 _m={command:`create`,describe:`Create your Zero Trust organization`,builder:gm,handler:async i=>l({command:`zero-trust organizations 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`,`warp-auth-non-browser-401`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/organizations`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({allow_authenticate_via_warp:i[`allow-authenticate-via-warp`],auth_domain:m(i[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:i[`auto-redirect-to-identity`],deny_unmatched_requests:i[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:i[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:i[`is-ui-read-only`],login_design:{background_color:m(i[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(i[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(i[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(i[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(i[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:i[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(i[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(i[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(i[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(i[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:i[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:i[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:i[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(i[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:i[`mfa-required-for-all-apps`],name:m(i.name,`name`,`text`),service_token_inactivity:{action:m(i[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:i[`service-token-inactivity-enabled`],inactivity_threshold_days:i[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(i[`session-duration`],`session-duration`,`text`),ui_read_only_toggle_reason:m(i[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(i[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:i[`warp-auth-non-browser-401`],warp_auth_session_duration:m(i[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.organizations.create({...e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`});return}i[`auth-domain`]===void 0&&(i[`auth-domain`]=await g(`auth-domain`,`The unique subdomain assigned to your Zero Trust organization.`)),i.name===void 0&&(i.name=await g(`name`,`The name of your Zero Trust organization.`));let h=p({allow_authenticate_via_warp:i[`allow-authenticate-via-warp`],auth_domain:m(i[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:i[`auto-redirect-to-identity`],deny_unmatched_requests:i[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:i[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:i[`is-ui-read-only`],login_design:{background_color:m(i[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(i[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(i[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(i[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(i[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:i[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(i[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(i[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(i[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(i[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:i[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:i[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:i[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(i[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:i[`mfa-required-for-all-apps`],name:m(i.name,`name`,`text`),service_token_inactivity:{action:m(i[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:i[`service-token-inactivity-enabled`],inactivity_threshold_days:i[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(i[`session-duration`],`session-duration`,`text`),ui_read_only_toggle_reason:m(i[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(i[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:i[`warp-auth-non-browser-401`],warp_auth_session_duration:m(i[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)});o(await c(`Creating`,async()=>l.zeroTrust.organizations.create({...h,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`})})};function vm(e){return e.usage(`$0 zero-trust organizations doh get
|
|
731
|
+
|
|
732
|
+
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 ym={command:`get`,describe:`Get your Zero Trust organization DoH settings`,builder:vm,handler:async t=>l({command:`zero-trust organizations doh get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust organizations doh get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/organizations/doh`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.organizations.doh.get({account_id:l})),{successLabel:`Loaded`})})};function bm(e){return e.usage(`$0 zero-trust organizations doh update
|
|
733
|
+
|
|
734
|
+
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 xm={command:`update`,describe:`Update your Zero Trust organization DoH settings`,builder:bm,handler:async t=>l({command:`zero-trust organizations doh update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust organizations doh update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.organizations.doh.update({...e,account_id:l})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.organizations.doh.update({...u,account_id:l})),{successLabel:`Updated`})})},Sm={command:`doh`,describe:`Operations for organizations.doh`,builder:e=>e.command(ym).command(xm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Cm(e){return e.usage(`$0 zero-trust organizations list
|
|
735
|
+
|
|
736
|
+
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 wm={command:`list`,describe:`Get your Zero Trust organization`,builder:Cm,handler:async i=>l({command:`zero-trust organizations list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/organizations`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.organizations.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})})};function Tm(e){return e.usage(`$0 zero-trust organizations revoke-users
|
|
737
|
+
|
|
738
|
+
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 Em={command:`revoke-users`,describe:`Revoke all Access tokens for a user`,builder:Tm,handler:async i=>l({command:`zero-trust organizations revoke-users`,classification:{safeFlags:[`devices`,`warp-session-reauth`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations revoke-users`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/organizations/revoke_user`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({devices:i.devices,email:m(i.email,`email`,`text`),user_uid:m(i[`user-uid`],`user-uid`,`text`),warp_session_reauth:i[`warp-session-reauth`]}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,!await v({force:!!i.force,message:`This operation revokes all access tokens for a user destructively.`})){process.stderr.write(`Aborted.
|
|
739
|
+
`);return}if(i.body){let e=d(i.body);o(await c(`Deleting`,async()=>l.zeroTrust.organizations.revokeUsers({...e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Deleted`});return}i.email===void 0&&(i.email=await g(`email`,`The email of the user to revoke.`));let h=p({devices:i.devices,email:m(i.email,`email`,`text`),user_uid:m(i[`user-uid`],`user-uid`,`text`),warp_session_reauth:i[`warp-session-reauth`]});o(await c(`Deleting`,async()=>l.zeroTrust.organizations.revokeUsers({...h,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Deleted`})})};function Dm(e){return e.usage(`$0 zero-trust organizations update
|
|
740
|
+
|
|
741
|
+
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.`}).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.`}).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(`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 Om={command:`update`,describe:`Update your Zero Trust organization`,builder:Dm,handler:async i=>l({command:`zero-trust organizations 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`,`warp-auth-non-browser-401`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await r():void 0,t=i.zone===void 0?`accounts`:`zones`,n=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/access/organizations`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:i.body===void 0?p({allow_authenticate_via_warp:i[`allow-authenticate-via-warp`],auth_domain:m(i[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:i[`auto-redirect-to-identity`],custom_pages:{forbidden:m(i[`custom-pages-forbidden`],`custom-pages-forbidden`,`text`),identity_denied:m(i[`custom-pages-identity-denied`],`custom-pages-identity-denied`,`text`)},deny_unmatched_requests:i[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:i[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:i[`is-ui-read-only`],login_design:{background_color:m(i[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(i[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(i[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(i[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(i[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:i[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(i[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(i[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(i[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(i[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:i[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:i[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:i[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(i[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:i[`mfa-required-for-all-apps`],name:m(i.name,`name`,`text`),service_token_inactivity:{action:m(i[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:i[`service-token-inactivity-enabled`],inactivity_threshold_days:i[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(i[`session-duration`],`session-duration`,`text`),ui_read_only_toggle_reason:m(i[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(i[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:i[`warp-auth-non-browser-401`],warp_auth_session_duration:m(i[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await t({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await n();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.organizations.update({...e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Updated`});return}let h=p({allow_authenticate_via_warp:i[`allow-authenticate-via-warp`],auth_domain:m(i[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:i[`auto-redirect-to-identity`],custom_pages:{forbidden:m(i[`custom-pages-forbidden`],`custom-pages-forbidden`,`text`),identity_denied:m(i[`custom-pages-identity-denied`],`custom-pages-identity-denied`,`text`)},deny_unmatched_requests:i[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:i[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:i[`is-ui-read-only`],login_design:{background_color:m(i[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(i[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(i[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(i[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(i[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:i[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(i[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(i[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(i[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(i[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:i[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:i[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:i[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(i[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:i[`mfa-required-for-all-apps`],name:m(i.name,`name`,`text`),service_token_inactivity:{action:m(i[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:i[`service-token-inactivity-enabled`],inactivity_threshold_days:i[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(i[`session-duration`],`session-duration`,`text`),ui_read_only_toggle_reason:m(i[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(i[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:i[`warp-auth-non-browser-401`],warp_auth_session_duration:m(i[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)});o(await c(`Updating`,async()=>l.zeroTrust.organizations.update({...h,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Updated`})})},km={command:`organizations`,describe:`Operations for organizations`,builder:e=>e.command(_m).command(wm).command(Em).command(Om).command(Sm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Am(e){return e.usage(`$0 zero-trust profiles custom list
|
|
742
|
+
|
|
743
|
+
Lists all DLP custom profiles in an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jm={command:`list`,describe:`List all custom profiles`,builder:Am,handler:async t=>l({command:`zero-trust profiles custom list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust profiles custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/profiles/custom`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.profiles.custom.list({account_id:l})),{successLabel:`Loaded`})})},Mm={command:`custom`,describe:`Profiles operations`,builder:e=>e.command(jm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Nm(e){return e.usage(`$0 zero-trust profiles predefined create
|
|
744
|
+
|
|
745
|
+
Creates a DLP predefined profile. Only supports enabling/disabling entries.`).option(`ai-context-enabled`,{type:`boolean`,description:`The ai_context_enabled field`,default:!1}).option(`allowed-match-count`,{type:`number`,description:`The allowed_match_count field`,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(`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`,default:!1}).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:`Predefined profiles can not be created. This endpoint will only update an existing predefined profiles settings.`}).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 Pm={command:`create`,describe:`Create predefined profile`,builder:Nm,handler:async t=>l({command:`zero-trust profiles predefined create`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust profiles predefined create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/profiles/predefined`,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`]}},entries:f(t.entries,`entries`),ocr_enabled:t[`ocr-enabled`],profile_id:m(t[`profile-id`],`profile-id`,`text`)}):d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.profiles.predefined.create({...e,account_id:l})),{successLabel:`Created`});return}t[`profile-id`]===void 0&&(t[`profile-id`]=await g(`profile-id`,`The profile_id 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`]}},entries:f(t.entries,`entries`),ocr_enabled:t[`ocr-enabled`],profile_id:m(t[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.profiles.predefined.create({...u,account_id:l})),{successLabel:`Created`})})};function Fm(e){return e.usage(`$0 zero-trust profiles predefined get <profile-id>
|
|
746
|
+
|
|
747
|
+
Fetches a predefined 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 Im={command:`get <profile-id>`,describe:`Get predefined profile`,builder:Fm,handler:async t=>l({command:`zero-trust profiles predefined get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust profiles predefined get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/profiles/predefined/${t[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(t[`profile-id`]))}`,pathParams:{"profile-id":String(t[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.profiles.predefined.get({account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Loaded`})})};function Lm(e){return e.usage(`$0 zero-trust profiles predefined update <profile-id>
|
|
748
|
+
|
|
749
|
+
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 Rm={command:`update <profile-id>`,describe:`Update predefined profile`,builder:Lm,handler:async t=>l({command:`zero-trust profiles predefined update`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust profiles predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.profiles.predefined.update({...e,account_id:l,profile_id:t[`profile-id`]})),{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`]});o(await c(`Updating`,async()=>i.zeroTrust.profiles.predefined.update({...u,account_id:l,profile_id:t[`profile-id`]})),{successLabel:`Updated`})})},zm={command:`predefined`,describe:`Profiles operations`,builder:e=>e.command(Pm).command(Im).command(Rm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Bm={command:`profiles`,describe:`Operations for profiles`,builder:e=>e.command(Mm).command(zm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Vm(e){return e.usage(`$0 zero-trust risk-scoring behaviours get
|
|
750
|
+
|
|
751
|
+
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 Hm={command:`get`,describe:`Get all behaviors and associated configuration`,builder:Vm,handler:async t=>l({command:`zero-trust risk-scoring behaviours get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust risk-scoring behaviours get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/zt_risk_scoring/behaviors`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.behaviours.get({account_id:l})),{successLabel:`Loaded`})})};function Um(e){return e.usage(`$0 zero-trust risk-scoring behaviours update
|
|
752
|
+
|
|
753
|
+
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 Wm={command:`update`,describe:`Update configuration for risk behaviors`,builder:Um,handler:async t=>l({command:`zero-trust risk-scoring behaviours update`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust risk-scoring behaviours update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/zt_risk_scoring/behaviors`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.riskScoring.behaviours.update({body:e,account_id:l})),{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.`)})},Gm={command:`behaviours`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(Hm).command(Wm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Km(e){return e.usage(`$0 zero-trust risk-scoring get <user-id>
|
|
754
|
+
|
|
755
|
+
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 qm={command:`get <user-id>`,describe:`Get risk event/score information for a specific user`,builder:Km,handler:async t=>l({command:`zero-trust risk-scoring get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust risk-scoring get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.get({account_id:l,user_id:t[`user-id`]})),{successLabel:`Loaded`})})};function Jm(e){return e.usage(`$0 zero-trust risk-scoring integrations create
|
|
756
|
+
|
|
757
|
+
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).
|
|
758
|
+
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 Ym={command:`create`,describe:`Create new risk score integration.`,builder:Jm,handler:async t=>l({command:`zero-trust risk-scoring integrations create`,classification:{safeFlags:[`integration-type`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust risk-scoring integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Creating`,async()=>i.zeroTrust.riskScoring.integrations.create({...e,account_id:l})),{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`)});o(await c(`Creating`,async()=>i.zeroTrust.riskScoring.integrations.create({...u,account_id:l})),{successLabel:`Created`})})};function Xm(e){return e.usage(`$0 zero-trust risk-scoring integrations delete <integration-id>
|
|
759
|
+
|
|
760
|
+
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 Zm={command:`delete <integration-id>`,describe:`Delete a risk score integration.`,builder:Xm,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){s({command:`cf zero-trust risk-scoring integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
761
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.riskScoring.integrations.delete({account_id:l,integration_id:t[`integration-id`]})),{successLabel:`Deleted`})})};function Qm(e){return e.usage(`$0 zero-trust risk-scoring integrations get <integration-id>
|
|
762
|
+
|
|
763
|
+
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 $m={command:`get <integration-id>`,describe:`Get risk score integration by id.`,builder:Qm,handler:async t=>l({command:`zero-trust risk-scoring integrations get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust risk-scoring integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.get({account_id:l,integration_id:t[`integration-id`]})),{successLabel:`Loaded`})})};function eh(e){return e.usage(`$0 zero-trust risk-scoring integrations list
|
|
764
|
+
|
|
765
|
+
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 th={command:`list`,describe:`List all risk score integrations for the account.`,builder:eh,handler:async t=>l({command:`zero-trust risk-scoring integrations list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust risk-scoring integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/zt_risk_scoring/integrations`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.list({account_id:l})),{successLabel:`Loaded`})})};function nh(e){return e.usage(`$0 zero-trust risk-scoring integrations references get <reference-id>
|
|
766
|
+
|
|
767
|
+
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 rh={command:`get <reference-id>`,describe:`Get risk score integration by reference id.`,builder:nh,handler:async t=>l({command:`zero-trust risk-scoring integrations references get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust risk-scoring integrations references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.references.get({account_id:l,reference_id:t[`reference-id`]})),{successLabel:`Loaded`})})},ih={command:`references`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(rh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ah(e){return e.usage(`$0 zero-trust risk-scoring integrations update <integration-id>
|
|
768
|
+
|
|
769
|
+
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).
|
|
770
|
+
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 oh={command:`update <integration-id>`,describe:`Update a risk score integration.`,builder:ah,handler:async t=>l({command:`zero-trust risk-scoring integrations update`,classification:{safeFlags:[`active`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust risk-scoring integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.riskScoring.integrations.update({...e,account_id:l,integration_id:t[`integration-id`]})),{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`)});o(await c(`Updating`,async()=>i.zeroTrust.riskScoring.integrations.update({...u,account_id:l,integration_id:t[`integration-id`]})),{successLabel:`Updated`})})},sh={command:`integrations`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(Ym).command(Zm).command($m).command(th).command(oh).command(ih).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ch(e){return e.usage(`$0 zero-trust risk-scoring reset <user-id>
|
|
771
|
+
|
|
772
|
+
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 lh={command:`reset <user-id>`,describe:`Clear the risk score for a particular user`,builder:ch,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){s({command:`cf zero-trust risk-scoring reset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force,message:`This operation wipes risk-scoring history.`})){process.stderr.write(`Aborted.
|
|
773
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.riskScoring.reset({account_id:l,user_id:t[`user-id`]})),{successLabel:`Deleted`})})};function uh(e){return e.usage(`$0 zero-trust risk-scoring summary get
|
|
774
|
+
|
|
775
|
+
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 dh={command:`get`,describe:`Get risk score info for all users in the account`,builder:uh,handler:async t=>l({command:`zero-trust risk-scoring summary get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust risk-scoring summary get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/zt_risk_scoring/summary`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.summary.get({account_id:l})),{successLabel:`Loaded`})})},fh={command:`summary`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(dh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ph={command:`risk-scoring`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(qm).command(lh).command(Gm).command(sh).command(fh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function mh(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 hh={command:`edit`,describe:`Update a user seat`,builder:mh,handler:async t=>l({command:`zero-trust seats edit`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust seats edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/access/seats`,pathParams:{},bodyKind:`json`,body:t.body===void 0?void 0:d(t.body)});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.seats.edit({body:e,account_id:l})),{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.`)})},gh={command:`seats`,describe:`Operations for seats`,builder:e=>e.command(hh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _h(e){return e.usage(`$0 zero-trust settings delete
|
|
776
|
+
|
|
777
|
+
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 vh={command:`delete`,describe:`Delete (reset) DLP account-level settings to initial values.`,builder:_h,handler:async t=>l({command:`zero-trust settings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
778
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.settings.delete({account_id:l})),{successLabel:`Deleted`})})};function yh(e){return e.usage(`$0 zero-trust settings edit
|
|
779
|
+
|
|
780
|
+
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.
|
|
781
|
+
|
|
782
|
+
- Set to a non-empty base64 string to enable payload logging with the given key.
|
|
783
|
+
- Set to an empty string to disable payload logging.
|
|
784
|
+
- 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 bh={command:`edit`,describe:`Partially update DLP account-level settings.`,builder:yh,handler:async t=>l({command:`zero-trust settings edit`,classification:{safeFlags:[`ai-context-analysis`,`ocr`,`payload-logging-masking-level`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.settings.edit({body:e,account_id:l})),{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`)}});o(await c(`Updating`,async()=>i.zeroTrust.settings.edit({body:u,account_id:l})),{successLabel:`Updated`})})};function xh(e){return e.usage(`$0 zero-trust settings get
|
|
785
|
+
|
|
786
|
+
Gets the account-level DLP settings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Sh={command:`get`,describe:`Get DLP account-level settings.`,builder:xh,handler:async t=>l({command:`zero-trust settings get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`none`});return}let i=await a(t),l=t.local?e:await n();t.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.settings.get({account_id:l})),{successLabel:`Loaded`})})};function Ch(e){return e.usage(`$0 zero-trust settings update
|
|
787
|
+
|
|
788
|
+
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.
|
|
789
|
+
|
|
790
|
+
- Set to a non-empty base64 string to enable payload logging with the given key.
|
|
791
|
+
- Set to an empty string to disable payload logging.
|
|
792
|
+
- 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 wh={command:`update`,describe:`Update DLP account-level settings (full replacement).`,builder:Ch,handler:async t=>l({command:`zero-trust settings update`,classification:{safeFlags:[`ai-context-analysis`,`ocr`,`payload-logging-masking-level`,`dry-run`]}},t,async()=>{if(t.dryRun){s({command:`cf zero-trust settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=d(t.body);o(await c(`Updating`,async()=>i.zeroTrust.settings.update({body:e,account_id:l})),{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`)}});o(await c(`Updating`,async()=>i.zeroTrust.settings.update({body:u,account_id:l})),{successLabel:`Updated`})})},Th={command:`settings`,describe:`Settings operations`,builder:e=>e.command(vh).command(bh).command(Sh).command(wh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Eh(e){return e.usage(`$0 zero-trust users mfa authenticators delete <authenticator-id>
|
|
793
|
+
|
|
794
|
+
Deletes a specific MFA device, including a PIV key or FIDO2 key enrollment, for a user. This action is only available if MFA is turned on for the organization. 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 Dh={command:`delete <authenticator-id>`,describe:`Delete a user's MFA device`,builder:Eh,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){s({command:`cf zero-trust users mfa authenticators delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<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 a(t),l=t.local?e:await n();if(t.accountId=l,!await v({force:!!t.force})){process.stderr.write(`Aborted.
|
|
795
|
+
`);return}o(await c(`Deleting`,async()=>i.zeroTrust.users.mfa.authenticators.delete({account_id:l,user_id:t[`user-id`],authenticator_id:t[`authenticator-id`]})),{successLabel:`Deleted`})})},Oh={command:`authenticators`,describe:`Operations for users.mfa.authenticators`,builder:e=>e.command(Dh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},kh={command:`mfa`,describe:`Operations for users.mfa`,builder:e=>e.command(Oh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ah={command:`users`,describe:`Operations for users`,builder:e=>e.command(kh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},jh={command:`zero-trust`,describe:`Cloudflare's SASE platform — secure access, device posture, DLP, tunnels, gateway policies, and network segmentation`,builder:e=>e.command(hr).command(Dr).command(ei).command(ai).command(po).command(Ks).command(pd).command(jd).command(Jp).command(hm).command(km).command(Bm).command(ph).command(gh).command(Th).command(Ah).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{jh as default};
|